|
|
!(function(){var $4=Object.defineProperty,Q4=Object.defineProperties;var J4=Object.getOwnPropertyDescriptors;var L2=Object.getOwnPropertySymbols;var q4=Object.prototype.hasOwnProperty,t5=Object.prototype.propertyIsEnumerable;var ph=Math.pow,km=(q,J,g)=>J in q?$4(q,J,{enumerable:!0,configurable:!0,writable:!0,value:g}):q[J]=g,ju=(q,J)=>{for(var g in J||(J={}))q4.call(J,g)&&km(q,g,J[g]);if(L2)for(var g of L2(J))t5.call(J,g)&&km(q,g,J[g]);return q},Tm=(q,J)=>Q4(q,J4(J));var ri=(q,J,g)=>km(q,typeof J!="symbol"?J+"":J,g);(self.webpackChunk=self.webpackChunk||[]).push([[9020],{73686:function(q,J,g){"use strict";g.d(J,{ni:function(){return Mh},EF:function(){return Ih}});var m=function(D,G){var X=D.nodes,lt=D.edges,ft=[],Mt={};if(!X)throw new Error("invalid nodes data!");return X&&X.forEach(function(se,de){Mt[se.id]=de;var pe=[];ft.push(pe)}),lt&<.forEach(function(se){var de=se.source,pe=se.target,ke=Mt[de],Te=Mt[pe];!ke&&ke!==0||!Te&&Te!==0||(ft[ke][Te]=1,G||(ft[Te][ke]=1))}),ft},F=m,R=function(D,G){return D===G},L=function(){function H(D,G){G===void 0&&(G=null),this.value=D,this.next=G}return H.prototype.toString=function(D){return D?D(this.value):"".concat(this.value)},H}(),k=function(){function H(D){D===void 0&&(D=R),this.head=null,this.tail=null,this.compare=D}return H.prototype.prepend=function(D){var G=new L(D,this.head);return this.head=G,this.tail||(this.tail=G),this},H.prototype.append=function(D){var G=new L(D);return this.head?(this.tail.next=G,this.tail=G,this):(this.head=G,this.tail=G,this)},H.prototype.delete=function(D){if(!this.head)return null;for(var G=null;this.head&&this.compare(this.head.value,D);)G=this.head,this.head=this.head.next;var X=this.head;if(X!==null)for(;X.next;)this.compare(X.next.value,D)?(G=X.next,X.next=X.next.next):X=X.next;return this.compare(this.tail.value,D)&&(this.tail=X),G},H.prototype.find=function(D){var G=D.value,X=G===void 0?void 0:G,lt=D.callback,ft=lt===void 0?void 0:lt;if(!this.head)return null;for(var Mt=this.head;Mt;){if(ft&&ft(Mt.value)||X!==void 0&&this.compare(Mt.value,X))return Mt;Mt=Mt.next}return null},H.prototype.deleteTail=function(){var D=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,D;for(var G=this.head;G.next;)G.next.next?G=G.next:G.next=null;return this.tail=G,D},H.prototype.deleteHead=function(){if(!this.head)return null;var D=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),D},H.prototype.fromArray=function(D){var G=this;return D.forEach(function(X){return G.append(X)}),this},H.prototype.toArray=function(){for(var D=[],G=this.head;G;)D.push(G),G=G.next;return D},H.prototype.reverse=function(){for(var D=this.head,G=null,X=null;D;)X=D.next,D.next=G,G=D,D=X;this.tail=this.head,this.head=G},H.prototype.toString=function(D){return D===void 0&&(D=void 0),this.toArray().map(function(G){return G.toString(D)}).toString()},H}(),O=k,b=function(){function H(){this.linkedList=new O}return H.prototype.isEmpty=function(){return!this.linkedList.head},H.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},H.prototype.enqueue=function(D){this.linkedList.append(D)},H.prototype.dequeue=function(){var D=this.linkedList.deleteHead();return D?D.value:null},H.prototype.toString=function(D){return this.linkedList.toString(D)},H}(),E=b,T=function(D,G,X){G===void 0&&(G=[]);var lt=G.filter(function(de){return de.source===D||de.target===D});if(X==="target"){var ft=function(pe){return pe.source===D};return lt.filter(ft).map(function(de){return de.target})}if(X==="source"){var Mt=function(pe){return pe.target===D};return lt.filter(Mt).map(function(de){return de.source})}var se=function(pe){return pe.source===D?pe.target:pe.source};return lt.map(se)},_=function(D,G){return G.filter(function(X){return X.source===D})},P=function(D,G){return G.filter(function(X){return X.source===D||X.target===D})},B=function(D){D===void 0&&(D=0);var G="".concat(Math.random()).split(".")[1].substr(0,5),X="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(D,"-").concat(G).concat(X)};function tt(H){H===void 0&&(H={});var D=H,G=function(){},X=function(){var lt={};return function(ft){var Mt=ft.next,se=Mt;return lt[se]?!1:(lt[se]=!0,!0)}}();return D.allowTraversal=H.allowTraversal||X,D.enter=H.enter||G,D.leave=H.leave||G,D}var st=function(D,G,X,lt){lt===void 0&&(lt=!0);var ft=tt(X),Mt=new E,se=D.edges,de=se===void 0?[]:se;Mt.enqueue(G);for(var pe="",ke=function(){var Ie=Mt.dequeue();ft.enter({current:Ie,previous:pe}),T(Ie,de,lt?"target":void 0).forEach(function(De){ft.allowTraversal({previous:pe,current:Ie,next:De})&&Mt.enqueue(De)}),ft.leave({current:Ie,previous:pe}),pe=Ie};!Mt.isEmpty();)ke()},Rt=st,xt=function(D){for(var G=D.nodes,X=G===void 0?[]:G,lt=D.edges,ft=lt===void 0?[]:lt,Mt=[],se={},de=[],pe=function De(Ge){de.push(Ge),se[Ge.id]=!0;for(var Ze=T(Ge.id,ft),We=function(dn){var xn=Ze[dn];if(!se[xn]){var wn=X.filter(function(Mn){return Mn.id===xn});wn.length>0&&De(wn[0])}},$e=0;$e<Ze.length;++$e)We($e)},ke=0;ke<X.length;ke++){var Te=X[ke];if(!se[Te.id]){pe(Te);for(var Ie=[];de.length>0;)Ie.push(de.pop());Mt.push(Ie)}}return Mt},nt=function(D){for(var G=D.nodes,X=G===void 0?[]:G,lt=D.edges,ft=lt===void 0?[]:lt,Mt=[],se={},de={},pe={},ke=[],Te=0,Ie=function We($e){de[$e.id]=Te,pe[$e.id]=Te,Te+=1,Mt.push($e),se[$e.id]=!0;for(var fn=T($e.id,ft,"target").filter(function(zn){return X.map(function(Fn){return Fn.id}).indexOf(zn)>-1}),dn=function(Fn){var Dn=fn[Fn];if(!de[Dn]&&de[Dn]!==0){var Kn=X.filter(function(Yn){return Yn.id===Dn});Kn.length>0&&We(Kn[0]),pe[$e.id]=Math.min(pe[$e.id],pe[Dn])}else se[Dn]&&(pe[$e.id]=Math.min(pe[$e.id],de[Dn]))},xn=0;xn<fn.length;xn++)dn(xn);if(pe[$e.id]===de[$e.id]){for(var wn=[];Mt.length>0;){var Mn=Mt.pop();if(se[Mn.id]=!1,wn.push(Mn),Mn===$e)break}wn.length>0&&ke.push(wn)}},De=0,Ge=X;De<Ge.length;De++){var Ze=Ge[De];!de[Ze.id]&&de[Ze.id]!==0&&Ie(Ze)}return ke};function Et(H,D){return D?nt(H):xt(H)}var ot=function(D){var G={},X=D.nodes,lt=X===void 0?[]:X,ft=D.edges,Mt=ft===void 0?[]:ft;return lt.forEach(function(se){G[se.id]={degree:0,inDegree:0,outDegree:0}}),Mt.forEach(function(se){G[se.source].degree++,G[se.source].outDegree++,G[se.target].degree++,G[se.target].inDegree++}),G},Ct=ot,_t=function(D,G){var X=ot(D);return X[G]?ot(D)[G].inDegree:0},dt=function(D,G){var X=ot(D);return X[G]?ot(D)[G].outDegree:0};function Ot(H){H===void 0&&(H={});var D=H,G=function(){},X=function(){var lt={};return function(ft){var Mt=ft.next;return lt[Mt]?!1:(lt[Mt]=!0,!0)}}();return D.allowTraversal=H.allowTraversal||X,D.enter=H.enter||G,D.leave=H.leave||G,D}function wt(H,D,G,X,lt){lt===void 0&&(lt=!0),X.enter({current:D,previous:G});var ft=H.edges,Mt=ft===void 0?[]:ft;T(D,Mt,lt?"target":void 0).forEach(function(se){X.allowTraversal({previous:G,current:D,next:se})&&wt(H,se,D,X,lt)}),X.leave({current:D,previous:G})}function Ft(H,D,G,X){X===void 0&&(X=!0),wt(H,D,"",Ot(G),X)}var jt=function(D){var G=null,X=D.nodes,lt=X===void 0?[]:X,ft={},Mt={},se={},de={};lt.forEach(function(Te){Mt[Te.id]=Te});for(var pe={enter:function(Ie){var De=Ie.current,Ge=Ie.previous;if(se[De]){G={};for(var Ze=De,We=Ge;We!==De;)G[Ze]=We,Ze=We,We=ft[We];G[Ze]=We}else se[De]=De,delete Mt[De],ft[De]=Ge},leave:function(Ie){var De=Ie.current;de[De]=De,delete se[De]},allowTraversal:function(Ie){var De=Ie.next;return G?!1:!de[De]}};Object.keys(Mt).length;){var ke=Object.keys(Mt)[0];Ft(D,ke,pe)}return G},re=function(D,G,X){var lt,ft;X===void 0&&(X=!0);for(var Mt=[],se=Et(D,!1),de=0,pe=se;de<pe.length;de++){var ke=pe[de];if(ke.length)for(var Te=ke[0],Ie=Te.id,De=[Te],Ge=(lt={},lt[Ie]=Te,lt),Ze=(ft={},ft[Ie]=new Set,ft);De.length>0;)for(var We=De.pop(),$e=We.id,fn=T($e,D.edges),dn=function(Mn){var zn,Fn=fn[Mn],Dn=D.nodes.find(function(nr){return nr.id===Fn});if(Fn===$e)Mt.push((zn={},zn[Fn]=We,zn));else if(!(Fn in Ze))Ge[Fn]=We,De.push(Dn),Ze[Fn]=new Set([We]);else if(!Ze[$e].has(Dn)){for(var Kn=!0,Yn=[Dn,We],In=Ge[$e];Ze[Fn].size&&!Ze[Fn].has(In)&&(Yn.push(In),In!==Ge[In.id]);)In=Ge[In.id];if(Yn.push(In),G&&X?(Kn=!1,Yn.findIndex(function(nr){return G.indexOf(nr.id)>-1})>-1&&(Kn=!0)):G&&!X&&Yn.findIndex(function(nr){return G.indexOf(nr.id)>-1})>-1&&(Kn=!1),Kn){for(var wr={},rr=1;rr<Yn.length;rr+=1)wr[Yn[rr-1].id]=Yn[rr];Yn.length&&(wr[Yn[Yn.length-1].id]=Yn[0]),Mt.push(wr)}Ze[Fn].add(We)}},xn=0;xn<fn.length;xn+=1)dn(xn)}return Mt},Ee=function(D,G,X){X===void 0&&(X=!0);for(var lt=[],ft=new Set,Mt=[],se=[],de={},pe={},ke=function(In){for(var wr=[In];wr.length>0;){var rr=wr.pop();ft.has(rr)&&(ft.delete(rr),Mt[rr.id].forEach(function(nr){wr.push(nr)}),Mt[rr.id].clear())}},Te=function Yn(In,wr,rr){var nr=!1;if(G&&X===!1&&G.indexOf(In.id)>-1)return nr;lt.push(In),ft.add(In);for(var yr=rr[In.id],br=0;br<yr.length;br+=1){var cr=de[yr[br]];if(cr===wr){for(var gn={},kn=1;kn<lt.length;kn+=1)gn[lt[kn-1].id]=lt[kn];lt.length&&(gn[lt[lt.length-1].id]=lt[0]),se.push(gn),nr=!0}else ft.has(cr)||Yn(cr,wr,rr)&&(nr=!0)}if(nr)ke(In);else for(var br=0;br<yr.length;br+=1){var cr=de[yr[br]];Mt[cr.id].has(In)||Mt[cr.id].add(In)}return lt.pop(),nr},Ie=D.nodes,De=Ie===void 0?[]:Ie,Ge=0;Ge<De.length;Ge+=1){var Ze=De[Ge],We=Ze.id;pe[We]=Ge,de[Ge]=Ze}if(G&&X)for(var $e=function(In){var wr=G[In];pe[De[In].id]=pe[wr],pe[wr]=0,de[0]=De.find(function(rr){return rr.id===wr}),de[pe[De[In].id]]=De[In]},Ge=0;Ge<G.length;Ge++)$e(Ge);for(var fn=function(In){for(var wr,rr,nr=1/0,yr=0;yr<In.length;yr+=1)for(var br=In[yr],cr=0;cr<br.length;cr++){var gn=pe[br[cr].id];gn<nr&&(nr=gn,rr=yr)}for(var kn=In[rr],Wn=[],yr=0;yr<kn.length;yr+=1){var Zn=kn[yr];Wn[Zn.id]=[];for(var Vn=0,qr=T(Zn.id,D.edges,"target").filter(function(Ri){return kn.map(function(Li){return Li.id}).indexOf(Ri)>-1});Vn<qr.length;Vn++){var Ur=qr[Vn];Ur===Zn.id&&!(X===!1&&G.indexOf(Zn.id)>-1)?se.push((wr={},wr[Zn.id]=Zn,wr)):Wn[Zn.id].push(pe[Ur])}}return{component:kn,adjList:Wn,minIdx:nr}},dn=0;dn<De.length;){var xn=De.filter(function(Yn){return pe[Yn.id]>=dn}),wn=nt({nodes:xn,edges:D.edges}).filter(function(Yn){return Yn.length>1});if(wn.length===0)break;var Mn=fn(wn),zn=Mn.minIdx,Fn=Mn.adjList,Dn=Mn.component;if(Dn.length>1){Dn.forEach(function(Yn){Mt[Yn.id]=new Set});var Kn=de[zn];if(G&&X&&G.indexOf(Kn.id)===-1)return se;Te(Kn,Kn,Fn),dn=zn+1}else break}return se},et=function(D,G,X,lt){return lt===void 0&&(lt=!0),G?Ee(D,X,lt):re(D,X,lt)},ge=jt,yt=function(H,D){return yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,X){G.__proto__=X}||function(G,X){for(var lt in X)Object.prototype.hasOwnProperty.call(X,lt)&&(G[lt]=X[lt])},yt(H,D)};function te(H,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");yt(H,D);function G(){this.constructor=H}H.prototype=D===null?Object.create(D):(G.prototype=D.prototype,new G)}var Xt=function(){return Xt=Object.assign||function(D){for(var G,X=1,lt=arguments.length;X<lt;X++){G=arguments[X];for(var ft in G)Object.prototype.hasOwnProperty.call(G,ft)&&(D[ft]=G[ft])}return D},Xt.apply(this,arguments)};function rt(H,D){var G={};for(var X in H)Object.prototype.hasOwnProperty.call(H,X)&&D.indexOf(X)<0&&(G[X]=H[X]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var lt=0,X=Object.getOwnPropertySymbols(H);lt<X.length;lt++)D.indexOf(X[lt])<0&&Object.prototype.propertyIsEnumerable.call(H,X[lt])&&(G[X[lt]]=H[X[lt]]);return G}function bt(H,D,G,X){var lt=arguments.length,ft=lt<3?D:X===null?X=Object.getOwnPropertyDescriptor(D,G):X,Mt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ft=Reflect.decorate(H,D,G,X);else for(var se=H.length-1;se>=0;se--)(Mt=H[se])&&(ft=(lt<3?Mt(ft):lt>3?Mt(D,G,ft):Mt(D,G))||ft);return lt>3&&ft&&Object.defineProperty(D,G,ft),ft}function ye(H,D){return function(G,X){D(G,X,H)}}function be(H,D,G,X,lt,ft){function Mt($e){if($e!==void 0&&typeof $e!="function")throw new TypeError("Function expected");return $e}for(var se=X.kind,de=se==="getter"?"get":se==="setter"?"set":"value",pe=!D&&H?X.static?H:H.prototype:null,ke=D||(pe?Object.getOwnPropertyDescriptor(pe,X.name):{}),Te,Ie=!1,De=G.length-1;De>=0;De--){var Ge={};for(var Ze in X)Ge[Ze]=Ze==="access"?{}:X[Ze];for(var Ze in X.access)Ge.access[Ze]=X.access[Ze];Ge.addInitializer=function($e){if(Ie)throw new TypeError("Cannot add initializers after decoration has completed");ft.push(Mt($e||null))};var We=(0,G[De])(se==="accessor"?{get:ke.get,set:ke.set}:ke[de],Ge);if(se==="accessor"){if(We===void 0)continue;if(We===null||typeof We!="object")throw new TypeError("Object expected");(Te=Mt(We.get))&&(ke.get=Te),(Te=Mt(We.set))&&(ke.set=Te),(Te=Mt(We.init))&<.push(Te)}else(Te=Mt(We))&&(se==="field"?lt.push(Te):ke[de]=Te)}pe&&Object.defineProperty(pe,X.name,ke),Ie=!0}function Gt(H,D,G){for(var X=arguments.length>2,lt=0;lt<D.length;lt++)G=X?D[lt].call(H,G):D[lt].call(H);return X?G:void 0}function Kt(H){return typeof H=="symbol"?H:"".concat(H)}function we(H,D,G){return typeof D=="symbol"&&(D=D.description?"[".concat(D.description,"]"):""),Object.defineProperty(H,"name",{configurable:!0,value:G?"".concat(G," ",D):D})}function Bt(H,D){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(H,D)}function oe(H,D,G,X){function lt(ft){return ft instanceof G?ft:new G(function(Mt){Mt(ft)})}return new(G||(G=Promise))(function(ft,Mt){function se(ke){try{pe(X.next(ke))}catch(Te){Mt(Te)}}function de(ke){try{pe(X.throw(ke))}catch(Te){Mt(Te)}}function pe(ke){ke.done?ft(ke.value):lt(ke.value).then(se,de)}pe((X=X.apply(H,D||[])).next())})}function ht(H,D){var G={label:0,sent:function(){if(ft[0]&1)throw ft[1];return ft[1]},trys:[],ops:[]},X,lt,ft,Mt;return Mt={next:se(0),throw:se(1),return:se(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function se(pe){return function(ke){return de([pe,ke])}}function de(pe){if(X)throw new TypeError("Generator is already executing.");for(;Mt&&(Mt=0,pe[0]&&(G=0)),G;)try{if(X=1,lt&&(ft=pe[0]&2?lt.return:pe[0]?lt.throw||((ft=lt.return)&&ft.call(lt),0):lt.next)&&!(ft=ft.call(lt,pe[1])).done)return ft;switch(lt=0,ft&&(pe=[pe[0]&2,ft.value]),pe[0]){case 0:case 1:ft=pe;break;case 4:return G.label++,{value:pe[1],done:!1};case 5:G.label++,lt=pe[1],pe=[0];continue;case 7:pe=G.ops.pop(),G.trys.pop();continue;default:if(ft=G.trys,!(ft=ft.length>0&&ft[ft.length-1])&&(pe[0]===6||pe[0]===2)){G=0;continue}if(pe[0]===3&&(!ft||pe[1]>ft[0]&&pe[1]<ft[3])){G.label=pe[1];break}if(pe[0]===6&&G.label<ft[1]){G.label=ft[1],ft=pe;break}if(ft&&G.label<ft[2]){G.label=ft[2],G.ops.push(pe);break}ft[2]&&G.ops.pop(),G.trys.pop();continue}pe=D.call(H,G)}catch(ke){pe=[6,ke],lt=0}finally{X=ft=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}}var ut=Object.create?function(H,D,G,X){X===void 0&&(X=G);var lt=Object.getOwnPropertyDescriptor(D,G);(!lt||("get"in lt?!D.__esModule:lt.writable||lt.configurable))&&(lt={enumerable:!0,get:function(){return D[G]}}),Object.defineProperty(H,X,lt)}:function(H,D,G,X){X===void 0&&(X=G),H[X]=D[G]};function Vt(H,D){for(var G in H)G!=="default"&&!Object.prototype.hasOwnProperty.call(D,G)&&ut(D,H,G)}function ve(H){var D=typeof Symbol=="function"&&Symbol.iterator,G=D&&H[D],X=0;if(G)return G.call(H);if(H&&typeof H.length=="number")return{next:function(){return H&&X>=H.length&&(H=void 0),{value:H&&H[X++],done:!H}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")}function kt(H,D){var G=typeof Symbol=="function"&&H[Symbol.iterator];if(!G)return H;var X=G.call(H),lt,ft=[],Mt;try{for(;(D===void 0||D-- >0)&&!(lt=X.next()).done;)ft.push(lt.value)}catch(se){Mt={error:se}}finally{try{lt&&!lt.done&&(G=X.return)&&G.call(X)}finally{if(Mt)throw Mt.error}}return ft}function ee(){for(var H=[],D=0;D<arguments.length;D++)H=H.concat(kt(arguments[D]));return H}function me(){for(var H=0,D=0,G=arguments.length;D<G;D++)H+=arguments[D].length;for(var X=Array(H),lt=0,D=0;D<G;D++)for(var ft=arguments[D],Mt=0,se=ft.length;Mt<se;Mt++,lt++)X[lt]=ft[Mt];return X}function Nt(H,D,G){if(G||arguments.length===2)for(var X=0,lt=D.length,ft;X<lt;X++)(ft||!(X in D))&&(ft||(ft=Array.prototype.slice.call(D,0,X)),ft[X]=D[X]);return H.concat(ft||Array.prototype.slice.call(D))}function Zt(H){return this instanceof Zt?(this.v=H,this):new Zt(H)}function Yt(H,D,G){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var X=G.apply(H,D||[]),lt,ft=[];return lt={},Mt("next"),Mt("throw"),Mt("return"),lt[Symbol.asyncIterator]=function(){return this},lt;function Mt(Ie){X[Ie]&&(lt[Ie]=function(De){return new Promise(function(Ge,Ze){ft.push([Ie,De,Ge,Ze])>1||se(Ie,De)})})}function se(Ie,De){try{de(X[Ie](De))}catch(Ge){Te(ft[0][3],Ge)}}function de(Ie){Ie.value instanceof Zt?Promise.resolve(Ie.value.v).then(pe,ke):Te(ft[0][2],Ie)}function pe(Ie){se("next",Ie)}function ke(Ie){se("throw",Ie)}function Te(Ie,De){Ie(De),ft.shift(),ft.length&&se(ft[0][0],ft[0][1])}}function S(H){var D,G;return D={},X("next"),X("throw",function(lt){throw lt}),X("return"),D[Symbol.iterator]=function(){return this},D;function X(lt,ft){D[lt]=H[lt]?function(Mt){return(G=!G)?{value:Zt(H[lt](Mt)),done:!1}:ft?ft(Mt):Mt}:ft}}function Y(H){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var D=H[Symbol.asyncIterator],G;return D?D.call(H):(H=typeof ve=="function"?ve(H):H[Symbol.iterator](),G={},X("next"),X("throw"),X("return"),G[Symbol.asyncIterator]=function(){return this},G);function X(ft){G[ft]=H[ft]&&function(Mt){return new Promise(function(se,de){Mt=H[ft](Mt),lt(se,de,Mt.done,Mt.value)})}}function lt(ft,Mt,se,de){Promise.resolve(de).then(function(pe){ft({value:pe,done:se})},Mt)}}function At(H,D){return Object.defineProperty?Object.defineProperty(H,"raw",{value:D}):H.raw=D,H}var ie=Object.create?function(H,D){Object.defineProperty(H,"default",{enumerable:!0,value:D})}:function(H,D){H.default=D};function $t(H){if(H&&H.__esModule)return H;var D={};if(H!=null)for(var G in H)G!=="default"&&Object.prototype.hasOwnProperty.call(H,G)&&ut(D,H,G);return ie(D,H),D}function Oe(H){return H&&H.__esModule?H:{default:H}}function Ne(H,D,G,X){if(G==="a"&&!X)throw new TypeError("Private accessor was defined without a getter");if(typeof D=="function"?H!==D||!X:!D.has(H))throw new TypeError("Cannot read private member from an object whose class did not declare it");return G==="m"?X:G==="a"?X.call(H):X?X.value:D.get(H)}function Le(H,D,G,X,lt){if(X==="m")throw new TypeError("Private method is not writable");if(X==="a"&&!lt)throw new TypeError("Private accessor was defined without a setter");if(typeof D=="function"?H!==D||!lt:!D.has(H))throw new TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?lt.call(H,G):lt?lt.value=G:D.set(H,G),G}function at(H,D){if(D===null||typeof D!="object"&&typeof D!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof H=="function"?D===H:H.has(D)}var V={}.toString,St=function(H,D){return V.call(H)==="[object "+D+"]"},Pt=St,pt=function(H){return Pt(H,"Function")},mt=function(H){return Array.isArray?Array.isArray(H):Pt(H,"Array")},Lt=function(H){var D=typeof H;return H!==null&&D==="object"||D==="function"};function Ht(H,D){if(H){var G;if(mt(H))for(var X=0,lt=H.length;X<lt&&(G=D(H[X],X),G!==!1);X++);else if(Lt(H)){for(var ft in H)if(H.hasOwnProperty(ft)&&(G=D(H[ft],ft),G===!1))break}}}var Dt=Ht,ne=Object.keys?function(H){return Object.keys(H)}:function(H){var D=[];return Dt(H,function(G,X){pt(H)&&X==="prototype"||D.push(X)}),D},_e=null;function Me(H,D){var G=keys(D),X=G.length;if(isNil(H))return!X;for(var lt=0;lt<X;lt+=1){var ft=G[lt];if(D[ft]!==H[ft]||!(ft in H))return!1}return!0}var Ae=null,ze=function(H){if(!isObjectLike(H)||!isType(H,"Object"))return!1;if(Object.getPrototypeOf(H)===null)return!0;for(var D=H;Object.getPrototypeOf(D)!==null;)D=Object.getPrototypeOf(D);return Object.getPrototypeOf(H)===D},Ve=null;function Je(H,D){if(!isArray(H))return null;var G;if(isFunction(D)&&(G=D),isPlainObject(D)&&(G=function(lt){return isMatch(lt,D)}),G){for(var X=0;X<H.length;X+=1)if(G(H[X]))return H[X]}return null}var pn=null,jn=function(H,D){for(var G=null,X=0;X<H.length;X++){var lt=H[X],ft=lt[D];if(!isNil(ft)){isArray(ft)?G=ft[0]:G=ft;break}}return G},hn=null,En=function(H){if(!isArray(H))return[];for(var D=[],G=0;G<H.length;G++)D=D.concat(H[G]);return D},Gn=null,Tn=function(H,D){if(D===void 0&&(D=[]),!isArray(H))D.push(H);else for(var G=0;G<H.length;G+=1)Tn(H[G],D);return D},Pn=null,Tr=function(H){if(isArray(H))return H.reduce(function(D,G){return Math.max(D,G)},H[0])},wi=function(H){if(isArray(H))return H.reduce(function(D,G){return Math.min(D,G)},H[0])},Vr=function(H){var D=H.filter(function(Mt){return!isNaN(Mt)});if(!D.length)return{min:0,max:0};if(isArray(H[0])){for(var G=[],X=0;X<H.length;X++)G=G.concat(H[X]);D=G}var lt=getMax(D),ft=getMin(D);return{min:ft,max:lt}},Ga=null,Wa=Array.prototype,qs=Wa.splice,Ns=Wa.indexOf,Ua=function(H){for(var D=[],G=1;G<arguments.length;G++)D[G-1]=arguments[G];for(var X=0;X<D.length;X++)for(var lt=D[X],ft=-1;(ft=Ns.call(H,lt))>-1;)qs.call(H,ft,1);return H},Ki=null,qo=Array.prototype.splice,Bl=function(D,G){if(!isArrayLike(D))return[];for(var X=D?G.length:0,lt=X-1;X--;){var ft=void 0,Mt=G[X];(X===lt||Mt!==ft)&&(ft=Mt,qo.call(D,Mt,1))}return D},gt=null,w=function(H,D,G){if(!isArray(H)&&!isPlainObject(H))return H;var X=G;return each(H,function(lt,ft){X=D(X,lt,ft)}),X},M=null,y=function(H,D){var G=[];if(!isArrayLike(H))return G;for(var X=-1,lt=[],ft=H.length;++X<ft;){var Mt=H[X];D(Mt,X,H)&&(G.push(Mt),lt.push(X))}return pullAt(H,lt),G},C=null,U=function(H){return Pt(H,"String")};function Wt(H,D){var G;if(isFunction(D))G=function(lt,ft){return D(lt)-D(ft)};else{var X=[];isString(D)?X.push(D):isArray(D)&&(X=D),G=function(lt,ft){for(var Mt=0;Mt<X.length;Mt+=1){var se=X[Mt];if(lt[se]>ft[se])return 1;if(lt[se]<ft[se])return-1}return 0}}return H.sort(G),H}var Ut=null;function Jt(H,D){D===void 0&&(D=new Map);var G=[];if(Array.isArray(H))for(var X=0,lt=H.length;X<lt;X++){var ft=H[X];D.has(ft)||(G.push(ft),D.set(ft,!0))}return G}var qt=function(H,D){for(var G=[],X={},lt=0;lt<H.length;lt++){var ft=H[lt],Mt=ft[D];if(!isNil(Mt)){isArray(Mt)||(Mt=[Mt]);for(var se=0;se<Mt.length;se++){var de=Mt[se];X[de]||(G.push(de),X[de]=!0)}}}return G};function Pe(H,D){return isArray(H)||isString(H)?H[0]===D:!1}var xe=null;function je(H,D){return isArray(H)||isString(H)?H[H.length-1]===D:!1}var en=null,Be=Object.prototype.hasOwnProperty;function he(H,D){if(!D||!isArray(H))return{};for(var G={},X=isFunction(D)?D:function(se){return se[D]},lt,ft=0;ft<H.length;ft++){var Mt=H[ft];lt=X(Mt),Be.call(G,lt)?G[lt].push(Mt):G[lt]=[Mt]}return G}var mn=null;function Se(H,D){if(!D)return{0:H};if(!isFunction(D)){var G=isArray(D)?D:D.replace(/\s+/g,"").split("*");D=function(X){for(var lt="_",ft=0,Mt=G.length;ft<Mt;ft++)lt+=X[G[ft]]&&X[G[ft]].toString();return lt}}return groupBy(H,D)}var nn=function(H,D){if(!D)return[H];var G=groupToMap(H,D),X=[];for(var lt in G)X.push(G[lt]);return X},yn={};function Bn(H){var D=yn[H];if(!D){for(var G=H.toString(16),X=G.length;X<6;X++)G="0"+G;D="#"+G,yn[H]=D}return D}var Xn=null;function Gr(H){var D=0,G=0,X=0,lt=0;return isArray(H)?H.length===1?D=G=X=lt=H[0]:H.length===2?(D=X=H[0],G=lt=H[1]):H.length===3?(D=H[0],G=lt=H[1],X=H[2]):(D=H[0],G=H[1],X=H[2],lt=H[3]):D=G=X=lt=H,{r1:D,r2:G,r3:X,r4:lt}}var An=null,Rn=function(H){return Pt(H,"Number")},Ln=Rn,Ce=function(H){return isNumber(H)&&H%1!==0},Xe=null,bn=function(H){return isNumber(H)&&H%2===0},Ye=null,Er=Number.isInteger?Number.isInteger:function(H){return Ln(H)&&H%1===0},Cn=null,mr=function(H){return isNumber(H)&&H<0},Wr=null,Kr=function(H){return isNumber(H)&&H%2!==0},Ui=null,ur=function(H){return isNumber(H)&&H>0},ya=null,qn=function(H,D){if(isArray(H)){for(var G,X=-1/0,lt=0;lt<H.length;lt++){var ft=H[lt],Mt=isFunction(D)?D(ft):ft[D];Mt>X&&(G=ft,X=Mt)}return G}},er=function(H,D){if(isArray(H)){for(var G,X=1/0,lt=0;lt<H.length;lt++){var ft=H[lt],Mt=isFunction(D)?D(ft):ft[D];Mt<X&&(G=ft,X=Mt)}return G}},vr=180/Math.PI,Zi=function(H){return vr*H},$i=null,ui=Math.PI/180,mh=function(H){return ui*H},tl=null,yh=null,Gu=Object.values?function(H){return Object.values(H)}:function(H){var D=[];return Dt(H,function(G,X){pt(H)&&X==="prototype"||D.push(G)}),D},el=Gu,bh=function(H,D){return contains(values(H),D)},Wu={}.toString,Uu=function(H){return Wu.call(H).replace(/^\[object /,"").replace(/]$/,"")},ba=null,Za=function(H){return isType(H,"Arguments")},zl=null,Un=function(H){return isType(H,"Boolean")},Uv=null,Cm=function(H){return isType(H,"Date")},Pm=null,Nm=function(H){return isType(H,"Error")},xh=null;function Or(H){return isNumber(H)&&isFinite(H)}var Zu=Object.prototype,xa=function(H){var D=H&&H.constructor,G=typeof D=="function"&&D.prototype||Zu;return H===G},Zv=null,Vv=function(H){return isType(H,"RegExp")},Yv=null,Rm=function(){for(var H=[],D=0;D<arguments.length;D++)H[D]=arguments[D];for(var G=H[0],X=1;X<H.length;X++){var lt=H[X];isFunction(lt)&&(lt=lt.prototype),mix(G.prototype,lt)}},Vu=null,jl=function(H){if(typeof H!="object"||H===null)return H;var D;if(mt(H)){D=[];for(var G=0,X=H.length;G<X;G++)typeof H[G]=="object"&&H[G]!=null?D[G]=jl(H[G]):D[G]=H[G]}else{D={};for(var lt in H)typeof H[lt]=="object"&&H[lt]!=null?D[lt]=jl(H[lt]):D[lt]=H[lt]}return D},qe=jl,Pi=function(H,D){if(!pt(H))throw new TypeError("Expected a function");var G=function(){for(var X=[],lt=0;lt<arguments.length;lt++)X[lt]=arguments[lt];var ft=D?D.apply(this,X):X[0],Mt=G.cache;if(Mt.has(ft))return Mt.get(ft);var se=H.apply(this,X);return Mt.set(ft,se),se};return G.cache=new Map,G},ln=5;function ua(H,D,G,X){G=G||0,X=X||ln;for(var lt in D)if(D.hasOwnProperty(lt)){var ft=D[lt];ft!==null&&isPlainObject(ft)?(isPlainObject(H[lt])||(H[lt]={}),G<X?ua(H[lt],ft,G+1,X):H[lt]=D[lt]):isArray(ft)?(H[lt]=[],H[lt]=H[lt].concat(ft)):ft!==void 0&&(H[lt]=ft)}}var Lm=function(H){for(var D=[],G=1;G<arguments.length;G++)D[G-1]=arguments[G];for(var X=0;X<D.length;X+=1)ua(H,D[X]);return H},Dm=null,Im=function(H,D,G,X){isFunction(D)||(G=D,D=H,H=function(){});var lt=Object.create?function(Mt,se){return Object.create(Mt,{constructor:{value:se}})}:function(Mt,se){function de(){}de.prototype=Mt;var pe=new de;return pe.constructor=se,pe},ft=lt(D.prototype,H);return H.prototype=mix(ft,H.prototype),H.superclass=lt(D.prototype,D),mix(ft,G),mix(H,X),H},nl=null,Hv=Object.prototype.hasOwnProperty;function Fm(H){if(isNil(H))return!0;if(isArrayLike(H))return!H.length;var D=getType(H);if(D==="Map"||D==="Set")return!H.size;if(isPrototype(H))return!Object.keys(H).length;for(var G in H)if(Hv.call(H,G))return!1;return!0}var Bm=null,Xv=function(H){return typeof H=="object"&&H!==null},Yu=Xv,Hu=function(H){return H!==null&&typeof H!="function"&&isFinite(H.length)},rl=Hu,Xu=function(H,D){if(H===D)return!0;if(!H||!D||U(H)||U(D))return!1;if(rl(H)||rl(D)){if(H.length!==D.length)return!1;for(var G=!0,X=0;X<H.length&&(G=Xu(H[X],D[X]),!!G);X++);return G}if(Yu(H)||Yu(D)){var lt=Object.keys(H),ft=Object.keys(D);if(lt.length!==ft.length)return!1;for(var G=!0,X=0;X<lt.length&&(G=Xu(H[lt[X]],D[lt[X]]),!!G);X++);return G}return!1},Rs=Xu,Ku=function(H,D,G){return isFunction(G)?!!G(H,D):isEqual(H,D)},Ea=function(H,D,G){for(var X=0,lt=isString(D)?D.split("."):D;H&&X<lt.length;)H=H[lt[X++]];return H===void 0||X<lt.length?G:H},zm=function(H,D,G){var X=H,lt=isString(D)?D.split("."):D;return lt.forEach(function(ft,Mt){Mt<lt.length-1?(isObject(X[ft])||(X[ft]=isNumber(lt[Mt+1])?[]:{}),X=X[ft]):X[ft]=G}),H},$u=Object.prototype.hasOwnProperty,Ar=function(H,D){if(H===null||!isPlainObject(H))return{};var G={};return each(D,function(X){$u.call(H,X)&&(G[X]=H[X])}),G},Va=function(H,D){return reduce(H,function(G,X,lt){return D.includes(lt)||(G[lt]=X),G},{})},Ya={},Eh=function(H){return H=H||"g",Ya[H]?Ya[H]+=1:Ya[H]=1,H+Ya[H]},il,jm=Pi(function(H,D){D===void 0&&(D={});var G=D.fontSize,X=D.fontFamily,lt=D.fontWeight,ft=D.fontStyle,Mt=D.fontVariant;return il||(il=document.createElement("canvas").getContext("2d")),il.font=[ft,Mt,lt,G+"px",X].join(" "),il.measureText(U(H)?H:"").width},function(H,D){return D===void 0&&(D={}),me([H],el(D)).join("")}),Gm=function(H,D,G,X){X===void 0&&(X="...");var lt=16,ft=measureTextWidth(X,G),Mt=isString(H)?H:toString(H),se=D,de=[],pe,ke;if(measureTextWidth(H,G)<=D)return H;for(;pe=Mt.substr(0,lt),ke=measureTextWidth(pe,G),!(ke+ft>se&&ke>se);)if(de.push(pe),se-=ke,Mt=Mt.substr(lt),!Mt)return de.join("");for(;pe=Mt.substr(0,1),ke=measureTextWidth(pe,G),!(ke+ft>se);)if(de.push(pe),se-=ke,Mt=Mt.substr(1),!Mt)return de.join("");return""+de.join("")+X},wh=function(){function H(){this.map={}}return H.prototype.has=function(D){return this.map[D]!==void 0},H.prototype.get=function(D,G){var X=this.map[D];return X===void 0?G:X},H.prototype.set=function(D,G){this.map[D]=G},H.prototype.clear=function(){this.map={}},H.prototype.delete=function(D){delete this.map[D]},H.prototype.size=function(){return Object.keys(this.map).length},H}(),Wm=null,Sh=function(D,G,X){for(var lt=1/0,ft,Mt=0;Mt<G.length;Mt++){var se=G[Mt].id;!X[se]&&D[se]<=lt&&(lt=D[se],ft=G[Mt])}return ft},_h=function(D,G,X,lt){var ft=D.nodes,Mt=ft===void 0?[]:ft,se=D.edges,de=se===void 0?[]:se,pe=[],ke={},Te={},Ie={};Mt.forEach(function(dn,xn){var wn=dn.id;pe.push(wn),Te[wn]=1/0,wn===G&&(Te[wn]=0)});for(var De=Mt.length,Ge=function(xn){var wn=Sh(Te,Mt,ke),Mn=wn.id;if(ke[Mn]=!0,Te[Mn]===1/0)return"continue";var zn=[];X?zn=_(Mn,de):zn=P(Mn,de),zn.forEach(function(Fn){var Dn=Fn.target,Kn=Fn.source,Yn=Dn===Mn?Kn:Dn,In=lt&&Fn[lt]?Fn[lt]:1;Te[Yn]>Te[wn.id]+In?(Te[Yn]=Te[wn.id]+In,Ie[Yn]=[wn.id]):Te[Yn]===Te[wn.id]+In&&Ie[Yn].push(wn.id)})},Ze=0;Ze<De;Ze++)Ge(Ze);Ie[G]=[G];var We={};for(var $e in Te)Te[$e]!==1/0&&Lr(G,$e,Ie,We);var fn={};for(var $e in We)fn[$e]=We[$e][0];return{length:Te,path:fn,allPath:We}},Gl=_h;function Lr(H,D,G,X){if(H===D)return[H];if(X[D])return X[D];for(var lt=[],ft=0,Mt=G[D];ft<Mt.length;ft++){var se=Mt[ft],de=Lr(H,se,G,X);if(!de)return;for(var pe=0,ke=de;pe<ke.length;pe++){var Te=ke[pe];mt(Te)?lt.push(Nt(Nt([],Te,!0),[D],!1)):lt.push([Te,D])}}return X[D]=lt,X[D]}var Mh=function(D,G,X,lt,ft){var Mt=Gl(D,G,lt,ft),se=Mt.length,de=Mt.path,pe=Mt.allPath;return{length:se[X],path:de[X],allPath:pe[X]}},Kv=function(D,G,X,lt){var ft;if(G===X)return[[G]];var Mt=D.edges,se=Mt===void 0?[]:Mt,de=[G],pe=(ft={},ft[G]=!0,ft),ke=[],Te=[],Ie=lt?T(G,se,"target"):T(G,se);for(ke.push(Ie);de.length>0&&ke.length>0;){var De=ke[ke.length-1];if(De.length){var Ge=De.shift();Ge&&(de.push(Ge),pe[Ge]=!0,Ie=lt?T(Ge,se,"target"):T(Ge,se),ke.push(Ie.filter(function($e){return!pe[$e]})))}else{var Ze=de.pop();pe[Ze]=!1,ke.pop();continue}if(de[de.length-1]===X){var We=de.map(function(fn){return fn});Te.push(We);var Ze=de.pop();pe[Ze]=!1,ke.pop()}}return Te},$v=function(D,G){for(var X=F(D,G),lt=[],ft=X.length,Mt=0;Mt<ft;Mt+=1){lt[Mt]=[];for(var se=0;se<ft;se+=1)Mt===se?lt[Mt][se]=0:X[Mt][se]===0||!X[Mt][se]?lt[Mt][se]=1/0:lt[Mt][se]=X[Mt][se]}for(var de=0;de<ft;de+=1)for(var Mt=0;Mt<ft;Mt+=1)for(var se=0;se<ft;se+=1)lt[Mt][se]>lt[Mt][de]+lt[de][se]&&(lt[Mt][se]=lt[Mt][de]+lt[de][se]);return lt},Qu=$v,Qv=function(D,G,X,lt){G===void 0&&(G=!1),X===void 0&&(X="weight"),lt===void 0&&(lt=1e3);var ft=D.nodes,Mt=ft===void 0?[]:ft,se=D.edges,de=se===void 0?[]:se,pe={},ke={};Mt.forEach(function(xn,wn){var Mn=B();xn.clusterId=Mn,pe[Mn]={id:Mn,nodes:[xn]},ke[xn.id]={node:xn,idx:wn}});var Te=F(D,G),Ie=[],De={};Te.forEach(function(xn,wn){var Mn=0,zn=Mt[wn].id;De[zn]={},xn.forEach(function(Fn,Dn){if(Fn){Mn+=Fn;var Kn=Mt[Dn].id;De[zn][Kn]=Fn}}),Ie.push(Mn)});for(var Ge=0,Ze=function(){var wn=!1;if(Mt.forEach(function(Mn){var zn={};Object.keys(De[Mn.id]).forEach(function(nr){var yr=De[Mn.id][nr],br=ke[nr].node,cr=br.clusterId;zn[cr]||(zn[cr]=0),zn[cr]+=yr});var Fn=-1/0,Dn=[];if(Object.keys(zn).forEach(function(nr){Fn<zn[nr]?(Fn=zn[nr],Dn=[nr]):Fn===zn[nr]&&Dn.push(nr)}),!(Dn.length===1&&Dn[0]===Mn.clusterId)){var Kn=Dn.indexOf(Mn.clusterId);if(Kn>=0&&Dn.splice(Kn,1),Dn&&Dn.length){wn=!0;var Yn=pe[Mn.clusterId],In=Yn.nodes.indexOf(Mn);Yn.nodes.splice(In,1);var wr=Math.floor(Math.random()*Dn.length),rr=pe[Dn[wr]];rr.nodes.push(Mn),Mn.clusterId=rr.id}}}),!wn)return"break";Ge++};Ge<lt;){var We=Ze();if(We==="break")break}Object.keys(pe).forEach(function(xn){var wn=pe[xn];(!wn.nodes||!wn.nodes.length)&&delete pe[xn]});var $e=[],fn={};de.forEach(function(xn){var wn=xn.source,Mn=xn.target,zn=xn[X]||1,Fn=ke[wn].node.clusterId,Dn=ke[Mn].node.clusterId,Kn="".concat(Fn,"---").concat(Dn);if(fn[Kn])fn[Kn].weight+=zn,fn[Kn].count++;else{var Yn={source:Fn,target:Dn,weight:zn,count:1};fn[Kn]=Yn,$e.push(Yn)}});var dn=[];return Object.keys(pe).forEach(function(xn){dn.push(pe[xn])}),{clusters:dn,clusterEdges:$e}},Jv=Qv,qv=function(){function H(D){this.arr=D}return H.prototype.getArr=function(){return this.arr||[]},H.prototype.add=function(D){var G,X=D.arr;if(!(!((G=this.arr)===null||G===void 0)&&G.length))return new H(X);if(!(X!=null&&X.length))return new H(this.arr);if(this.arr.length===X.length){var lt=[];for(var ft in this.arr)lt[ft]=this.arr[ft]+X[ft];return new H(lt)}},H.prototype.subtract=function(D){var G,X=D.arr;if(!(!((G=this.arr)===null||G===void 0)&&G.length))return new H(X);if(!(X!=null&&X.length))return new H(this.arr);if(this.arr.length===X.length){var lt=[];for(var ft in this.arr)lt[ft]=this.arr[ft]-X[ft];return new H(lt)}},H.prototype.avg=function(D){var G=[];if(D!==0)for(var X in this.arr)G[X]=this.arr[X]/D;return new H(G)},H.prototype.negate=function(){var D=[];for(var G in this.arr)D[G]=-this.arr[G];return new H(D)},H.prototype.squareEuclideanDistance=function(D){var G,X=D.arr;if(!(!((G=this.arr)===null||G===void 0)&&G.length)||!(X!=null&&X.length))return 0;if(this.arr.length===X.length){var lt=0;for(var ft in this.arr)lt+=Math.pow(this.arr[ft]-D.arr[ft],2);return lt}},H.prototype.euclideanDistance=function(D){var G,X=D.arr;if(!(!((G=this.arr)===null||G===void 0)&&G.length)||!(X!=null&&X.length))return 0;if(this.arr.length===X.length){var lt=0;for(var ft in this.arr)lt+=Math.pow(this.arr[ft]-D.arr[ft],2);return Math.sqrt(lt)}else console.error("The two vectors are unequal in length.")},H.prototype.normalize=function(){var D=[],G=qe(this.arr);G.sort(function(Mt,se){return Mt-se});var X=G[G.length-1],lt=G[0];for(var ft in this.arr)D[ft]=(this.arr[ft]-lt)/(X-lt);return new H(D)},H.prototype.norm2=function(){var D;if(!(!((D=this.arr)===null||D===void 0)&&D.length))return 0;var G=0;for(var X in this.arr)G+=Math.pow(this.arr[X],2);return Math.sqrt(G)},H.prototype.dot=function(D){var G,X=D.arr;if(!(!((G=this.arr)===null||G===void 0)&&G.length)||!(X!=null&&X.length))return 0;if(this.arr.length===X.length){var lt=0;for(var ft in this.arr)lt+=this.arr[ft]*D.arr[ft];return lt}else console.error("The two vectors are unequal in length.")},H.prototype.equal=function(D){var G,X=D.arr;if(((G=this.arr)===null||G===void 0?void 0:G.length)!==(X==null?void 0:X.length))return!1;for(var lt in this.arr)if(this.arr[lt]!==X[lt])return!1;return!0},H}(),Qi=qv,tg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,eg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,kh=function(D,G){D===void 0&&(D=[]),G===void 0&&(G=100);var X={};D.forEach(function(ft){ft.properties&&Object.keys(ft.properties).forEach(function(Mt){if(Mt==="id"||!"".concat(ft.properties[Mt]).match(tg)&&!"".concat(ft.properties[Mt]).match(eg)&&isNaN(Number(ft.properties[Mt]))){X.hasOwnProperty(Mt)&&delete X[Mt];return}X.hasOwnProperty(Mt)?X[Mt]+=1:X[Mt]=1})});var lt=Object.keys(X).sort(function(ft,Mt){return X[Mt]-X[ft]});return lt.length<G?lt:lt.slice(0,G)},ng=function(D,G){return G.map(function(X){return D.hasOwnProperty(X)?D[X]:0})},rg=function(D){for(var G=kh(D),X=[],lt=0;lt<D.length;lt++)X[lt]=ng(D[lt].properties,G);return X},Wl=function(D,G){G===void 0&&(G=void 0);var X=[];return D.forEach(function(lt){G===void 0&&X.push(lt),lt[G]!==void 0&&X.push(lt[G])}),X},Um={getAllSortProperties:kh,getPropertyWeight:rg,getAllProperties:Wl},Ha;(function(H){H.EuclideanDistance="euclideanDistance"})(Ha||(Ha={}));var Ls=function(D,G,X){var lt=[];G!=null&&G.length?lt=G:(D.forEach(function(Mt){lt=lt.concat(Object.keys(Mt))}),lt=Jt(lt));var ft={};return lt.forEach(function(Mt){var se=[];D.forEach(function(de){de[Mt]!==void 0&&de[Mt]!==""&&se.push(de[Mt])}),se.length&&!(X!=null&&X.includes(Mt))&&(ft[Mt]=Jt(se))}),ft},to=function(D,G,X){var lt=Ls(D,G,X),ft=[];if(!Object.keys(lt).length)return ft;var Mt=Object.values(lt),se=Mt.every(function(de){return de.every(function(pe){return typeof pe=="number"})});return D.forEach(function(de,pe){var ke=[];Object.keys(lt).forEach(function(Te){var Ie=de[Te],De=lt[Te],Ge=De.findIndex(function($e){return Ie===$e}),Ze=[];if(se)Ze.push(Ie);else for(var We=0;We<De.length;We++)We===Ge?Ze.push(1):Ze.push(0);ke=ke.concat(Ze)}),ft[pe]=ke}),ft},eo=function(D,G,X,lt){X===void 0&&(X=Ha.EuclideanDistance);var ft=0;switch(X){case Ha.EuclideanDistance:ft=new Qi(D).euclideanDistance(new Qi(G));break;default:break}return ft},Zm={getAllKeyValueMap:Ls,oneHot:to,getDistance:eo},So=function(D,G,X,lt){for(var ft=G.length,Mt=2*lt,se=0,de=0;de<ft;de++)for(var pe=D[de].clusterId,ke=0;ke<ft;ke++){var Te=D[ke].clusterId;if(pe===Te){var Ie=G[de][ke]||0,De=X[de]||0,Ge=X[ke]||0;se+=Ie-De*Ge/Mt}}return se*=1/Mt,se},Ul=function(D,G){D===void 0&&(D=[]);for(var X=D.length,lt=new Qi([]),ft=0;ft<X;ft++)lt=lt.add(new Qi(G[ft]));var Mt=lt.avg(X);Mt.normalize();for(var se=0,ft=0;ft<X;ft++){var de=new Qi(G[ft]),pe=de.squareEuclideanDistance(Mt);se+=pe}var ke=[];D.forEach(function(){ke.push([])});for(var ft=0;ft<X;ft++){var de=new Qi(G[ft]);D[ft].clusterInertial=0;for(var Te=0;Te<X;Te++){if(ft===Te){ke[ft][Te]=0;continue}var Ie=new Qi(G[Te]);ke[ft][Te]=de.squareEuclideanDistance(Ie),D[ft].clusterInertial+=ke[ft][Te]}}for(var De=0,Ge=2*X*se,ft=0;ft<X;ft++)for(var Ze=D[ft].clusterId,Te=0;Te<X;Te++){var We=D[Te].clusterId;if(!(ft===Te||Ze!==We)){var $e=D[ft].clusterInertial*D[Te].clusterInertial/Math.pow(Ge,2)-ke[ft][Te]/Ge;De+=$e}}return Number(De.toFixed(4))},ig=function(D,G,X,lt,ft,Mt,se,de,pe){G===void 0&&(G=!1),X===void 0&&(X="weight"),lt===void 0&&(lt=1e-4),ft===void 0&&(ft=!1),Mt===void 0&&(Mt=void 0),se===void 0&&(se=[]),de===void 0&&(de=["id"]),pe===void 0&&(pe=1);var ke=D.nodes,Te=ke===void 0?[]:ke,Ie=D.edges,De=Ie===void 0?[]:Ie,Ge=[];if(ft){Te.forEach(function(gn,kn){gn.properties=gn.properties||{},gn.originIndex=kn});var Ze=[];Te.every(function(gn){return gn.hasOwnProperty("nodeType")})&&(Ze=Array.from(new Set(Te.map(function(gn){return gn.nodeType}))),Te.forEach(function(gn){gn.properties.nodeType=Ze.findIndex(function(kn){return kn===gn.nodeType})}));var We=Wl(Te,Mt);Ge=to(We,se,de)}var $e=1,fn={},dn={};Te.forEach(function(gn,kn){var Wn=String($e++);gn.clusterId=Wn,fn[Wn]={id:Wn,nodes:[gn]},dn[gn.id]={node:gn,idx:kn}});var xn=F(D,G),wn=[],Mn={},zn=0;xn.forEach(function(gn,kn){var Wn=0,Zn=Te[kn].id;Mn[Zn]={},gn.forEach(function(Vn,qr){if(Vn){Wn+=Vn;var Ur=Te[qr].id;Mn[Zn][Ur]=Vn,zn+=Vn}}),wn.push(Wn)}),zn/=2;for(var Fn=1/0,Dn=1/0,Kn=0,Yn=[],In={};;){ft&&Te.every(function(gn){return gn.hasOwnProperty("properties")})?Fn=So(Te,xn,wn,zn)+Ul(Te,Ge)*pe:Fn=So(Te,xn,wn,zn),Kn===0&&(Dn=Fn,Yn=Te,In=fn);var wr=Fn>0&&Fn>Dn&&Fn-Dn<lt;if(Fn>Dn&&(Yn=Te.map(function(gn){return{node:gn,clusterId:gn.clusterId}}),In=qe(fn),Dn=Fn),wr||Kn>100)break;Kn++,Object.keys(fn).forEach(function(gn){var kn=0;De.forEach(function(Wn){var Zn=Wn.source,Vn=Wn.target,qr=dn[Zn].node.clusterId,Ur=dn[Vn].node.clusterId;(qr===gn&&Ur!==gn||Ur===gn&&qr!==gn)&&(kn=kn+(Wn[X]||1))}),fn[gn].sumTot=kn}),Te.forEach(function(gn,kn){var Wn=fn[gn.clusterId],Zn=0,Vn,qr=wn[kn]/(2*zn),Ur=0,Ni=Wn.nodes;Ni.forEach(function(hi){var Di=dn[hi.id].idx;Ur+=xn[kn][Di]||0});var Ri=Ur-Wn.sumTot*qr,Li=Ni.filter(function(hi){return hi.id!==gn.id}),fs=[];Li.forEach(function(hi,Di){fs[Di]=Ge[hi.originIndex]});var Mi=Ul(Li,Ge)*pe,Is=Mn[gn.id];if(Object.keys(Is).forEach(function(hi){var Di=dn[hi].node,_o=Di.clusterId;if(_o!==gn.clusterId){var ii=fn[_o],Sa=ii.nodes;if(!(!Sa||!Sa.length)){var tr=0;Sa.forEach(function(gr){var _r=dn[gr.id].idx;tr+=xn[kn][_r]||0});var hr=tr-ii.sumTot*qr,ir=Sa.concat([gn]),Sr=[];ir.forEach(function(gr,_r){Sr[_r]=Ge[gr.originIndex]});var ti=Ul(ir,Ge)*pe,Nn=hr-Ri;ft&&(Nn=hr+ti-(Ri+Mi)),Nn>Zn&&(Zn=Nn,Vn=ii)}}}),Zn>0){Vn.nodes.push(gn);var ci=gn.clusterId;gn.clusterId=Vn.id;var ul=Wn.nodes.indexOf(gn);Wn.nodes.splice(ul,1);var ki=0,Fs=0;De.forEach(function(hi){var Di=hi.source,_o=hi.target,ii=dn[Di].node.clusterId,Sa=dn[_o].node.clusterId;(ii===Vn.id&&Sa!==Vn.id||Sa===Vn.id&&ii!==Vn.id)&&(ki=ki+(hi[X]||1)),(ii===ci&&Sa!==ci||Sa===ci&&ii!==ci)&&(Fs=Fs+(hi[X]||1))}),Vn.sumTot=ki,Wn.sumTot=Fs}})}var rr={},nr=0;Object.keys(In).forEach(function(gn){var kn=In[gn];if(!kn.nodes||!kn.nodes.length){delete In[gn];return}var Wn=String(nr+1);Wn!==gn&&(kn.id=Wn,kn.nodes=kn.nodes.map(function(Zn){return{id:Zn.id,clusterId:Wn}}),In[Wn]=kn,rr[gn]=Wn,delete In[gn],nr++)}),Yn.forEach(function(gn){var kn=gn.node,Wn=gn.clusterId;kn&&(kn.clusterId=Wn,kn.clusterId&&rr[kn.clusterId]&&(kn.clusterId=rr[kn.clusterId]))});var yr=[],br={};De.forEach(function(gn){var kn=gn.source,Wn=gn.target,Zn=gn[X]||1,Vn=dn[kn].node.clusterId,qr=dn[Wn].node.clusterId;if(!(!Vn||!qr)){var Ur="".concat(Vn,"---").concat(qr);if(br[Ur])br[Ur].weight+=Zn,br[Ur].count++;else{var Ni={source:Vn,target:qr,weight:Zn,count:1};br[Ur]=Ni,yr.push(Ni)}}});var cr=[];return Object.keys(In).forEach(function(gn){cr.push(In[gn])}),{clusters:cr,clusterEdges:yr}},Th=ig,Oh=function(D,G,X,lt,ft,Mt,se,de){return G===void 0&&(G=!1),X===void 0&&(X="weight"),lt===void 0&&(lt=1e-4),ft===void 0&&(ft=void 0),Mt===void 0&&(Mt=[]),se===void 0&&(se=["id"]),de===void 0&&(de=1),Th(D,G,X,lt,!0,ft,Mt,se,de)},Ju=Oh,Ah=function(D,G){var X;G===void 0&&(G=1);for(var lt=qe(D),ft=lt.nodes,Mt=ft===void 0?[]:ft,se=lt.edges,de=se===void 0?[]:se,pe=function(){var Ie=Ct({nodes:Mt,edges:de}),De=Object.keys(Ie);De.sort(function(We,$e){var fn,dn;return((fn=Ie[We])===null||fn===void 0?void 0:fn.degree)-((dn=Ie[$e])===null||dn===void 0?void 0:dn.degree)});var Ge=De[0];if(!Mt.length||((X=Ie[Ge])===null||X===void 0?void 0:X.degree)>=G)return"break";var Ze=Mt.findIndex(function(We){return We.id===Ge});Mt.splice(Ze,1),de=de.filter(function(We){return!(We.source===Ge||We.target===Ge)})};;){var ke=pe();if(ke==="break")break}return{nodes:Mt,edges:de}},ag=Ah,Ch=function(D,G,X){var lt=[];switch(D){case Ha.EuclideanDistance:lt=G[X];break;default:lt=[];break}return lt},Vi=function(D,G,X,lt,ft,Mt){G===void 0&&(G=3),X===void 0&&(X=void 0),lt===void 0&&(lt=[]),ft===void 0&&(ft=["id"]),Mt===void 0&&(Mt=Ha.EuclideanDistance);var se=D.nodes,de=se===void 0?[]:se,pe=D.edges,ke=pe===void 0?[]:pe,Te={clusters:[{id:"0",nodes:de}],clusterEdges:[]};if(Mt===Ha.EuclideanDistance&&!de.every(function(Wn){return Wn.hasOwnProperty(X)}))return Te;var Ie=[],De=[];if(Mt===Ha.EuclideanDistance&&(Ie=Wl(de,X),De=to(Ie,lt,ft)),!De.length)return Te;for(var Ge=Jt(De.map(function(Wn){return Wn.join("")})),Ze=Math.min(G,de.length,Ge.length),We=0;We<de.length;We++)de[We].originIndex=We;for(var $e=[],fn=[],dn=[],We=0;We<Ze;We++)if(We===0){var xn=Math.floor(Math.random()*de.length);switch(Mt){case Ha.EuclideanDistance:$e[We]=De[xn];break;default:$e[We]=[];break}fn.push(xn),dn[We]=[de[xn]],de[xn].clusterId=String(We)}else{for(var wn=-1/0,Mn=0,zn=function(Vn){if(!fn.includes(Vn)){for(var qr=0,Ur=0;Ur<$e.length;Ur++){var Ni=0;switch(Mt){case Ha.EuclideanDistance:Ni=eo(De[de[Vn].originIndex],$e[Ur],Mt);break;default:break}qr+=Ni}var Ri=qr/$e.length;Ri>wn&&!$e.find(function(Li){return Rs(Li,Ch(Mt,De,de[Vn].originIndex))})&&(wn=Ri,Mn=Vn)}},Fn=0;Fn<de.length;Fn++)zn(Fn);$e[We]=Ch(Mt,De,Mn),fn.push(Mn),dn[We]=[de[Mn]],de[Mn].clusterId=String(We)}for(var Dn=0;;){for(var We=0;We<de.length;We++){var Kn=0,Yn=1/0;if(!(Dn===0&&fn.includes(We))){for(var In=0;In<$e.length;In++){var wr=0;switch(Mt){case Ha.EuclideanDistance:wr=eo(De[We],$e[In],Mt);break;default:break}wr<Yn&&(Yn=wr,Kn=In)}if(de[We].clusterId!==void 0)for(var rr=dn[Number(de[We].clusterId)].length-1;rr>=0;rr--)dn[Number(de[We].clusterId)][rr].id===de[We].id&&dn[Number(de[We].clusterId)].splice(rr,1);de[We].clusterId=String(Kn),dn[Kn].push(de[We])}}for(var nr=!1,We=0;We<dn.length;We++){for(var yr=dn[We],br=new Qi([]),In=0;In<yr.length;In++)br=br.add(new Qi(De[yr[In].originIndex]));var cr=br.avg(yr.length);cr.equal(new Qi($e[We]))||(nr=!0,$e[We]=cr.getArr())}if(Dn++,de.every(function(Wn){return Wn.clusterId!==void 0})&&nr||Dn>=1e3)break}var gn=[],kn={};return ke.forEach(function(Wn){var Zn,Vn,qr=Wn.source,Ur=Wn.target,Ni=(Zn=de.find(function(Mi){return Mi.id===qr}))===null||Zn===void 0?void 0:Zn.clusterId,Ri=(Vn=de.find(function(Mi){return Mi.id===Ur}))===null||Vn===void 0?void 0:Vn.clusterId,Li="".concat(Ni,"---").concat(Ri);if(kn[Li])kn[Li].count++;else{var fs={source:Ni,target:Ri,count:1};kn[Li]=fs,gn.push(fs)}}),{clusters:dn,clusterEdges:gn}},Ph=Vi,Ji=function(D,G){var X=new Qi(G),lt=X.norm2(),ft=new Qi(D),Mt=ft.norm2(),se=X.dot(ft),de=lt*Mt,pe=de?se/de:0;return pe},Nh=Ji,sg=function(D,G,X,lt,ft){D===void 0&&(D=[]),X===void 0&&(X=void 0),lt===void 0&&(lt=[]),ft===void 0&&(ft=[]);var Mt=qe(D.filter(function(Ie){return Ie.id!==G.id})),se=D.findIndex(function(Ie){return Ie.id===G.id}),de=Wl(D,X),pe=to(de,lt,ft),ke=pe[se],Te=[];return Mt.forEach(function(Ie,De){if(Ie.id!==G.id){var Ge=pe[De],Ze=Nh(Ge,ke);Te.push(Ze),Ie.cosineSimilarity=Ze}}),Mt.sort(function(Ie,De){return De.cosineSimilarity-Ie.cosineSimilarity}),{allCosineSimilarity:Te,similarNodes:Mt}},og=sg,Rh=function(){function H(D){this.count=D.length,this.parent={};for(var G=0,X=D;G<X.length;G++){var lt=X[G];this.parent[lt]=lt}}return H.prototype.find=function(D){for(;this.parent[D]!==D;)D=this.parent[D];return D},H.prototype.union=function(D,G){var X=this.find(D),lt=this.find(G);X!==lt&&(X<lt?(this.parent[G]!==G&&this.union(this.parent[G],D),this.parent[G]=this.parent[D]):(this.parent[D]!==D&&this.union(this.parent[D],G),this.parent[D]=this.parent[G]))},H.prototype.connected=function(D,G){return this.find(D)===this.find(G)},H}(),Lh=Rh,qu=function(D,G){return D-G},tc=function(){function H(D){D===void 0&&(D=qu),this.compareFn=D,this.list=[]}return H.prototype.getLeft=function(D){return 2*D+1},H.prototype.getRight=function(D){return 2*D+2},H.prototype.getParent=function(D){return D===0?null:Math.floor((D-1)/2)},H.prototype.isEmpty=function(){return this.list.length<=0},H.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},H.prototype.delMin=function(){var D=this.top(),G=this.list.pop();return this.list.length>0&&(this.list[0]=G,this.moveDown(0)),D},H.prototype.insert=function(D){if(D!==null){this.list.push(D);var G=this.list.length-1;return this.moveUp(G),!0}return!1},H.prototype.moveUp=function(D){for(var G=this.getParent(D);D&&D>0&&this.compareFn(this.list[G],this.list[D])>0;){var X=this.list[G];this.list[G]=this.list[D],this.list[D]=X,D=G,G=this.getParent(D)}},H.prototype.moveDown=function(D){var G,X=D,lt=this.getLeft(D),ft=this.getRight(D),Mt=this.list.length;lt!==null&<<Mt&&this.compareFn(this.list[X],this.list[lt])>0?X=lt:ft!==null&&ft<Mt&&this.compareFn(this.list[X],this.list[ft])>0&&(X=ft),D!==X&&(G=[this.list[X],this.list[D]],this.list[D]=G[0],this.list[X]=G[1],this.moveDown(X))},H}(),ec=tc,Dh=function(D,G){var X=[],lt=D.nodes,ft=lt===void 0?[]:lt,Mt=D.edges,se=Mt===void 0?[]:Mt;if(ft.length===0)return X;var de=ft[0],pe=new Set;pe.add(de);var ke=function(We,$e){return G?We.weight-$e.weight:0},Te=new ec(ke);for(P(de.id,se).forEach(function(Ze){Te.insert(Ze)});!Te.isEmpty();){var Ie=Te.delMin(),De=Ie.source,Ge=Ie.target;pe.has(De)&&pe.has(Ge)||(X.push(Ie),pe.has(De)||(pe.add(De),P(De,se).forEach(function(Ze){Te.insert(Ze)})),pe.has(Ge)||(pe.add(Ge),P(Ge,se).forEach(function(Ze){Te.insert(Ze)})))}return X},Zl=function(D,G){var X=[],lt=D.nodes,ft=lt===void 0?[]:lt,Mt=D.edges,se=Mt===void 0?[]:Mt;if(ft.length===0)return X;var de=se.map(function(De){return De});G&&de.sort(function(De,Ge){return De.weight-Ge.weight});for(var pe=new Lh(ft.map(function(De){return De.id}));de.length>0;){var ke=de.shift(),Te=ke.source,Ie=ke.target;pe.connected(Te,Ie)||(X.push(ke),pe.union(Te,Ie))}return X},lg=function(D,G,X){var lt={prim:Dh,kruskal:Zl};return X?lt[X](D,G):Zl(D,G)},ug=lg,cg=function(D,G,X){typeof G!="number"&&(G=1e-6),typeof X!="number"&&(X=.85);for(var lt=1,ft=0,Mt=1e3,se=D.nodes,de=se===void 0?[]:se,pe=D.edges,ke=pe===void 0?[]:pe,Te=de.length,Ie,De={},Ge={},Ze=0;Ze<Te;++Ze){var We=de[Ze],$e=We.id;De[$e]=1/Te,Ge[$e]=1/Te}for(var fn=Ct(D);Mt>0&<>G;){ft=0;for(var Ze=0;Ze<Te;++Ze){var We=de[Ze],$e=We.id;if(Ie=0,fn[We.id].inDegree===0)De[$e]=0;else{for(var dn=T($e,ke,"source"),xn=0;xn<dn.length;++xn){var wn=dn[xn],Mn=fn[wn].outDegree;Mn>0&&(Ie+=Ge[wn]/Mn)}De[$e]=X*Ie,ft+=De[$e]}}ft=(1-ft)/Te,lt=0;for(var Ze=0;Ze<Te;++Ze){var We=de[Ze],$e=We.id;Ie=De[$e]+ft,lt+=Math.abs(Ie-Ge[$e]),Ge[$e]=Ie}Mt-=1}return Ge},Ih=cg,Vl=-1,Yl=-1,al="-1",wa="-1",nc=-1,hg="-1",Fh=function(){function H(D,G,X,lt){D===void 0&&(D=Vl),G===void 0&&(G=Yl),X===void 0&&(X=Yl),lt===void 0&&(lt=al),this.id=D,this.from=G,this.to=X,this.label=lt}return H}(),Bh=function(){function H(D,G){D===void 0&&(D=Yl),G===void 0&&(G=wa),this.id=D,this.label=G,this.edges=[],this.edgeMap={}}return H.prototype.addEdge=function(D){this.edges.push(D),this.edgeMap[D.id]=D},H}(),sl=function(){function H(D,G,X){D===void 0&&(D=Yl),G===void 0&&(G=!0),X===void 0&&(X=!1),this.id=D,this.edgeIdAutoIncrease=G,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=X}return H.prototype.getNodeNum=function(){return this.nodes.length},H.prototype.addNode=function(D,G){if(!this.nodeMap[D]){var X=new Bh(D,G);this.nodes.push(X),this.nodeMap[D]=X,this.nodeLabelMap[G]||(this.nodeLabelMap[G]=[]),this.nodeLabelMap[G].push(D)}},H.prototype.addEdge=function(D,G,X,lt){if((this.edgeIdAutoIncrease||D===void 0)&&(D=this.counter++),!(this.nodeMap[G]&&this.nodeMap[X]&&this.nodeMap[X].edgeMap[D])){var ft=new Fh(D,G,X,lt);if(this.edges.push(ft),this.edgeMap[D]=ft,this.nodeMap[G].addEdge(ft),this.edgeLabelMap[lt]||(this.edgeLabelMap[lt]=[]),this.edgeLabelMap[lt].push(ft),!this.directed){var Mt=new Fh(D,X,G,lt);this.nodeMap[X].addEdge(Mt),this.edgeLabelMap[lt].push(Mt)}}},H}(),ds=function(){function H(D,G,X,lt,ft){this.fromNode=D,this.toNode=G,this.nodeEdgeNodeLabel={nodeLabel1:X||wa,edgeLabel:lt||al,nodeLabel2:ft||wa}}return H.prototype.equalTo=function(D){return this.fromNode===D.formNode&&this.toNode===D.toNode&&this.nodeEdgeNodeLabel===D.nodeEdgeNodeLabel},H.prototype.notEqualTo=function(D){return!this.equalTo(D)},H}(),rc=function(){function H(){this.rmpath=[],this.dfsEdgeList=[]}return H.prototype.equalTo=function(D){var G=this.dfsEdgeList.length,X=D.length;if(G!==X)return!1;for(var lt=0;lt<G;lt++)if(this.dfsEdgeList[lt]!==D[lt])return!1;return!0},H.prototype.notEqualTo=function(D){return!this.equalTo(D)},H.prototype.pushBack=function(D,G,X,lt,ft){return this.dfsEdgeList.push(new ds(D,G,X,lt,ft)),this.dfsEdgeList},H.prototype.toGraph=function(D,G){D===void 0&&(D=nc),G===void 0&&(G=!1);var X=new sl(D,!0,G);return this.dfsEdgeList.forEach(function(lt){var ft=lt.fromNode,Mt=lt.toNode,se=lt.nodeEdgeNodeLabel,de=se.nodeLabel1,pe=se.edgeLabel,ke=se.nodeLabel2;de!==wa&&X.addNode(ft,de),ke!==wa&&X.addNode(Mt,ke),de!==wa&&ke!==de&&X.addEdge(void 0,ft,Mt,pe)}),X},H.prototype.buildRmpath=function(){this.rmpath=[];for(var D=void 0,G=this.dfsEdgeList.length,X=G-1;X>=0;X--){var lt=this.dfsEdgeList[X],ft=lt.fromNode,Mt=lt.toNode;ft<Mt&&(D===void 0||Mt===D)&&(this.rmpath.push(X),D=ft)}return this.rmpath},H.prototype.getNodeNum=function(){var D={};return this.dfsEdgeList.forEach(function(G){D[G.fromNode]||(D[G.fromNode]=!0),D[G.toNode]||(D[G.toNode]=!0)}),Object.keys(D).length},H}(),Hl=function(){function H(D){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!D){for(;D;){var G=D.edge;this.edges.push(G),this.nodesUsed[G.from]=1,this.nodesUsed[G.to]=1,this.edgesUsed[G.id]=1,D=D.preNode}this.edges=this.edges.reverse()}}return H.prototype.hasNode=function(D){return this.nodesUsed[D.id]===1},H.prototype.hasEdge=function(D){return this.edgesUsed[D.id]===1},H}(),dg=function(){function H(D){var G=D.graphs,X=D.minSupport,lt=X===void 0?2:X,ft=D.minNodeNum,Mt=ft===void 0?1:ft,se=D.maxNodeNum,de=se===void 0?4:se,pe=D.top,ke=pe===void 0?10:pe,Te=D.directed,Ie=Te===void 0?!1:Te,De=D.verbose,Ge=De===void 0?!1:De;this.graphs=G,this.dfsCode=new rc,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=lt,this.top=ke,this.directed=Ie,this.counter=0,this.maxNodeNum=de,this.minNodeNum=Mt,this.verbose=Ge,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return H.prototype.findForwardRootEdges=function(D,G){var X=this,lt=[],ft=D.nodeMap;return G.edges.forEach(function(Mt){(X.directed||G.label<=ft[Mt.to].label)&<.push(Mt)}),lt},H.prototype.findBackwardEdge=function(D,G,X,lt){if(!this.directed&&G===X)return null;for(var ft=D.nodeMap,Mt=ft[X.to],se=Mt.edges,de=se.length,pe=0;pe<de;pe++){var ke=se[pe];if(!(lt.hasEdge(ke)||ke.to!==G.from)){if(this.directed){if(ft[G.from].label<ft[X.to].label||ft[G.from].label===ft[X.to].label&&G.label<=ke.label)return ke}else if(G.label<ke.label||G.label===ke.label&&ft[G.to].label<=ft[X.to].label)return ke}}return null},H.prototype.findForwardPureEdges=function(D,G,X,lt){for(var ft=[],Mt=G.to,se=D.nodeMap[Mt].edges,de=se.length,pe=0;pe<de;pe++){var ke=se[pe],Te=D.nodeMap[ke.to];X<=Te.label&&!lt.hasNode(Te)&&ft.push(ke)}return ft},H.prototype.findForwardRmpathEdges=function(D,G,X,lt){for(var ft=[],Mt=D.nodeMap,se=Mt[G.to].label,de=Mt[G.from],pe=de.edges,ke=pe.length,Te=0;Te<ke;Te++){var Ie=pe[Te],De=Mt[Ie.to].label;G.to===Ie.to||X>De||lt.hasNode(Mt[Ie.to])||(G.label<Ie.label||G.label===Ie.label&&se<=De)&&ft.push(Ie)}return ft},H.prototype.getSupport=function(D){var G={};return D.forEach(function(X){G[X.graphId]||(G[X.graphId]=!0)}),Object.keys(G).length},H.prototype.findMinLabel=function(D){var G=void 0;return Object.keys(D).forEach(function(X){var lt=D[X],ft=lt.nodeLabel1,Mt=lt.edgeLabel,se=lt.nodeLabel2;if(!G){G={nodeLabel1:ft,edgeLabel:Mt,nodeLabel2:se};return}(ft<G.nodeLabel1||ft===G.nodeLabel1&&Mt<G.edgeLabel||ft===G.nodeLabel1&&Mt===G.edgeLabel&&se<G.nodeLabel2)&&(G={nodeLabel1:ft,edgeLabel:Mt,nodeLabel2:se})}),G},H.prototype.isMin=function(){var D=this,G=this.dfsCode;if(this.verbose&&console.log("isMin checking",G),G.dfsEdgeList.length===1)return!0;var X=this.directed,lt=G.toGraph(nc,X),ft=lt.nodeMap,Mt=new rc,se={};lt.nodes.forEach(function(Te){var Ie=D.findForwardRootEdges(lt,Te);Ie.forEach(function(De){var Ge=ft[De.to],Ze="".concat(Te.label,"-").concat(De.label,"-").concat(Ge.label);se[Ze]||(se[Ze]={projected:[],nodeLabel1:Te.label,edgeLabel:De.label,nodeLabel2:Ge.label});var We={graphId:lt.id,edge:De,preNode:null};se[Ze].projected.push(We)})});var de=this.findMinLabel(se);if(de){Mt.dfsEdgeList.push(new ds(0,1,de.nodeLabel1,de.edgeLabel,de.nodeLabel2));var pe=function Te(Ie){for(var De=Mt.buildRmpath(),Ge=Mt.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,Ze=Mt.dfsEdgeList[De[0]].toNode,We={},$e=!1,fn=0,dn=X?-1:0,xn=function(br){if($e)return"break";Ie.forEach(function(cr){var gn=new Hl(cr),kn=D.findBackwardEdge(lt,gn.edges[De[br]],gn.edges[De[0]],gn);kn&&(We[kn.label]||(We[kn.label]={projected:[],edgeLabel:kn.label}),We[kn.label].projected.push({graphId:lt.id,edge:We,preNode:cr}),fn=Mt.dfsEdgeList[De[br]].fromNode,$e=!0)})},wn=De.length-1;wn>dn;wn--){var Mn=xn(wn);if(Mn==="break")break}if($e){var zn=D.findMinLabel(We);Mt.dfsEdgeList.push(new ds(Ze,fn,wa,zn.edgeLabel,wa));var Fn=Mt.dfsEdgeList.length-1;return D.dfsCode.dfsEdgeList[Fn]!==Mt.dfsEdgeList[Fn]?!1:Te(We[zn.edgeLabel].projected)}var Dn={};$e=!1;var Kn=0;Ie.forEach(function(yr){var br=new Hl(yr),cr=D.findForwardPureEdges(lt,br.edges[De[0]],Ge,br);cr.length>0&&($e=!0,Kn=Ze,cr.forEach(function(gn){var kn="".concat(gn.label,"-").concat(ft[gn.to].label);Dn[kn]||(Dn[kn]={projected:[],edgeLabel:gn.label,nodeLabel2:ft[gn.to].label}),Dn[kn].projected.push({graphId:lt.id,edge:gn,preNode:yr})}))});for(var Yn=De.length,In=function(br){if($e)return"break";var cr=De[br];Ie.forEach(function(gn){var kn=new Hl(gn),Wn=D.findForwardRmpathEdges(lt,kn.edges[cr],Ge,kn);Wn.length>0&&($e=!0,Kn=Mt.dfsEdgeList[cr].fromNode,Wn.forEach(function(Zn){var Vn="".concat(Zn.label,"-").concat(ft[Zn.to].label);Dn[Vn]||(Dn[Vn]={projected:[],edgeLabel:Zn.label,nodeLabel2:ft[Zn.to].label}),Dn[Vn].projected.push({graphId:lt.id,edge:Zn,preNode:gn})}))})},wn=0;wn<Yn;wn++){var wr=In(wn);if(wr==="break")break}if(!$e)return!0;var rr=D.findMinLabel(Dn);Mt.dfsEdgeList.push(new ds(Kn,Ze+1,wa,rr.edgeLabel,rr.nodeLabel2));var nr=Mt.dfsEdgeList.length-1;return G.dfsEdgeList[nr]!==Mt.dfsEdgeList[nr]?!1:Te(Dn["".concat(rr.edgeLabel,"-").concat(rr.nodeLabel2)].projected)},ke="".concat(de.nodeLabel1,"-").concat(de.edgeLabel,"-").concat(de.nodeLabel2);return pe(se[ke].projected)}},H.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var D=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(qe(D))}},H.prototype.subGraphMining=function(D){var G=this,X=this.getSupport(D);if(!(X<this.minSupport)&&this.isMin()){this.report();var lt=this.dfsCode.getNodeNum(),ft=this.dfsCode.buildRmpath(),Mt=this.dfsCode.dfsEdgeList[ft[0]].toNode,se=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,de={},pe={};D.forEach(function(ke){for(var Te=G.graphs[ke.graphId],Ie=Te.nodeMap,De=new Hl(ke),Ge=ft.length-1;Ge>=0;Ge--){var Ze=G.findBackwardEdge(Te,De.edges[ft[Ge]],De.edges[ft[0]],De);if(Ze){var We="".concat(G.dfsCode.dfsEdgeList[ft[Ge]].fromNode,"-").concat(Ze.label);pe[We]||(pe[We]={projected:[],toNodeId:G.dfsCode.dfsEdgeList[ft[Ge]].fromNode,edgeLabel:Ze.label}),pe[We].projected.push({graphId:ke.graphId,edge:Ze,preNode:ke})}}if(!(lt>=G.maxNodeNum)){var $e=G.findForwardPureEdges(Te,De.edges[ft[0]],se,De);$e.forEach(function(dn){var xn="".concat(Mt,"-").concat(dn.label,"-").concat(Ie[dn.to].label);de[xn]||(de[xn]={projected:[],fromNodeId:Mt,edgeLabel:dn.label,nodeLabel2:Ie[dn.to].label}),de[xn].projected.push({graphId:ke.graphId,edge:dn,preNode:ke})});for(var fn=function(xn){var wn=G.findForwardRmpathEdges(Te,De.edges[ft[xn]],se,De);wn.forEach(function(Mn){var zn="".concat(G.dfsCode.dfsEdgeList[ft[xn]].fromNode,"-").concat(Mn.label,"-").concat(Ie[Mn.to].label);de[zn]||(de[zn]={projected:[],fromNodeId:G.dfsCode.dfsEdgeList[ft[xn]].fromNode,edgeLabel:Mn.label,nodeLabel2:Ie[Mn.to].label}),de[zn].projected.push({graphId:ke.graphId,edge:Mn,preNode:ke})})},Ge=0;Ge<ft.length;Ge++)fn(Ge)}}),Object.keys(pe).forEach(function(ke){var Te=pe[ke],Ie=Te.toNodeId,De=Te.edgeLabel;G.dfsCode.dfsEdgeList.push(new ds(Mt,Ie,"-1",De,"-1")),G.subGraphMining(pe[ke].projected),G.dfsCode.dfsEdgeList.pop()}),Object.keys(de).forEach(function(ke){var Te=de[ke],Ie=Te.fromNodeId,De=Te.edgeLabel,Ge=Te.nodeLabel2;G.dfsCode.dfsEdgeList.push(new ds(Ie,Mt+1,wa,De,Ge)),G.subGraphMining(de[ke].projected),G.dfsCode.dfsEdgeList.pop()})}},H.prototype.generate1EdgeFrequentSubGraphs=function(){var D=this.graphs,G=this.directed,X=this.minSupport,lt=this.frequentSize1Subgraphs,ft={},Mt={},se={},de={};return Object.keys(D).forEach(function(pe){var ke=D[pe],Te=ke.nodeMap;ke.nodes.forEach(function(Ie,De){var Ge=Ie.label,Ze="".concat(pe,"-").concat(Ge);if(!se[Ze]){var We=ft[Ge]||0;We++,ft[Ge]=We}se[Ze]={graphKey:pe,label:Ge},Ie.edges.forEach(function($e){var fn=Ge,dn=Te[$e.to].label;if(!G&&fn>dn){var xn=dn;dn=fn,fn=xn}var wn=$e.label,Mn="".concat(pe,"-").concat(fn,"-").concat(wn,"-").concat(dn),zn="".concat(fn,"-").concat(wn,"-").concat(dn);if(!Mt[zn]){var Fn=Mt[zn]||0;Fn++,Mt[zn]=Fn}de[Mn]={graphId:pe,nodeLabel1:fn,edgeLabel:wn,nodeLabel2:dn}})})}),Object.keys(ft).forEach(function(pe){var ke=ft[pe];if(!(ke<X)){var Te={nodes:[],edges:[]};Te.nodes.push({id:"0",label:pe}),lt.push(Te)}}),lt},H.prototype.run=function(){var D=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var G=this.graphs,X=this.directed,lt={};Object.keys(G).forEach(function(ft){var Mt=G[ft],se=Mt.nodeMap;Mt.nodes.forEach(function(de){var pe=D.findForwardRootEdges(Mt,de);pe.forEach(function(ke){var Te=se[ke.to],Ie="".concat(de.label,"-").concat(ke.label,"-").concat(Te.label);lt[Ie]||(lt[Ie]={projected:[],nodeLabel1:de.label,edgeLabel:ke.label,nodeLabel2:Te.label});var De={graphId:ft,edge:ke,preNode:null};lt[Ie].projected.push(De)})})}),Object.keys(lt).forEach(function(ft){var Mt=lt[ft],se=Mt.projected,de=Mt.nodeLabel1,pe=Mt.edgeLabel,ke=Mt.nodeLabel2;D.dfsCode.dfsEdgeList.push(new ds(0,1,de,pe,ke)),D.subGraphMining(se),D.dfsCode.dfsEdgeList.pop()})}},H}(),fg=function(D,G,X,lt){var ft={};return Object.keys(D).forEach(function(Mt,se){var de=D[Mt],pe=new sl(se,!0,G),ke={};de.nodes.forEach(function(Te,Ie){pe.addNode(Ie,Te[X]),ke[Te.id]=Ie}),de.edges.forEach(function(Te,Ie){var De=ke[Te.source],Ge=ke[Te.target];pe.addEdge(-1,De,Ge,Te[lt])}),pe&&pe.getNodeNum()&&(ft[pe.id]=pe)}),ft},zh=function(D,G,X){var lt=[];return D.forEach(function(ft){var Mt={nodes:[],edges:[]};ft.nodes.forEach(function(se){var de;Mt.nodes.push((de={id:"".concat(se.id)},de[G]=se.label,de))}),ft.edges.forEach(function(se){var de;Mt.edges.push((de={source:"".concat(se.from),target:"".concat(se.to)},de[X]=se.label,de))}),lt.push(Mt)}),lt},jh="cluster",vg=function(D){var G=D.graphs,X=D.directed,lt=X===void 0?!1:X,ft=D.nodeLabelProp,Mt=ft===void 0?jh:ft,se=D.edgeLabelProp,de=se===void 0?jh:se,pe=fg(G,lt,Mt,de),ke=D.minSupport,Te=D.maxNodeNum,Ie=D.minNodeNum,De=D.verbose,Ge=D.top,Ze={graphs:pe,minSupport:ke,maxNodeNum:Te,minNodeNum:Ie,top:Ge,verbose:De,directed:lt},We=new dg(Ze);We.run();var $e=zh(We.frequentSubgraphs,Mt,de);return $e},Vm=vg,gg=function(D,G,X,lt){X===void 0&&(X="cluster"),lt===void 0&&(lt=2);var ft=[],Mt=D.nodes;return G.forEach(function(se,de){ft.push(ic(Mt,se,de,X,lt))}),ft},ic=function(D,G,X,lt,ft){var Mt=[X],se=[],de={};return G.forEach(function(pe,ke){if(pe<=ft&&X!==ke){Mt.push(ke),se.push(D[ke]);var Te=D[ke][lt];de[Te]?(de[Te].count++,de[Te].dists.push(pe)):de[Te]={count:1,dists:[pe]}}}),Object.keys(de).forEach(function(pe){de[pe].dists=de[pe].dists.sort(function(ke,Te){return ke-Te})}),{nodeIdx:X,nodeId:D[X].id,nodeIdxs:Mt,neighbors:se,neighborNum:Mt.length-1,nodeLabelCountMap:de}},pg=function(D,G,X,lt,ft){var Mt=Math.ceil(X/G),se={},de=0;return lt.forEach(function(pe,ke){for(var Te=0,Ie=0,De=pe.nodeIdxs,Ge=pe.neighborNum-1;Te<Mt;){for(var Ze=De[1+Math.floor(Math.random()*Ge)],We=0;(se["".concat(ke,"-").concat(Ze)]||se["".concat(Ze,"-").concat(ke)])&&(Ze=Math.floor(Math.random()*G),We++,!(We>2*G)););if(We<2*G&&(se["".concat(ke,"-").concat(Ze)]={start:ke,end:Ze,distance:ft[ke][Ze]},Te++,de++,de>=X))return se;if(Ie++,Ie>2*G)break}if(Te<Mt){var $e=Mt-Te;Mt=(Mt+$e)/(G-ke-1)}}),se},ol=function(D,G,X,lt){var ft=X.nodes;return lt||(lt={}),Object.keys(D).forEach(function(Mt){var se,de;if(!(lt&<[Mt])){lt[Mt]={nodes:[],edges:[]};var pe=D[Mt],ke=(se=G[pe.start])===null||se===void 0?void 0:se.nodeIdxs,Te=(de=G[pe.end])===null||de===void 0?void 0:de.nodeIdxs;if(!(!ke||!Te)){var Ie=new Set(Te),De=ke.filter(function(fn){return Ie.has(fn)});if(!(!De||!De.length)){for(var Ge={},Ze=De.length,We=0;We<Ze;We++){var $e=ft[De[We]];lt[Mt].nodes.push($e),Ge[$e.id]=!0}X.edges.forEach(function(fn){Ge[fn.source]&&Ge[fn.target]&<[Mt].edges.push(fn)})}}}}),lt},Xl=function(D,G,X,lt){var ft,Mt,se={};D.nodes.forEach(function(pe){se[pe.id]=pe});var de=0;return!(!((ft=G==null?void 0:G.edges)===null||ft===void 0)&&ft.length)||((Mt=G==null?void 0:G.nodes)===null||Mt===void 0?void 0:Mt.length)<2?0:(D.edges.forEach(function(pe){var ke=se[pe.source][X],Te=se[pe.target][X],Ie=G==null?void 0:G.nodes[0][X],De=G==null?void 0:G.nodes[1][X],Ge=G==null?void 0:G.edges[0][lt];pe[lt]===Ge&&(ke===Ie&&Te===De||ke===De&&Te===Ie)&&de++}),de)},mg=function(D,G,X){for(var lt=1/0,ft=0,Mt=function(pe){var ke=D[pe],Te=Object.keys(ke).sort(function(fn,dn){return ke[fn]-ke[dn]}),Ie=10,De=[];Te.forEach(function(fn,dn){De[dn%Ie]||(De[dn%Ie]={graphs:[],totalCount:0,aveCount:0}),De[dn%Ie].graphs.push(fn),De[dn%Ie].totalCount+=ke[fn]});var Ge=0,Ze=[];De.forEach(function(fn){var dn=fn.totalCount/fn.graphs.length;fn.aveCount=dn,Ze.push(dn);var xn=0,wn=fn.length;fn.graphs.forEach(function(Mn,zn){var Fn=ke[Mn];fn.graphs.forEach(function(Dn,Kn){zn!==Kn&&(xn+=Math.abs(Fn-ke[Dn]))})}),xn/=wn*(wn-1)/2,Ge+=xn}),Ge/=De.length;var We=0;Ze.forEach(function(fn,dn){Ze.forEach(function(xn,wn){dn!==wn&&(We+=Math.abs(fn-xn))}),We/=Ze.length*(Ze.length-1)/2});var $e=We-Ge;lt<$e&&(lt=$e,ft=pe)},se=0;se<G;se++)Mt(se);return{structure:X[ft],structureCountMap:D[ft]}},Gh=function(D,G){var X={},lt={};return D.forEach(function(ft,Mt){X[ft.id]={idx:Mt,node:ft,degree:0,inDegree:0,outDegree:0};var se=ft[G];lt[se]||(lt[se]=[]),lt[se].push(ft)}),{nodeMap:X,nodeLabelMap:lt}},Yr=function(D,G,X){var lt={},ft={};return D.forEach(function(Mt,se){lt["".concat(B)]={idx:se,edge:Mt};var de=Mt[G];ft[de]||(ft[de]=[]),ft[de].push(Mt);var pe=X[Mt.source];pe&&(pe.degree++,pe.outDegree++);var ke=X[Mt.target];ke&&(ke.degree++,ke.inDegree++)}),{edgeMap:lt,edgeLabelMap:ft}},no=function(D,G,X){var lt=G.length,ft={};return G.forEach(function(Mt,se){for(var de=X?0:se+1,pe=D[se].id,ke=de;ke<lt;ke++)if(se!==ke){var Te=D[ke].id,Ie=Mt[ke];ft["".concat(pe,"-").concat(Te)]=Ie,X||(ft["".concat(Te,"-").concat(pe)]=Ie)}}),ft},Yi=function(D,G,X,lt,ft,Mt,se,de,pe,ke,Te){var Ie,De="".concat(G.id,"-").concat(X.id);if(ke&&ke[De])return ke[De];var Ge=Te?Te[De]:void 0;if(!Ge){var Ze=(Ie={},Ie[De]={start:lt[G.id].idx,end:lt[X.id].idx,distance:ft},Ie);Te=ol(Ze,Mt,D,Te),Ge=Te[De]}return Xl(Ge,se,de,pe)},Ds=function(D,G,X,lt){var ft,Mt,se,de=(ft=D[G])===null||ft===void 0?void 0:ft.degree,pe=(Mt=D[G])===null||Mt===void 0?void 0:Mt.inDegree,ke=(se=D[G])===null||se===void 0?void 0:se.outDegree;return D[G]===void 0&&(de=1/0,pe=1/0,ke=1/0,lt[G].forEach(function(Te){var Ie=X[Te.id].degree;de>Ie&&(de=Ie);var De=X[Te.id].inDegree;pe>De&&(pe=De);var Ge=X[Te.id].outDegree;ke>Ge&&(ke=Ge)}),D[G]={degree:de,inDegree:pe,outDegree:ke}),{minPatternNodeLabelDegree:de,minPatternNodeLabelInDegree:pe,minPatternNodeLabelOutDegree:ke}},ll=function(D,G,X,lt,ft,Mt,se){var de;if(X===void 0&&(X=!1),Mt===void 0&&(Mt="cluster"),se===void 0&&(se="cluster"),!(!D||!D.nodes)){var pe=D.nodes.length;if(pe){var ke=Qu(D,X),Te=Qu(G,X),Ie=no(D.nodes,ke,X),De=no(G.nodes,Te,X),Ge=Gh(D.nodes,Mt),Ze=Ge.nodeMap,We=Ge.nodeLabelMap,$e=Gh(G.nodes,Mt),fn=$e.nodeMap,dn=$e.nodeLabelMap;Yr(D.edges,se,Ze);var xn=Yr(G.edges,se,fn).edgeLabelMap,wn=[];Te==null||Te.forEach(function(tr){wn=wn.concat(tr)}),ft||(ft=Math.max.apply(Math,Nt(Nt([],wn,!1),[2],!1))),lt||(lt=ft);var Mn=gg(D,ke,Mt,lt),zn=gg(G,Te,Mt,lt),Fn=Math.min(100,pe*(pe-1)/2),Dn=pg(lt,pe,Fn,Mn,ke),Kn=ol(Dn,Mn,D),Yn=10,In=1,wr=1,rr=4,nr={graphs:Kn,nodeLabelProp:Mt,edgeLabelProp:se,minSupport:In,minNodeNum:wr,maxNodeNum:rr,directed:X},yr=Vm(nr).slice(0,Yn),br=yr.length,cr=[];yr.forEach(function(tr,hr){cr[hr]={},Object.keys(Kn).forEach(function(ir){var Sr=Kn[ir],ti=Xl(Sr,tr,Mt,se);cr[hr][ir]=ti})});var gn=mg(cr,br,yr),kn=gn.structure,Wn=gn.structureCountMap,Zn=G.nodes[0],Vn=[],qr=(de=G.nodes[0])===null||de===void 0?void 0:de[Mt],Ur=-1/0;G.nodes.forEach(function(tr){var hr=tr[Mt],ir=We[hr];(ir==null?void 0:ir.length)>Ur&&(Ur=ir.length,Vn=ir,qr=hr,Zn=tr)});var Ni={},Ri={},Li={},fs={},Mi={},Is={};Object.keys(dn).forEach(function(tr,hr){Mi[tr]=[],X&&(Is[tr]=[]);var ir=-1/0,Sr=dn[tr],ti={};Sr.forEach(function(xr){var ar=De["".concat(Zn.id,"-").concat(xr.id)];if(ar&&Mi[tr].push(ar),ir<ar&&(ir=ar),ti["".concat(Zn.id,"-").concat(xr.id)]={start:0,end:fn[xr.id].idx,distance:ar},X){var $r=De["".concat(xr.id,"-").concat(Zn.id)];$r&&Is[tr].push($r)}}),Mi[tr]=Mi[tr].sort(function(xr,ar){return xr-ar}),X&&(Is[tr]=Is[tr].sort(function(xr,ar){return xr-ar})),Ri=ol(ti,zn,G,Ri);var Nn=[];if(Object.keys(ti).forEach(function(xr){if(Li[xr]){Nn.push(Li[xr]);return}var ar=Ri[xr];Li[xr]=Xl(ar,kn,Mt,se),Nn.push(Li[xr])}),Nn=Nn.sort(function(xr,ar){return ar-xr}),fs["".concat(Zn.id,"-").concat(tr)]=Nn,tr!==qr)for(var gr=(Vn==null?void 0:Vn.length)||0,_r=function(ar){var $r=Vn[ar],qi=Mn[Ze[$r.id].idx],ai=qi.nodeLabelCountMap[tr],si=dn[tr].length;if(!ai||ai.count<si)return Vn.splice(ar,1),"continue";for(var Bs=!1,Ii=0;Ii<si;Ii++)if(ai.dists[Ii]>Mi[tr][Ii]){Bs=!0;break}if(Bs)return Vn.splice(ar,1),"continue";var ca={};qi.neighbors.forEach(function(sr){var _a=Ie["".concat($r.id,"-").concat(sr.id)];ca["".concat($r.id,"-").concat(sr.id)]={start:Ze[$r.id].idx,end:Ze[sr.id].idx,distance:_a}}),Kn=ol(ca,Mn,D,Kn);var Xa=[];Object.keys(ca).forEach(function(sr){if(Wn[sr]){Xa.push(Wn[sr]);return}var _a=Kn[sr];Wn[sr]=Xl(_a,kn,Mt,se),Xa.push(Wn[sr])}),Xa=Xa.sort(function(sr,_a){return _a-sr});for(var Ka=!1,Ii=0;Ii<si;Ii++)if(Xa[Ii]<Nn[Ii]){Ka=!0;break}if(Ka)return Vn.splice(ar,1),"continue"},bi=gr-1;bi>=0;bi--)_r(bi)});var ci=[];Vn==null||Vn.forEach(function(tr){for(var hr=Ze[tr.id].idx,ir=ic(D.nodes,ke[hr],hr,Mt,ft),Sr=ir.neighbors,ti=Sr.length,Nn=!1,gr=ti-1;gr>=0;gr--){if(Sr.length+1<G.nodes.length){Nn=!0;return}var _r=Sr[gr],bi=_r[Mt];if(!dn[bi]||!dn[bi].length){Sr.splice(gr,1);continue}if(!Mi[bi]||!Mi[bi].length){Sr.splice(gr,1);continue}var xr="".concat(tr.id,"-").concat(_r.id),ar=Ie[xr],$r=Mi[bi].length-1,qi=Mi[bi][$r];if(ar>qi){Sr.splice(gr,1);continue}if(X){var ai="".concat(_r.id,"-").concat(tr.id),si=Ie[ai];$r=Is[bi].length-1;var Bs=Is[bi][$r];if(si>Bs){Sr.splice(gr,1);continue}}var Ii=Wn[xr]?Wn[xr]:Yi(D,tr,_r,Ze,ar,Mn,kn,Mt,se,Wn,Kn),ca="".concat(Zn.id,"-").concat(bi),Xa=fs[ca][fs[ca].length-1];if(Ii<Xa){Sr.splice(gr,1);continue}var Ka=Ds(Ni,bi,fn,dn),sr=Ka.minPatternNodeLabelDegree,_a=Ka.minPatternNodeLabelInDegree,vs=Ka.minPatternNodeLabelOutDegree;if(Ze[_r.id].degree<sr){Sr.splice(gr,1);continue}}Nn||ci.push({nodes:[tr].concat(Sr)})});var ul=Gl(G,Zn.id,!1).length,ki={};X?(Object.keys(ul).forEach(function(tr){var hr=fn[tr].node[Mt];ki[hr]?ki[hr].push(ul[tr]):ki[hr]=[ul[tr]]}),Object.keys(ki).forEach(function(tr){ki[tr].sort(function(hr,ir){return hr-ir})})):ki=Mi;for(var Fs=ci.length,hi=function(hr){var ir=ci[hr],Sr=ir.nodes[0],ti={},Nn={};ir.nodes.forEach(function(Dr,ta){Nn[Dr.id]={idx:ta,node:Dr,degree:0,inDegree:0,outDegree:0};var gi=Dr[Mt];ti[gi]?ti[gi]++:ti[gi]=1});var gr=[],_r={};D.edges.forEach(function(Dr){Nn[Dr.source]&&Nn[Dr.target]&&(gr.push(Dr),_r[Dr[se]]?_r[Dr[se]]++:_r[Dr[se]]=1,Nn[Dr.source].degree++,Nn[Dr.target].degree++,Nn[Dr.source].outDegree++,Nn[Dr.target].inDegree++)});for(var bi=Object.keys(xn).length,xr=!1,ar=0;ar<bi;ar++){var $r=Object.keys(xn)[ar];if(!_r[$r]||_r[$r]<xn[$r].length){xr=!0;break}}if(xr)return ci.splice(hr,1),"continue";var qi=gr.length;if(qi<G.edges.length)return ci.splice(hr,1),"break";for(var ai=!1,si=function(ta){var gi=gr[ta],$a=gi[se],Mo=xn[$a];if(!Mo||!Mo.length)return _r[$a]--,Mo&&_r[$a]<Mo.length?(ai=!0,"break"):(gr.splice(ta,1),Nn[gi.source].degree--,Nn[gi.target].degree--,Nn[gi.source].outDegree--,Nn[gi.target].inDegree--,"continue");var cl=Nn[gi.source].node[Mt],sc=Nn[gi.target].node[Mt],ko=!1;if(Mo.forEach(function(Ql){var Si=fn[Ql.source].node,oc=fn[Ql.target].node;Si[Mt]===cl&&oc[Mt]===sc&&(ko=!0),!X&&Si[Mt]===sc&&oc[Mt]===cl&&(ko=!0)}),!ko)return _r[$a]--,Mo&&_r[$a]<Mo.length?(ai=!0,"break"):(gr.splice(ta,1),Nn[gi.source].degree--,Nn[gi.target].degree--,Nn[gi.source].outDegree--,Nn[gi.target].inDegree--,"continue")},ar=qi-1;ar>=0;ar--){var Bs=si(ar);if(Bs==="break")break}if(ai)return ci.splice(hr,1),"continue";ir.edges=gr;var Ii=Gl(ir,ir.nodes[0].id,!1).length;if(Object.keys(Ii).reverse().forEach(function(Dr){if(!(Dr===ir.nodes[0].id||ai)){if(Ii[Dr]===1/0){var ta=Nn[Dr].node[Mt];if(ti[ta]--,ti[ta]<dn[ta].length){ai=!0;return}var gi=ir.nodes.indexOf(Nn[Dr].node);ir.nodes.splice(gi,1),Nn[Dr]=void 0;return}var $a=Ze[Dr].node[Mt];if(!ki[$a]||!ki[$a].length||Ii[Dr]>ki[$a][ki[$a].length-1]){var ta=Nn[Dr].node[Mt];if(ti[ta]--,ti[ta]<dn[ta].length){ai=!0;return}var gi=ir.nodes.indexOf(Nn[Dr].node);ir.nodes.splice(gi,1),Nn[Dr]=void 0}}}),ai)return ci.splice(hr,1),"continue";for(var ca=!0,Xa=0;ca&&!ai;){ca=!1;var Ka=X?Nn[Sr.id].degree<fn[Zn.id].degree||Nn[Sr.id].inDegree<fn[Zn.id].inDegree||Nn[Sr.id].outDegree<fn[Zn.id].outDegree:Nn[Sr.id].degree<fn[Zn.id].degree;if(Ka){ai=!0;break}if(ti[Sr[Mt]]<dn[Sr[Mt]].length){ai=!0;break}for(var sr=ir.nodes.length,_a=sr-1;_a>=0;_a--){var vs=ir.nodes[_a],Zh=Nn[vs.id].degree,xg=Nn[vs.id].inDegree,Vh=Nn[vs.id].outDegree,Yh=vs[Mt],ac=Ds(Ni,Yh,fn,dn),Hh=ac.minPatternNodeLabelDegree,Eg=ac.minPatternNodeLabelInDegree,wg=ac.minPatternNodeLabelOutDegree,Sg=X?Zh<Hh||xg<Eg||Vh<wg:Zh<Hh;if(Sg){if(ti[vs[Mt]]--,ti[vs[Mt]]<dn[vs[Mt]].length){ai=!0;break}ir.nodes.splice(_a,1),Nn[vs.id]=void 0,ca=!0}}if(ai||!ca&&Xa!==0)break;qi=gr.length;for(var Kl=qi-1;Kl>=0;Kl--){var gs=gr[Kl];if(!Nn[gs.source]||!Nn[gs.target]){gr.splice(Kl,1);var $l=gs[se];if(_r[$l]--,Nn[gs.source]&&(Nn[gs.source].degree--,Nn[gs.source].outDegree--),Nn[gs.target]&&(Nn[gs.target].degree--,Nn[gs.target].inDegree--),xn[$l]&&_r[$l]<xn[$l].length){ai=!0;break}ca=!0}}Xa++}if(ai||ai||ir.nodes.length<G.nodes.length||gr.length<G.edges.length)return ci.splice(hr,1),"continue"},Di=Fs-1;Di>=0;Di--){var _o=hi(Di);if(_o==="break")break}for(var ii=ci.length,Sa=function(hr){var ir=ci[hr],Sr={};ir.edges.forEach(function(gr){var _r="".concat(gr.source,"-").concat(gr.target,"-").concat(gr.label);Sr[_r]?Sr[_r]++:Sr[_r]=1});for(var ti=function(_r){var bi=ci[_r],xr={};bi.edges.forEach(function($r){var qi="".concat($r.source,"-").concat($r.target,"-").concat($r.label);xr[qi]?xr[qi]++:xr[qi]=1});var ar=!0;Object.keys(xr).length!==Object.keys(Sr).length?ar=!1:Object.keys(Sr).forEach(function($r){xr[$r]!==Sr[$r]&&(ar=!1)}),ar&&ci.splice(_r,1)},Nn=ii-1;Nn>hr;Nn--)ti(Nn);ii=ci.length},Di=0;Di<=ii-1;Di++)Sa(Di);return ci}}},Wh=ll,Uh=function(){function H(D){D===void 0&&(D=10),this.linkedList=new O,this.maxStep=D}return Object.defineProperty(H.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),H.prototype.isEmpty=function(){return!this.linkedList.head},H.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},H.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},H.prototype.push=function(D){this.linkedList.prepend(D),this.length>this.maxStep&&this.linkedList.deleteTail()},H.prototype.pop=function(){var D=this.linkedList.deleteHead();return D?D.value:null},H.prototype.toArray=function(){return this.linkedList.toArray().map(function(D){return D.value})},H.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},H}(),yg=Uh,bg=ge,Ym={getAdjMatrix:F,breadthFirstSearch:Rt,connectedComponent:Et,getDegree:Ct,getInDegree:_t,getOutDegree:dt,detectCycle:ge,detectDirectedCycle:bg,detectAllCycles:et,detectAllDirectedCycle:Ee,detectAllUndirectedCycle:re,depthFirstSearch:Ft,dijkstra:Gl,findAllPath:Kv,findShortestPath:Mh,floydWarshall:Qu,labelPropagation:Jv,louvain:Th,iLouvain:Ju,kCore:ag,kMeans:Ph,cosineSimilarity:Nh,nodesCosineSimilarity:og,minimumSpanningTree:ug,pageRank:Ih,getNeighbors:T,Stack:yg,GADDI:Wh}},90494:function(q,J){"use strict";var g="*",m=function(){function F(){this._events={}}return F.prototype.on=function(R,L,k){return this._events[R]||(this._events[R]=[]),this._events[R].push({callback:L,once:!!k}),this},F.prototype.once=function(R,L){return this.on(R,L,!0)},F.prototype.emit=function(R){for(var L=this,k=[],O=1;O<arguments.length;O++)k[O-1]=arguments[O];var b=this._events[R]||[],E=this._events[g]||[],T=function(_){for(var P=_.length,B=0;B<P;B++)if(_[B]){var tt=_[B],st=tt.callback,Rt=tt.once;Rt&&(_.splice(B,1),_.length===0&&delete L._events[R],P--,B--),st.apply(L,k)}};T(b),T(E)},F.prototype.off=function(R,L){if(!R)this._events={};else if(!L)delete this._events[R];else{for(var k=this._events[R]||[],O=k.length,b=0;b<O;b++)k[b].callback===L&&(k.splice(b,1),O--,b--);k.length===0&&delete this._events[R]}return this},F.prototype.getEvents=function(){return this._events},F}();J.Z=m},11702:function(q,J,g){"use strict";g.d(J,{TE:function(){return L},U4:function(){return jt},Xk:function(){return Ft},Y1:function(){return Pt},_x:function(){return Ee},hE:function(){return kt},l5:function(){return bt},ph:function(){return Gt},vp:function(){return Et},x4:function(){return at}});var m=g(97582),F=g(80450),R=g(31437);function L(pt,mt,Lt,Ht){var Dt=pt-Lt,ne=mt-Ht;return Math.sqrt(Dt*Dt+ne*ne)}function k(pt,mt){var Lt=Math.min.apply(Math,(0,m.ev)([],(0,m.CR)(pt),!1)),Ht=Math.min.apply(Math,(0,m.ev)([],(0,m.CR)(mt),!1)),Dt=Math.max.apply(Math,(0,m.ev)([],(0,m.CR)(pt),!1)),ne=Math.max.apply(Math,(0,m.ev)([],(0,m.CR)(mt),!1));return{x:Lt,y:Ht,width:Dt-Lt,height:ne-Ht}}function O(pt){return(pt+Math.PI*2)%(Math.PI*2)}function b(pt,mt){var Lt=Math.abs(pt);return mt>0?Lt:Lt*-1}function E(pt,mt,Lt,Ht,Dt,ne){var _e=Lt,Me=Ht;if(_e===0||Me===0)return{x:pt,y:mt};for(var Ae=Dt-pt,ze=ne-mt,Ve=Math.abs(Ae),Je=Math.abs(ze),pn=_e*_e,jn=Me*Me,hn=Math.PI/4,En=0,Gn=0,Tn=0;Tn<4;Tn++){En=_e*Math.cos(hn),Gn=Me*Math.sin(hn);var Pn=(pn-jn)*Math.pow(Math.cos(hn),3)/_e,Tr=(jn-pn)*Math.pow(Math.sin(hn),3)/Me,wi=En-Pn,Vr=Gn-Tr,Ga=Ve-Pn,Wa=Je-Tr,qs=Math.hypot(Vr,wi),Ns=Math.hypot(Wa,Ga),Ua=qs*Math.asin((wi*Wa-Vr*Ga)/(qs*Ns)),Ki=Ua/Math.sqrt(pn+jn-En*En-Gn*Gn);hn+=Ki,hn=Math.min(Math.PI/2,Math.max(0,hn))}return{x:pt+b(En,Ae),y:mt+b(Gn,ze)}}function T(pt,mt,Lt,Ht,Dt,ne,_e,Me){return-1*Lt*Math.cos(Dt)*Math.sin(Me)-Ht*Math.sin(Dt)*Math.cos(Me)}function _(pt,mt,Lt,Ht,Dt,ne,_e,Me){return-1*Lt*Math.sin(Dt)*Math.sin(Me)+Ht*Math.cos(Dt)*Math.cos(Me)}function P(pt,mt,Lt){return Math.atan(-mt/pt*Math.tan(Lt))}function B(pt,mt,Lt){return Math.atan(mt/(pt*Math.tan(Lt)))}function tt(pt,mt,Lt,Ht,Dt,ne){return Lt*Math.cos(Dt)*Math.cos(ne)-Ht*Math.sin(Dt)*Math.sin(ne)+pt}function st(pt,mt,Lt,Ht,Dt,ne){return Lt*Math.sin(Dt)*Math.cos(ne)+Ht*Math.cos(Dt)*Math.sin(ne)+mt}function Rt(pt,mt,Lt,Ht){var Dt=Math.atan2(Ht*pt,Lt*mt);return(Dt+Math.PI*2)%(Math.PI*2)}function xt(pt,mt,Lt){return{x:pt*Math.cos(Lt),y:mt*Math.sin(Lt)}}function nt(pt,mt,Lt){var Ht=Math.cos(Lt),Dt=Math.sin(Lt);return[pt*Ht-mt*Dt,pt*Dt+mt*Ht]}function Et(pt,mt,Lt,Ht,Dt,ne,_e){for(var Me=P(Lt,Ht,Dt),Ae=1/0,ze=-1/0,Ve=[ne,_e],Je=-Math.PI*2;Je<=Math.PI*2;Je+=Math.PI){var pn=Me+Je;ne<_e?ne<pn&&pn<_e&&Ve.push(pn):_e<pn&&pn<ne&&Ve.push(pn)}for(var Je=0;Je<Ve.length;Je++){var jn=tt(pt,mt,Lt,Ht,Dt,Ve[Je]);jn<Ae&&(Ae=jn),jn>ze&&(ze=jn)}for(var hn=B(Lt,Ht,Dt),En=1/0,Gn=-1/0,Tn=[ne,_e],Je=-Math.PI*2;Je<=Math.PI*2;Je+=Math.PI){var Pn=hn+Je;ne<_e?ne<Pn&&Pn<_e&&Tn.push(Pn):_e<Pn&&Pn<ne&&Tn.push(Pn)}for(var Je=0;Je<Tn.length;Je++){var Tr=st(pt,mt,Lt,Ht,Dt,Tn[Je]);Tr<En&&(En=Tr),Tr>Gn&&(Gn=Tr)}return{x:Ae,y:En,width:ze-Ae,height:Gn-En}}function ot(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae){var ze=nt(Me-pt,Ae-mt,-Dt),Ve=__read(ze,2),Je=Ve[0],pn=Ve[1],jn=E(0,0,Lt,Ht,Je,pn),hn=Rt(Lt,Ht,jn.x,jn.y);hn<ne?jn=xt(Lt,Ht,ne):hn>_e&&(jn=xt(Lt,Ht,_e));var En=nt(jn.x,jn.y,Dt);return{x:En[0]+pt,y:En[1]+mt}}function Ct(pt,mt,Lt,Ht,Dt,ne,_e,Me){var Ae=(_e-ne)*Me+ne,ze=T(pt,mt,Lt,Ht,Dt,ne,_e,Ae),Ve=_(pt,mt,Lt,Ht,Dt,ne,_e,Ae);return O(Math.atan2(Ve,ze))}var _t=1e-4;function dt(pt,mt,Lt,Ht,Dt,ne){var _e=-1,Me=1/0,Ae=[Lt,Ht],ze=20;ne&&ne>200&&(ze=ne/10);for(var Ve=1/ze,Je=Ve/10,pn=0;pn<=ze;pn++){var jn=pn*Ve,hn=[Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(pt.concat([jn])),!1)),Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(mt.concat([jn])),!1))],En=L(Ae[0],Ae[1],hn[0],hn[1]);En<Me&&(_e=jn,Me=En)}if(_e===0)return{x:pt[0],y:mt[0]};if(_e===1){var Gn=pt.length;return{x:pt[Gn-1],y:mt[Gn-1]}}Me=1/0;for(var pn=0;pn<32&&!(Je<_t);pn++){var Tn=_e-Je,Pn=_e+Je,hn=[Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(pt.concat([Tn])),!1)),Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(mt.concat([Tn])),!1))],En=L(Ae[0],Ae[1],hn[0],hn[1]);if(Tn>=0&&En<Me)_e=Tn,Me=En;else{var Tr=[Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(pt.concat([Pn])),!1)),Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(mt.concat([Pn])),!1))],wi=L(Ae[0],Ae[1],Tr[0],Tr[1]);Pn<=1&&wi<Me?(_e=Pn,Me=wi):Je*=.5}}return{x:Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(pt.concat([_e])),!1)),y:Dt.apply(void 0,(0,m.ev)([],(0,m.CR)(mt.concat([_e])),!1))}}function Ot(pt,mt){for(var Lt=0,Ht=pt.length,Dt=0;Dt<Ht;Dt++){var ne=pt[Dt],_e=mt[Dt],Me=pt[(Dt+1)%Ht],Ae=mt[(Dt+1)%Ht];Lt+=L(ne,_e,Me,Ae)}return Lt/2}function wt(pt,mt,Lt,Ht){return k([pt,Lt],[mt,Ht])}function Ft(pt,mt,Lt,Ht){return L(pt,mt,Lt,Ht)}function jt(pt,mt,Lt,Ht,Dt){return{x:(1-Dt)*pt+Dt*Lt,y:(1-Dt)*mt+Dt*Ht}}function re(pt,mt,Lt,Ht,Dt,ne){var _e=(Lt-pt)*(Dt-pt)+(Ht-mt)*(ne-mt);if(_e<0)return L(pt,mt,Dt,ne);var Me=(Lt-pt)*(Lt-pt)+(Ht-mt)*(Ht-mt);return _e>Me?L(Lt,Ht,Dt,ne):Ee(pt,mt,Lt,Ht,Dt,ne)}function Ee(pt,mt,Lt,Ht,Dt,ne){var _e=[Lt-pt,Ht-mt];if(R.I6(_e,[0,0]))return Math.sqrt((Dt-pt)*(Dt-pt)+(ne-mt)*(ne-mt));var Me=[-_e[1],_e[0]];R.Fv(Me,Me);var Ae=[Dt-pt,ne-mt];return Math.abs(R.AK(Ae,Me))}function et(pt,mt,Lt,Ht){return Math.atan2(Ht-mt,Lt-pt)}function ge(pt,mt,Lt,Ht,Dt){var ne=1-Dt;return ne*ne*ne*pt+3*mt*Dt*ne*ne+3*Lt*Dt*Dt*ne+Ht*Dt*Dt*Dt}function yt(pt,mt,Lt,Ht,Dt){var ne=1-Dt;return 3*(ne*ne*(mt-pt)+2*ne*Dt*(Lt-mt)+Dt*Dt*(Ht-Lt))}function te(pt,mt,Lt,Ht){var Dt=-3*pt+9*mt-9*Lt+3*Ht,ne=6*pt-12*mt+6*Lt,_e=3*mt-3*pt,Me=[],Ae,ze,Ve;if((0,F.Z)(Dt,0))(0,F.Z)(ne,0)||(Ae=-_e/ne,Ae>=0&&Ae<=1&&Me.push(Ae));else{var Je=ne*ne-4*Dt*_e;(0,F.Z)(Je,0)?Me.push(-ne/(2*Dt)):Je>0&&(Ve=Math.sqrt(Je),Ae=(-ne+Ve)/(2*Dt),ze=(-ne-Ve)/(2*Dt),Ae>=0&&Ae<=1&&Me.push(Ae),ze>=0&&ze<=1&&Me.push(ze))}return Me}function Xt(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae){var ze=ge(pt,Lt,Dt,_e,Ae),Ve=ge(mt,Ht,ne,Me,Ae),Je=jt(pt,mt,Lt,Ht,Ae),pn=jt(Lt,Ht,Dt,ne,Ae),jn=jt(Dt,ne,_e,Me,Ae),hn=jt(Je.x,Je.y,pn.x,pn.y,Ae),En=jt(pn.x,pn.y,jn.x,jn.y,Ae);return[[pt,mt,Je.x,Je.y,hn.x,hn.y,ze,Ve],[ze,Ve,En.x,En.y,jn.x,jn.y,_e,Me]]}function rt(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae){if(Ae===0)return Ot([pt,Lt,Dt,_e],[mt,Ht,ne,Me]);var ze=Xt(pt,mt,Lt,Ht,Dt,ne,_e,Me,.5),Ve=__spreadArray(__spreadArray([],__read(ze[0]),!1),[Ae-1],!1),Je=__spreadArray(__spreadArray([],__read(ze[1]),!1),[Ae-1],!1);return rt.apply(void 0,__spreadArray([],__read(Ve),!1))+rt.apply(void 0,__spreadArray([],__read(Je),!1))}function bt(pt,mt,Lt,Ht,Dt,ne,_e,Me){for(var Ae=[pt,_e],ze=[mt,Me],Ve=te(pt,Lt,Dt,_e),Je=te(mt,Ht,ne,Me),pn=0;pn<Ve.length;pn++)Ae.push(ge(pt,Lt,Dt,_e,Ve[pn]));for(var pn=0;pn<Je.length;pn++)ze.push(ge(mt,Ht,ne,Me,Je[pn]));return k(Ae,ze)}function ye(pt,mt,Lt,Ht,Dt,ne,_e,Me){return rt(pt,mt,Lt,Ht,Dt,ne,_e,Me,3)}function be(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae,ze,Ve){return dt([pt,Lt,Dt,_e],[mt,Ht,ne,Me],Ae,ze,ge,Ve)}function Gt(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae,ze,Ve){var Je=be(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae,ze,Ve);return L(Je.x,Je.y,Ae,ze)}function Kt(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae){return{x:ge(pt,Lt,Dt,_e,Ae),y:ge(mt,Ht,ne,Me,Ae)}}function we(pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae){var ze=yt(pt,Lt,Dt,_e,Ae),Ve=yt(mt,Ht,ne,Me,Ae);return O(Math.atan2(Ve,ze))}function Bt(pt){for(var mt=0,Lt=[],Ht=0;Ht<pt.length-1;Ht++){var Dt=pt[Ht],ne=pt[Ht+1],_e=L(Dt[0],Dt[1],ne[0],ne[1]),Me={from:Dt,to:ne,length:_e};Lt.push(Me),mt+=_e}return{segments:Lt,totalLength:mt}}function oe(pt){if(pt.length<2)return 0;for(var mt=0,Lt=0;Lt<pt.length-1;Lt++){var Ht=pt[Lt],Dt=pt[Lt+1];mt+=L(Ht[0],Ht[1],Dt[0],Dt[1])}return mt}function ht(pt,mt){if(mt>1||mt<0||pt.length<2)return null;var Lt=Bt(pt),Ht=Lt.segments,Dt=Lt.totalLength;if(Dt===0)return{x:pt[0][0],y:pt[0][1]};for(var ne=0,_e=null,Me=0;Me<Ht.length;Me++){var Ae=Ht[Me],ze=Ae.from,Ve=Ae.to,Je=Ae.length/Dt;if(mt>=ne&&mt<=ne+Je){var pn=(mt-ne)/Je;_e=jt(ze[0],ze[1],Ve[0],Ve[1],pn);break}ne+=Je}return _e}function ut(pt,mt){if(mt>1||mt<0||pt.length<2)return 0;for(var Lt=Bt(pt),Ht=Lt.segments,Dt=Lt.totalLength,ne=0,_e=0,Me=0;Me<Ht.length;Me++){var Ae=Ht[Me],ze=Ae.from,Ve=Ae.to,Je=Ae.length/Dt;if(mt>=ne&&mt<=ne+Je){_e=Math.atan2(Ve[1]-ze[1],Ve[0]-ze[0]);break}ne+=Je}return _e}function Vt(pt,mt,Lt){for(var Ht=1/0,Dt=0;Dt<pt.length-1;Dt++){var ne=pt[Dt],_e=pt[Dt+1],Me=re(ne[0],ne[1],_e[0],_e[1],mt,Lt);Me<Ht&&(Ht=Me)}return Ht}function ve(pt){for(var mt=[],Lt=[],Ht=0;Ht<pt.length;Ht++){var Dt=pt[Ht];mt.push(Dt[0]),Lt.push(Dt[1])}return k(mt,Lt)}function kt(pt){return oe(pt)}function ee(pt,mt){return ht(pt,mt)}function me(pt,mt,Lt){return Vt(pt,mt,Lt)}function Nt(pt,mt){return ut(pt,mt)}function Zt(pt){var mt=pt.slice(0);return pt.length&&mt.push(pt[0]),mt}function Yt(pt){return ve(pt)}function S(pt){return oe(Zt(pt))}function Y(pt,mt){return ht(Zt(pt),mt)}function At(pt,mt,Lt){return Vt(Zt(pt),mt,Lt)}function ie(pt,mt){return ut(Zt(pt),mt)}function $t(pt,mt,Lt,Ht){var Dt=1-Ht;return Dt*Dt*pt+2*Ht*Dt*mt+Ht*Ht*Lt}function Oe(pt,mt,Lt){var Ht=pt+Lt-2*mt;if((0,F.Z)(Ht,0))return[.5];var Dt=(pt-mt)/Ht;return Dt<=1&&Dt>=0?[Dt]:[]}function Ne(pt,mt,Lt,Ht,Dt,ne,_e){var Me=$t(pt,Lt,Dt,_e),Ae=$t(mt,Ht,ne,_e),ze=jt(pt,mt,Lt,Ht,_e),Ve=jt(Lt,Ht,Dt,ne,_e);return[[pt,mt,ze.x,ze.y,Me,Ae],[Me,Ae,Ve.x,Ve.y,Dt,ne]]}function Le(pt,mt,Lt,Ht,Dt,ne,_e){if(_e===0)return(L(pt,mt,Lt,Ht)+L(Lt,Ht,Dt,ne)+L(pt,mt,Dt,ne))/2;var Me=Ne(pt,mt,Lt,Ht,Dt,ne,.5),Ae=Me[0],ze=Me[1];return Ae.push(_e-1),ze.push(_e-1),Le.apply(void 0,__spreadArray([],__read(Ae),!1))+Le.apply(void 0,__spreadArray([],__read(ze),!1))}function at(pt,mt,Lt,Ht,Dt,ne){var _e=Oe(pt,Lt,Dt)[0],Me=Oe(mt,Ht,ne)[0],Ae=[pt,Dt],ze=[mt,ne];return _e!==void 0&&Ae.push($t(pt,Lt,Dt,_e)),Me!==void 0&&ze.push($t(mt,Ht,ne,Me)),k(Ae,ze)}function V(pt,mt,Lt,Ht,Dt,ne){return Le(pt,mt,Lt,Ht,Dt,ne,3)}function St(pt,mt,Lt,Ht,Dt,ne,_e,Me){return dt([pt,Lt,Dt],[mt,Ht,ne],_e,Me,$t)}function Pt(pt,mt,Lt,Ht,Dt,ne,_e,Me){var Ae=St(pt,mt,Lt,Ht,Dt,ne,_e,Me);return L(Ae.x,Ae.y,_e,Me)}},62850:function(q,J,g){"use strict";g.d(J,{kJ:function(){return Fv},RN:function(){return I4}});var m={};g.r(m),g.d(m,{circle:function(){return CT},diamond:function(){return PT},rect:function(){return RT},simple:function(){return DT},triangle:function(){return ib},triangleRect:function(){return LT},vee:function(){return NT}});function F(r){"@babel/helpers - typeof";return F=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},F(r)}function R(r,e){if(F(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(F(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function L(r){var e=R(r,"string");return F(e)=="symbol"?e:e+""}function k(r,e,t){return(e=L(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function O(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function b(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?O(Object(t),!0).forEach(function(n){k(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function E(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function T(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,L(n.key),n)}}function _(r,e,t){return e&&T(r.prototype,e),t&&T(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function P(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function B(r){if(Array.isArray(r))return P(r)}function tt(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function st(r,e){if(r){if(typeof r=="string")return P(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?P(r,e):void 0}}function Rt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xt(r){return B(r)||tt(r)||st(r)||Rt()}function nt(r){return nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nt(r)}function Et(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Et=function(){return!!r})()}function ot(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ct(r,e){if(e&&(F(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ot(r)}function _t(r,e,t){return e=nt(e),Ct(r,Et()?Reflect.construct(e,t||[],nt(r).constructor):e.apply(r,t))}function dt(r,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},dt(r,e)}function Ot(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&dt(r,e)}function wt(r){if(Array.isArray(r))return r}function Ft(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function jt(){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 re(r,e){return wt(r)||Ft(r,e)||st(r,e)||jt()}var Ee=g(54146),et=g(33983),ge=g(98333),yt=g(85975),te=g(35600),Xt=g(32945),rt=g(31437),bt=g(25897),ye=g(44078),be=g(95147),Gt=g(76714),Kt=g(81957),we=g(69877),Bt=g(71523),oe=g(13882),ht=g(80450),ut=g(8614),Vt=g(4848),ve=g(75839),kt=g(99872),ee=g(92455),me=g(65850),Nt=g(28659),Zt=g(83555),Yt=g(71154),S=g(44978),Y=g(90134),At=g(45607),ie=g(4637),$t=g(84329);function Oe(r,e){for(;!{}.hasOwnProperty.call(r,e)&&(r=nt(r))!==null;);return r}function Ne(){return Ne=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(r,e,t){var n=Oe(r,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?r:t):i.value}},Ne.apply(null,arguments)}function Le(r,e,t,n){var i=Ne(nt(1&n?r.prototype:r),e,t);return 2&n&&typeof i=="function"?function(a){return i.apply(t,a)}:i}function at(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function V(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function St(){}var Pt=.7,pt=1/Pt,mt="\\s*([+-]?\\d+)\\s*",Lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dt=/^#([0-9a-f]{3,8})$/,ne=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),_e=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),Me=new RegExp(`^rgba\\(${mt},${mt},${mt},${Lt}\\)$`),Ae=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${Lt}\\)$`),ze=new RegExp(`^hsl\\(${Lt},${Ht},${Ht}\\)$`),Ve=new RegExp(`^hsla\\(${Lt},${Ht},${Ht},${Lt}\\)$`),Je={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};at(St,Gn,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:pn,formatHex:pn,formatHex8:jn,formatHsl:hn,formatRgb:En,toString:En});function pn(){return this.rgb().formatHex()}function jn(){return this.rgb().formatHex8()}function hn(){return Bl(this).formatHsl()}function En(){return this.rgb().formatRgb()}function Gn(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=Dt.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?Tn(e):t===3?new Vr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Pn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Pn(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=ne.exec(r))?new Vr(e[1],e[2],e[3],1):(e=_e.exec(r))?new Vr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Me.exec(r))?Pn(e[1],e[2],e[3],e[4]):(e=Ae.exec(r))?Pn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ze.exec(r))?qo(e[1],e[2]/100,e[3]/100,1):(e=Ve.exec(r))?qo(e[1],e[2]/100,e[3]/100,e[4]):Je.hasOwnProperty(r)?Tn(Je[r]):r==="transparent"?new Vr(NaN,NaN,NaN,0):null}function Tn(r){return new Vr(r>>16&255,r>>8&255,r&255,1)}function Pn(r,e,t,n){return n<=0&&(r=e=t=NaN),new Vr(r,e,t,n)}function Tr(r){return r instanceof St||(r=Gn(r)),r?(r=r.rgb(),new Vr(r.r,r.g,r.b,r.opacity)):new Vr}function wi(r,e,t,n){return arguments.length===1?Tr(r):new Vr(r,e,t,n==null?1:n)}function Vr(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}at(Vr,wi,V(St,{brighter(r){return r=r==null?pt:Math.pow(pt,r),new Vr(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Pt:Math.pow(Pt,r),new Vr(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Vr(Ua(this.r),Ua(this.g),Ua(this.b),Ns(this.opacity))},displayable(){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:Ga,formatHex:Ga,formatHex8:Wa,formatRgb:qs,toString:qs}));function Ga(){return`#${Ki(this.r)}${Ki(this.g)}${Ki(this.b)}`}function Wa(){return`#${Ki(this.r)}${Ki(this.g)}${Ki(this.b)}${Ki((isNaN(this.opacity)?1:this.opacity)*255)}`}function qs(){const r=Ns(this.opacity);return`${r===1?"rgb(":"rgba("}${Ua(this.r)}, ${Ua(this.g)}, ${Ua(this.b)}${r===1?")":`, ${r})`}`}function Ns(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function Ua(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Ki(r){return r=Ua(r),(r<16?"0":"")+r.toString(16)}function qo(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new w(r,e,t,n)}function Bl(r){if(r instanceof w)return new w(r.h,r.s,r.l,r.opacity);if(r instanceof St||(r=Gn(r)),!r)return new w;if(r instanceof w)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(t-n)/o+(t<n)*6:t===a?s=(n-e)/o+2:s=(e-t)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new w(s,o,l,r.opacity)}function gt(r,e,t,n){return arguments.length===1?Bl(r):new w(r,e,t,n==null?1:n)}function w(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}at(w,gt,V(St,{brighter(r){return r=r==null?pt:Math.pow(pt,r),new w(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Pt:Math.pow(Pt,r),new w(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new Vr(C(r>=240?r-240:r+120,i,n),C(r,i,n),C(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new w(M(this.h),y(this.s),y(this.l),Ns(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Ns(this.opacity);return`${r===1?"hsl(":"hsla("}${M(this.h)}, ${y(this.s)*100}%, ${y(this.l)*100}%${r===1?")":`, ${r})`}`}}));function M(r){return r=(r||0)%360,r<0?r+360:r}function y(r){return Math.max(0,Math.min(1,r||0))}function C(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}var U=g(11702);function Wt(){"use strict";Wt=function(){return e};var r,e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(ct,$,Q){ct[$]=Q.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(ct,$,Q){return Object.defineProperty(ct,$,{value:Q,enumerable:!0,configurable:!0,writable:!0}),ct[$]}try{u({},"")}catch(ct){u=function(Q,It,ue){return Q[It]=ue}}function c(ct,$,Q,It){var ue=$&&$.prototype instanceof A?$:A,le=Object.create(ue.prototype),Fe=new fe(It||[]);return i(le,"_invoke",{value:Tt(ct,Q,Fe)}),le}function h(ct,$,Q){try{return{type:"normal",arg:ct.call($,Q)}}catch(It){return{type:"throw",arg:It}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",v="executing",p="completed",x={};function A(){}function N(){}function I(){}var K={};u(K,s,function(){return this});var W=Object.getPrototypeOf,z=W&&W(W(ce([])));z&&z!==t&&n.call(z,s)&&(K=z);var j=I.prototype=A.prototype=Object.create(K);function Z(ct){["next","throw","return"].forEach(function($){u(ct,$,function(Q){return this._invoke($,Q)})})}function vt(ct,$){function Q(ue,le,Fe,Qe){var He=h(ct[ue],ct,le);if(He.type!=="throw"){var tn=He.arg,vn=tn.value;return vn&&F(vn)=="object"&&n.call(vn,"__await")?$.resolve(vn.__await).then(function(_n){Q("next",_n,Fe,Qe)},function(_n){Q("throw",_n,Fe,Qe)}):$.resolve(vn).then(function(_n){tn.value=_n,Fe(tn)},function(_n){return Q("throw",_n,Fe,Qe)})}Qe(He.arg)}var It;i(this,"_invoke",{value:function(le,Fe){function Qe(){return new $(function(He,tn){Q(le,Fe,He,tn)})}return It=It?It.then(Qe,Qe):Qe()}})}function Tt(ct,$,Q){var It=d;return function(ue,le){if(It===v)throw Error("Generator is already running");if(It===p){if(ue==="throw")throw le;return{value:r,done:!0}}for(Q.method=ue,Q.arg=le;;){var Fe=Q.delegate;if(Fe){var Qe=zt(Fe,Q);if(Qe){if(Qe===x)continue;return Qe}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(It===d)throw It=p,Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);It=v;var He=h(ct,$,Q);if(He.type==="normal"){if(It=Q.done?p:f,He.arg===x)continue;return{value:He.arg,done:Q.done}}He.type==="throw"&&(It=p,Q.method="throw",Q.arg=He.arg)}}}function zt(ct,$){var Q=$.method,It=ct.iterator[Q];if(It===r)return $.delegate=null,Q==="throw"&&ct.iterator.return&&($.method="return",$.arg=r,zt(ct,$),$.method==="throw")||Q!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),x;var ue=h(It,ct.iterator,$.arg);if(ue.type==="throw")return $.method="throw",$.arg=ue.arg,$.delegate=null,x;var le=ue.arg;return le?le.done?($[ct.resultName]=le.value,$.next=ct.nextLoc,$.method!=="return"&&($.method="next",$.arg=r),$.delegate=null,x):le:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,x)}function Qt(ct){var $={tryLoc:ct[0]};1 in ct&&($.catchLoc=ct[1]),2 in ct&&($.finallyLoc=ct[2],$.afterLoc=ct[3]),this.tryEntries.push($)}function ae(ct){var $=ct.completion||{};$.type="normal",delete $.arg,ct.completion=$}function fe(ct){this.tryEntries=[{tryLoc:"root"}],ct.forEach(Qt,this),this.reset(!0)}function ce(ct){if(ct||ct===""){var $=ct[s];if($)return $.call(ct);if(typeof ct.next=="function")return ct;if(!isNaN(ct.length)){var Q=-1,It=function ue(){for(;++Q<ct.length;)if(n.call(ct,Q))return ue.value=ct[Q],ue.done=!1,ue;return ue.value=r,ue.done=!0,ue};return It.next=It}}throw new TypeError(F(ct)+" is not iterable")}return N.prototype=I,i(j,"constructor",{value:I,configurable:!0}),i(I,"constructor",{value:N,configurable:!0}),N.displayName=u(I,l,"GeneratorFunction"),e.isGeneratorFunction=function(ct){var $=typeof ct=="function"&&ct.constructor;return!!$&&($===N||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(ct){return Object.setPrototypeOf?Object.setPrototypeOf(ct,I):(ct.__proto__=I,u(ct,l,"GeneratorFunction")),ct.prototype=Object.create(j),ct},e.awrap=function(ct){return{__await:ct}},Z(vt.prototype),u(vt.prototype,o,function(){return this}),e.AsyncIterator=vt,e.async=function(ct,$,Q,It,ue){ue===void 0&&(ue=Promise);var le=new vt(c(ct,$,Q,It),ue);return e.isGeneratorFunction($)?le:le.next().then(function(Fe){return Fe.done?Fe.value:le.next()})},Z(j),u(j,l,"Generator"),u(j,s,function(){return this}),u(j,"toString",function(){return"[object Generator]"}),e.keys=function(ct){var $=Object(ct),Q=[];for(var It in $)Q.push(It);return Q.reverse(),function ue(){for(;Q.length;){var le=Q.pop();if(le in $)return ue.value=le,ue.done=!1,ue}return ue.done=!0,ue}},e.values=ce,fe.prototype={constructor:fe,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ae),!$)for(var Q in this)Q.charAt(0)==="t"&&n.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=r)},stop:function(){this.done=!0;var $=this.tryEntries[0].completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var Q=this;function It(tn,vn){return Fe.type="throw",Fe.arg=$,Q.next=tn,vn&&(Q.method="next",Q.arg=r),!!vn}for(var ue=this.tryEntries.length-1;ue>=0;--ue){var le=this.tryEntries[ue],Fe=le.completion;if(le.tryLoc==="root")return It("end");if(le.tryLoc<=this.prev){var Qe=n.call(le,"catchLoc"),He=n.call(le,"finallyLoc");if(Qe&&He){if(this.prev<le.catchLoc)return It(le.catchLoc,!0);if(this.prev<le.finallyLoc)return It(le.finallyLoc)}else if(Qe){if(this.prev<le.catchLoc)return It(le.catchLoc,!0)}else{if(!He)throw Error("try statement without catch or finally");if(this.prev<le.finallyLoc)return It(le.finallyLoc)}}}},abrupt:function($,Q){for(var It=this.tryEntries.length-1;It>=0;--It){var ue=this.tryEntries[It];if(ue.tryLoc<=this.prev&&n.call(ue,"finallyLoc")&&this.prev<ue.finallyLoc){var le=ue;break}}le&&($==="break"||$==="continue")&&le.tryLoc<=Q&&Q<=le.finallyLoc&&(le=null);var Fe=le?le.completion:{};return Fe.type=$,Fe.arg=Q,le?(this.method="next",this.next=le.finallyLoc,x):this.complete(Fe)},complete:function($,Q){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&Q&&(this.next=Q),x},finish:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.finallyLoc===$)return this.complete(It.completion,It.afterLoc),ae(It),x}},catch:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.tryLoc===$){var ue=It.completion;if(ue.type==="throw"){var le=ue.arg;ae(It)}return le}}throw Error("illegal catch attempt")},delegateYield:function($,Q,It){return this.delegate={iterator:ce($),resultName:Q,nextLoc:It},this.method==="next"&&(this.arg=r),x}},e}function Ut(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(n,i)}function Jt(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Ut(a,n,i,s,o,"next",l)}function o(l){Ut(a,n,i,s,o,"throw",l)}s(void 0)})}}function qt(r,e){var t=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=st(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function Pe(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n]}return t}function xe(r,e){if(r==null)return{};var t,n,i=Pe(r,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(n=0;n<a.length;n++)t=a[n],e.includes(t)||{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}var je=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof g.g!="undefined"?g.g:typeof self!="undefined"?self:{},en={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(je,function(){function t(W,z,j,Z,vt){n(W,z,j||0,Z||W.length-1,vt||a)}function n(W,z,j,Z,vt){for(;Z>j;){if(Z-j>600){var Tt=Z-j+1,zt=z-j+1,Qt=Math.log(Tt),ae=.5*Math.exp(2*Qt/3),fe=.5*Math.sqrt(Qt*ae*(Tt-ae)/Tt)*(zt-Tt/2<0?-1:1),ce=Math.max(j,Math.floor(z-zt*ae/Tt+fe)),ct=Math.min(Z,Math.floor(z+(Tt-zt)*ae/Tt+fe));n(W,z,ce,ct,vt)}var $=W[z],Q=j,It=Z;for(i(W,j,z),vt(W[Z],$)>0&&i(W,j,Z);Q<It;){for(i(W,Q,It),Q++,It--;vt(W[Q],$)<0;)Q++;for(;vt(W[It],$)>0;)It--}vt(W[j],$)===0?i(W,j,It):(It++,i(W,It,Z)),It<=z&&(j=It+1),z<=It&&(Z=It-1)}}function i(W,z,j){var Z=W[z];W[z]=W[j],W[j]=Z}function a(W,z){return W<z?-1:W>z?1:0}var s=function(z){z===void 0&&(z=9),this._maxEntries=Math.max(4,z),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(z){var j=this.data,Z=[];if(!N(z,j))return Z;for(var vt=this.toBBox,Tt=[];j;){for(var zt=0;zt<j.children.length;zt++){var Qt=j.children[zt],ae=j.leaf?vt(Qt):Qt;N(z,ae)&&(j.leaf?Z.push(Qt):A(z,ae)?this._all(Qt,Z):Tt.push(Qt))}j=Tt.pop()}return Z},s.prototype.collides=function(z){var j=this.data;if(!N(z,j))return!1;for(var Z=[];j;){for(var vt=0;vt<j.children.length;vt++){var Tt=j.children[vt],zt=j.leaf?this.toBBox(Tt):Tt;if(N(z,zt)){if(j.leaf||A(z,zt))return!0;Z.push(Tt)}}j=Z.pop()}return!1},s.prototype.load=function(z){if(!(z&&z.length))return this;if(z.length<this._minEntries){for(var j=0;j<z.length;j++)this.insert(z[j]);return this}var Z=this._build(z.slice(),0,z.length-1,0);if(!this.data.children.length)this.data=Z;else if(this.data.height===Z.height)this._splitRoot(this.data,Z);else{if(this.data.height<Z.height){var vt=this.data;this.data=Z,Z=vt}this._insert(Z,this.data.height-Z.height-1,!0)}return this},s.prototype.insert=function(z){return z&&this._insert(z,this.data.height-1),this},s.prototype.clear=function(){return this.data=I([]),this},s.prototype.remove=function(z,j){if(!z)return this;for(var Z=this.data,vt=this.toBBox(z),Tt=[],zt=[],Qt,ae,fe;Z||Tt.length;){if(Z||(Z=Tt.pop(),ae=Tt[Tt.length-1],Qt=zt.pop(),fe=!0),Z.leaf){var ce=o(z,Z.children,j);if(ce!==-1)return Z.children.splice(ce,1),Tt.push(Z),this._condense(Tt),this}!fe&&!Z.leaf&&A(Z,vt)?(Tt.push(Z),zt.push(Qt),Qt=0,ae=Z,Z=Z.children[0]):ae?(Qt++,Z=ae.children[Qt],fe=!1):Z=null}return this},s.prototype.toBBox=function(z){return z},s.prototype.compareMinX=function(z,j){return z.minX-j.minX},s.prototype.compareMinY=function(z,j){return z.minY-j.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(z){return this.data=z,this},s.prototype._all=function(z,j){for(var Z=[];z;)z.leaf?j.push.apply(j,z.children):Z.push.apply(Z,z.children),z=Z.pop();return j},s.prototype._build=function(z,j,Z,vt){var Tt=Z-j+1,zt=this._maxEntries,Qt;if(Tt<=zt)return Qt=I(z.slice(j,Z+1)),l(Qt,this.toBBox),Qt;vt||(vt=Math.ceil(Math.log(Tt)/Math.log(zt)),zt=Math.ceil(Tt/Math.pow(zt,vt-1))),Qt=I([]),Qt.leaf=!1,Qt.height=vt;var ae=Math.ceil(Tt/zt),fe=ae*Math.ceil(Math.sqrt(zt));K(z,j,Z,fe,this.compareMinX);for(var ce=j;ce<=Z;ce+=fe){var ct=Math.min(ce+fe-1,Z);K(z,ce,ct,ae,this.compareMinY);for(var $=ce;$<=ct;$+=ae){var Q=Math.min($+ae-1,ct);Qt.children.push(this._build(z,$,Q,vt-1))}}return l(Qt,this.toBBox),Qt},s.prototype._chooseSubtree=function(z,j,Z,vt){for(;vt.push(j),!(j.leaf||vt.length-1===Z);){for(var Tt=1/0,zt=1/0,Qt=void 0,ae=0;ae<j.children.length;ae++){var fe=j.children[ae],ce=f(fe),ct=p(z,fe)-ce;ct<zt?(zt=ct,Tt=ce<Tt?ce:Tt,Qt=fe):ct===zt&&ce<Tt&&(Tt=ce,Qt=fe)}j=Qt||j.children[0]}return j},s.prototype._insert=function(z,j,Z){var vt=Z?z:this.toBBox(z),Tt=[],zt=this._chooseSubtree(vt,this.data,j,Tt);for(zt.children.push(z),c(zt,vt);j>=0&&Tt[j].children.length>this._maxEntries;)this._split(Tt,j),j--;this._adjustParentBBoxes(vt,Tt,j)},s.prototype._split=function(z,j){var Z=z[j],vt=Z.children.length,Tt=this._minEntries;this._chooseSplitAxis(Z,Tt,vt);var zt=this._chooseSplitIndex(Z,Tt,vt),Qt=I(Z.children.splice(zt,Z.children.length-zt));Qt.height=Z.height,Qt.leaf=Z.leaf,l(Z,this.toBBox),l(Qt,this.toBBox),j?z[j-1].children.push(Qt):this._splitRoot(Z,Qt)},s.prototype._splitRoot=function(z,j){this.data=I([z,j]),this.data.height=z.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(z,j,Z){for(var vt,Tt=1/0,zt=1/0,Qt=j;Qt<=Z-j;Qt++){var ae=u(z,0,Qt,this.toBBox),fe=u(z,Qt,Z,this.toBBox),ce=x(ae,fe),ct=f(ae)+f(fe);ce<Tt?(Tt=ce,vt=Qt,zt=ct<zt?ct:zt):ce===Tt&&ct<zt&&(zt=ct,vt=Qt)}return vt||Z-j},s.prototype._chooseSplitAxis=function(z,j,Z){var vt=z.leaf?this.compareMinX:h,Tt=z.leaf?this.compareMinY:d,zt=this._allDistMargin(z,j,Z,vt),Qt=this._allDistMargin(z,j,Z,Tt);zt<Qt&&z.children.sort(vt)},s.prototype._allDistMargin=function(z,j,Z,vt){z.children.sort(vt);for(var Tt=this.toBBox,zt=u(z,0,j,Tt),Qt=u(z,Z-j,Z,Tt),ae=v(zt)+v(Qt),fe=j;fe<Z-j;fe++){var ce=z.children[fe];c(zt,z.leaf?Tt(ce):ce),ae+=v(zt)}for(var ct=Z-j-1;ct>=j;ct--){var $=z.children[ct];c(Qt,z.leaf?Tt($):$),ae+=v(Qt)}return ae},s.prototype._adjustParentBBoxes=function(z,j,Z){for(var vt=Z;vt>=0;vt--)c(j[vt],z)},s.prototype._condense=function(z){for(var j=z.length-1,Z=void 0;j>=0;j--)z[j].children.length===0?j>0?(Z=z[j-1].children,Z.splice(Z.indexOf(z[j]),1)):this.clear():l(z[j],this.toBBox)};function o(W,z,j){if(!j)return z.indexOf(W);for(var Z=0;Z<z.length;Z++)if(j(W,z[Z]))return Z;return-1}function l(W,z){u(W,0,W.children.length,z,W)}function u(W,z,j,Z,vt){vt||(vt=I(null)),vt.minX=1/0,vt.minY=1/0,vt.maxX=-1/0,vt.maxY=-1/0;for(var Tt=z;Tt<j;Tt++){var zt=W.children[Tt];c(vt,W.leaf?Z(zt):zt)}return vt}function c(W,z){return W.minX=Math.min(W.minX,z.minX),W.minY=Math.min(W.minY,z.minY),W.maxX=Math.max(W.maxX,z.maxX),W.maxY=Math.max(W.maxY,z.maxY),W}function h(W,z){return W.minX-z.minX}function d(W,z){return W.minY-z.minY}function f(W){return(W.maxX-W.minX)*(W.maxY-W.minY)}function v(W){return W.maxX-W.minX+(W.maxY-W.minY)}function p(W,z){return(Math.max(z.maxX,W.maxX)-Math.min(z.minX,W.minX))*(Math.max(z.maxY,W.maxY)-Math.min(z.minY,W.minY))}function x(W,z){var j=Math.max(W.minX,z.minX),Z=Math.max(W.minY,z.minY),vt=Math.min(W.maxX,z.maxX),Tt=Math.min(W.maxY,z.maxY);return Math.max(0,vt-j)*Math.max(0,Tt-Z)}function A(W,z){return W.minX<=z.minX&&W.minY<=z.minY&&z.maxX<=W.maxX&&z.maxY<=W.maxY}function N(W,z){return z.minX<=W.maxX&&z.minY<=W.maxY&&z.maxX>=W.minX&&z.maxY>=W.minY}function I(W){return{children:W,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(W,z,j,Z,vt){for(var Tt=[z,j];Tt.length;)if(j=Tt.pop(),z=Tt.pop(),!(j-z<=Z)){var zt=z+Math.ceil((j-z)/Z/2)*Z;t(W,zt,z,j,vt),Tt.push(z,zt,zt,j)}}return s})})(en);var Be=en.exports,he=function(r){return r.GROUP="g",r.FRAGMENT="fragment",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",r}({}),mn=function(r){return r[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",r}({}),Se=function(){function r(){E(this,r),this.plugins=[]}return _(r,[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(n){var i=t.context.renderingPlugins.indexOf(n);i>=0&&t.context.renderingPlugins.splice(i,1)})}}])}(),nn=function(){function r(e){E(this,r),this.clipSpaceNearZ=mn.NEGATIVE_ONE,this.plugins=[],this.config=b({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}return _(r,[{key:"registerPlugin",value:function(t){var n=this.plugins.findIndex(function(i){return i===t});n===-1&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var n=this.plugins.findIndex(function(i){return i===t});n>-1&&this.plugins.splice(n,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(n){return n.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),yn=et.IH,Bn=et.JG,Xn=et.Fp,Gr=et.VV,An=et.bA,Rn=et.lu,Ln=function(){function r(){E(this,r),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return _(r,[{key:"update",value:function(t,n){Bn(this.center,t),Bn(this.halfExtents,n),Rn(this.min,this.center,this.halfExtents),yn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,n){yn(this.center,n,t),An(this.center,this.center,.5),Rn(this.halfExtents,n,t),An(this.halfExtents,this.halfExtents,.5),Bn(this.min,t),Bn(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!r.isEmpty(t)){if(r.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,i=n[0],a=n[1],s=n[2],o=this.halfExtents,l=o[0],u=o[1],c=o[2],h=i-l,d=i+l,f=a-u,v=a+u,p=s-c,x=s+c,A=t.center,N=A[0],I=A[1],K=A[2],W=t.halfExtents,z=W[0],j=W[1],Z=W[2],vt=N-z,Tt=N+z,zt=I-j,Qt=I+j,ae=K-Z,fe=K+Z;vt<h&&(h=vt),Tt>d&&(d=Tt),zt<f&&(f=zt),Qt>v&&(v=Qt),ae<p&&(p=ae),fe>x&&(x=fe),n[0]=(h+d)*.5,n[1]=(f+v)*.5,n[2]=(p+x)*.5,o[0]=(d-h)*.5,o[1]=(v-f)*.5,o[2]=(x-p)*.5,this.min[0]=h,this.min[1]=f,this.min[2]=p,this.max[0]=d,this.max[1]=v,this.max[2]=x}}},{key:"setFromTransformedAABB",value:function(t,n){var i=this.center,a=this.halfExtents,s=t.center,o=t.halfExtents,l=n[0],u=n[4],c=n[8],h=n[1],d=n[5],f=n[9],v=n[2],p=n[6],x=n[10],A=Math.abs(l),N=Math.abs(u),I=Math.abs(c),K=Math.abs(h),W=Math.abs(d),z=Math.abs(f),j=Math.abs(v),Z=Math.abs(p),vt=Math.abs(x);i[0]=n[12]+l*s[0]+u*s[1]+c*s[2],i[1]=n[13]+h*s[0]+d*s[1]+f*s[2],i[2]=n[14]+v*s[0]+p*s[1]+x*s[2],a[0]=A*o[0]+N*o[1]+I*o[2],a[1]=K*o[0]+W*o[1]+z*o[2],a[2]=j*o[0]+Z*o[1]+vt*o[2],Rn(this.min,i,a),yn(this.max,i,a)}},{key:"intersects",value:function(t){var n=this.getMax(),i=this.getMin(),a=t.getMax(),s=t.getMin();return i[0]<=a[0]&&n[0]>=s[0]&&i[1]<=a[1]&&n[1]>=s[1]&&i[2]<=a[2]&&n[2]>=s[2]}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var n=new r,i=Xn([0,0,0],this.getMin(),t.getMin()),a=Gr([0,0,0],this.getMax(),t.getMax());return n.setMinMax(i,a),n}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?Bn([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?Bn([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0}}])}(),Ce=function(){function r(e,t){E(this,r),this.distance=e||0,this.normal=t||et.al(0,1,0),this.updatePNVertexFlag()}return _(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return et.AK(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/et.Zh(this.normal);et.bA(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,n,i){var a=this.distanceToPoint(t),s=this.distanceToPoint(n),o=a/(a-s),l=o>=0&&o<=1;return l&&i&&et.t7(i,t,n,o),l}}])}(),Xe=function(r){return r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",r}({}),bn=function(){function r(e){if(E(this,r),this.planes=[],e)this.planes=e;else for(var t=0;t<6;t++)this.planes.push(new Ce)}return _(r,[{key:"extractFromVPMatrix",value:function(t){var n=re(t,16),i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],h=n[7],d=n[8],f=n[9],v=n[10],p=n[11],x=n[12],A=n[13],N=n[14],I=n[15];et.t8(this.planes[0].normal,o-i,h-l,p-d),this.planes[0].distance=I-x,et.t8(this.planes[1].normal,o+i,h+l,p+d),this.planes[1].distance=I+x,et.t8(this.planes[2].normal,o+a,h+u,p+f),this.planes[2].distance=I+A,et.t8(this.planes[3].normal,o-a,h-u,p-f),this.planes[3].distance=I-A,et.t8(this.planes[4].normal,o-s,h-c,p-v),this.planes[4].distance=I-N,et.t8(this.planes[5].normal,o+s,h+c,p+v),this.planes[5].distance=I+N,this.planes.forEach(function(K){K.normalize(),K.updatePNVertexFlag()})}}])}(),Ye=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;E(this,r),this.x=0,this.y=0,this.x=e,this.y=t}return _(r,[{key:"clone",value:function(){return new r(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Er=function(){function r(e,t,n,i){E(this,r),this.x=e,this.y=t,this.width=n,this.height=i,this.left=e,this.right=e+n,this.top=t,this.bottom=t+i}return _(r,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(t){return new r(t.x,t.y,t.width,t.height)}},{key:"applyTransform",value:function(t,n){var i=ge.al(t.x,t.y,0,1),a=ge.al(t.x+t.width,t.y,0,1),s=ge.al(t.x,t.y+t.height,0,1),o=ge.al(t.x+t.width,t.y+t.height,0,1),l=ge.Ue(),u=ge.Ue(),c=ge.Ue(),h=ge.Ue();ge.fF(l,i,n),ge.fF(u,a,n),ge.fF(c,s,n),ge.fF(h,o,n);var d=Math.min(l[0],u[0],c[0],h[0]),f=Math.min(l[1],u[1],c[1],h[1]),v=Math.max(l[0],u[0],c[0],h[0]),p=Math.max(l[1],u[1],c[1],h[1]);return r.fromRect({x:d,y:f,width:v-d,height:p-f})}}])}(),Cn="Method not implemented.",mr="Use document.documentElement instead.",Wr="Cannot append a destroyed element.";function Kr(r){return r===void 0?0:r>360||r<-360?r%360:r}var Ui=et.Ue();function ur(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(r)&&r.length===3?n?et.d9(r):et.JG(Ui,r):(0,bt.Z)(r)?n?et.al(r,e,t):et.t8(Ui,r,e,t):n?et.al(r[0],r[1]||e,r[2]||t):et.t8(Ui,r[0],r[1]||e,r[2]||t)}var ya=Math.PI/180;function qn(r){return r*ya}var er=180/Math.PI;function vr(r){return r*er}var Zi=.9;function $i(r){return r%=400,r<0&&(r+=400),r*Zi}function ui(r){return r/360}function mh(r){return 360*r}var tl=Math.PI/2;function yh(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t*t,o=n*n,l=i*i,u=a*a,c=s+o+l+u,h=t*a-n*i;return h>.499995*c?(r[0]=tl,r[1]=2*Math.atan2(n,t),r[2]=0):h<-.499995*c?(r[0]=-tl,r[1]=2*Math.atan2(n,t),r[2]=0):(r[0]=Math.asin(2*(t*i-a*n)),r[1]=Math.atan2(2*(t*a+n*i),1-2*(l+u)),r[2]=Math.atan2(2*(t*n+i*a),1-2*(o+l))),r}function Gu(r,e){var t,n,i=yt.getScaling(et.Ue(),e),a=re(i,3),s=a[0],o=a[1],l=a[2],u=Math.asin(-e[2]/s);return u<tl?u>-tl?(t=Math.atan2(e[6]/o,e[10]/l),n=Math.atan2(e[1]/s,e[0]/s)):(n=0,t=-Math.atan2(e[4]/o,e[5]/o)):(n=0,t=Math.atan2(e[4]/o,e[5]/o)),r[0]=t,r[1]=u,r[2]=n,r}function el(r,e){return e.length===16?Gu(r,e):yh(r,e)}function bh(r,e,t,n,i){var a=Math.cos(r),s=Math.sin(r);return te.al(n*a,i*s,0,-n*s,i*a,0,e,t,1)}function Wu(r,e,t,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=2*a,u=t-e,c=n-i,h=l/u,d=l/c,f=(t+e)/u,v=(n+i)/c,p,x,A=s-a,N=s*a;return o?(p=-s/A,x=-N/A):(p=-(s+a)/A,x=-2*N/A),r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=d,r[6]=0,r[7]=0,r[8]=f,r[9]=v,r[10]=p,r[11]=-1,r[12]=0,r[13]=0,r[14]=x,r[15]=0,r}function Uu(r){var e=r[0],t=r[1],n=r[3],i=r[4],a=Math.sqrt(e*e+t*t),s=Math.sqrt(n*n+i*i),o=e*i-t*n;if(o<0&&(e<i?a=-a:s=-s),a){var l=1/a;e*=l,t*=l}if(s){var u=1/s;n*=u,i*=u}var c=Math.atan2(t,e),h=vr(c);return[r[6],r[7],a,s,h]}var ba=yt.create(),Za=yt.create(),zl=ge.Ue(),Un=[et.Ue(),et.Ue(),et.Ue()],Uv=et.Ue();function Cm(r,e,t,n,i,a){if(!Pm(ba,r)||(yt.copy(Za,ba),Za[3]=0,Za[7]=0,Za[11]=0,Za[15]=1,Math.abs(yt.determinant(Za))<1e-8))return!1;var s=ba[3],o=ba[7],l=ba[11],u=ba[12],c=ba[13],h=ba[14],d=ba[15];if(s!==0||o!==0||l!==0){zl[0]=s,zl[1]=o,zl[2]=l,zl[3]=d;var f=yt.invert(Za,Za);if(!f)return!1;yt.transpose(Za,Za),ge.fF(i,zl,Za)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=u,e[1]=c,e[2]=h,Nm(Un,ba),t[0]=et.kE(Un[0]),et.Fv(Un[0],Un[0]),n[0]=et.AK(Un[0],Un[1]),xh(Un[1],Un[1],Un[0],1,-n[0]),t[1]=et.kE(Un[1]),et.Fv(Un[1],Un[1]),n[0]/=t[1],n[1]=et.AK(Un[0],Un[2]),xh(Un[2],Un[2],Un[0],1,-n[1]),n[2]=et.AK(Un[1],Un[2]),xh(Un[2],Un[2],Un[1],1,-n[2]),t[2]=et.kE(Un[2]),et.Fv(Un[2],Un[2]),n[1]/=t[2],n[2]/=t[2],et.kC(Uv,Un[1],Un[2]),et.AK(Un[0],Uv)<0)for(var v=0;v<3;v++)t[v]*=-1,Un[v][0]*=-1,Un[v][1]*=-1,Un[v][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Un[0][0]-Un[1][1]-Un[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Un[0][0]+Un[1][1]-Un[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Un[0][0]-Un[1][1]+Un[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Un[0][0]+Un[1][1]+Un[2][2],0)),Un[2][1]>Un[1][2]&&(a[0]=-a[0]),Un[0][2]>Un[2][0]&&(a[1]=-a[1]),Un[1][0]>Un[0][1]&&(a[2]=-a[2]),!0}function Pm(r,e){var t=e[15];if(t===0)return!1;for(var n=1/t,i=0;i<16;i++)r[i]=e[i]*n;return!0}function Nm(r,e){r[0][0]=e[0],r[0][1]=e[1],r[0][2]=e[2],r[1][0]=e[4],r[1][1]=e[5],r[1][2]=e[6],r[2][0]=e[8],r[2][1]=e[9],r[2][2]=e[10]}function xh(r,e,t,n,i){r[0]=e[0]*n+t[0]*i,r[1]=e[1]*n+t[1]*i,r[2]=e[2]*n+t[2]*i}var Or=function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r}({}),Zu=function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r}({}),xa=function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r}({}),Zv={UPDATED:"updated"},Vv=2e-4,Yv=function(){function r(){E(this,r),this.clipSpaceNearZ=mn.NEGATIVE_ONE,this.eventEmitter=new Ee.Z,this.matrix=yt.create(),this.right=et.al(1,0,0),this.up=et.al(0,1,0),this.forward=et.al(0,0,1),this.position=et.al(0,0,1),this.focalPoint=et.al(0,0,0),this.distanceVector=et.al(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=yt.create(),this.projectionMatrixInverse=yt.create(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Or.EXPLORING,this.trackingMode=Zu.DEFAULT,this.projectionMode=xa.PERSPECTIVE,this.frustum=new bn,this.orthoMatrix=yt.create()}return _(r,[{key:"isOrtho",value:function(){return this.projectionMode===xa.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,n){return this.type=t,this.type===Or.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Or.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Or.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return yt.invert(yt.create(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,n){var i=yt.fromTranslation(yt.create(),[t,n,0]);this.jitteredProjectionMatrix=yt.multiply(yt.create(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===xa.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===xa.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,n,i,a,s,o){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===xa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===xa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===xa.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===xa.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,n){var i=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(t),this.rotate(0,0,o);var l=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),u=l.x,c=l.y,h=et.al(u-a,c-s,0),d=et.AK(h,this.right)/et.kE(this.right),f=et.AK(h,this.up)/et.kE(this.up),v=this.getPosition(),p=re(v,2),x=p[0],A=p[1],N=this.getFocalPoint(),I=re(N,2),K=I[0],W=I[1];return this.setPosition(x-d,A-f),this.setFocalPoint(K-d,W-f),this}},{key:"setPerspective",value:function(t,n,i,a){var s;this.projectionMode=xa.PERSPECTIVE,this.fov=i,this.near=t,this.far=n,this.aspect=a;var o=this.near*Math.tan(qn(.5*this.fov))/this.zoom,l=2*o,u=this.aspect*l,c=-.5*u;if((s=this.view)!==null&&s!==void 0&&s.enabled){var h=this.view.fullWidth,d=this.view.fullHeight;c+=this.view.offsetX*u/h,o-=this.view.offsetY*l/d,u*=this.view.width/h,l*=this.view.height/d}return Wu(this.projectionMatrix,c,c+u,o-l,o,t,this.far,this.clipSpaceNearZ===mn.ZERO),yt.invert(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,n,i,a,s,o){var l;this.projectionMode=xa.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=i,this.bottom=a,this.near=s,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,f=h-u,v=h+u,p=d+c,x=d-c;if((l=this.view)!==null&&l!==void 0&&l.enabled){var A=(this.rright-this.left)/this.view.fullWidth/this.zoom,N=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f+=A*this.view.offsetX,v=f+A*this.view.width,p-=N*this.view.offsetY,x=p-N*this.view.height}return this.clipSpaceNearZ===mn.NEGATIVE_ONE?yt.ortho(this.projectionMatrix,f,v,p,x,s,o):yt.orthoZO(this.projectionMatrix,f,v,p,x,s,o),yt.invert(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=ur(t,n,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=et.al(0,1,0);if(this.focalPoint=ur(t,n,i),this.trackingMode===Zu.CINEMATIC){var s=et.$X(et.Ue(),this.focalPoint,this.position);t=s[0],n=s[1],i=s[2];var o=et.kE(s),l=vr(Math.asin(n/o)),u=90+vr(Math.atan2(i,t)),c=yt.create();yt.rotateY(c,c,qn(u)),yt.rotateX(c,c,qn(l)),a=et.fF(et.Ue(),[0,1,0],c)}return yt.invert(this.matrix,yt.lookAt(yt.create(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Vv&&(this.distance=Vv),this.dollyingStep=this.distance/100;var n=et.Ue();t=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=t*i[0]+a[0],n[1]=t*i[1]+a[1],n[2]=t*i[2]+a[2],this._setPosition(n),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Kr(t),this.computeMatrix(),this._getAxes(),this.type===Or.ORBITING||this.type===Or.EXPLORING?this._getPosition():this.type===Or.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Kr(t),this.computeMatrix(),this._getAxes(),this.type===Or.ORBITING||this.type===Or.EXPLORING?this._getPosition():this.type===Or.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Kr(t),this.computeMatrix(),this._getAxes(),this.type===Or.ORBITING||this.type===Or.EXPLORING?this._getPosition():this.type===Or.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Xt.yY(Xt.Ue(),[0,0,1],qn(this.roll));yt.identity(this.matrix);var n=Xt.yY(Xt.Ue(),[1,0,0],qn((this.rotateWorld&&this.type!==Or.TRACKING||this.type===Or.TRACKING?1:-1)*this.elevation)),i=Xt.yY(Xt.Ue(),[0,1,0],qn((this.rotateWorld&&this.type!==Or.TRACKING||this.type===Or.TRACKING?1:-1)*this.azimuth)),a=Xt.Jp(Xt.Ue(),i,n);a=Xt.Jp(Xt.Ue(),a,t);var s=yt.fromQuat(yt.create(),a);this.type===Or.ORBITING||this.type===Or.EXPLORING?(yt.translate(this.matrix,this.matrix,this.focalPoint),yt.multiply(this.matrix,this.matrix,s),yt.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===Or.TRACKING&&(yt.translate(this.matrix,this.matrix,this.position),yt.multiply(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(t,n,i){this.position=ur(t,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){et.JG(this.right,ur(ge.fF(ge.Ue(),[1,0,0,0],this.matrix))),et.JG(this.up,ur(ge.fF(ge.Ue(),[0,1,0,0],this.matrix))),et.JG(this.forward,ur(ge.fF(ge.Ue(),[0,0,1,0],this.matrix))),et.Fv(this.right,this.right),et.Fv(this.up,this.up),et.Fv(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=et.kE(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===Or.TRACKING?(this.elevation=vr(Math.asin(n/a)),this.azimuth=vr(Math.atan2(-t,-i))):this.rotateWorld?(this.elevation=vr(Math.asin(n/a)),this.azimuth=vr(Math.atan2(-t,-i))):(this.elevation=-vr(Math.asin(n/a)),this.azimuth=-vr(Math.atan2(-t,-i)))}},{key:"_getPosition",value:function(){et.JG(this.position,ur(ge.fF(ge.Ue(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){et.kK(this.distanceVector,[0,0,-this.distance],te.xO(te.Ue(),this.matrix)),et.IH(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=et.$X(et.Ue(),this.focalPoint,this.position),this.distance=et.kE(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===xa.ORTHOGRAPHIC){var t=this.position,n=Xt.yY(Xt.Ue(),[0,0,1],-this.roll*Math.PI/180);yt.fromRotationTranslationScaleOrigin(this.orthoMatrix,n,et.al((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),et.al(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),n=yt.multiply(yt.create(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(Zv.UPDATED)}}},{key:"rotate",value:function(t,n,i){throw new Error(Cn)}},{key:"pan",value:function(t,n){throw new Error(Cn)}},{key:"dolly",value:function(t){throw new Error(Cn)}},{key:"createLandmark",value:function(t,n){throw new Error(Cn)}},{key:"gotoLandmark",value:function(t,n){throw new Error(Cn)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Cn)}}])}(),Rm=function(r){return r[r.Standard=0]="Standard",r}({}),Vu=function(r){return r[r.ADDED=0]="ADDED",r[r.REMOVED=1]="REMOVED",r[r.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",r}({}),jl={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Er(0,0,0,0)},qe=function(r){return r.COORDINATE="<coordinate>",r.COLOR="<color>",r.PAINT="<paint>",r.NUMBER="<number>",r.ANGLE="<angle>",r.OPACITY_VALUE="<opacity-value>",r.SHADOW_BLUR="<shadow-blur>",r.LENGTH="<length>",r.PERCENTAGE="<percentage>",r.LENGTH_PERCENTAGE="<length> | <percentage>",r.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",r.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",r.LIST_OF_POINTS="<list-of-points>",r.PATH="<path>",r.FILTER="<filter>",r.Z_INDEX="<z-index>",r.OFFSET_DISTANCE="<offset-distance>",r.DEFINED_PATH="<defined-path>",r.MARKER="<marker>",r.TRANSFORM="<transform>",r.TRANSFORM_ORIGIN="<transform-origin>",r.TEXT="<text>",r.TEXT_TRANSFORM="<text-transform>",r}({});function Pi(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=e?e.apply(this,a):a[0],l=t.cache;if(l.has(o))return l.get(o);var u=r.apply(this,a);return t.cache=l.set(o,u)||l,u};return t.cache=new(Pi.Cache||Map),t}Pi.Cache=Map;var ln=function(r){return r[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",r}({}),ua=function(r){return r[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",r}({}),Lm=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),Dm=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),Im=[{name:"em",unit_type:ln.kEms},{name:"px",unit_type:ln.kPixels},{name:"deg",unit_type:ln.kDegrees},{name:"rad",unit_type:ln.kRadians},{name:"grad",unit_type:ln.kGradians},{name:"ms",unit_type:ln.kMilliseconds},{name:"s",unit_type:ln.kSeconds},{name:"rem",unit_type:ln.kRems},{name:"turn",unit_type:ln.kTurns}],nl=function(r){return r[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",r}({}),Hv=function(e){return Im.find(function(t){return t.name===e}).unit_type},Fm=function(e){return e?e==="number"?ln.kNumber:e==="percent"||e==="%"?ln.kPercentage:Hv(e):ln.kUnknown},Bm=function(e){switch(e){case ln.kNumber:case ln.kInteger:return ua.kUNumber;case ln.kPercentage:return ua.kUPercent;case ln.kPixels:return ua.kULength;case ln.kMilliseconds:case ln.kSeconds:return ua.kUTime;case ln.kDegrees:case ln.kRadians:case ln.kGradians:case ln.kTurns:return ua.kUAngle;default:return ua.kUOther}},Xv=function(e){switch(e){case ua.kUNumber:return ln.kNumber;case ua.kULength:return ln.kPixels;case ua.kUPercent:return ln.kPercentage;case ua.kUTime:return ln.kSeconds;case ua.kUAngle:return ln.kDegrees;default:return ln.kUnknown}},Yu=function(e){var t=1;switch(e){case ln.kPixels:case ln.kDegrees:case ln.kSeconds:break;case ln.kMilliseconds:t=.001;break;case ln.kRadians:t=180/Math.PI;break;case ln.kGradians:t=.9;break;case ln.kTurns:t=360;break}return t},Hu=function(e){switch(e){case ln.kNumber:case ln.kInteger:return"";case ln.kPercentage:return"%";case ln.kEms:return"em";case ln.kRems:return"rem";case ln.kPixels:return"px";case ln.kDegrees:return"deg";case ln.kRadians:return"rad";case ln.kGradians:return"grad";case ln.kMilliseconds:return"ms";case ln.kSeconds:return"s";case ln.kTurns:return"turn"}return""},rl=function(){function r(){E(this,r)}return _(r,[{key:"toString",value:function(){return this.buildCSSText(Lm.kNo,Dm.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=nl.kUnitType&&this.getType()<=nl.kClampType}}],[{key:"isAngle",value:function(t){return t===ln.kDegrees||t===ln.kRadians||t===ln.kGradians||t===ln.kTurns}},{key:"isLength",value:function(t){return t>=ln.kEms&&t<ln.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===ln.kPercentage||t===ln.kEms||t===ln.kRems}},{key:"isTime",value:function(t){return t===ln.kSeconds||t===ln.kMilliseconds}}])}(),Xu=function(r){function e(t){var n;return E(this,e),n=_t(this,e),n.colorSpace=t,n}return Ot(e,r),_(e,[{key:"getType",value:function(){return nl.kColorType}},{key:"to",value:function(n){return this}}])}(rl),Rs=function(r){return r[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",r}({}),Ku=function(r){function e(t,n){var i;return E(this,e),i=_t(this,e),i.type=t,i.value=n,i}return Ot(e,r),_(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(n,i,a){return a}},{key:"getType",value:function(){return nl.kColorType}}])}(rl),Ea=function(r){function e(t){var n;return E(this,e),n=_t(this,e),n.value=t,n}return Ot(e,r),_(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return nl.kKeywordType}},{key:"buildCSSText",value:function(n,i,a){return a+this.value}}])}(rl),zm=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";return Number.isFinite(e)?n="NaN":e>0?n="infinity":n="-infinity",n+=t},$u=function(e){return Xv(Bm(e))},Ar=function(r){function e(t){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln.kNumber;E(this,e),n=_t(this,e);var a;return typeof i=="string"?a=Fm(i):a=i,n.unit=a,n.value=t,n}return Ot(e,r),_(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(n){var i=n;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return nl.kUnitType}},{key:"convertTo",value:function(n){if(this.unit===n)return new e(this.value,this.unit);var i=$u(this.unit);if(i!==$u(n)||i===ln.kUnknown)return null;var a=Yu(this.unit)/Yu(n);return new e(this.value*a,n)}},{key:"buildCSSText",value:function(n,i,a){var s;switch(this.unit){case ln.kUnknown:break;case ln.kInteger:s=Number(this.value).toFixed(0);break;case ln.kNumber:case ln.kPercentage:case ln.kEms:case ln.kRems:case ln.kPixels:case ln.kDegrees:case ln.kRadians:case ln.kGradians:case ln.kMilliseconds:case ln.kSeconds:case ln.kTurns:{var o=-999999,l=999999,u=this.value,c=Hu(this.unit);if(u<o||u>l){var h=Hu(this.unit);!Number.isFinite(u)||Number.isNaN(u)?s=zm(u,h):s=u+(h||"")}else s="".concat(u).concat(c)}}return a+=s,a}}])}(rl),Va=new Ar(0,"px");new Ar(1,"px");var Ya=new Ar(0,"deg"),Eh=function(r){function e(t,n,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return E(this,e),a=_t(this,e,["rgb"]),a.r=t,a.g=n,a.b=i,a.alpha=s,a.isNone=o,a}return Ot(e,r),_(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(n,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Xu),il=new Ea("unset"),jm=new Ea("initial"),Gm=new Ea("inherit"),wh={"":il,unset:il,initial:jm,inherit:Gm},Wm=function(e){return wh[e]||(wh[e]=new Ea(e)),wh[e]},Sh=new Eh(0,0,0,0,!0),_h=new Eh(0,0,0,0),Gl=Pi(function(r,e,t,n){return new Eh(r,e,t,n)},function(r,e,t,n){return"rgba(".concat(r,",").concat(e,",").concat(t,",").concat(n,")")}),Lr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln.kNumber;return new Ar(e,t)};new Ar(50,"%");function Mh(r){var e=r.type,t=r.value;return e==="hex"?"#".concat(t):e==="literal"?t:e==="rgb"?"rgb(".concat(t.join(","),")"):"rgba(".concat(t.join(","),")")}var Kv=function(){var r={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function t($){throw new Error("".concat(e,": ").concat($))}function n(){var $=i();return e.length>0&&t("Invalid input not EOF"),$}function i(){return I(a)}function a(){return s("linear-gradient",r.linearGradient,l)||s("repeating-linear-gradient",r.repeatingLinearGradient,l)||s("radial-gradient",r.radialGradient,h)||s("repeating-radial-gradient",r.repeatingRadialGradient,h)||s("conic-gradient",r.conicGradient,h)}function s($,Q,It){return o(Q,function(ue){var le=It();return le&&(ce(r.comma)||t("Missing comma before color stops")),{type:$,orientation:le,colorStops:I(K)}})}function o($,Q){var It=ce($);if(It){ce(r.startCall)||t("Missing (");var ue=Q(It);return ce(r.endCall)||t("Missing )"),ue}}function l(){return u()||c()}function u(){return fe("directional",r.sideOrCorner,1)}function c(){return fe("angular",r.angleValue,1)}function h(){var $,Q=d(),It;return Q&&($=[],$.push(Q),It=e,ce(r.comma)&&(Q=d(),Q?$.push(Q):e=It)),$}function d(){var $=f()||v();if($)$.at=x();else{var Q=p();if(Q){$=Q;var It=x();It&&($.at=It)}else{var ue=A();ue&&($={type:"default-radial",at:ue})}}return $}function f(){var $=fe("shape",/^(circle)/i,0);return $&&($.style=ae()||p()),$}function v(){var $=fe("shape",/^(ellipse)/i,0);return $&&($.style=zt()||p()),$}function p(){return fe("extent-keyword",r.extentKeywords,1)}function x(){if(fe("position",/^at/,0)){var $=A();return $||t("Missing positioning value"),$}}function A(){var $=N();if($.x||$.y)return{type:"position",value:$}}function N(){return{x:zt(),y:zt()}}function I($){var Q=$(),It=[];if(Q)for(It.push(Q);ce(r.comma);)Q=$(),Q?It.push(Q):t("One extra comma");return It}function K(){var $=W();return $||t("Expected color definition"),$.length=zt(),$}function W(){return j()||vt()||Z()||z()}function z(){return fe("literal",r.literalColor,0)}function j(){return fe("hex",r.hexColor,1)}function Z(){return o(r.rgbColor,function(){return{type:"rgb",value:I(Tt)}})}function vt(){return o(r.rgbaColor,function(){return{type:"rgba",value:I(Tt)}})}function Tt(){return ce(r.number)[1]}function zt(){return fe("%",r.percentageValue,1)||Qt()||ae()}function Qt(){return fe("position-keyword",r.positionKeywords,1)}function ae(){return fe("px",r.pixelValue,1)||fe("em",r.emValue,1)}function fe($,Q,It){var ue=ce(Q);if(ue)return{type:$,value:ue[It]}}function ce($){var Q=/^[\n\r\t\s]+/.exec(e);Q&&ct(Q[0].length);var It=$.exec(e);return It&&ct(It[0].length),It}function ct($){e=e.substring($)}return function($){return e=$,n()}}();function $v(r,e,t,n){var i=qn(n.value),a=0,s=0,o=a+e/2,l=s+t/2,u=Math.abs(e*Math.cos(i))+Math.abs(t*Math.sin(i)),c=r[0]+o-Math.cos(i)*u/2,h=r[1]+l-Math.sin(i)*u/2,d=r[0]+o+Math.cos(i)*u/2,f=r[1]+l+Math.sin(i)*u/2;return{x1:c,y1:h,x2:d,y2:f}}function Qu(r,e,t,n,i,a){var s=n.value,o=i.value;n.unit===ln.kPercentage&&(s=n.value/100*e),i.unit===ln.kPercentage&&(o=i.value/100*t);var l=Math.max((0,ye.y)([0,0],[s,o]),(0,ye.y)([0,t],[s,o]),(0,ye.y)([e,t],[s,o]),(0,ye.y)([e,0],[s,o]));return a&&(a instanceof Ar?l=a.value:a instanceof Ea&&(a.value==="closest-side"?l=Math.min(s,e-s,o,t-o):a.value==="farthest-side"?l=Math.max(s,e-s,o,t-o):a.value==="closest-corner"&&(l=Math.min((0,ye.y)([0,0],[s,o]),(0,ye.y)([0,t],[s,o]),(0,ye.y)([e,t],[s,o]),(0,ye.y)([e,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:l}}var Qv=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Jv=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,qv=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Qi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function tg(r){var e,t=r.length;if(r[t-1].length=(e=r[t-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},t>1){var n;r[0].length=(n=r[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"}}for(var i=0,a=Number(r[0].length.value),s=1;s<t;s++){var o,l=(o=r[s].length)===null||o===void 0?void 0:o.value;if(!(0,be.Z)(l)&&!(0,be.Z)(a)){for(var u=1;u<s-i;u++)r[i+u].length={type:"%",value:"".concat(a+(Number(l)-a)*u/(s-i))};i=s,a=Number(l)}}}var eg={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},kh=Pi(function(r){var e;return r.type==="angular"?e=Number(r.value):e=eg[r.value]||0,Lr(e,"deg")}),ng=Pi(function(r){var e=50,t=50,n="%",i="%";if((r==null?void 0:r.type)==="position"){var a=r.value,s=a.x,o=a.y;(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?e=0:s.value==="center"?e=50:s.value==="right"?e=100:s.value==="top"?t=0:s.value==="bottom"&&(t=100)),(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?e=0:o.value==="center"?t=50:o.value==="right"?e=100:o.value==="top"?t=0:o.value==="bottom"&&(t=100)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(n=s==null?void 0:s.type,e=Number(s.value)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(i=o==null?void 0:o.type,t=Number(o.value))}return{cx:Lr(e,n),cy:Lr(t,i)}}),rg=Pi(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var e=Kv(r);return e.map(function(o){var l=o.type,u=o.orientation,c=o.colorStops;tg(c);var h=c.map(function(I){return{offset:Lr(Number(I.length.value),"%"),color:Mh(I)}});if(l==="linear-gradient")return new Ku(Rs.LinearGradient,{angle:u?kh(u):Ya,steps:h});if(l==="radial-gradient"&&(u||(u=[{type:"shape",value:"circle"}]),u[0].type==="shape"&&u[0].value==="circle")){var d=ng(u[0].at),f=d.cx,v=d.cy,p;if(u[0].style){var x=u[0].style,A=x.type,N=x.value;A==="extent-keyword"?p=Wm(N):p=Lr(N,A)}return new Ku(Rs.RadialGradient,{cx:f,cy:v,size:p,steps:h})}})}var t=r[0];if(r[1]==="("||r[2]==="("){if(t==="l"){var n=Qv.exec(r);if(n){var i,a=((i=n[2].match(Qi))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new Ku(Rs.LinearGradient,{angle:Lr(parseFloat(n[1]),"deg"),steps:a.map(function(o){var l=re(o,2),u=l[0],c=l[1];return{offset:Lr(Number(u)*100,"%"),color:c}})})]}}else if(t==="r"){var s=Wl(r);if(s)if((0,Gt.Z)(s))r=s;else return[new Ku(Rs.RadialGradient,s)]}else if(t==="p")return Um(r)}});function Wl(r){var e=Jv.exec(r);if(e){var t,n=((t=e[4].match(Qi))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:Lr(50,"%"),cy:Lr(50,"%"),steps:n.map(function(i){var a=re(i,2),s=a[0],o=a[1];return{offset:Lr(Number(s)*100,"%"),color:o}})}}return null}function Um(r){var e=qv.exec(r);if(e){var t=e[1],n=e[2];switch(t){case"a":t="repeat";break;case"x":t="repeat-x";break;case"y":t="repeat-y";break;case"n":t="no-repeat";break;default:t="no-repeat"}return{image:n,repetition:t}}return null}function Ha(r){return!!r.type&&!!r.value}function Ls(r){return r&&!!r.image}function to(r){return r&&!(0,be.Z)(r.r)&&!(0,be.Z)(r.g)&&!(0,be.Z)(r.b)}var eo=Pi(function(r){if(Ls(r))return b({repetition:"repeat"},r);if((0,be.Z)(r)&&(r=""),r==="transparent")return _h;if(r==="currentColor")r="black";else if(r==="none")return Sh;var e=rg(r);if(e)return e;var t=Gn(r),n=[0,0,0,0];return t!==null&&(n[0]=t.r||0,n[1]=t.g||0,n[2]=t.b||0,n[3]=t.opacity),Gl.apply(void 0,n)});function Zm(r,e){if(!(!to(r)||!to(e)))return[[Number(r.r),Number(r.g),Number(r.b),Number(r.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var n=t.slice();if(n[3])for(var i=0;i<3;i++)n[i]=Math.round((0,Kt.Z)(n[i],0,255));return n[3]=(0,Kt.Z)(n[3],0,1),"rgba(".concat(n.join(","),")")}]}function So(r,e){if((0,be.Z)(e))return Lr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(r)>=0)return Lr(Number(e),"px");if("deg".search(r)>=0)return Lr(Number(e),"deg")}var t=[];e=e.replace(r,function(i){return t.push(i),"U".concat(i)});var n="U(".concat(r.source,")");return t.map(function(i){return Lr(Number(e.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(n,"g"),"*0")),i)})[0]}var Ul=function(e){return So(new RegExp("px","g"),e)},ig=Pi(Ul),Th=function(e){return So(new RegExp("%","g"),e)};Pi(Th);var Oh=function(e){return(0,bt.Z)(e)||isFinite(Number(e))?Lr(Number(e)||0,"px"):So(new RegExp("px|%|em|rem","g"),e)},Ju=Pi(Oh),Ah=function(e){return So(new RegExp("deg|rad|grad|turn","g"),e)},ag=Pi(Ah);function Ch(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=r.value||0,o=e.value||0,l=$u(r.unit),u=r.convertTo(l),c=e.convertTo(l);return u&&c?(s=u.value,o=c.value,a=Hu(r.unit)):(Ar.isLength(r.unit)||Ar.isLength(e.unit))&&(s=Ji(r,i,t),o=Ji(e,i,t),a="px"),[s,o,function(h){return n&&(h=Math.max(h,0)),h+a}]}function Vi(r){var e=0;return r.unit===ln.kDegrees?e=r.value:r.unit===ln.kRadians?e=vr(Number(r.value)):r.unit===ln.kTurns?e=mh(Number(r.value)):r.value&&(e=r.value),e}function Ph(r,e){var t;return Array.isArray(r)?t=r.map(function(n){return Number(n)}):(0,Gt.Z)(r)?t=r.split(" ").map(function(n){return Number(n)}):(0,bt.Z)(r)&&(t=[r]),e===2?t.length===1?[t[0],t[0]]:[t[0],t[1]]:t.length===1?[t[0],t[0],t[0],t[0]]:t.length===2?[t[0],t[1],t[0],t[1]]:t.length===3?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]]}function Ji(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r.unit===ln.kPixels)return Number(r.value);if(r.unit===ln.kPercentage&&t){var i=t.nodeName===he.GROUP?t.getLocalBounds():t.getGeometryBounds();return(n?i.min[e]:0)+r.value/100*i.halfExtents[e]*2}return 0}var Nh=function(e){return So(/deg|rad|grad|turn|px|%/g,e)},sg=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function og(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(r=r.toLowerCase().trim(),r==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,t=[],n,i=0;n=e.exec(r);){if(n.index!==i)return[];if(i=n.index+n[0].length,sg.indexOf(n[1])>-1&&t.push({name:n[1],params:n[2].split(" ").map(function(a){return Nh(a)||eo(a)})}),e.lastIndex===r.length)return t}return[]}function Rh(r){return r.toString()}var Lh=function(e){return typeof e=="number"?Lr(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Lr(Number(e)):Lr(0)},qu=Pi(Lh);Pi(function(r){return(0,Gt.Z)(r)?r.split(" ").map(qu):r.map(qu)});function tc(r,e){return[r,e,Rh]}function ec(r,e){return function(t,n){return[t,n,function(i){return Rh((0,Kt.Z)(i,r,e))}]}}function Dh(r,e){if(r.length===e.length)return[r,e,function(t){return t}]}function Zl(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=(0,we.D)(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function lg(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=(0,U.hE)(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function ug(r){for(var e=0;e<r.length;e++){var t=r[e-1],n=r[e],i=n[0];if(i==="M"&&t){var a=t[0],s=[n[1],n[2]],o=void 0;a==="L"||a==="M"?o=[t[1],t[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[t[t.length-2],t[t.length-1]]),o&&Vl(s,o)&&(r.splice(e,1),e--)}}}function cg(r){for(var e=!1,t=r.length,n=0;n<t;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function Ih(r){for(var e=[],t=[],n=[],i=0;i<r.length;i++){var a=r[i],s=a[0];s==="M"?(n.length&&(t.push(n),n=[]),n.push([a[1],a[2]])):s==="Z"?n.length&&(e.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&t.push(n),{polygons:e,polylines:t}}function Vl(r,e){return r[0]===e[0]&&r[1]===e[1]}function Yl(r,e){for(var t=[],n=[],i=[],a=0;a<r.length;a++){var s=r[a],o=s.currentPoint,l=s.params,u=s.prePoint,c=void 0;switch(s.command){case"Q":c=(0,U.x4)(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":c=(0,U.l5)(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;c=(0,U.vp)(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:t.push(o[0]),n.push(o[1]);break}c&&(s.box=c,t.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)),e&&(s.command==="L"||s.command==="M")&&s.prePoint&&s.nextPoint&&i.push(s)}t=t.filter(function(K){return!Number.isNaN(K)&&K!==1/0&&K!==-1/0}),n=n.filter(function(K){return!Number.isNaN(K)&&K!==1/0&&K!==-1/0});var d=(0,Bt.Z)(t),f=(0,Bt.Z)(n),v=(0,oe.Z)(t),p=(0,oe.Z)(n);if(i.length===0)return{x:d,y:f,width:v-d,height:p-f};for(var x=0;x<i.length;x++){var A=i[x],N=A.currentPoint,I=void 0;N[0]===d?(I=al(A,e),d-=I.xExtra):N[0]===v&&(I=al(A,e),v+=I.xExtra),N[1]===f?(I=al(A,e),f-=I.yExtra):N[1]===p&&(I=al(A,e),p+=I.yExtra)}return{x:d,y:f,width:v-d,height:p-f}}function al(r,e){var t=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2),l=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!l||Math.sin(l)===0||(0,ht.Z)(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),c=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));u=u>Math.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c;var h={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return h}function wa(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}var nc=function(e,t){var n=e.x*t.x+e.y*t.y,i=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),a=e.x*t.y-e.y*t.x<0?-1:1,s=a*Math.acos(n/i);return s},hg=function(e,t,n,i,a,s,o,l){t=Math.abs(t),n=Math.abs(n),i=(0,ut.Z)(i,360);var u=qn(i);if(e.x===o.x&&e.y===o.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(e.x-o.x)/2,h=(e.y-o.y)/2,d={x:Math.cos(u)*c+Math.sin(u)*h,y:-Math.sin(u)*c+Math.cos(u)*h},f=Math.pow(d.x,2)/Math.pow(t,2)+Math.pow(d.y,2)/Math.pow(n,2);f>1&&(t*=Math.sqrt(f),n*=Math.sqrt(f));var v=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(d.y,2)-Math.pow(n,2)*Math.pow(d.x,2),p=Math.pow(t,2)*Math.pow(d.y,2)+Math.pow(n,2)*Math.pow(d.x,2),x=v/p;x=x<0?0:x;var A=(a!==s?1:-1)*Math.sqrt(x),N={x:A*(t*d.y/n),y:A*(-(n*d.x)/t)},I={x:Math.cos(u)*N.x-Math.sin(u)*N.y+(e.x+o.x)/2,y:Math.sin(u)*N.x+Math.cos(u)*N.y+(e.y+o.y)/2},K={x:(d.x-N.x)/t,y:(d.y-N.y)/n},W=nc({x:1,y:0},K),z={x:(-d.x-N.x)/t,y:(-d.y-N.y)/n},j=nc(K,z);!s&&j>0?j-=2*Math.PI:s&&j<0&&(j+=2*Math.PI),j%=2*Math.PI;var Z=W+j*l,vt=t*Math.cos(Z),Tt=n*Math.sin(Z),zt={x:Math.cos(u)*vt-Math.sin(u)*Tt+I.x,y:Math.sin(u)*vt+Math.cos(u)*Tt+I.y,ellipticalArcStartAngle:W,ellipticalArcEndAngle:W+j,ellipticalArcAngle:Z,ellipticalArcCenter:I,resultantRx:t,resultantRy:n};return zt};function Fh(r){for(var e=[],t=null,n=null,i=null,a=0,s=r.length,o=0;o<s;o++){var l=r[o];n=r[o+1];var u=l[0],c={command:u,prePoint:t,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(u){case"M":i=[l[1],l[2]],a=o;break;case"A":var h=Hl(t,l);c.arcParams=h;break}if(u==="Z")t=i,n=r[a+1];else{var d=l.length;t=[l[d-2],l[d-1]]}n&&n[0]==="Z"&&(n=r[a],e[a]&&(e[a].prePoint=t)),c.currentPoint=t,e[a]&&Vl(t,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var f=n?[n[n.length-2],n[n.length-1]]:null;c.nextPoint=f;var v=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[v[0]-t[0],v[1]-t[1]],c.endTangent=[t[0]-v[0],t[1]-v[1]];else if(u==="Q"){var p=[l[1],l[2]];c.startTangent=[v[0]-p[0],v[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]}else if(u==="T"){var x=e[o-1],A=wa(x.currentPoint,v);x.command==="Q"?(c.command="Q",c.startTangent=[v[0]-A[0],v[1]-A[1]],c.endTangent=[t[0]-A[0],t[1]-A[1]]):(c.command="TL",c.startTangent=[v[0]-t[0],v[1]-t[1]],c.endTangent=[t[0]-v[0],t[1]-v[1]])}else if(u==="C"){var N=[l[1],l[2]],I=[l[3],l[4]];c.startTangent=[v[0]-N[0],v[1]-N[1]],c.endTangent=[t[0]-I[0],t[1]-I[1]],c.startTangent[0]===0&&c.startTangent[1]===0&&(c.startTangent=[N[0]-I[0],N[1]-I[1]]),c.endTangent[0]===0&&c.endTangent[1]===0&&(c.endTangent=[I[0]-N[0],I[1]-N[1]])}else if(u==="S"){var K=e[o-1],W=wa(K.currentPoint,v),z=[l[1],l[2]];K.command==="C"?(c.command="C",c.startTangent=[v[0]-W[0],v[1]-W[1]],c.endTangent=[t[0]-z[0],t[1]-z[1]]):(c.command="SQ",c.startTangent=[v[0]-z[0],v[1]-z[1]],c.endTangent=[t[0]-z[0],t[1]-z[1]])}else if(u==="A"){var j=Bh(c,0),Z=j.x,vt=j.y,Tt=Bh(c,1,!1),zt=Tt.x,Qt=Tt.y;c.startTangent=[Z,vt],c.endTangent=[zt,Qt]}e.push(c)}return e}function Bh(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=r.arcParams,i=n.rx,a=i===void 0?0:i,s=n.ry,o=s===void 0?0:s,l=n.xRotation,u=n.arcFlag,c=n.sweepFlag,h=hg({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!u,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},e),d=hg({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!u,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},t?e+.005:e-.005),f=d.x-h.x,v=d.y-h.y,p=Math.sqrt(f*f+v*v);return{x:-f/p,y:-v/p}}function sl(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function ds(r,e){return sl(r)*sl(e)?(r[0]*e[0]+r[1]*e[1])/(sl(r)*sl(e)):1}function rc(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(ds(r,e))}function Hl(r,e){var t=e[1],n=e[2],i=(0,ut.Z)(qn(e[3]),Math.PI*2),a=e[4],s=e[5],o=r[0],l=r[1],u=e[6],c=e[7],h=Math.cos(i)*(o-u)/2+Math.sin(i)*(l-c)/2,d=-1*Math.sin(i)*(o-u)/2+Math.cos(i)*(l-c)/2,f=h*h/(t*t)+d*d/(n*n);f>1&&(t*=Math.sqrt(f),n*=Math.sqrt(f));var v=t*t*(d*d)+n*n*(h*h),p=v?Math.sqrt((t*t*(n*n)-v)/v):1;a===s&&(p*=-1),isNaN(p)&&(p=0);var x=n?p*t*d/n:0,A=t?p*-n*h/t:0,N=(o+u)/2+Math.cos(i)*x-Math.sin(i)*A,I=(l+c)/2+Math.sin(i)*x+Math.cos(i)*A,K=[(h-x)/t,(d-A)/n],W=[(-1*h-x)/t,(-1*d-A)/n],z=rc([1,0],K),j=rc(K,W);return ds(K,W)<=-1&&(j=Math.PI),ds(K,W)>=1&&(j=0),s===0&&j>0&&(j-=2*Math.PI),s===1&&j<0&&(j+=2*Math.PI),{cx:N,cy:I,rx:Vl(r,[u,c])?0:t,ry:Vl(r,[u,c])?0:n,startAngle:z,endAngle:z+j,xRotation:i,arcFlag:a,sweepFlag:s}}function dg(r,e,t){return r.reduce(function(n,i){var a="";if(i[0]==="M"||i[0]==="L"){var s=vec3.fromValues(i[1],i[2],0);t&&vec3.transformMat4(s,s,t),a="".concat(i[0]).concat(s[0],",").concat(s[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var o=vec3.fromValues(i[1],i[2],0),l=vec3.fromValues(i[3],i[4],0),u=vec3.fromValues(i[5],i[6],0);t&&(vec3.transformMat4(o,o,t),vec3.transformMat4(l,l,t),vec3.transformMat4(u,u,t)),a="".concat(i[0]).concat(o[0],",").concat(o[1],",").concat(l[0],",").concat(l[1],",").concat(u[0],",").concat(u[1])}else if(i[0]==="A"){var c=vec3.fromValues(i[6],i[7],0);t&&vec3.transformMat4(c,c,t),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(c[0],",").concat(c[1])}else if(i[0]==="Q"){var h=vec3.fromValues(i[1],i[2],0),d=vec3.fromValues(i[3],i[4],0);t&&(vec3.transformMat4(h,h,t),vec3.transformMat4(d,d,t)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return n+=a},"")}function fg(r,e,t,n){return[["M",r,e],["L",t,n]]}function zh(r,e,t,n){var i=(-1+Math.sqrt(2))/3*4,a=r*i,s=e*i,o=t-r,l=t+r,u=n-e,c=n+e;return[["M",o,n],["C",o,n-s,t-a,u,t,u],["C",t+a,u,l,n-s,l,n],["C",l,n+s,t+a,c,t,c],["C",t-a,c,o,n+s,o,n],["Z"]]}function jh(r,e){var t=r.map(function(n,i){return[i===0?"M":"L",n[0],n[1]]});return e&&t.push(["Z"]),t}function vg(r,e,t,n,i){if(i){var a=_slicedToArray(i,4),s=a[0],o=a[1],l=a[2],u=a[3],c=r>0?1:-1,h=e>0?1:-1,d=c+h!==0?1:0;return[["M",c*s+t,n],["L",r-c*o+t,n],o?["A",o,o,0,0,d,r+t,h*o+n]:null,["L",r+t,e-h*l+n],l?["A",l,l,0,0,d,r+t-c*l,e+n]:null,["L",t+c*u,e+n],u?["A",u,u,0,0,d,t,e+n-h*u]:null,["L",t,h*s+n],s?["A",s,s,0,0,d,c*s+t,n]:null,["Z"]].filter(function(f){return f})}return[["M",t,n],["L",t+r,n],["L",t+r,n+e],["L",t,n+e],["Z"]]}function Vm(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.getLocalTransform(),t=[];switch(r.nodeName){case he.LINE:var n=r.parsedStyle,i=n.x1,a=i===void 0?0:i,s=n.y1,o=s===void 0?0:s,l=n.x2,u=l===void 0?0:l,c=n.y2,h=c===void 0?0:c;t=fg(a,o,u,h);break;case he.CIRCLE:{var d=r.parsedStyle,f=d.r,v=f===void 0?0:f,p=d.cx,x=p===void 0?0:p,A=d.cy,N=A===void 0?0:A;t=zh(v,v,x,N);break}case he.ELLIPSE:{var I=r.parsedStyle,K=I.rx,W=K===void 0?0:K,z=I.ry,j=z===void 0?0:z,Z=I.cx,vt=Z===void 0?0:Z,Tt=I.cy,zt=Tt===void 0?0:Tt;t=zh(W,j,vt,zt);break}case he.POLYLINE:case he.POLYGON:var Qt=r.parsedStyle.points;t=jh(Qt.points,r.nodeName===he.POLYGON);break;case he.RECT:var ae=r.parsedStyle,fe=ae.width,ce=fe===void 0?0:fe,ct=ae.height,$=ct===void 0?0:ct,Q=ae.x,It=Q===void 0?0:Q,ue=ae.y,le=ue===void 0?0:ue,Fe=ae.radius,Qe=Fe&&Fe.some(function(tn){return tn!==0});t=vg(ce,$,It,le,Qe&&Fe.map(function(tn){return clamp(tn,0,Math.min(Math.abs(ce)/2,Math.abs($)/2))}));break;case he.PATH:var He=r.parsedStyle.d.absolutePath;t=_toConsumableArray(He);break}if(t.length)return dg(t,r,e)}function gg(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=r.map(function(s,o){var l=s[0],u=r[o+1],c=o===0&&(e!==0||t!==0),h=(o===r.length-1||u&&(u[0]==="M"||u[0]==="Z"))&&n!==0&&i!==0,d=c?[e,t]:[0,0],f=_slicedToArray(d,2),v=f[0],p=f[1],x=h?[n,i]:[0,0],A=_slicedToArray(x,2),N=A[0],I=A[1];switch(l){case"M":return"M ".concat(s[1]+v,",").concat(s[2]+p);case"L":return"L ".concat(s[1]+N,",").concat(s[2]+I);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+N," ").concat(s[4]+I);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+N," ").concat(s[6]+I);case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]+N," ").concat(s[7]+I);case"Z":return"Z";default:return null}}).filter(function(s){return s!==null}).join(" ");return~a.indexOf("NaN")?"":a}var ic=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=(0,Vt.A)(e)}catch(f){t=(0,Vt.A)(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}ug(t);var n=cg(t),i=Ih(t),a=i.polygons,s=i.polylines,o=Fh(t),l=Yl(o,0),u=l.x,c=l.y,h=l.width,d=l.height;return{absolutePath:t,hasArc:n,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(h)?h:0,height:Number.isFinite(d)?d:0}}},pg=Pi(ic);function ol(r){return(0,Gt.Z)(r)?pg(r):ic(r)}function Xl(r,e,t){var n=r.curve,i=e.curve;(!n||n.length===0)&&(n=(0,ve.Y)(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=(0,ve.Y)(e.absolutePath,!1),e.curve=i);var a=[n,i];n.length!==i.length&&(a=(0,kt.x)(n,i));var s=(0,ee.b)(a[0])!==(0,ee.b)(a[1])?(0,me.G)(a[0]):(0,Nt.U)(a[0]);return[s,(0,Zt.g)(a[1],s),function(o){return o}]}function mg(r,e){var t;return(0,Gt.Z)(r)?t=r.split(" ").map(function(n){var i=n.split(","),a=re(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):t=r,{points:t,totalLength:0,segments:[]}}function Gh(r,e){return[r.points,e.points,function(t){return t}]}var Yr=null,no=/\s*(\w+)\(([^)]*)\)/g;function Yi(r){return function(e){var t=0;return r.map(function(n){return n===Yr?e[t++]:n})}}function Ds(r){return r}var ll={matrix:["NNNNNN",[Yr,Yr,0,0,Yr,Yr,0,0,0,0,1,0,Yr,Yr,0,1],Ds],matrix3d:["NNNNNNNNNNNNNNNN",Ds],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Yi([Yr,Yr,new Ar(1)]),Ds],scaleX:["N",Yi([Yr,new Ar(1),new Ar(1)]),Yi([Yr,new Ar(1)])],scaleY:["N",Yi([new Ar(1),Yr,new Ar(1)]),Yi([new Ar(1),Yr])],scaleZ:["N",Yi([new Ar(1),new Ar(1),Yr])],scale3d:["NNN",Ds],skew:["Aa",null,Ds],skewX:["A",null,Yi([Yr,Ya])],skewY:["A",null,Yi([Ya,Yr])],translate:["Tt",Yi([Yr,Yr,Va]),Ds],translateX:["T",Yi([Yr,Va,Va]),Yi([Yr,Va])],translateY:["T",Yi([Va,Yr,Va]),Yi([Va,Yr])],translateZ:["L",Yi([Va,Va,Yr])],translate3d:["TTL",Ds]};function Wh(r){for(var e=[],t=r.length,n=0;n<t;n++){var i=r[n],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=ll[a];if(!o)return[];var l=s.map(function(u){return Lr(u)});e.push({t:a,d:l})}return e}function Uh(r){if(Array.isArray(r))return Wh(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(no.lastIndex=0;t=no.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=ll[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],u=0;u<o.length;u++){var c=s[u],h=o[u],d=void 0;if(c?d={A:function(v){return v.trim()==="0"?Ya:ag(v)},N:qu,T:Ju,L:ig}[h.toUpperCase()](c):d={a:Ya,n:l[0],t:Va}[h],d===void 0)return[];l.push(d)}if(e.push({t:i,d:l}),no.lastIndex===r.length)return e}return[]}function yg(r){if(Array.isArray(r))return Wh(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(no.lastIndex=0;t=no.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=ll[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],u=0;u<o.length;u++){var c=s[u],h=o[u],d=void 0;if(c?d={A:function(v){return v.trim()==="0"?Ya:Ah(v)},N:Lh,T:Oh,L:Ul}[h.toUpperCase()](c):d={a:Ya,n:l[0],t:Va}[h],d===void 0)return[];l.push(d)}if(e.push({t:i,d:l}),no.lastIndex===r.length)return e}return[]}function bg(r){var e,t,n,i;switch(r.t){case"rotateX":return i=qn(Vi(r.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=qn(Vi(r.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=qn(Vi(r.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=r.d[0].value,t=r.d[1].value,n=r.d[2].value,i=qn(Vi(r.d[3]));var a=e*e+t*t+n*n;if(a===0)e=1,t=0,n=0;else if(a!==1){var s=Math.sqrt(a);e/=s,t/=s,n/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),u=o*o;return[1-2*(t*t+n*n)*u,2*(e*t*u+n*l),2*(e*n*u-t*l),0,2*(e*t*u-n*l),1-2*(e*e+n*n)*u,2*(t*n*u+e*l),0,2*(e*n*u+t*l),2*(t*n*u-e*l),1-2*(e*e+t*t)*u,0,0,0,0,1];case"scale":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[r.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,r.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,r.d[0].value,0,0,0,0,1];case"scale3d":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,r.d[2].value,0,0,0,0,1];case"skew":var c=qn(Vi(r.d[0])),h=qn(Vi(r.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=qn(Vi(r.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=qn(Vi(r.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return e=Ji(r.d[0],0,null)||0,t=Ji(r.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,0,1];case"translateX":return e=Ji(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,0,0,1];case"translateY":return t=Ji(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,t,0,1];case"translateZ":return n=Ji(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n,1];case"translate3d":return e=Ji(r.d[0],0,null)||0,t=Ji(r.d[1],0,null)||0,n=Ji(r.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1];case"perspective":var d=Ji(r.d[0],0,null)||0,f=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,f,0,0,0,1];case"matrix":return[r.d[0].value,r.d[1].value,0,0,r.d[2].value,r.d[3].value,0,0,0,0,1,0,r.d[4].value,r.d[5].value,0,1];case"matrix3d":return r.d.map(function(v){return v.value})}}function Ym(r,e){return[r[0]*e[0]+r[4]*e[1]+r[8]*e[2]+r[12]*e[3],r[1]*e[0]+r[5]*e[1]+r[9]*e[2]+r[13]*e[3],r[2]*e[0]+r[6]*e[1]+r[10]*e[2]+r[14]*e[3],r[3]*e[0]+r[7]*e[1]+r[11]*e[2]+r[15]*e[3],r[0]*e[4]+r[4]*e[5]+r[8]*e[6]+r[12]*e[7],r[1]*e[4]+r[5]*e[5]+r[9]*e[6]+r[13]*e[7],r[2]*e[4]+r[6]*e[5]+r[10]*e[6]+r[14]*e[7],r[3]*e[4]+r[7]*e[5]+r[11]*e[6]+r[15]*e[7],r[0]*e[8]+r[4]*e[9]+r[8]*e[10]+r[12]*e[11],r[1]*e[8]+r[5]*e[9]+r[9]*e[10]+r[13]*e[11],r[2]*e[8]+r[6]*e[9]+r[10]*e[10]+r[14]*e[11],r[3]*e[8]+r[7]*e[9]+r[11]*e[10]+r[15]*e[11],r[0]*e[12]+r[4]*e[13]+r[8]*e[14]+r[12]*e[15],r[1]*e[12]+r[5]*e[13]+r[9]*e[14]+r[13]*e[15],r[2]*e[12]+r[6]*e[13]+r[10]*e[14]+r[14]*e[15],r[3]*e[12]+r[7]*e[13]+r[11]*e[14]+r[15]*e[15]]}function H(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(bg).reduce(Ym)}function D(r){var e=[0,0,0],t=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return Cm(H(r),e,t,n,i,a),[[e,t,n,a,i]]}var G=function(){function r(n,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var l=0;l<4;l++)a[s][o]+=i[s][l]*n[l][o];return a}function e(n){return n[0][2]===0&&n[0][3]===0&&n[1][2]===0&&n[1][3]===0&&n[2][0]===0&&n[2][1]===0&&n[2][2]===1&&n[2][3]===0&&n[3][2]===0&&n[3][3]===1}function t(n,i,a,s,o){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=0;u<4;u++)l[u][3]=o[u];for(var c=0;c<3;c++)for(var h=0;h<3;h++)l[3][c]+=n[h]*l[h][c];var d=s[0],f=s[1],v=s[2],p=s[3],x=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];x[0][0]=1-2*(f*f+v*v),x[0][1]=2*(d*f-v*p),x[0][2]=2*(d*v+f*p),x[1][0]=2*(d*f+v*p),x[1][1]=1-2*(d*d+v*v),x[1][2]=2*(f*v-d*p),x[2][0]=2*(d*v-f*p),x[2][1]=2*(f*v+d*p),x[2][2]=1-2*(d*d+f*f),l=r(l,x);var A=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(A[2][1]=a[2],l=r(l,A)),a[1]&&(A[2][1]=0,A[2][0]=a[0],l=r(l,A)),a[0]&&(A[2][0]=0,A[1][0]=a[0],l=r(l,A));for(var N=0;N<3;N++)for(var I=0;I<3;I++)l[N][I]*=i[N];return e(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return t}();function X(r){return r.toFixed(6).replace(".000000","")}function lt(r,e){var t,n;return r.decompositionPair!==e&&(r.decompositionPair=e,t=D(r)),e.decompositionPair!==r&&(e.decompositionPair=r,n=D(e)),t[0]===null||n[0]===null?[[!1],[!0],function(i){return i?e[0].d:r[0].d}]:(t[0].push(0),n[0].push(1),[t,n,function(i){var a=Mt(t[0][3],n[0][3],i[5]),s=G(i[0],i[1],i[2],a,i[4]),o=s.map(X).join(",");return o}])}function ft(r,e){for(var t=0,n=0;n<r.length;n++)t+=r[n]*e[n];return t}function Mt(r,e,t){var n=ft(r,e);n=(0,Kt.Z)(n,-1,1);var i=[];if(n===1)i=r;else for(var a=Math.acos(n),s=Math.sin(t*a)*1/Math.sqrt(1-n*n),o=0;o<4;o++)i.push(r[o]*(Math.cos(t*a)-n*s)+e[o]*s);return i}function se(r){return r.replace(/[XY]/,"")}function de(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var pe=function(e,t){return e==="perspective"&&t==="perspective"||(e==="matrix"||e==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function ke(r,e,t){var n=!1;if(!r.length||!e.length){r.length||(n=!0,r=e,e=[]);for(var i=function(){var zt=r[a],Qt=zt.t,ae=zt.d,fe=Qt.substring(0,5)==="scale"?1:0;e.push({t:Qt,d:ae.map(function(ce){return typeof ce=="number"?Lr(fe):Lr(fe,ce.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],l=[];if(r.length!==e.length){var u=lt(r,e);s=[u[0]],o=[u[1]],l=[["matrix",[u[2]]]]}else for(var c=0;c<r.length;c++){var h=r[c].t,d=e[c].t,f=r[c].d,v=e[c].d,p=ll[h],x=ll[d],A=void 0;if(pe(h,d)){var N=lt([r[c]],[e[c]]);s.push(N[0]),o.push(N[1]),l.push(["matrix",[N[2]]]);continue}else if(h===d)A=h;else if(p[2]&&x[2]&&se(h)===se(d))A=se(h),f=p[2](f),v=x[2](v);else if(p[1]&&x[1]&&de(h)===de(d))A=de(h),f=p[1](f),v=x[1](v);else{var I=lt(r,e);s=[I[0]],o=[I[1]],l=[["matrix",[I[2]]]];break}for(var K=[],W=[],z=[],j=0;j<f.length;j++){var Z=Ch(f[j],v[j],t,!1,j);K[j]=Z[0],W[j]=Z[1],z.push(Z[2])}s.push(K),o.push(W),l.push([A,z])}if(n){var vt=s;s=o,o=vt}return[s,o,function(Tt){return Tt.map(function(zt,Qt){var ae=zt.map(function(fe,ce){return l[Qt][1][ce](fe)}).join(",");return l[Qt][0]==="matrix"&&ae.split(",").length===16&&(l[Qt][0]="matrix3d"),l[Qt][0]==="matrix3d"&&ae.split(",").length===6&&(l[Qt][0]="matrix"),"".concat(l[Qt][0],"(").concat(ae,")")}).join(" ")}]}var Te=Pi(function(r){if((0,Gt.Z)(r)){if(r==="text-anchor")return[Lr(0,"px"),Lr(0,"px")];var e=r.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Ju(Ie(e[0])),Ju(Ie(e[1]))]}return[Lr(r[0]||0,"px"),Lr(r[1]||0,"px")]});function Ie(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var De=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:qe.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:qe.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:qe.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:qe.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:qe.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:qe.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:qe.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:qe.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:qe.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:qe.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:qe.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:qe.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:qe.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:qe.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:qe.FILTER},{n:"clipPath",syntax:qe.DEFINED_PATH},{n:"textPath",syntax:qe.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:qe.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:qe.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:qe.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:qe.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:qe.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:qe.COORDINATE},{n:"y1",int:!0,l:!0,syntax:qe.COORDINATE},{n:"z1",int:!0,l:!0,syntax:qe.COORDINATE},{n:"x2",int:!0,l:!0,syntax:qe.COORDINATE},{n:"y2",int:!0,l:!0,syntax:qe.COORDINATE},{n:"z2",int:!0,l:!0,syntax:qe.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:qe.PATH,p:50},{n:"points",int:!0,l:!0,syntax:qe.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:qe.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:qe.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:qe.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:qe.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:qe.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:qe.NUMBER,d:function(e){return e===he.PATH||e===he.POLYGON||e===he.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:qe.MARKER},{n:"markerEnd",syntax:qe.MARKER},{n:"markerMid",syntax:qe.MARKER},{n:"markerStartOffset",syntax:qe.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:qe.LENGTH,l:!0,int:!0,d:"0"}],Ge=new Set(De.filter(function(r){return!!r.l}).map(function(r){return r.n})),Ze={},We=function(){function r(e){var t=this;E(this,r),this.runtime=e,De.forEach(function(n){t.registerMetadata(n)})}return _(r,[{key:"registerMetadata",value:function(t){[t.n].concat(xt(t.a||[])).forEach(function(n){Ze[n]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,n);var a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;$e(t,n);var o=!!i.forceUpdateGeometry;if(!o){for(var l in n)if(Ge.has(l)){o=!0;break}}n.fill&&(t.parsedStyle.fill=eo(n.fill)),n.stroke&&(t.parsedStyle.stroke=eo(n.stroke)),n.shadowColor&&(t.parsedStyle.shadowColor=eo(n.shadowColor)),n.filter&&(t.parsedStyle.filter=og(n.filter)),(0,be.Z)(n.radius)||(t.parsedStyle.radius=Ph(n.radius,4)),(0,be.Z)(n.lineDash)||(t.parsedStyle.lineDash=Ph(n.lineDash,2)),n.points&&(t.parsedStyle.points=mg(n.points)),n.d===""&&(t.parsedStyle.d=b({},jl)),n.d&&(t.parsedStyle.d=ol(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[qe.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},t,null),(0,Yt.Z)(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[qe.DEFINED_PATH].calculator("clipPath",a,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[qe.DEFINED_PATH].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.transform&&(t.parsedStyle.transform=Uh(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=Te(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[qe.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[qe.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[qe.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),(0,be.Z)(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[qe.Z_INDEX].postProcessor(t),(0,be.Z)(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[qe.OFFSET_DISTANCE].postProcessor(t),n.transform&&this.runtime.CSSPropertySyntaxFactory[qe.TRANSFORM].postProcessor(t),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[qe.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var n=t.nodeName,i=this.runtime.geometryUpdaterFactory[n];if(i){var a=t.geometry;a.contentBounds||(a.contentBounds=new Ln),a.renderBounds||(a.renderBounds=new Ln);var s=t.parsedStyle,o=i.update(s,t),l=o.cx,u=l===void 0?0:l,c=o.cy,h=c===void 0?0:c,d=o.cz,f=d===void 0?0:d,v=o.hwidth,p=v===void 0?0:v,x=o.hheight,A=x===void 0?0:x,N=o.hdepth,I=N===void 0?0:N,K=[Math.abs(p),Math.abs(A),I],W=s.stroke,z=s.lineWidth,j=z===void 0?1:z,Z=s.increasedLineWidthForHitTesting,vt=Z===void 0?0:Z,Tt=s.shadowType,zt=Tt===void 0?"outer":Tt,Qt=s.shadowColor,ae=s.filter,fe=ae===void 0?[]:ae,ce=s.transformOrigin,ct=[u,h,f];a.contentBounds.update(ct,K);var $=n===he.POLYLINE||n===he.POLYGON||n===he.PATH?Math.SQRT2:.5,Q=W&&!W.isNone;if(Q){var It=((j||0)+(vt||0))*$;K[0]+=It,K[1]+=It}if(a.renderBounds.update(ct,K),Qt&&zt&&zt!=="inner"){var ue=a.renderBounds,le=ue.min,Fe=ue.max,Qe=s.shadowBlur,He=s.shadowOffsetX,tn=s.shadowOffsetY,vn=Qe||0,_n=He||0,kr=tn||0,Rr=le[0]-vn+_n,Ps=Fe[0]+vn+_n,Fl=le[1]-vn+kr,ja=Fe[1]+vn+kr;le[0]=Math.min(le[0],Rr),Fe[0]=Math.max(Fe[0],Ps),le[1]=Math.min(le[1],Fl),Fe[1]=Math.max(Fe[1],ja),a.renderBounds.setMinMax(le,Fe)}fe.forEach(function(ch){var hh=ch.name,Eo=ch.params;if(hh==="blur"){var dh=Eo[0].value;a.renderBounds.update(a.renderBounds.center,et.IH(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[dh,dh,0]))}else if(hh==="drop-shadow"){var fh=Eo[0].value,vh=Eo[1].value,wo=Eo[2].value,gh=a.renderBounds,oa=gh.min,la=gh.max,wm=oa[0]-wo+fh,Sm=la[0]+wo+fh,_m=oa[1]-wo+vh,Mm=la[1]+wo+vh;oa[0]=Math.min(oa[0],wm),la[0]=Math.max(la[0],Sm),oa[1]=Math.min(oa[1],_m),la[1]=Math.max(la[1],Mm),a.renderBounds.setMinMax(oa,la)}}),t.geometry.dirty=!1;var xo=p<0,Em=A<0,lh=(xo?-1:1)*(ce?Ji(ce[0],0,t,!0):0),uh=(Em?-1:1)*(ce?Ji(ce[1],1,t,!0):0);(lh||uh)&&t.setOrigin(lh,uh)}}},{key:"updateSizeAttenuation",value:function(t,n){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/n,t.nodeName===he.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/n)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===he.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function $e(r,e){if(!Ke.enableMassiveParsedStyleAssignOptimization){Object.assign(r.parsedStyle,e);return}var t=r.constructor.PARSED_STYLE_LIST;for(var n in e)t.has(n)&&(r.parsedStyle[n]=e[n])}var fn=function(){function r(){E(this,r),this.mixer=tc}return _(r,[{key:"calculator",value:function(t,n,i,a){return Vi(i)}}])}(),dn=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i,a,s){return i instanceof Ea&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(t,n,i,a),t==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtifyToRoot(o)}),i}}])}(),xn=function(){function r(){E(this,r),this.parser=eo,this.mixer=Zm}return _(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Ea?i.value==="none"?Sh:_h:i}}])}(),wn=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i){return i instanceof Ea?[]:i}}])}();function Mn(r){var e=r.parsedStyle,t=e.fontSize;return(0,be.Z)(t)?null:t}var zn=function(){function r(){E(this,r),this.mixer=tc}return _(r,[{key:"calculator",value:function(t,n,i,a,s){if((0,bt.Z)(i))return i;if(Ar.isRelativeUnit(i.unit)){if(i.unit===ln.kPercentage)return 0;if(i.unit===ln.kEms){if(a.parentNode){var o=Mn(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===ln.kRems){var l;if(a!=null&&(l=a.ownerDocument)!==null&&l!==void 0&&l.documentElement){var u=Mn(a.ownerDocument.documentElement);if(u)return u*=i.value,u}return 0}}else return i.value}}])}(),Fn=function(){function r(){E(this,r),this.mixer=Dh}return _(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])}(),Dn=function(){function r(){E(this,r),this.mixer=Dh}return _(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])}(),Kn=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i,a){var s;i instanceof Ea&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),Yn=function(){function r(){E(this,r),this.mixer=tc}return _(r,[{key:"calculator",value:function(t,n,i){return i.value}}])}(),In=function(){function r(){E(this,r),this.mixer=ec(0,1)}return _(r,[{key:"calculator",value:function(t,n,i){return i.value}},{key:"postProcessor",value:function(t){var n=t.parsedStyle,i=n.offsetPath,a=n.offsetDistance;if(i){var s=i.nodeName;if(s===he.LINE||s===he.PATH||s===he.POLYLINE){var o=i.getPoint(a);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),wr=function(){function r(){E(this,r),this.mixer=ec(0,1)}return _(r,[{key:"calculator",value:function(t,n,i){return i.value}}])}(),rr=function(){function r(){E(this,r),this.parser=ol,this.mixer=Xl}return _(r,[{key:"calculator",value:function(t,n,i){return i instanceof Ea&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Er(0,0,0,0)}:i}}])}(),nr=_(function r(){E(this,r),this.mixer=Gh}),yr=function(r){function e(){var t;E(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=_t(this,e,[].concat(i)),t.mixer=ec(0,1/0),t}return Ot(e,r),_(e)}(zn),br=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Ea?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),cr=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])}(),gn=function(e){return Object.fromEntries(Object.entries(e).filter(function(t){var n=_slicedToArray(t,2),i=n[1];return i!==void 0}))},kn=new WeakMap;function Wn(r,e,t){if(r){var n=typeof r=="string"?document.getElementById(r):r;kn.has(n)&&kn.get(n).destroy(t),kn.set(n,e)}}var Zn=typeof window!="undefined"&&typeof window.document!="undefined";function Vn(r){return!!r.getAttribute}function qr(r,e){for(var t=0,n=r.length;t<n;){var i=t+n>>>1;Ur(r[i],e)<0?t=i+1:n=i}return t}function Ur(r,e){var t=Number(r.parsedStyle.zIndex||0),n=Number(e.parsedStyle.zIndex||0);if(t===n){var i=r.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(r)-a.indexOf(e)}}return t-n}function Ni(r){var e=r;do{var t,n=(t=e.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(n)return e;e=e.parentElement}while(e!==null);return null}var Ri="px";function Li(r,e,t){Zn&&r.style&&(r.style.width=e+Ri,r.style.height=t+Ri)}function fs(r,e){if(Zn)return document.defaultView.getComputedStyle(r,null).getPropertyValue(e)}function Mi(r){var e=fs(r,"width");return e==="auto"?r.offsetWidth:parseFloat(e)}function Is(r){var e=fs(r,"height");return e==="auto"?r.offsetHeight:parseFloat(e)}var ci=1,ul={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ki=typeof performance=="object"&&performance.now?performance:Date;function Fs(r){return r.nodeName===he.FRAGMENT?!0:r.getRootNode().nodeName===he.FRAGMENT}function hi(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=!1,i=!1,a=!!e&&!e.isNone,s=!!t&&!t.isNone;return r==="visiblepainted"||r==="painted"||r==="auto"?(n=a,i=s):r==="visiblefill"||r==="fill"?n=!0:r==="visiblestroke"||r==="stroke"?i=!0:(r==="visible"||r==="all")&&(n=!0,i=!0),[n,i]}var Di=1,_o=function(){return Di++},ii=typeof self=="object"&&self.self===self?self:typeof g.g=="object"&&g.g.global===g.g?g.g:{},Sa=Date.now(),tr=function(){return ii.performance&&typeof ii.performance.now=="function"?ii.performance.now():Date.now()-Sa},hr={},ir=Date.now(),Sr=function(e){if(typeof e!="function")throw new TypeError("".concat(e," is not a function"));var t=Date.now(),n=t-ir,i=n>16?0:16-n,a=_o();return hr[a]=e,Object.keys(hr).length>1||setTimeout(function(){ir=t;var s=hr;hr={},Object.keys(s).forEach(function(o){return s[o](tr())})},i),a},ti=function(e){delete hr[e]},Nn=["","webkit","moz","ms","o"],gr=function(e){return typeof e!="string"?Sr:e===""?ii.requestAnimationFrame:ii["".concat(e,"RequestAnimationFrame")]},_r=function(e){return typeof e!="string"?ti:e===""?ii.cancelAnimationFrame:ii["".concat(e,"CancelAnimationFrame")]||ii["".concat(e,"CancelRequestAnimationFrame")]},bi=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n+=1}},xr=bi(Nn,function(r){return!!gr(r)}),ar=gr(xr),$r=_r(xr);ii.requestAnimationFrame=ar,ii.cancelAnimationFrame=$r;var qi=function(){function r(){E(this,r),this.callbacks=[]}return _(r,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,n){this.callbacks.push(n)}},{key:"promise",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Promise.all(this.callbacks.map(function(a){return a.apply(void 0,n)}))}}])}(),ai=function(){function r(){E(this,r),this.callbacks=[]}return _(r,[{key:"tapPromise",value:function(t,n){this.callbacks.push(n)}},{key:"promise",value:function(){var e=Jt(Wt().mark(function n(){var i,a,s,o,l=arguments;return Wt().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.callbacks.length){c.next=14;break}return c.next=3,(i=this.callbacks)[0].apply(i,l);case 3:a=c.sent,s=0;case 5:if(!(s<this.callbacks.length-1)){c.next=13;break}return o=this.callbacks[s],c.next=9,o(a);case 9:a=c.sent;case 10:s++,c.next=5;break;case 13:return c.abrupt("return",a);case 14:return c.abrupt("return",null);case 15:case"end":return c.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()}])}(),si=function(){function r(){E(this,r),this.callbacks=[]}return _(r,[{key:"tap",value:function(t,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var a=arguments;this.callbacks.forEach(function(s){s.apply(void 0,a)})}}])}(),Bs=function(){function r(){E(this,r),this.callbacks=[]}return _(r,[{key:"tap",value:function(t,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this.callbacks.length){for(var a=arguments,s=this.callbacks[0].apply(void 0,a),o=0;o<this.callbacks.length-1;o++){var l=this.callbacks[o];s=l(s)}return s}return null}}])}(),Ii=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ca=/([\"\'])[^\'\"]+\1/;function Xa(r){for(var e=r.fontSize,t=e===void 0?16:e,n=r.fontFamily,i=n===void 0?"sans-serif":n,a=r.fontStyle,s=a===void 0?"normal":a,o=r.fontVariant,l=o===void 0?"normal":o,u=r.fontWeight,c=u===void 0?"normal":u,h=(0,bt.Z)(t)&&"".concat(t,"px")||"16px",d=i.split(","),f=d.length-1;f>=0;f--){var v=d[f].trim();!ca.test(v)&&Ii.indexOf(v)<0&&(v='"'.concat(v,'"')),d[f]=v}return"".concat(s," ").concat(l," ").concat(c," ").concat(h," ").concat(d.join(","))}function Ka(r,e,t){return yt.identity(r),r[4]=Math.tan(e),r[1]=Math.tan(t),r}var sr=yt.create(),_a=yt.create(),vs={scale:function(e){yt.fromScaling(sr,[e[0].value,e[1].value,1])},scaleX:function(e){yt.fromScaling(sr,[e[0].value,1,1])},scaleY:function(e){yt.fromScaling(sr,[1,e[0].value,1])},scaleZ:function(e){yt.fromScaling(sr,[1,1,e[0].value])},scale3d:function(e){yt.fromScaling(sr,[e[0].value,e[1].value,e[2].value])},translate:function(e){yt.fromTranslation(sr,[e[0].value,e[1].value,0])},translateX:function(e){yt.fromTranslation(sr,[e[0].value,0,0])},translateY:function(e){yt.fromTranslation(sr,[0,e[0].value,0])},translateZ:function(e){yt.fromTranslation(sr,[0,0,e[0].value])},translate3d:function(e){yt.fromTranslation(sr,[e[0].value,e[1].value,e[2].value])},rotate:function(e){yt.fromZRotation(sr,qn(Vi(e[0])))},rotateX:function(e){yt.fromXRotation(sr,qn(Vi(e[0])))},rotateY:function(e){yt.fromYRotation(sr,qn(Vi(e[0])))},rotateZ:function(e){yt.fromZRotation(sr,qn(Vi(e[0])))},rotate3d:function(e){yt.fromRotation(sr,qn(Vi(e[3])),[e[0].value,e[1].value,e[2].value])},skew:function(e){Ka(sr,qn(e[0].value),qn(e[1].value))},skewX:function(e){Ka(sr,qn(e[0].value),0)},skewY:function(e){Ka(sr,0,qn(e[0].value))},matrix:function(e){yt.set(sr,e[0].value,e[1].value,0,0,e[2].value,e[3].value,0,0,0,0,1,0,e[4].value,e[5].value,0,1)},matrix3d:function(e){yt.set.apply(yt,[sr].concat(xt(e.map(function(t){return t.value}))))}},Zh=et.al(1,1,1),xg=et.Ue(),Vh={translate:function(e,t){Ke.sceneGraphService.setLocalScale(e,Zh,!1),Ke.sceneGraphService.setLocalEulerAngles(e,xg,void 0,void 0,!1),Ke.sceneGraphService.setLocalPosition(e,[t[0].value,t[1].value,0],!1),Ke.sceneGraphService.dirtifyLocal(e,e.transformable)}};function Yh(r,e){if(r.length){if(r.length===1&&Vh[r[0].t]){Vh[r[0].t](e,r[0].d);return}for(var t=yt.identity(_a),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=vs[a];o&&(o(s),yt.mul(t,t,sr))}e.setLocalTransform(t)}else e.resetLocalTransform();return e.getLocalTransform()}var ac=function(){function r(){E(this,r),this.parser=yg,this.mixer=ke}return _(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Ea?[]:i}},{key:"postProcessor",value:function(t){Yh(t.parsedStyle.transform,t)}}])}(),Hh=function(){function r(){E(this,r)}return _(r,[{key:"postProcessor",value:function(t){var n=t.parsedStyle.transformOrigin;n[0].unit===ln.kPixels&&n[1].unit===ln.kPixels?t.setOrigin(n[0].value,n[1].value):t.getGeometryBounds()}}])}(),Eg=function(){function r(){E(this,r)}return _(r,[{key:"calculator",value:function(t,n,i,a){return i.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var n=t.parentNode,i=n.renderable,a=n.sortable;i&&(i.dirty=!0),a&&(a.dirty=!0,a.dirtyReason=Vu.Z_INDEX_CHANGED)}}}])}(),wg=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,l=t.r,u=l===void 0?0:l;return{cx:a,cy:o,hwidth:u,hheight:u}}}])}(),Sg=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,l=t.rx,u=l===void 0?0:l,c=t.ry,h=c===void 0?0:c;return{cx:a,cy:o,hwidth:u,hheight:h}}}])}(),Kl=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t){var n=t.x1,i=t.y1,a=t.x2,s=t.y2,o=Math.min(n,a),l=Math.max(n,a),u=Math.min(i,s),c=Math.max(i,s),h=l-o,d=c-u,f=h/2,v=d/2;return{cx:o+f,cy:u+v,hwidth:f,hheight:v}}}])}(),gs=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t){var n=t.d,i=n.rect,a=i.x,s=i.y,o=i.width,l=i.height,u=o/2,c=l/2;return{cx:a+u,cy:s+c,hwidth:u,hheight:c}}}])}(),$l=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t){if(t.points&&(0,S.Z)(t.points.points)){var n=t.points.points,i=Math.min.apply(Math,xt(n.map(function(d){return d[0]}))),a=Math.max.apply(Math,xt(n.map(function(d){return d[0]}))),s=Math.min.apply(Math,xt(n.map(function(d){return d[1]}))),o=Math.max.apply(Math,xt(n.map(function(d){return d[1]}))),l=a-i,u=o-s,c=l/2,h=u/2;return{cx:i+c,cy:s+h,hwidth:c,hheight:h}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Dr=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,l=t.src,u=t.width,c=u===void 0?0:u,h=t.height,d=h===void 0?0:h,f=c,v=d;return l&&!(0,Gt.Z)(l)&&(f||(f=l.width,t.width=f),v||(v=l.height,t.height=v)),{cx:a+f/2,cy:o+v/2,hwidth:f/2,hheight:v/2}}}])}(),ta=function(){function r(e){E(this,r),this.globalRuntime=e}return _(r,[{key:"isReadyToMeasure",value:function(t,n){var i=t.text;return i}},{key:"update",value:function(t,n){var i,a=t.text,s=t.textAlign,o=s===void 0?"start":s,l=t.lineWidth,u=l===void 0?1:l,c=t.textBaseline,h=c===void 0?"alphabetic":c,d=t.dx,f=d===void 0?0:d,v=t.dy,p=v===void 0?0:v,x=t.x,A=x===void 0?0:x,N=t.y,I=N===void 0?0:N;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var K=(n==null||(i=n.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},W=K.offscreenCanvas,z=this.globalRuntime.textService.measureText(a,t,W);t.metrics=z;var j=z.width,Z=z.height,vt=j/2,Tt=Z/2,zt=A+vt;o==="center"||o==="middle"?zt+=u/2-vt:(o==="right"||o==="end")&&(zt+=u-vt*2);var Qt=I-Tt;return h==="middle"?Qt+=Tt:h==="top"||h==="hanging"?Qt+=Tt*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&(Qt+=0),f&&(zt+=f),p&&(Qt+=p),{cx:zt,cy:Qt,hwidth:vt,hheight:Tt}}}])}(),gi=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t,n){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),$a=function(){function r(){E(this,r)}return _(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,l=t.width,u=l===void 0?0:l,c=t.height,h=c===void 0?0:c;return{cx:a+u/2,cy:o+h/2,hwidth:u/2,hheight:h/2}}}])}();function Mo(r){return!!r.type}var cl=function(){function r(e){E(this,r),this.eventPhase=r.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ye,this.page=new Ye,this.canvas=new Ye,this.viewport=new Ye,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return _(r,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Cn)}}])}(),sc=function(r){function e(){var t;E(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=_t(this,e,[].concat(i)),t.client=new Ye,t.movement=new Ye,t.offset=new Ye,t.global=new Ye,t.screen=new Ye,t}return Ot(e,r),_(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)}},{key:"initMouseEvent",value:function(){throw new Error(Cn)}}])}(cl),ko=function(r){function e(){var t;E(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=_t(this,e,[].concat(i)),t.width=0,t.height=0,t.isPrimary=!1,t}return Ot(e,r),_(e,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(sc),Ql=function(r){function e(){return E(this,e),_t(this,e,arguments)}return Ot(e,r),_(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(sc),Si=function(r){function e(t,n){var i;return E(this,e),i=_t(this,e,[null]),i.type=t,i.detail=n,Object.assign(i,n),i}return Ot(e,r),_(e)}(cl),oc=new WeakMap,Hm=function(){function r(){E(this,r),this.emitter=new Ee.Z}return _(r,[{key:"on",value:function(t,n,i){return this.addEventListener(t,n,i),this}},{key:"addEventListener",value:function(t,n,i){var a=!1,s=!1;if((0,Y.Z)(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var l=i.once;s=l===void 0?!1:l}a&&(t+="capture"),n=(0,At.Z)(n)?n:n.handleEvent;var u=(0,At.Z)(n)?void 0:n;return s?this.emitter.once(t,n,u):this.emitter.on(t,n,u),this}},{key:"off",value:function(t,n,i){return t?this.removeEventListener(t,n,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;(t=this.emitter)===null||t===void 0||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,n,i){var a;if(!this.emitter)return this;var s=(0,Y.Z)(i)?i:i==null?void 0:i.capture;s&&(t+="capture"),n=(0,At.Z)(n)?n:(a=n)===null||a===void 0?void 0:a.handleEvent;var o=(0,At.Z)(n)?void 0:n;return this.emitter.off(t,n,o),this}},{key:"emit",value:function(t,n){this.dispatchEvent(new Si(t,n))}},{key:"dispatchEvent",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=oc.get(this);if(!i){var a;this.document?i=this:this.defaultView?i=this.defaultView:i=(a=this.ownerDocument)===null||a===void 0?void 0:a.defaultView,i&&oc.set(this,i)}if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),ei=function(r){function e(){var t;E(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=_t(this,e,[].concat(i)),t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return Ot(e,r),_(e,[{key:"textContent",get:function(){var n="";this.nodeName===he.TEXT&&(n+=this.style.text);var i=qt(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===he.TEXT?n+=s.nodeValue:n+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return n},set:function(n){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===he.TEXT&&(this.style.text="".concat(n))}},{key:"getRootNode",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(n){throw new Error(Cn)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(Cn)}},{key:"lookupPrefix",value:function(n){throw new Error(Cn)}},{key:"normalize",value:function(){throw new Error(Cn)}},{key:"isEqualNode",value:function(n){return this===n}},{key:"isSameNode",value:function(n){return this.isEqualNode(n)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(n){if(n===this)return 0;for(var i=n,a=this,s=[i],o=[a];(l=i.parentNode)!==null&&l!==void 0?l:a.parentNode;){var l;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var u=s.length>o.length?s:o,c=u===s?o:s;if(u[u.length-c.length]===c[0])return u===s?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var h=u.length-c.length,d=c.length-1;d>=0;d--){var f=c[d],v=u[h+d];if(v!==f){var p=f.parentNode.childNodes;return p.indexOf(f)<p.indexOf(v)?c===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:u===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(n){return this.contains(n)}},{key:"contains",value:function(n){for(var i=n;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(n){for(var i=this;n>0&&i;)i=i.parentNode,n--;return i}},{key:"forEach",value:function(n){for(var i=[this];i.length>0;){var a=i.pop(),s=n(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(n){return!!n.childNodes}}])}(Hm);ei.DOCUMENT_POSITION_DISCONNECTED=1,ei.DOCUMENT_POSITION_PRECEDING=2,ei.DOCUMENT_POSITION_FOLLOWING=4,ei.DOCUMENT_POSITION_CONTAINS=8,ei.DOCUMENT_POSITION_CONTAINED_BY=16,ei.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var D2=2048,I2=function(){function r(e,t){var n=this;E(this,r),this.emitter=new Ee.Z,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=yt.create(),this.tmpVec3=et.Ue(),this.onPointerDown=function(i){var a=n.createPointerEvent(i);if(n.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")n.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var s=a.button===2;n.dispatchEvent(a,s?"rightdown":"mousedown")}var o=n.trackingData(i.pointerId);o.pressTargetsByButton[i.button]=a.composedPath(),n.freeEvent(a)},this.onPointerUp=function(i){var a=ki.now(),s=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(s,"pointerup"),s.pointerType==="touch")n.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;n.dispatchEvent(s,o?"rightup":"mouseup")}var l=n.trackingData(i.pointerId),u=n.findMountedTarget(l.pressTargetsByButton[i.button]),c=u;if(u&&!s.composedPath().includes(u)){for(var h=u;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,n.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")n.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var d=s.button===2;n.notifyTarget(s,d?"rightupoutside":"mouseupoutside")}ei.isNode(h)&&(h=h.parentNode)}delete l.pressTargetsByButton[i.button],c=h}if(c){var f,v=n.clonePointerEvent(s,"click");v.target=c,v.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:v.target,timeStamp:a});var p=n.context.renderingContext.root.ownerDocument.defaultView,x=l.clicksByButton[i.button];x.target===v.target&&a-x.timeStamp<p.dblClickSpeed?++x.clickCount:x.clickCount=1,x.target=v.target,x.timeStamp=a,v.detail=x.clickCount,(f=s.detail)!==null&&f!==void 0&&f.preventClick||(!n.context.config.useNativeClickEvent&&(v.pointerType==="mouse"||v.pointerType==="touch")&&n.dispatchEvent(v,"click"),n.dispatchEvent(v,"pointertap")),n.freeEvent(v)}n.freeEvent(s)},this.onPointerMove=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),s=a.pointerType==="mouse"||a.pointerType==="pen",o=n.trackingData(i.pointerId),l=n.findMountedTarget(o.overTargets);if(o.overTargets&&l!==a.target){var u=i.type==="mousemove"?"mouseout":"pointerout",c=n.createPointerEvent(i,u,l||void 0);if(n.dispatchEvent(c,"pointerout"),s&&n.dispatchEvent(c,"mouseout"),!a.composedPath().includes(l)){var h=n.createPointerEvent(i,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,n.notifyTarget(h),s&&n.notifyTarget(h,"mouseleave"),ei.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}n.freeEvent(c)}if(l!==a.target){var d=i.type==="mousemove"?"mouseover":"pointerover",f=n.clonePointerEvent(a,d);n.dispatchEvent(f,"pointerover"),s&&n.dispatchEvent(f,"mouseover");for(var v=l&&ei.isNode(l)&&l.parentNode;v&&v!==(ei.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var p=!v||v===(ei.isNode(n.rootTarget)&&n.rootTarget.parentNode);if(p){var x=n.clonePointerEvent(a,"pointerenter");for(x.eventPhase=x.AT_TARGET;x.target&&x.target!==l&&x.target!==(ei.isNode(n.rootTarget)&&n.rootTarget.parentNode);)x.currentTarget=x.target,n.notifyTarget(x),s&&n.notifyTarget(x,"mouseenter"),ei.isNode(x.target)&&(x.target=x.target.parentNode);n.freeEvent(x)}n.freeEvent(f)}n.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&n.dispatchEvent(a,"touchmove"),s&&(n.dispatchEvent(a,"mousemove"),n.cursor=n.getCursor(a.target)),o.overTargets=a.composedPath(),n.freeEvent(a)},this.onPointerOut=function(i){var a=n.trackingData(i.pointerId);if(a.overTargets){var s=i.pointerType==="mouse"||i.pointerType==="pen",o=n.findMountedTarget(a.overTargets),l=n.createPointerEvent(i,"pointerout",o||void 0);n.dispatchEvent(l),s&&n.dispatchEvent(l,"mouseout");var u=n.createPointerEvent(i,"pointerleave",o||void 0);for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==(ei.isNode(n.rootTarget)&&n.rootTarget.parentNode);)u.currentTarget=u.target,n.notifyTarget(u),s&&n.notifyTarget(u,"mouseleave"),ei.isNode(u.target)&&(u.target=u.target.parentNode);a.overTargets=null,n.freeEvent(l),n.freeEvent(u)}n.cursor=null},this.onPointerOver=function(i){var a=n.trackingData(i.pointerId),s=n.createPointerEvent(i),o=s.pointerType==="mouse"||s.pointerType==="pen";n.dispatchEvent(s,"pointerover"),o&&n.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(n.cursor=n.getCursor(s.target));var l=n.clonePointerEvent(s,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(ei.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),o&&n.notifyTarget(l,"mouseenter"),ei.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=s.composedPath(),n.freeEvent(s),n.freeEvent(l)},this.onPointerUpOutside=function(i){var a=n.trackingData(i.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[i.button]),o=n.createPointerEvent(i);if(s){for(var l=s;l;)o.currentTarget=l,n.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"||(o.pointerType==="mouse"||o.pointerType==="pen")&&n.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),ei.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}n.freeEvent(o)},this.onWheel=function(i){var a=n.createWheelEvent(i);n.dispatchEvent(a),n.freeEvent(a)},this.onClick=function(i){if(n.context.config.useNativeClickEvent){var a=n.createPointerEvent(i);n.dispatchEvent(a),n.freeEvent(a)}},this.onPointerCancel=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(a),n.freeEvent(a)},this.globalRuntime=e,this.context=t}return _(r,[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),n=1,i=1,a=this.context.contextService.getDomElement();if(a&&t){var s=a.offsetWidth,o=a.offsetHeight;s&&o&&(n=t.width/s,i=t.height/o)}return{scaleX:n,scaleY:i,bbox:t}}},{key:"client2Viewport",value:function(t){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new Ye((t.x-((s==null?void 0:s.left)||0))/i,(t.y-((s==null?void 0:s.top)||0))/a)}},{key:"viewport2Client",value:function(t){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new Ye((t.x+((s==null?void 0:s.left)||0))*i,(t.y+((s==null?void 0:s.top)||0))*a)}},{key:"viewport2Canvas",value:function(t){var n=t.x,i=t.y,a=this.rootTarget.defaultView,s=a.getCamera(),o=this.context.config,l=o.width,u=o.height,c=s.getPerspectiveInverse(),h=s.getWorldTransform(),d=yt.multiply(this.tmpMatrix,h,c),f=et.t8(this.tmpVec3,n/l*2-1,(1-i/u)*2-1,0);return et.fF(f,f,d),new Ye(f[0],f[1])}},{key:"canvas2Viewport",value:function(t){var n=this.rootTarget.defaultView,i=n.getCamera(),a=i.getPerspective(),s=i.getViewTransform(),o=yt.multiply(this.tmpMatrix,a,s),l=et.t8(this.tmpVec3,t.x,t.y,0);et.fF(this.tmpVec3,this.tmpVec3,o);var u=this.context.config,c=u.width,h=u.height;return new Ye((l[0]+1)/2*c,(1-(l[1]+1)/2)*h)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(i,a){return i.priority-a.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var i=0,a=n.length;i<a;i++)n[i].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,n,i){if(!i)t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,n);else{t.eventPhase=t.AT_TARGET;var a=this.rootTarget.defaultView||null;t.currentTarget=a,this.notifyListeners(t,n)}this.emitter.emit(n||t.type,t)}},{key:"propagate",value:function(t,n){if(t.target){var i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var a=i.length-1;a>=1;a--)if(t.currentTarget=i[a],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var s=i.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=s+1;o<i.length;o++)if(t.currentTarget=i[o],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var n=[t],i=this.rootTarget.defaultView||null;if(i&&i===t)return n.unshift(i.document),n;for(var a=0;a<D2&&t!==this.rootTarget;a++)ei.isNode(t)&&t.parentNode&&(n.push(t.parentNode),t=t.parentNode);return i&&n.push(i),n}},{key:"hitTest",value:function(t){var n=t.viewportX,i=t.viewportY,a=this.context.config,s=a.width,o=a.height,l=a.disableHitTesting;return n<0||i<0||n>s||i>o?null:!l&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,n){var i,a=n==null?void 0:n.target;if((i=a)!==null&&i!==void 0&&i.shadowRoot&&(a=n.composedPath()[0]),a){if(a===t)return!0;if(t&&t.contains)return t.contains(a)}return n!=null&&n.composedPath?n.composedPath().indexOf(t)>-1:!1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var n=0,i=t.nativeEvent.composedPath();n<i.length;n++){var a=i[n],s=this.nativeHTMLMap.get(a);if(s)return s}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,n,i,a){var s=this.allocateEvent(ko);this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t;var o=this.getExistedHTML(s),l=this.context.contextService.getDomElement();return s.target=i!=null?i:o||this.isNativeEventFromCanvas(l,s.nativeEvent)&&this.pickTarget(s)||a,typeof n=="string"&&(s.type=n),s}},{key:"createWheelEvent",value:function(t){var n=this.allocateEvent(Ql);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var i=this.getExistedHTML(n),a=this.context.contextService.getDomElement();return n.target=i||this.isNativeEventFromCanvas(a,n.nativeEvent)&&this.pickTarget(n),n}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var n=this.allocateEvent(Ql);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n}},{key:"clonePointerEvent",value:function(t,n){var i=this.allocateEvent(ko);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=n!=null?n:i.type,i}},{key:"copyPointerData",value:function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist}},{key:"copyMouseData",value:function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=ki.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)}},{key:"notifyTarget",value:function(t,n){var i;n=(i=n)!==null&&i!==void 0?i:t.type;var a=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,a),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)}},{key:"notifyListeners",value:function(t,n){var i=t.currentTarget.emitter,a=i._events[n];if(a)if("fn"in a)a.once&&i.removeListener(n,a.fn,void 0,!0),a.fn.call(t.currentTarget||a.context,t);else for(var s=0;s<a.length&&!t.propagationImmediatelyStopped;s++)a[s].once&&i.removeListener(n,a[s].fn,void 0,!0),a[s].fn.call(t.currentTarget||a[s].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var n=t[t.length-1],i=t.length-2;i>=0;i--){var a=t[i];if(a===this.rootTarget||ei.isNode(a)&&a.parentNode===n)n=t[i];else break}return n}},{key:"getCursor",value:function(t){for(var n=t;n;){var i=Vn(n)&&n.getAttribute("cursor");if(i)return i;n=ei.isNode(n)&&n.parentNode}}}])}(),_g=function(){function r(){E(this,r)}return _(r,[{key:"getOrCreateCanvas",value:function(t,n){if(this.canvas)return this.canvas;if(t||Ke.offscreenCanvas)this.canvas=t||Ke.offscreenCanvas,this.context=this.canvas.getContext("2d",b({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",b({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",b({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Jl=function(r){return r[r.CAMERA_CHANGED=0]="CAMERA_CHANGED",r[r.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",r[r.NONE=2]="NONE",r}({}),F2=function(){function r(e,t){E(this,r),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new si,initAsync:new qi,dirtycheck:new Bs,cull:new Bs,beginFrame:new si,beforeRender:new si,render:new si,afterRender:new si,endFrame:new si,destroy:new si,pick:new ai,pickSync:new Bs,pointerDown:new si,pointerUp:new si,pointerMove:new si,pointerOut:new si,pointerOver:new si,pointerWheel:new si,pointerCancel:new si,click:new si},this.globalRuntime=e,this.context=t}return _(r,[{key:"init",value:function(t){var n=this,i=b(b({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(a){a.apply(i,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()}).catch(function(a){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var t=this.context.config.renderer,n=t.getConfig(),i=n.enableDirtyRectangleRendering;return!i||this.context.renderingContext.renderReasons.has(Jl.CAMERA_CHANGED)}},{key:"render",value:function(t,n,i){var a=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var s=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(s.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),s.renderReasons.size&&this.inited){s.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=s.renderReasons.size===1&&s.renderReasons.has(Jl.CAMERA_CHANGED),l=!t.disableRenderHooks||!(t.disableRenderHooks&&o);l&&this.renderDisplayObject(s.root,t,s),this.hooks.beginFrame.call(n),l&&s.renderListCurrentFrame.forEach(function(u){a.hooks.beforeRender.call(u),a.hooks.render.call(u),a.hooks.afterRender.call(u)}),this.hooks.endFrame.call(n),s.renderListCurrentFrame=[],s.renderReasons.clear(),i()}}},{key:"renderDisplayObject",value:function(t,n,i){var a=this,s=n.renderer.getConfig(),o=s.enableDirtyCheck,l=s.enableCulling;function u(v){var p=v.renderable,x=v.sortable,A=o?p.dirty||i.dirtyRectangleRenderingDisabled?v:null:v;if(A){var N=l?a.hooks.cull.call(A,a.context.camera):A;N&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(N))}p.dirty=!1,x.renderOrder=a.zIndexCounter,a.zIndexCounter+=1,a.stats.total+=1,x.dirty&&(a.sort(v,x),x.dirty=!1,x.dirtyChildren=[],x.dirtyReason=void 0)}for(var c=[t];c.length>0;){var h=c.pop();u(h);for(var d=h.sortable.sorted||h.childNodes,f=d.length-1;f>=0;f--)c.push(d[f])}}},{key:"sort",value:function(t,n){n.sorted&&n.dirtyReason!==Vu.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(i){var a=t.childNodes.indexOf(i);if(a===-1){var s=n.sorted.indexOf(i);s>=0&&n.sorted.splice(s,1)}else if(n.sorted.length===0)n.sorted.push(i);else{var o=qr(n.sorted,i);n.sorted.splice(o,0,i)}}):n.sorted=t.childNodes.slice().sort(Ur)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Jl.DISPLAY_OBJECT_CHANGED)}}])}(),B2=/\[\s*(.*)=(.*)\s*\]/,z2=function(){function r(){E(this,r)}return _(r,[{key:"selectOne",value:function(t,n){var i=this;if(t.startsWith("."))return n.find(function(l){return((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(l){return l.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.find(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):null}return n.find(function(l){return n!==l&&l.nodeName===t})}},{key:"selectAll",value:function(t,n){var i=this;if(t.startsWith("."))return n.findAll(function(l){return n!==l&&((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(l){return n!==l&&l.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.findAll(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):[]}return n.findAll(function(l){return n!==l&&l.nodeName===t})}},{key:"is",value:function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,s=i.value;return a==="name"?n.name===s:this.attributeToString(n,a)===s}return n.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var n=t.match(B2),i="",a="";return n&&n.length>2&&(i=n[1].replace(/"/g,""),a=n[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(t,n){if(!t.getAttribute)return"";var i=t.getAttribute(n);return(0,be.Z)(i)?"":i.toString?i.toString():""}}])}(),or=function(r){return r.REPARENT="reparent",r.DESTROY="destroy",r.ATTR_MODIFIED="DOMAttrModified",r.INSERTED="DOMNodeInserted",r.REMOVED="removed",r.MOUNTED="DOMNodeInsertedIntoDocument",r.UNMOUNTED="DOMNodeRemovedFromDocument",r.BOUNDS_CHANGED="bounds-changed",r.CULLED="culled",r}({}),zs=function(r){function e(t,n,i,a,s,o,l,u){var c;return E(this,e),c=_t(this,e,[null]),c.relatedNode=n,c.prevValue=i,c.newValue=a,c.attrName=s,c.attrChange=o,c.prevParsedValue=l,c.newParsedValue=u,c.type=t,c}return Ot(e,r),_(e)}(cl);zs.ADDITION=2,zs.MODIFICATION=1,zs.REMOVAL=3;function Xm(r){var e=r.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var j2=new zs(or.REPARENT,null,"","","",0,"",""),G2=rt.Ue(),Xh=et.Ue(),W2=et.al(1,1,1),U2=yt.create(),Z2=rt.Ue(),To=et.Ue(),ql=yt.create(),Oo=Xt.Ue(),V2=et.Ue(),Y2=Xt.Ue(),H2=et.Ue(),lc=et.Ue(),hl=et.Ue(),Kh=yt.create(),Km=Xt.Ue(),$m=Xt.Ue(),$h=Xt.Ue(),Mg={affectChildren:!0},X2=function(){function r(e){E(this,r),this.pendingEvents=new Map,this.boundsChangedEvent=new Si(or.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}return _(r,[{key:"matches",value:function(t,n){return this.runtime.sceneGraphSelector.is(t,n)}},{key:"querySelector",value:function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)}},{key:"querySelectorAll",value:function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)}},{key:"attach",value:function(t,n,i){var a,s=!1;t.parentNode&&(s=t.parentNode!==n,this.detach(t));var o=t.nodeName===he.FRAGMENT,l=Fs(n);t.parentNode=n;var u=o?t.childNodes:[t];(0,bt.Z)(i)?u.forEach(function(f){n.childNodes.splice(i,0,f),f.parentNode=n}):u.forEach(function(f){n.childNodes.push(f),f.parentNode=n});var c=n,h=c.sortable;if((h!=null&&(a=h.sorted)!==null&&a!==void 0&&a.length||t.parsedStyle.zIndex)&&(h.dirtyChildren.indexOf(t)===-1&&h.dirtyChildren.push(t),h.dirty=!0,h.dirtyReason=Vu.ADDED),!l){if(o)this.dirtifyFragment(t);else{var d=t.transformable;d&&this.dirtifyWorld(t,d)}s&&t.dispatchEvent(j2)}}},{key:"detach",value:function(t){if(t.parentNode){var n,i,a=t.transformable,s=t.parentNode,o=s.sortable;(o!=null&&(n=o.sorted)!==null&&n!==void 0&&n.length||(i=t.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=Vu.REMOVED);var l=t.parentNode.childNodes.indexOf(t);l>-1&&t.parentNode.childNodes.splice(l,1),a&&this.dirtifyWorld(t,a),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=[n,i,a]);var s=t.transformable;if(!(n[0]===s.origin[0]&&n[1]===s.origin[1]&&n[2]===s.origin[2])){var o=s.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtifyLocal(t,s)}}},{key:"rotate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.rotateLocal(t,n);else{var o=Oo;Xt.Su(o,n[0],n[1],n[2]);var l=this.getRotation(t),u=this.getRotation(t.parentNode);Xt.JG($h,u),Xt.U_($h,$h),Xt.Jp(o,$h,o),Xt.Jp(s.localRotation,o,l),Xt.Fv(s.localRotation,s.localRotation),this.dirtifyLocal(t,s)}}},{key:"rotateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;Xt.Su($m,n[0],n[1],n[2]),Xt.dC(s.localRotation,s.localRotation,$m),this.dirtifyLocal(t,s)}},{key:"setEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.setLocalEulerAngles(t,n);else{Xt.Su(s.localRotation,n[0],n[1],n[2]);var o=this.getRotation(t.parentNode);Xt.JG(Km,Xt.U_(Oo,o)),Xt.dC(s.localRotation,s.localRotation,Km),this.dirtifyLocal(t,s)}}},{key:"setLocalEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof n=="number"&&(n=et.al(n,i,a));var o=t.transformable;Xt.Su(o.localRotation,n[0],n[1],n[2]),s&&this.dirtifyLocal(t,o)}},{key:"translateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;et.fS(n,Xh)||(et.VC(n,n,s.localRotation),et.IH(s.localPosition,s.localPosition,n),this.dirtifyLocal(t,s))}},{key:"setPosition",value:function(t,n){var i,a=t.transformable;if(hl[0]=n[0],hl[1]=n[1],hl[2]=(i=n[2])!==null&&i!==void 0?i:0,!et.fS(this.getPosition(t),hl)){if(et.JG(a.position,hl),t.parentNode===null||!t.parentNode.transformable)et.JG(a.localPosition,hl);else{var s=t.parentNode.transformable;yt.copy(Kh,s.worldTransform),yt.invert(Kh,Kh),et.fF(a.localPosition,hl,Kh)}this.dirtifyLocal(t,a)}}},{key:"setLocalPosition",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;lc[0]=n[0],lc[1]=n[1],lc[2]=(i=n[2])!==null&&i!==void 0?i:0,!et.fS(s.localPosition,lc)&&(et.JG(s.localPosition,lc),a&&this.dirtifyLocal(t,s))}},{key:"scaleLocal",value:function(t,n){var i,a=t.transformable;et.Jp(a.localScale,a.localScale,et.t8(To,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:1)),this.dirtifyLocal(t,a)}},{key:"setLocalScale",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;et.t8(To,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:s.localScale[2]),!et.fS(To,s.localScale)&&(et.JG(s.localScale,To),a&&this.dirtifyLocal(t,s))}},{key:"translate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.t8(To,n,i,a)),!et.fS(n,Xh)&&(et.IH(To,this.getPosition(t),n),this.setPosition(t,To))}},{key:"setRotation",value:function(t,n,i,a,s){var o=t.transformable;if(typeof n=="number"&&(n=Xt.al(n,i,a,s)),t.parentNode===null||!t.parentNode.transformable)this.setLocalRotation(t,n);else{var l=this.getRotation(t.parentNode);Xt.JG(Oo,l),Xt.U_(Oo,Oo),Xt.Jp(o.localRotation,Oo,n),Xt.Fv(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}}},{key:"setLocalRotation",value:function(t,n,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof n=="number"&&(n=Xt.t8(Oo,n,i,a,s));var l=t.transformable;Xt.JG(l.localRotation,n),o&&this.dirtifyLocal(t,l)}},{key:"setLocalSkew",value:function(t,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof n=="number"&&(n=rt.t8(Z2,n,i));var s=t.transformable;rt.JG(s.localSkew,n),a&&this.dirtifyLocal(t,s)}},{key:"dirtifyLocal",value:function(t,n){Fs(t)||n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))}},{key:"dirtifyWorld",value:function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var n=t.transformable;n&&(n.frozen=!1,n.dirtyFlag=!0,n.localDirtyFlag=!0);var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0);for(var a=t.childNodes.length,s=0;s<a;s++)this.dirtifyFragment(t.childNodes[s]);t.nodeName===he.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,n=new Set,i=function(s,o){!s.isConnected||n.has(s)||s.nodeName===he.FRAGMENT||(t.boundsChangedEvent.detail=o,t.boundsChangedEvent.target=s,s.isMutationObserved?s.dispatchEvent(t.boundsChangedEvent):s.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(s))};this.pendingEvents.forEach(function(a,s){s.nodeName!==he.FRAGMENT&&(Mg.affectChildren=a,a?s.forEach(function(o){i(o,Mg)}):i(s,Mg))}),n.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t;for(i.renderable&&(i.renderable.dirty=!0);i;)Xm(i),i=i.parentNode;n&&t.forEach(function(a){Xm(a)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"updateDisplayObjectDependency",value:function(t,n,i,a){if(n&&n!==i){var s=this.displayObjectDependencyMap.get(n);if(s&&s[t]){var o=s[t].indexOf(a);s[t].splice(o,1)}}if(i){var l=this.displayObjectDependencyMap.get(i);l||(this.displayObjectDependencyMap.set(i,{}),l=this.displayObjectDependencyMap.get(i)),l[t]||(l[t]=[]),l[t].push(a)}}},{key:"informDependentDisplayObjects",value:function(t){var n=this,i=this.displayObjectDependencyMap.get(t);i&&Object.keys(i).forEach(function(a){i[a].forEach(function(s){n.dirtifyToRoot(s,!0),s.dispatchEvent(new zs(or.ATTR_MODIFIED,s,n,n,a,zs.MODIFICATION,n,n)),s.isCustomElement&&s.isConnected&&s.attributeChangedCallback&&s.attributeChangedCallback(a,n,n)})})}},{key:"getPosition",value:function(t){var n=t.transformable;return yt.getTranslation(n.position,this.getWorldTransform(t,n))}},{key:"getRotation",value:function(t){var n=t.transformable;return yt.getRotation(n.rotation,this.getWorldTransform(t,n))}},{key:"getScale",value:function(t){var n=t.transformable;return yt.getScaling(n.scaling,this.getWorldTransform(t,n))}},{key:"getWorldTransform",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.transformable;return!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){var n=t.localSkew[0]!==0||t.localSkew[1]!==0;if(n){yt.fromRotationTranslationScaleOrigin(t.localTransform,t.localRotation,t.localPosition,et.al(1,1,1),t.origin),(t.localSkew[0]!==0||t.localSkew[1]!==0)&&(yt.identity(ql),ql[4]=Math.tan(t.localSkew[0]),ql[1]=Math.tan(t.localSkew[1]),yt.multiply(t.localTransform,t.localTransform,ql));var i=yt.fromRotationTranslationScaleOrigin(ql,Xt.t8(Oo,0,0,0,1),et.t8(To,1,1,1),t.localScale,t.origin);yt.multiply(t.localTransform,t.localTransform,i)}else{var a=t.localTransform,s=t.localPosition,o=t.localRotation,l=t.localScale,u=t.origin,c=s[0]!==0||s[1]!==0||s[2]!==0,h=o[3]!==1||o[0]!==0||o[1]!==0||o[2]!==0,d=l[0]!==1||l[1]!==1||l[2]!==1,f=u[0]!==0||u[1]!==0||u[2]!==0;!h&&!d&&!f?c?yt.fromTranslation(a,s):yt.identity(a):yt.fromRotationTranslationScaleOrigin(a,o,s,l,u)}}},{key:"getLocalTransform",value:function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform}},{key:"setLocalTransform",value:function(t,n){var i=yt.getTranslation(V2,n),a=yt.getRotation(Y2,n),s=yt.getScaling(H2,n);this.setLocalScale(t,s,!1),this.setLocalPosition(t,i,!1),this.setLocalRotation(t,a,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,W2,!1),this.setLocalPosition(t,Xh,!1),this.setLocalEulerAngles(t,Xh,void 0,void 0,!1),this.setLocalSkew(t,G2,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(t,n);if(!Ln.isEmpty(a)){var s=i||new Ln;return s.setFromTransformedAABB(a,this.getWorldTransform(t)),s}return null}},{key:"getGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t,a=i.geometry;a.dirty&&Ke.styleValueRegistry.updateGeometry(t);var s=n?a.renderBounds:a.contentBounds||null;return s||new Ln}},{key:"getBounds",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,l=this.getTransformedGeometryBounds(t,i,o),u=t.childNodes;if(u.forEach(function(d){var f=n.getBounds(d,i);f&&(l?l.add(f):(l=o||new Ln,l.update(f.center,f.halfExtents)))}),l||(l=new Ln),i){var c=Ni(t);if(c){var h=c.parsedStyle.clipPath.getBounds(i);l?h&&(l=h.intersection(l)):l.update(h.center,h.halfExtents)}}return i?(s.renderBounds=l,s.renderBoundsDirty=!1):(s.bounds=l,s.boundsDirty=!1),l}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var n=U2;t.parentNode.transformable&&(n=yt.invert(ql,this.getWorldTransform(t.parentNode)));var i=this.getBounds(t);if(!Ln.isEmpty(i)){var a=new Ln;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var n,i,a=this.getGeometryBounds(t);Ln.isEmpty(a)||(i=new Ln,i.setFromTransformedAABB(a,this.getWorldTransform(t)));var s=(n=t.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0?void 0:n.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),l=re(o,2),u=l[0],c=l[1],h=i.getMax(),d=re(h,2),f=d[0],v=d[1];return new Er(u+((s==null?void 0:s.left)||0),c+((s==null?void 0:s.top)||0),f-u,v-c)}return new Er((s==null?void 0:s.left)||0,(s==null?void 0:s.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,n){var i=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(o){var l=o.transformable;l.dirtyFlag||i.dirtifyWorldInternal(o,l)});var a=t,s=a.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var i=t.childNodes,a=0;a<i.length;a++)this.syncHierarchy(i[a])}}},{key:"sync",value:function(t,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var i=t.parentNode,a=i&&i.transformable;i===null||!a?yt.copy(n.worldTransform,n.localTransform):yt.multiply(n.worldTransform,a.worldTransform,n.localTransform),n.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var n=t.parentNode;n;){var i=n.transformable;i&&(i.frozen=!1),n=n.parentNode}}}])}(),dl={MetricsString:"|\xC9q\xC5",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Qm=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,K2=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,$2=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,Q2=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,J2=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,q2=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,tS=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,eS=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,nS=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,rS=new RegExp("".concat(K2.source,"|").concat(Q2.source,"|").concat(q2.source,"|").concat(eS.source)),iS=new RegExp("".concat($2.source,"|").concat(J2.source,"|").concat(tS.source,"|").concat(nS.source)),aS=function(){function r(e){var t=this;E(this,r),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(n,i){return t.isBreakingSpace(i)?!1:!!(n&&(iS.exec(i)||rS.exec(n)))},this.trimByKinsokuShorui=function(n){var i=xt(n),a=i[i.length-2];if(!a)return n;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=e}return _(r,[{key:"measureFont",value:function(t,n){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});s.font=t;var o=dl.MetricsString+dl.BaselineSymbol,l=Math.ceil(s.measureText(o).width),u=Math.ceil(s.measureText(dl.BaselineSymbol).width),c=dl.HeightMultiplier*u;u=u*dl.BaselineMultiplier|0,a.width=l,a.height=c,s.fillStyle="#f00",s.fillRect(0,0,l,c),s.font=t,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,u);var h=s.getImageData(0,0,l||1,c||1).data,d=h.length,f=l*4,v=0,p=0,x=!1;for(v=0;v<u;++v){for(var A=0;A<f;A+=4)if(h[p+A]!==255){x=!0;break}if(!x)p+=f;else break}for(i.ascent=u-v,p=d-f,x=!1,v=c;v>u;--v){for(var N=0;N<f;N+=4)if(h[p+N]!==255){x=!0;break}if(!x)p-=f;else break}return i.descent=v-u,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[t]=i,i}},{key:"measureText",value:function(t,n,i){var a=n.fontSize,s=a===void 0?16:a,o=n.wordWrap,l=o===void 0?!1:o,u=n.lineHeight,c=n.lineWidth,h=c===void 0?1:c,d=n.textBaseline,f=d===void 0?"alphabetic":d,v=n.textAlign,p=v===void 0?"start":v,x=n.letterSpacing,A=x===void 0?0:x,N=n.textPath;n.textPathSide,n.textPathStartOffset;var I=n.leading,K=I===void 0?0:I,W=Xa(n),z=this.measureFont(W,i);z.fontSize===0&&(z.fontSize=s,z.ascent=s);var j=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);j.font=W,n.isOverflowing=!1;var Z=l?this.wordWrap(t,n,i):t,vt=Z.split(/(?:\r\n|\r|\n)/),Tt=new Array(vt.length),zt=0;if(N){N.getTotalLength();for(var Qt=0;Qt<vt.length;Qt++)j.measureText(vt[Qt]).width+(vt[Qt].length-1)*A}else{for(var ae=0;ae<vt.length;ae++){var fe=j.measureText(vt[ae]).width+(vt[ae].length-1)*A;Tt[ae]=fe,zt=Math.max(zt,fe)}var ce=zt+h,ct=u||z.fontSize+h,$=Math.max(ct,z.fontSize+h)+(vt.length-1)*(ct+K);ct+=K;var Q=0;return f==="middle"?Q=-$/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?Q=-$:(f==="top"||f==="hanging")&&(Q=0),{font:W,width:ce,height:$,lines:vt,lineWidths:Tt,lineHeight:ct,maxLineWidth:zt,fontProperties:z,lineMetrics:Tt.map(function(It,ue){var le=0;return p==="center"||p==="middle"?le-=It/2:(p==="right"||p==="end")&&(le-=It),new Er(le-h/2,Q+ue*ct,It+h,ct)})}}}},{key:"wordWrap",value:function(t,n,i){var a=this,s=n.wordWrapWidth,o=s===void 0?0:s,l=n.letterSpacing,u=l===void 0?0:l,c=n.maxLines,h=c===void 0?1/0:c,d=n.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),v=o+u,p="";d==="ellipsis"?p="...":d&&d!=="clip"&&(p=d);var x=[],A=0,N=0,I={},K=function(fe){return a.getFromCache(fe,u,I,f)},W=Array.from(p).reduce(function(ae,fe){return ae+K(fe)},0);function z(ae){if(!(W<=0||W>v)){for(var fe=x[ae].length,ce=0,ct=fe,$=0;$<fe;$++){var Q=K(x[ae][$]);if(ce+Q+W>v){ct=$;break}ce+=Q}x[ae]=(x[ae]||"").slice(0,ct)+p}}for(var j=Array.from(t),Z=0;Z<j.length;Z++){var vt=j[Z],Tt=t[Z-1],zt=t[Z+1],Qt=K(vt);if(this.isNewline(vt)){if(A++,A>=h){n.isOverflowing=!0,Z<j.length-1&&z(A-1);break}N=0,x[A]="";continue}if(N>0&&N+Qt>v){if(A+1>=h){n.isOverflowing=!0,z(A);break}if(A++,N=0,x[A]="",this.isBreakingSpace(vt))continue;this.canBreakInLastChar(vt)||(x=this.trimToBreakable(x),N=this.sumTextWidthByCache(x[A]||"",I)),this.shouldBreakByKinsokuShorui(vt,zt)&&(x=this.trimByKinsokuShorui(x),N+=K(Tt||""))}N+=Qt,x[A]=(x[A]||"")+vt}return x.join(`
|
|
|
`)}},{key:"isBreakingSpace",value:function(t){return typeof t!="string"?!1:dl.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return typeof t!="string"?!1:dl.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var n=xt(t),i=n[n.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return n;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),l=a+1,u=a+(o?0:1);return n[n.length-1]+=i.slice(l,i.length),n[n.length-2]=i.slice(0,u),n}},{key:"canBreakInLastChar",value:function(t){return!(t&&Qm.test(t))}},{key:"sumTextWidthByCache",value:function(t,n){return t.split("").reduce(function(i,a){if(!n[a])throw Error("cannot count the word without cache");return i+n[a]},0)}},{key:"findBreakableIndex",value:function(t){for(var n=t.length-1;n>=0;n--)if(!Qm.test(t[n]))return n;return-1}},{key:"getFromCache",value:function(t,n,i,a){var s=i[t];if(typeof s!="number"){var o=t.length*n;s=a.measureText(t).width+o,i[t]=s}return s}}])}(),Ke={},sS=function(r){var e=new Dr,t=new $l;return r={},k(k(k(k(k(k(k(k(k(k(r,he.FRAGMENT,null),he.CIRCLE,new wg),he.ELLIPSE,new Sg),he.RECT,e),he.IMAGE,e),he.GROUP,new gi),he.LINE,new Kl),he.TEXT,new ta(Ke)),he.POLYLINE,t),he.POLYGON,t),k(k(k(r,he.PATH,new gs),he.HTML,new $a),he.MESH,null)}(),oS=function(r){var e=new xn,t=new zn;return r={},k(k(k(k(k(k(k(k(k(k(r,qe.PERCENTAGE,null),qe.NUMBER,new Yn),qe.ANGLE,new fn),qe.DEFINED_PATH,new dn),qe.PAINT,e),qe.COLOR,e),qe.FILTER,new wn),qe.LENGTH,t),qe.LENGTH_PERCENTAGE,t),qe.LENGTH_PERCENTAGE_12,new Fn),k(k(k(k(k(k(k(k(k(k(r,qe.LENGTH_PERCENTAGE_14,new Dn),qe.COORDINATE,new zn),qe.OFFSET_DISTANCE,new In),qe.OPACITY_VALUE,new wr),qe.PATH,new rr),qe.LIST_OF_POINTS,new nr),qe.SHADOW_BLUR,new yr),qe.TEXT,new br),qe.TEXT_TRANSFORM,new cr),qe.TRANSFORM,new ac),k(k(k(r,qe.TRANSFORM_ORIGIN,new Hh),qe.Z_INDEX,new Eg),qe.MARKER,new Kn)}(),lS=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof g.g!="undefined"?g.g:{}};Ke.CameraContribution=Yv,Ke.AnimationTimeline=null,Ke.EasingFunction=null,Ke.offscreenCanvasCreator=new _g,Ke.sceneGraphSelector=new z2,Ke.sceneGraphService=new X2(Ke),Ke.textService=new aS(Ke),Ke.geometryUpdaterFactory=sS,Ke.CSSPropertySyntaxFactory=oS,Ke.styleValueRegistry=new We(Ke),Ke.layoutRegistry=null,Ke.globalThis=lS(),Ke.enableStyleSyntax=!0,Ke.enableSizeAttenuation=!1;var Jm=0;function e5(){Jm=0}var kg=new zs(or.INSERTED,null,"","","",0,"",""),Tg=new zs(or.REMOVED,null,"","","",0,"",""),qm=new Si(or.DESTROY),uS=function(r){function e(){var t;E(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=_t(this,e,[].concat(i)),t.entity=Jm++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:Rm.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return Ot(e,r),_(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(n){return n!==""})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null}},{key:"cloneNode",value:function(n){throw new Error(Cn)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error(Wr);return Ke.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!Fs(this)&&n.nodeName===he.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(kg.relatedNode=this,n.dispatchEvent(kg)),n}},{key:"insertBefore",value:function(n,i){if(!i)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(n):this.appendChild(n,a)}return n}},{key:"replaceChild",value:function(n,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(n,a),i}},{key:"removeChild",value:function(n){var i;return Tg.relatedNode=this,n.dispatchEvent(Tg),(i=n.ownerDocument)!==null&&i!==void 0&&i.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),Ke.sceneGraphService.detach(n),n}},{key:"removeChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(n){return Ke.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return Ke.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return Ke.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return Ke.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return Ke.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return Ke.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return Ke.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(Ke.sceneGraphService.matches(n,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(n){var i=this,a=null;return this.forEach(function(s){return s!==i&&n(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(n){var i=this,a=[];return this.forEach(function(s){s!==i&&n(s)&&a.push(s)}),a}},{key:"after",value:function(){var n=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(l,u){var c;return(c=n.parentNode)===null||c===void 0?void 0:c.appendChild(l,i+u+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var n,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var l=s[0],u=s.slice(1);this.parentNode.appendChild(l,i),(n=l).after.apply(n,xt(u))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return n.appendChild(o)})}},{key:"prepend",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,l){return n.appendChild(o,l)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(qm),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Ke.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Ke.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Ke.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Ke.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Ke.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(n){if(typeof n!="symbol"){var i=this.attributes[n];return i}}},{key:"hasAttribute",value:function(n){return this.getAttributeNames().includes(n)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(n){this.setAttribute(n,null),delete this.attributes[n]}},{key:"setAttribute",value:function(n,i,a,s){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(Cn)}},{key:"getAttributeNode",value:function(n){throw new Error(Cn)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(Cn)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(Cn)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(Cn)}},{key:"removeAttributeNode",value:function(n){throw new Error(Cn)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(Cn)}},{key:"setAttributeNode",value:function(n){throw new Error(Cn)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(Cn)}},{key:"toggleAttribute",value:function(n,i){throw new Error(Cn)}}])}(ei);function pr(r){return!!(r!=null&&r.nodeName)}var cS=Ke.globalThis.Proxy?Ke.globalThis.Proxy:function(){},js=new zs(or.ATTR_MODIFIED,null,null,null,null,zs.MODIFICATION,null,null),uc=et.Ue(),hS=Xt.Ue(),ni=function(r){function e(t){var n;return E(this,e),n=_t(this,e),n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||he.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Ke.enableStyleSyntax&&(n.style=new cS({setProperty:function(a,s){n.setAttribute(a,s)},getPropertyValue:function(a){return n.getAttribute(a)},removeProperty:function(a){n.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:n.getAttribute(s)},set:function(a,s,o){return n.setAttribute(s,o),!0}})),n}return Ot(e,r),_(e,[{key:"destroy",value:function(){Le(e,"destroy",this,3)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=b({},this.attributes);for(var s in a){var o=a[s];pr(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var l=new this.constructor(b(b({},this.config),{},{style:a}));return l.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(u){if(!u.style.isMarker){var c=u.cloneNode(n);l.appendChild(c)}}),l}},{key:"initAttributes",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};Ke.styleValueRegistry.processProperties(this,n,i),this.renderable.dirty=!0}},{key:"setAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;(0,Yt.Z)(i)||(a||i!==this.attributes[n])&&(this.internalSetAttribute(n,i,{memoize:s}),Le(e,"setAttribute",this,3)([n,i]))}},{key:"internalSetAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.renderable,o=this.attributes[n],l=this.parsedStyle[n];Ke.styleValueRegistry.processProperties(this,k({},n,i),a),s.dirty=!0;var u=this.parsedStyle[n];if(this.isConnected&&(js.relatedNode=this,js.prevValue=o,js.newValue=i,js.attrName=n,js.prevParsedValue=l,js.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(js):(js.target=this,this.ownerDocument.defaultView.dispatchEvent(js,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement){var c,h;(c=(h=this).attributeChangedCallback)===null||c===void 0||c.call(h,n,o,i,l,u)}}},{key:"getBBox",value:function(){var n=this.getBounds(),i=n.getMin(),a=re(i,2),s=a[0],o=a[1],l=n.getMax(),u=re(l,2),c=u[0],h=u[1];return new Er(s,o,c-s,h-o)}},{key:"setOrigin",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ke.sceneGraphService.setOrigin(this,ur(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return Ke.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ke.sceneGraphService.setPosition(this,ur(n,i,a,!1)),this}},{key:"setLocalPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ke.sceneGraphService.setLocalPosition(this,ur(n,i,a,!1)),this}},{key:"translate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ke.sceneGraphService.translate(this,ur(n,i,a,!1)),this}},{key:"translateLocal",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Ke.sceneGraphService.translateLocal(this,ur(n,i,a,!1)),this}},{key:"getPosition",value:function(){return Ke.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Ke.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(n,i,a){return this.scaleLocal(n,i,a)}},{key:"scaleLocal",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=ur(n,i,a,!1)),Ke.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=ur(n,i,a,!1)),Ke.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return Ke.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Ke.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=el(uc,Ke.sceneGraphService.getWorldTransform(this)),i=re(n,3),a=i[2];return vr(a)}},{key:"getLocalEulerAngles",value:function(){var n=el(uc,Ke.sceneGraphService.getLocalRotation(this)),i=re(n,3),a=i[2];return vr(a)}},{key:"setEulerAngles",value:function(n){return Ke.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return Ke.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return(0,be.Z)(i)&&(0,be.Z)(a)?Ke.sceneGraphService.rotateLocal(this,0,0,n):Ke.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return(0,be.Z)(i)&&(0,be.Z)(a)?Ke.sceneGraphService.rotate(this,0,0,n):Ke.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return Ke.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return Ke.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return Ke.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return Ke.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Ke.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Ke.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Ke.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Ke.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return Ke.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){Ke.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(n,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,n,i):null}},{key:"isVisible",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"}},{key:"isInteractive",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,xt(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,xt(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],l=a[1];return o?(0,ie.Z)(o)?(Object.keys(o).forEach(function(u){n.setAttribute(u,o[u])}),this):a.length===2?(this.setAttribute(o,l),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(n){var i=n||this.getWorldTransform(),a=yt.getTranslation(uc,i),s=re(a,2),o=s[0],l=s[1],u=yt.getScaling(uc,i),c=re(u,2),h=c[0],d=c[1],f=yt.getRotation(hS,i),v=el(uc,f),p=re(v,3),x=p[0],A=p[2];return bh(x||A,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=Uu(n),a=re(i,5),s=a[0],o=a[1],l=a[2],u=a[3],c=a[4];this.setEulerAngles(c).setPosition(s,o).setLocalScale(l,u)}},{key:"setLocalMatrix",value:function(n){var i=Uu(n),a=re(i,5),s=a[0],o=a[1],l=a[2],u=a[3],c=a[4];this.setLocalEulerAngles(c).setLocalPosition(s,o).setLocalScale(l,u)}},{key:"show",value:function(){this.forEach(function(n){n.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(n){n.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(n){return this.children[n]||null}},{key:"add",value:function(n,i){return this.appendChild(n,i)}},{key:"set",value:function(n,i){this.config[n]=i}},{key:"get",value:function(n){return this.config[n]}},{key:"moveTo",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"move",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"setZIndex",value:function(n){return this.style.zIndex=n,this}}])}(uS);ni.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var tu=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,e),_t(this,e,[b({type:he.CIRCLE},t)])}return Ot(e,r),_(e)}(ni);tu.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var dS=["style"],fS=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=xe(n,dS);return E(this,e),t=_t(this,e,[b({style:i},a)]),t.isCustomElement=!0,t}return Ot(e,r),_(e)}(ni),Qh=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,e),_t(this,e,[b({type:he.ELLIPSE},t)])}return Ot(e,r),_(e)}(ni);Qh.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var n5=null,eu=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,e),_t(this,e,[b({type:he.GROUP},t)])}return Ot(e,r),_(e)}(ni);eu.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["width","height"]));var vS=["style"],Jh=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=xe(n,vS);return E(this,e),t=_t(this,e,[b({type:he.HTML,style:i},a)]),t.cullable.enable=!1,t}return Ot(e,r),_(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var n=yt.invert(yt.create(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!Ln.isEmpty(i)){var a=new Ln;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])}(ni);Jh.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var qh=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,e),_t(this,e,[b({type:he.IMAGE},t)])}return Ot(e,r),_(e)}(ni);qh.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var gS=["style"],cc=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=xe(n,gS);E(this,e),t=_t(this,e,[b({type:he.LINE,style:b({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),t.markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd;return o&&pr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&pr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return Ot(e,r),_(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&pr(s)&&(this.markerStartAngle=0,s.remove()),o&&pr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&pr(s)&&(this.markerEndAngle=0,s.remove()),o&&pr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=i.x1,c=i.x2,h=i.y1,d=i.y2,f=n?a:s;if(!(!f||!pr(f))){var v=0,p,x,A,N,I,K;n?(A=u,N=h,p=c-u,x=d-h,I=o||0,K=this.markerStartAngle):(A=c,N=d,p=u-c,x=h-d,I=l||0,K=this.markerEndAngle),v=Math.atan2(x,p),f.setLocalEulerAngles(v*180/Math.PI+K),f.setLocalPosition(A+Math.cos(v)*I,N+Math.sin(v)*I)}}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,l=a.x2,u=a.y2,c=(0,U.U4)(s,o,l,u,n),h=c.x,d=c.y,f=et.fF(et.Ue(),et.al(h,d,0),i?this.getWorldTransform():this.getLocalTransform());return new Ye(f[0],f[1])}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var n=this.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;return(0,U.Xk)(i,a,s,o)}}])}(ni);cc.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var pS=["style"],ro=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=xe(n,pS);E(this,e),t=_t(this,e,[b({type:he.PATH,style:i,initialParsedStyle:{miterLimit:4,d:b({},jl)}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd,u=s.markerMid;return o&&pr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),u&&pr(u)&&t.placeMarkerMid(u),l&&pr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return Ot(e,r),_(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&pr(s)&&(this.markerStartAngle=0,s.remove()),o&&pr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&pr(s)&&(this.markerEndAngle=0,s.remove()),o&&pr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=n?a:s;if(!(!u||!pr(u))){var c=0,h,d,f,v,p,x;if(n){var A=this.getStartTangent(),N=re(A,2),I=N[0],K=N[1];f=K[0],v=K[1],h=I[0]-K[0],d=I[1]-K[1],p=o||0,x=this.markerStartAngle}else{var W=this.getEndTangent(),z=re(W,2),j=z[0],Z=z[1];f=Z[0],v=Z[1],h=j[0]-Z[0],d=j[1]-Z[1],p=l||0,x=this.markerEndAngle}c=Math.atan2(d,h),u.setLocalEulerAngles(c*180/Math.PI+x),u.setLocalPosition(f+Math.cos(c)*p,v+Math.sin(c)*p)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(c){c.remove()}),n&&pr(n))for(var a=1;a<i.length-1;a++){var s=re(i[a].currentPoint,2),o=s[0],l=s[1],u=a===1?n:n.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,l)}}},{key:"getTotalLength",value:function(){return Zl(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=(0,$t.r)(a,n),o=s.x,l=s.y,u=et.fF(et.Ue(),et.al(o,l,0),i?this.getWorldTransform():this.getLocalTransform());return new Ye(u[0],u[1])}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(n*Zl(this),i)}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.d.segments,i=[];if(n.length>1){var a=n[0].currentPoint,s=n[1].currentPoint,o=n[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.d.segments,i=n.length,a=[];if(i>1){var s=n[i-2].currentPoint,o=n[i-1].currentPoint,l=n[i-1].endTangent;a=[],l?(a.push([o[0]-l[0],o[1]-l[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])}(ni);ro.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var mS=["style"],nu=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=xe(n,mS);E(this,e),t=_t(this,e,[b({type:he.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd,u=s.markerMid;return o&&pr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),u&&pr(u)&&t.placeMarkerMid(u),l&&pr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return Ot(e,r),_(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&pr(s)&&(this.markerStartAngle=0,s.remove()),o&&pr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&pr(s)&&(this.markerEndAngle=0,s.remove()),o&&pr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=i.points,c=u||{},h=c.points,d=n?a:s;if(!(!d||!pr(d)||!h)){var f=0,v,p,x,A,N,I;if(x=h[0][0],A=h[0][1],n)v=h[1][0]-h[0][0],p=h[1][1]-h[0][1],N=o||0,I=this.markerStartAngle;else{var K=h.length;this.parsedStyle.isClosed?(v=h[K-1][0]-h[0][0],p=h[K-1][1]-h[0][1]):(x=h[K-1][0],A=h[K-1][1],v=h[K-2][0]-h[K-1][0],p=h[K-2][1]-h[K-1][1]),N=l||0,I=this.markerEndAngle}f=Math.atan2(p,v),d.setLocalEulerAngles(f*180/Math.PI+I),d.setLocalPosition(x+Math.cos(f)*N,A+Math.sin(f)*N)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(h){h.remove()}),this.markerMidList=[],n&&pr(n)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var l=s[o][0],u=s[o][1],c=o===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(l,u)}}}])}(ni);nu.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var yS=["style"],Og=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=xe(t,yS);return E(this,e),_t(this,e,[b({type:he.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return Ot(e,r),_(e,[{key:"getTotalLength",value:function(){return lg(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,l,u,c=this.getTotalLength();a.forEach(function(A,N){a[N+1]&&(l=[0,0],l[0]=o/c,u=(0,U.Xk)(A[0],A[1],a[N+1][0],a[N+1][1]),o+=u,l[1]=o/c,s.push(l))}),this.parsedStyle.points.segments=s}var h=0,d=0;this.parsedStyle.points.segments.forEach(function(A,N){n>=A[0]&&n<=A[1]&&(h=(n-A[0])/(A[1]-A[0]),d=N)});var f=(0,U.U4)(a[d][0],a[d][1],a[d+1][0],a[d+1][1],h),v=f.x,p=f.y,x=et.fF(et.Ue(),et.al(v,p,0),i?this.getWorldTransform():this.getLocalTransform());return new Ye(x[0],x[1])}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.points.points,i=[];return i.push([n[1][0],n[1][1]]),i.push([n[0][0],n[0][1]]),i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.points.points,i=n.length-1,a=[];return a.push([n[i-1][0],n[i-1][1]]),a.push([n[i][0],n[i][1]]),a}}])}(nu);Og.PARSED_STYLE_LIST=new Set([].concat(xt(nu.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var ps=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,e),_t(this,e,[b({type:he.RECT},t)])}return Ot(e,r),_(e)}(ni);ps.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var bS=["style"],ru=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=xe(t,bS);return E(this,e),_t(this,e,[b({type:he.TEXT,style:b({fill:"black"},n)},i)])}return Ot(e,r),_(e,[{key:"getComputedTextLength",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(ni);ru.PARSED_STYLE_LIST=new Set([].concat(xt(ni.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var xS=function(){function r(){E(this,r),this.registry={},this.define(he.CIRCLE,tu),this.define(he.ELLIPSE,Qh),this.define(he.RECT,ps),this.define(he.IMAGE,qh),this.define(he.LINE,cc),this.define(he.GROUP,eu),this.define(he.PATH,ro),this.define(he.POLYGON,nu),this.define(he.POLYLINE,Og),this.define(he.TEXT,ru),this.define(he.HTML,Jh)}return _(r,[{key:"define",value:function(t,n){this.registry[t]=n}},{key:"get",value:function(t){return this.registry[t]}}])}(),r5={number:function(e){return new Ar(e)},percent:function(e){return new Ar(e,"%")},px:function(e){return new Ar(e,"px")},em:function(e){return new Ar(e,"em")},rem:function(e){return new Ar(e,"rem")},deg:function(e){return new Ar(e,"deg")},grad:function(e){return new Ar(e,"grad")},rad:function(e){return new Ar(e,"rad")},turn:function(e){return new Ar(e,"turn")},s:function(e){return new Ar(e,"s")},ms:function(e){return new Ar(e,"ms")},registerProperty:function(e){var t=e.name,n=e.inherits,i=e.interpolable,a=e.initialValue,s=e.syntax;Ke.styleValueRegistry.registerMetadata({n:t,inh:n,int:i,d:a,syntax:s})},registerLayout:function(e,t){Ke.layoutRegistry.registerLayout(e,t)}},ty=function(r){function e(){var t;E(this,e),t=_t(this,e),t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Ke.AnimationTimeline(t)}catch(i){}var n={};return De.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(n[a]=(0,At.Z)(o)?o(he.GROUP):o)}),t.documentElement=new eu({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return Ot(e,r),_(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(n,i){if(n==="svg")return this.documentElement;var a=this.defaultView.customElements.get(n);a||(console.warn("Unsupported tagName: ",n),a=n==="tspan"?ru:eu);var s=new a(i);return s.ownerDocument=this,s}},{key:"createElementNS",value:function(n,i,a){return this.createElement(i,a)}},{key:"cloneNode",value:function(n){throw new Error(Cn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}}},{key:"elementsFromBBox",value:function(n,i,a,s){var o=this.defaultView.context.rBushRoot,l=o.search({minX:n,minY:i,maxX:a,maxY:s}),u=[];return l.forEach(function(c){var h=c.displayObject,d=h.parsedStyle.pointerEvents,f=d===void 0?"auto":d,v=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!v||v&&h.isVisible())&&!h.isCulled()&&h.isInteractive()&&u.push(h)}),u.sort(function(c,h){return h.sortable.renderOrder-c.sortable.renderOrder}),u}},{key:"elementFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),u=l.width,c=l.height;if(s<0||o<0||s>u||o>c)return null;var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),p=v.picked;return p&&p[0]||this.documentElement}},{key:"elementFromPoint",value:function(){var t=Jt(Wt().mark(function i(a,s){var o,l,u,c,h,d,f,v,p,x,A;return Wt().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,u=o.y,c=this.defaultView.getConfig(),h=c.width,d=c.height,!(l<0||u<0||l>h||u>d)){I.next=4;break}return I.abrupt("return",null);case 4:return f=this.defaultView.viewport2Client({x:l,y:u}),v=f.x,p=f.y,I.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:s,viewportX:l,viewportY:u,clientX:v,clientY:p},picked:[]});case 7:return x=I.sent,A=x.picked,I.abrupt("return",A&&A[0]||this.documentElement);case 10:case"end":return I.stop()}},i,this)}));function n(i,a){return t.apply(this,arguments)}return n}()},{key:"elementsFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),u=l.width,c=l.height;if(s<0||o<0||s>u||o>c)return[];var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),p=v.picked;return p[p.length-1]!==this.documentElement&&p.push(this.documentElement),p}},{key:"elementsFromPoint",value:function(){var t=Jt(Wt().mark(function i(a,s){var o,l,u,c,h,d,f,v,p,x,A;return Wt().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,u=o.y,c=this.defaultView.getConfig(),h=c.width,d=c.height,!(l<0||u<0||l>h||u>d)){I.next=4;break}return I.abrupt("return",[]);case 4:return f=this.defaultView.viewport2Client({x:l,y:u}),v=f.x,p=f.y,I.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:s,viewportX:l,viewportY:u,clientX:v,clientY:p},picked:[]});case 7:return x=I.sent,A=x.picked,A[A.length-1]!==this.documentElement&&A.push(this.documentElement),I.abrupt("return",A);case 11:case"end":return I.stop()}},i,this)}));function n(i,a){return t.apply(this,arguments)}return n}()},{key:"appendChild",value:function(n,i){throw new Error(mr)}},{key:"insertBefore",value:function(n,i){throw new Error(mr)}},{key:"removeChild",value:function(n,i){throw new Error(mr)}},{key:"replaceChild",value:function(n,i,a){throw new Error(mr)}},{key:"append",value:function(){throw new Error(mr)}},{key:"prepend",value:function(){throw new Error(mr)}},{key:"getElementById",value:function(n){return this.documentElement.getElementById(n)}},{key:"getElementsByName",value:function(n){return this.documentElement.getElementsByName(n)}},{key:"getElementsByTagName",value:function(n){return this.documentElement.getElementsByTagName(n)}},{key:"getElementsByClassName",value:function(n){return this.documentElement.getElementsByClassName(n)}},{key:"querySelector",value:function(n){return this.documentElement.querySelector(n)}},{key:"querySelectorAll",value:function(n){return this.documentElement.querySelectorAll(n)}},{key:"find",value:function(n){return this.documentElement.find(n)}},{key:"findAll",value:function(n){return this.documentElement.findAll(n)}}])}(ei),ey=function(){function r(e){E(this,r),this.strategies=e}return _(r,[{key:"apply",value:function(t){var n=t.camera,i=t.renderingService,a=t.renderingContext,s=this.strategies;i.hooks.cull.tap(r.tag,function(o){if(o){var l=o.cullable;return s.length===0?l.visible=a.unculledEntities.indexOf(o.entity)>-1:l.visible=s.every(function(u){return u.isVisible(n,o)}),!o.isCulled()&&o.isVisible()?o:(o.dispatchEvent(new Si(or.CULLED)),null)}return o}),i.hooks.afterRender.tap(r.tag,function(o){o.cullable.visibilityPlaneMask=-1})}}])}();ey.tag="Culling";var ny=function(){function r(){var e=this;E(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new ko(null),this.rootWheelEvent=new Ql(null),this.onPointerMove=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView;if(!(i.supportsTouchEvents&&t.pointerType==="touch")){var a=e.normalizeToPointerEvent(t,i),s=qt(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=e.bootstrapEvent(e.rootPointerEvent,l,i,t);e.context.eventService.mapEvent(u)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView,a=e.normalizeToPointerEvent(t,i),s=qt(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=e.bootstrapEvent(e.rootPointerEvent,l,i,t);e.context.eventService.mapEvent(u)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}}return _(r,[{key:"apply",value:function(t){var n=this;this.context=t;var i=t.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=n.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),l=o.picked;return l[0]||null}),i.hooks.pointerWheel.tap(r.tag,function(s){var o=n.normalizeWheelEvent(s);n.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.normalizeToPointerEvent(s,a);if(n.autoPreventDefault&&o[0].isNormalized){var l=s.cancelable||!("cancelable"in s);l&&s.preventDefault()}var u=qt(o),c;try{for(u.s();!(c=u.n()).done;){var h=c.value,d=n.bootstrapEvent(n.rootPointerEvent,h,a,s);n.context.eventService.mapEvent(d)}}catch(f){u.e(f)}finally{u.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.context.contextService.getDomElement(),l=n.context.eventService.isNativeEventFromCanvas(o,s),u=l?"":"outside",c=n.normalizeToPointerEvent(s,a),h=qt(c),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=n.bootstrapEvent(n.rootPointerEvent,f,a,s);v.type+=u,n.context.eventService.mapEvent(v)}}catch(p){h.e(p)}finally{h.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(r.tag,this.onPointerMove),i.hooks.pointerOver.tap(r.tag,this.onPointerMove),i.hooks.pointerOut.tap(r.tag,this.onPointerMove),i.hooks.click.tap(r.tag,this.onClick),i.hooks.pointerCancel.tap(r.tag,function(s){var o=n.normalizeToPointerEvent(s,a),l=qt(o),u;try{for(l.s();!(u=l.n()).done;){var c=u.value,h=n.bootstrapEvent(n.rootPointerEvent,c,a,s);n.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,n,i,a){t.view=i,t.originalEvent=null,t.nativeEvent=a,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var s=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=s.x,l=s.y;t.viewport.x=o,t.viewport.y=l;var u=this.context.eventService.viewport2Canvas(t.viewport),c=u.x,h=u.y;return t.canvas.x=c,t.canvas.y=h,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=a.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ul[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var n=this.rootWheelEvent;this.transferMouseData(n,t),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ;var i=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),a=i.x,s=i.y;n.viewport.x=a,n.viewport.y=s;var o=this.context.eventService.viewport2Canvas(n.viewport),l=o.x,u=o.y;return n.canvas.x=l,n.canvas.y=u,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=t,n.type=t.type,n}},{key:"transferMouseData",value:function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=ki.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,n){var i=[];if(n.isTouchEvent(t))for(var a=0;a<t.changedTouches.length;a++){var s=t.changedTouches[a];(0,Yt.Z)(s.button)&&(s.button=0),(0,Yt.Z)(s.buttons)&&(s.buttons=1),(0,Yt.Z)(s.isPrimary)&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),(0,Yt.Z)(s.width)&&(s.width=s.radiusX||1),(0,Yt.Z)(s.height)&&(s.height=s.radiusY||1),(0,Yt.Z)(s.tiltX)&&(s.tiltX=0),(0,Yt.Z)(s.tiltY)&&(s.tiltY=0),(0,Yt.Z)(s.pointerType)&&(s.pointerType="touch"),(0,Yt.Z)(s.pointerId)&&(s.pointerId=s.identifier||0),(0,Yt.Z)(s.pressure)&&(s.pressure=s.force||.5),(0,Yt.Z)(s.twist)&&(s.twist=0),(0,Yt.Z)(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=t.type,i.push(s)}else if(n.isMouseEvent(t)){var o=t;(0,Yt.Z)(o.isPrimary)&&(o.isPrimary=!0),(0,Yt.Z)(o.width)&&(o.width=1),(0,Yt.Z)(o.height)&&(o.height=1),(0,Yt.Z)(o.tiltX)&&(o.tiltX=0),(0,Yt.Z)(o.tiltY)&&(o.tiltY=0),(0,Yt.Z)(o.pointerType)&&(o.pointerType="mouse"),(0,Yt.Z)(o.pointerId)&&(o.pointerId=ci),(0,Yt.Z)(o.pressure)&&(o.pressure=.5),(0,Yt.Z)(o.twist)&&(o.twist=0),(0,Yt.Z)(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(t);return i}}])}();ny.tag="Event";var ES=[he.CIRCLE,he.ELLIPSE,he.IMAGE,he.RECT,he.LINE,he.POLYLINE,he.POLYGON,he.TEXT,he.PATH,he.HTML],wS=function(){function r(){E(this,r)}return _(r,[{key:"isVisible",value:function(t,n){var i,a=n.cullable;if(!a.enable)return!0;var s=n.getRenderBounds();if(Ln.isEmpty(s))return!1;var o=t.getFrustum(),l=(i=n.parentNode)===null||i===void 0||(i=i.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,s,l||Xe.INDETERMINATE,o.planes),a.visible=a.visibilityPlaneMask!==Xe.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,n,i,a){if(i===Xe.OUTSIDE||i===Xe.INSIDE)return i;for(var s=Xe.INSIDE,o=ES.indexOf(t.nodeName)>-1,l=0,u=a.length;l<u;++l){var c=1<<l;if(i&c&&!(o&&(l===4||l===5))){var h=a[l],d=h.normal,f=h.distance;if(et.AK(d,n.getPositiveFarPoint(a[l]))+f<0)return Xe.OUTSIDE;et.AK(d,n.getNegativeFarPoint(a[l]))+f<0&&(s|=c)}}return s}}])}(),ry=function(){function r(){E(this,r),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return _(r,[{key:"apply",value:function(t){var n=this,i,a=t.renderingService,s=t.renderingContext,o=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=o;var u=function(p){var x=p.target;x.renderable.dirty=!0,a.dirtify()},c=function(p){n.syncTasks.set(p.target,p.detail.affectChildren),a.dirtify()},h=function(p){var x=p.target;Ke.enableSizeAttenuation&&Ke.styleValueRegistry.updateSizeAttenuation(x,l.getCamera().getZoom())},d=function(p){var x=p.target,A=x.rBushNode;A.aabb&&n.rBush.remove(A.aabb),n.syncTasks.delete(x),Ke.sceneGraphService.dirtifyToRoot(x),a.dirtify()};a.hooks.init.tap(r.tag,function(){l.addEventListener(or.MOUNTED,h),l.addEventListener(or.UNMOUNTED,d),l.addEventListener(or.ATTR_MODIFIED,u),l.addEventListener(or.BOUNDS_CHANGED,c)}),a.hooks.destroy.tap(r.tag,function(){l.removeEventListener(or.MOUNTED,h),l.removeEventListener(or.UNMOUNTED,d),l.removeEventListener(or.ATTR_MODIFIED,u),l.removeEventListener(or.BOUNDS_CHANGED,c),n.syncTasks.clear()});var f=(i=Ke.globalThis.requestIdleCallback)!==null&&i!==void 0?i:ar.bind(Ke.globalThis);a.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering?(n.isFirstTimeRendering=!1,n.syncing=!0,f(function(){n.syncRTree(!0),n.isFirstTimeRenderingFinished=!0})):n.syncRTree()})}},{key:"syncNode",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.isConnected){var i=t.rBushNode;i.aabb&&this.rBush.remove(i.aabb);var a=t.getRenderBounds();if(a){var s=t.renderable;n&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new Ln),s.dirtyRenderBounds.update(a.center,a.halfExtents));var o=a.getMin(),l=re(o,2),u=l[0],c=l[1],h=a.getMax(),d=re(h,2),f=d[0],v=d[1];i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=u,i.aabb.minY=c,i.aabb.maxX=f,i.aabb.maxY=v}if(i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY))return i.aabb}}},{key:"syncRTree",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!n&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var i=[],a=new Set,s=function(l){if(!a.has(l)&&l.renderable){var u=t.syncNode(l,n);u&&(i.push(u),a.add(l))}};this.syncTasks.forEach(function(o,l){o&&l.forEach(s);for(var u=l;u;)s(u),u=u.parentElement}),this.rBush.load(i),i.length=0,this.syncing=!1}}}])}();ry.tag="Prepare";function i5(r){return!!r.document}var Ma=function(r){return r.READY="ready",r.BEFORE_RENDER="beforerender",r.RERENDER="rerender",r.AFTER_RENDER="afterrender",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.RESIZE="resize",r.DIRTY_RECTANGLE="dirtyrectangle",r.RENDERER_CHANGED="rendererchanged",r}({}),iy=500,SS=.1,_S=1e3,td=new Si(or.MOUNTED),ed=new Si(or.UNMOUNTED),Ag=new Si(Ma.BEFORE_RENDER),ay=new Si(Ma.RERENDER),Cg=new Si(Ma.AFTER_RENDER),Pg=function(r){function e(t){var n;E(this,e),n=_t(this,e),n.Element=ni,n.inited=!1,n.context={},n.document=new ty,n.document.defaultView=n,n.customElements=new xS;var i=t.container,a=t.canvas,s=t.offscreenCanvas,o=t.width,l=t.height,u=t.devicePixelRatio,c=t.renderer,h=t.background,d=t.cursor,f=t.document,v=t.requestAnimationFrame,p=t.cancelAnimationFrame,x=t.createImage,A=t.enableLargeImageOptimization,N=t.supportsPointerEvents,I=t.supportsTouchEvents,K=t.supportsCSSTransform,W=t.cleanUpOnDestroy,z=W===void 0?!0:W,j=t.supportsMutipleCanvasesInOneContainer,Z=t.useNativeClickEvent,vt=t.alwaysTriggerPointerEventOnCanvas,Tt=t.isTouchEvent,zt=t.isMouseEvent,Qt=t.dblClickSpeed;j||Wn(i,n,z);var ae=o,fe=l,ce=u;return a&&(ce=u||Zn&&window.devicePixelRatio||1,ce=ce>=1?Math.ceil(ce):1,ae=o||Mi(a)||a.width/ce,fe=l||Is(a)||a.height/ce),s&&(Ke.offscreenCanvas=s),n.devicePixelRatio=ce,n.requestAnimationFrame=v!=null?v:ar.bind(Ke.globalThis),n.cancelAnimationFrame=p!=null?p:$r.bind(Ke.globalThis),n.supportsTouchEvents=I!=null?I:"ontouchstart"in Ke.globalThis,n.supportsPointerEvents=N!=null?N:!!Ke.globalThis.PointerEvent,n.isTouchEvent=Tt!=null?Tt:function(ct){return n.supportsTouchEvents&&ct instanceof Ke.globalThis.TouchEvent},n.isMouseEvent=zt!=null?zt:function(ct){return!Ke.globalThis.MouseEvent||ct instanceof Ke.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(ct instanceof Ke.globalThis.PointerEvent))},n.dblClickSpeed=Qt!=null?Qt:200,n.initRenderingContext({container:i,canvas:a,width:ae,height:fe,renderer:c,offscreenCanvas:s,devicePixelRatio:ce,cursor:d||"default",background:h||"transparent",createImage:x,enableLargeImageOptimization:A,document:f,supportsCSSTransform:K,useNativeClickEvent:Z,cleanUpOnDestroy:z,alwaysTriggerPointerEventOnCanvas:vt}),n.initDefaultCamera(ae,fe,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return Ot(e,r),_(e,[{key:"initRenderingContext",value:function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(n,i,a){var s=this,o=new Ke.CameraContribution;o.clipSpaceNearZ=a,o.setType(Or.EXPLORING,Zu.DEFAULT).setPosition(n/2,i/2,iy).setFocalPoint(n/2,i/2,0).setOrthographic(n/-2,n/2,i/2,i/-2,SS,_S),o.canvas=this,o.eventEmitter.on(Zv.UPDATED,function(){s.context.renderingContext.renderReasons.add(Jl.CAMERA_CHANGED),Ke.enableSizeAttenuation&&s.getConfig().renderer.getConfig().enableSizeAttenuation&&s.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(i){Ke.styleValueRegistry.updateSizeAttenuation(i,n)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(i){n.resolveReadyPromise=function(){i(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1?arguments[1]:void 0;i===void 0&&(i=this.getConfig().fastCleanExistingCanvas),i||this.dispatchEvent(new Si(Ma.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var a=this.getRoot();this.unmountChildren(a),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),i||this.dispatchEvent(new Si(Ma.AFTER_DESTROY));var s=function(l){l.currentTarget=null,l.manager=null,l.target=null,l.relatedNode=null};s(td),s(ed),s(Ag),s(ay),s(Cg),s(js),s(kg),s(Tg),s(qm)}},{key:"changeSize",value:function(n,i){this.resize(n,i)}},{key:"resize",value:function(n,i){var a=this.context.config;a.width=n,a.height=i,this.getContextService().resize(n,i);var s=this.context.camera,o=s.getProjectionMode();s.setPosition(n/2,i/2,iy).setFocalPoint(n/2,i/2,0),o===xa.ORTHOGRAPHIC?s.setOrthographic(n/-2,n/2,i/2,i/-2,s.getNear(),s.getFar()):s.setAspect(n/i),this.dispatchEvent(new Si(Ma.RESIZE,{width:n,height:i}))}},{key:"appendChild",value:function(n,i){return this.document.documentElement.appendChild(n,i)}},{key:"insertBefore",value:function(n,i){return this.document.documentElement.insertBefore(n,i)}},{key:"removeChild",value:function(n){return this.document.documentElement.removeChild(n)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(n){var i=this;n&&(Ag.detail=n,Cg.detail=n),this.dispatchEvent(Ag);var a=this.getRenderingService();a.render(this.getConfig(),n,function(){i.dispatchEvent(ay)}),this.dispatchEvent(Cg)}},{key:"run",value:function(){var n=this,i=function(s,o){n.render(o),n.frameId=n.requestAnimationFrame(i)};i()}},{key:"initRenderer",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Be,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ny,new ry,new ey([new wS])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(b(b({},Ke),this.context)),this.context.renderingService=new F2(Ke,this.context),this.context.eventService=new I2(Ke,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,a,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,a)})}},{key:"initRenderingService",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){i.inited=!0,a?s?i.requestAnimationFrame(function(){i.dispatchEvent(new Si(Ma.READY))}):i.dispatchEvent(new Si(Ma.READY)):i.dispatchEvent(new Si(Ma.RENDERER_CHANGED)),i.readyPromise&&i.resolveReadyPromise(),a||i.getRoot().forEach(function(o){var l=o,u=l.renderable;u&&(u.renderBoundsDirty=!0,u.boundsDirty=!0,u.dirty=!0)}),i.mountChildren(i.getRoot()),n.getConfig().enableAutoRendering&&i.run()})}},{key:"loadRendererContainerModule",value:function(n){var i=this,a=n.getPlugins();a.forEach(function(s){s.context=i.context,s.init(Ke)})}},{key:"setRenderer",value:function(n){var i=this.getConfig();if(i.renderer!==n){var a=i.renderer;i.renderer=n,this.destroy(!1,!0),xt((a==null?void 0:a.getPlugins())||[]).reverse().forEach(function(s){s.destroy(Ke)}),this.initRenderer(n)}}},{key:"setCursor",value:function(n){var i=this.getConfig();i.cursor=n,this.getContextService().applyCursorStyle(n)}},{key:"unmountChildren",value:function(n){var i=this;n.childNodes.forEach(function(a){i.unmountChildren(a)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(ed):(ed.target=n,this.dispatchEvent(ed,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()}},{key:"mountChildren",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fs(n);this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,a||(n.isMutationObserved?n.dispatchEvent(td):(td.target=n,this.dispatchEvent(td,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName),n.childNodes.forEach(function(s){i.mountChildren(s,a)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()}},{key:"mountFragment",value:function(n){this.mountChildren(n,!1)}},{key:"client2Viewport",value:function(n){return this.getEventService().client2Viewport(n)}},{key:"viewport2Client",value:function(n){return this.getEventService().viewport2Client(n)}},{key:"viewport2Canvas",value:function(n){return this.getEventService().viewport2Canvas(n)}},{key:"canvas2Viewport",value:function(n){return this.getEventService().canvas2Viewport(n)}},{key:"getPointByClient",value:function(n,i){return this.client2Viewport({x:n,y:i})}},{key:"getClientByPoint",value:function(n,i){return this.viewport2Client({x:n,y:i})}}])}(Hm);function rn(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ao(r){"@babel/helpers - typeof";return Ao=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},Ao(r)}function MS(r,e){if(Ao(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Ao(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function sy(r){var e=MS(r,"string");return Ao(e)=="symbol"?e:e+""}function oy(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,sy(n.key),n)}}function an(r,e,t){return e&&oy(r.prototype,e),t&&oy(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function iu(r){return iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iu(r)}function ly(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ly=function(){return!!r})()}function kS(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function TS(r,e){if(e&&(Ao(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kS(r)}function dr(r,e,t){return e=iu(e),TS(r,ly()?Reflect.construct(e,t||[],iu(r).constructor):e.apply(r,t))}function Ng(r,e){return Ng=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Ng(r,e)}function fr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Ng(r,e)}var OS=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.landmarks=[],t}return fr(e,r),an(e,[{key:"rotate",value:function(n,i,a){if(this.relElevation=Kr(i),this.relAzimuth=Kr(n),this.relRoll=Kr(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Or.EXPLORING){var s=Xt.yY(Xt.Ue(),[1,0,0],qn((this.rotateWorld?1:-1)*this.relElevation)),o=Xt.yY(Xt.Ue(),[0,1,0],qn((this.rotateWorld?1:-1)*this.relAzimuth)),l=Xt.yY(Xt.Ue(),[0,0,1],qn(this.relRoll)),u=Xt.Jp(Xt.Ue(),o,s);u=Xt.Jp(Xt.Ue(),u,l);var c=yt.fromQuat(yt.create(),u);yt.translate(this.matrix,this.matrix,[0,0,-this.distance]),yt.multiply(this.matrix,this.matrix,c),yt.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Or.ORBITING||this.type===Or.EXPLORING?this._getPosition():this.type===Or.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=ur(n,i,0),s=et.d9(this.position);return et.IH(s,s,et.bA(et.Ue(),this.right,a[0])),et.IH(s,s,et.bA(et.Ue(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(n){var i=this.forward,a=et.d9(this.position),s=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===Or.ORBITING||this.type===Or.EXPLORING?this._getDistance():this.type===Or.TRACKING&&et.IH(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(n){var i,a,s,o,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=l.position,c=u===void 0?this.position:u,h=l.focalPoint,d=h===void 0?this.focalPoint:h,f=l.roll,v=l.zoom,p=new Ke.CameraContribution;p.setType(this.type,void 0),p.setPosition(c[0],(i=c[1])!==null&&i!==void 0?i:this.position[1],(a=c[2])!==null&&a!==void 0?a:this.position[2]),p.setFocalPoint(d[0],(s=d[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),p.setRoll(f!=null?f:this.roll),p.setZoom(v!=null?v:this.zoom);var x={name:n,matrix:yt.clone(p.getWorldTransform()),right:et.d9(p.right),up:et.d9(p.up),forward:et.d9(p.forward),position:et.d9(p.getPosition()),focalPoint:et.d9(p.getFocalPoint()),distanceVector:et.d9(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(x),x}},{key:"gotoLandmark",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(0,Gt.Z)(n)?this.landmarks.find(function(zt){return zt.name===n}):n;if(s){var o=(0,bt.Z)(a)?{duration:a}:a,l=o.easing,u=l===void 0?"linear":l,c=o.duration,h=c===void 0?100:c,d=o.easingFunction,f=d===void 0?void 0:d,v=o.onfinish,p=v===void 0?void 0:v,x=o.onframe,A=x===void 0?void 0:x,N=.01;this.cancelLandmarkAnimation();var I=s.position,K=s.focalPoint,W=s.zoom,z=s.roll,j=f||Ke.EasingFunction(u),Z,vt=function(){i.setFocalPoint(K),i.setPosition(I),i.setRoll(z),i.setZoom(W),i.computeMatrix(),i.triggerUpdate(),p==null||p()};if(h===0)return vt();var Tt=function(Qt){Z===void 0&&(Z=Qt);var ae=Qt-Z;if(ae>=h){vt();return}var fe=j(ae/h),ce=et.Ue(),ct=et.Ue(),$=1,Q=0;et.t7(ce,i.focalPoint,K,fe),et.t7(ct,i.position,I,fe),Q=i.roll*(1-fe)+z*fe,$=i.zoom*(1-fe)+W*fe,i.setFocalPoint(ce),i.setPosition(ct),i.setRoll(Q),i.setZoom($);var It=et.TK(ce,K)+et.TK(ct,I);if(It<=N&&W===void 0&&z===void 0)return vt();i.computeMatrix(),i.triggerUpdate(),ae<h&&(A==null||A(fe),i.landmarkAnimationID=i.canvas.requestAnimationFrame(Tt))};this.canvas.requestAnimationFrame(Tt)}}}])}(Yv);Ke.CameraContribution=OS;var uy=null,a5=0,cy=new WeakMap,s5=null,o5=null,nd,io;function l5(r,e){return nd=new uy(r,e)}function u5(r){return io||(io=uy.copy(nd),io.oldValue=r,io)}function c5(){nd=io=void 0}function AS(r){return r===io||r===nd}function h5(r,e){return r===e?r:io&&AS(r)?io:null}function CS(r){r.nodes.forEach(function(e){var t=cy.get(e);t&&t.forEach(function(n){n.observer===r&&n.removeTransientObservers()})})}function d5(r,e){for(var t=r;t;t=t.parentNode){var n=cy.get(t);if(n)for(var i=0;i<n.length;i++){var a=n[i],s=a.options;if(!(t!==r&&!s.subtree)){var o=e(s);o&&a.enqueue(o)}}}}var Rg=!1,Lg=null;function f5(r){Lg.push(r),Rg||(Rg=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(Dg):Dg())}function Dg(){Rg=!1;var r=Lg;Lg=[],r.sort(function(t,n){return t.uid-n.uid});var e=!1;r.forEach(function(t){var n=t.takeRecords();CS(t),n.length&&(t.callback(n,t),e=!0)}),e&&Dg()}function Ig(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function PS(r){if(Array.isArray(r))return Ig(r)}function NS(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Fg(r,e){if(r){if(typeof r=="string")return Ig(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ig(r,e):void 0}}function RS(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ea(r){return PS(r)||NS(r)||Fg(r)||RS()}function LS(r){if(Array.isArray(r))return r}function DS(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function IS(){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 Mr(r,e){return LS(r)||DS(r,e)||Fg(r,e)||IS()}var Bg=function(r){function e(t,n,i,a){var s;return rn(this,e),s=dr(this,e,[t]),s.currentTime=i,s.timelineTime=a,s.target=n,s.type="finish",s.bubbles=!1,s.currentTarget=n,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return fr(e,r),an(e)}(cl),FS=0,BS=function(){function r(e,t){var n;rn(this,r),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=t,this.id="".concat(FS++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((n=this.effect)===null||n===void 0?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return an(r,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,i){t.resolveReadyPromise=function(){n(t)},t.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,i){t.resolveFinishedPromise=function(){n(t)},t.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var n;this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-t/this.playbackRate}this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(t!==null){if(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=t,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==t&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):t==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==t&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():t==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new Bg(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)}},{key:"tick",value:function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(Cn)}},{key:"addEventListener",value:function(t,n,i){throw new Error(Cn)}},{key:"removeEventListener",value:function(t,n,i){throw new Error(Cn)}},{key:"dispatchEvent",value:function(t){throw new Error(Cn)}},{key:"commitStyles",value:function(){throw new Error(Cn)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var t;this._inEffect=!!((t=this.effect)!==null&&t!==void 0&&t.update(-1))}else{var n;this._inEffect=!!((n=this.effect)!==null&&n!==void 0&&n.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new Bg(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new Bg(null,this,this.currentTime,t);this.onframe(a)}this._finishedFlag=!1}}}])}(),zS=4,jS=.001,GS=1e-7,WS=10,hc=11,rd=1/(hc-1),US=typeof Float32Array=="function",hy=function(e,t){return 1-3*t+3*e},dy=function(e,t){return 3*t-6*e},fy=function(e){return 3*e},id=function(e,t,n){return((hy(t,n)*e+dy(t,n))*e+fy(t))*e},vy=function(e,t,n){return 3*hy(t,n)*e*e+2*dy(t,n)*e+fy(t)},ZS=function(e,t,n,i,a){var s,o,l=0;do o=t+(n-t)/2,s=id(o,i,a)-e,s>0?n=o:t=o;while(Math.abs(s)>GS&&++l<WS);return o},VS=function(e,t,n,i){for(var a=0;a<zS;++a){var s=vy(t,n,i);if(s===0)return t;var o=id(t,n,i)-e;t-=o/s}return t},zg=function(e,t,n,i){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return function(l){return l};for(var a=US?new Float32Array(hc):new Array(hc),s=0;s<hc;++s)a[s]=id(s*rd,e,n);var o=function(u){for(var c=0,h=1,d=hc-1;h!==d&&a[h]<=u;++h)c+=rd;--h;var f=(u-a[h])/(a[h+1]-a[h]),v=c+f*rd,p=vy(v,e,n);return p>=jS?VS(u,v,e,n):p===0?v:ZS(u,c,c+rd,e,n)};return function(l){return l===0||l===1?l:id(o(l),t,i)}},YS=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},ad=function(e){return Math.pow(e,2)},sd=function(e){return Math.pow(e,3)},od=function(e){return Math.pow(e,4)},ld=function(e){return Math.pow(e,5)},ud=function(e){return Math.pow(e,6)},cd=function(e){return 1-Math.cos(e*Math.PI/2)},hd=function(e){return 1-Math.sqrt(1-e*e)},dd=function(e){return e*e*(3*e-2)},fd=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},vd=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=Mr(t,2),i=n[0],a=i===void 0?1:i,s=n[1],o=s===void 0?.5:s,l=(0,Kt.Z)(Number(a),1,10),u=(0,Kt.Z)(Number(o),.1,2);return e===0||e===1?e:-l*Math.pow(2,10*(e-1))*Math.sin((e-1-u/(Math.PI*2)*Math.asin(1/l))*(Math.PI*2)/u)},dc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=Mr(t,4),a=i[0],s=a===void 0?1:a,o=i[1],l=o===void 0?100:o,u=i[2],c=u===void 0?10:u,h=i[3],d=h===void 0?0:h;s=(0,Kt.Z)(s,.1,1e3),l=(0,Kt.Z)(l,.1,1e3),c=(0,Kt.Z)(c,.1,1e3),d=(0,Kt.Z)(d,.1,1e3);var f=Math.sqrt(l/s),v=c/(2*Math.sqrt(l*s)),p=v<1?f*Math.sqrt(1-v*v):0,x=1,A=v<1?(v*f+-d)/p:-d+f,N=n?n*e/1e3:e;return v<1?N=Math.exp(-N*v*f)*(x*Math.cos(p*N)+A*Math.sin(p*N)):N=(x+A*N)*Math.exp(-N*f),e===0||e===1?e:1-N},jg=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=t,i=Mr(n,2),a=i[0],s=a===void 0?10:a,o=i[1],l=o==="start"?Math.ceil:Math.floor;return l((0,Kt.Z)(e,0,1)*s)/s},gy=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=Mr(t,4),i=n[0],a=n[1],s=n[2],o=n[3];return zg(i,a,s,o)(e)},gd=zg(.42,0,1,1),Qa=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-e(1-t,n,i)}},Ja=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?e(t*2,n,i)/2:1-e(t*-2+2,n,i)/2}},qa=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?(1-e(1-t*2,n,i))/2:(e(t*2-1,n,i)+1)/2}},py={steps:jg,"step-start":function(e){return jg(e,[1,"start"])},"step-end":function(e){return jg(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":gy,ease:function(e){return gy(e,[.25,.1,.25,1])},in:gd,out:Qa(gd),"in-out":Ja(gd),"out-in":qa(gd),"in-quad":ad,"out-quad":Qa(ad),"in-out-quad":Ja(ad),"out-in-quad":qa(ad),"in-cubic":sd,"out-cubic":Qa(sd),"in-out-cubic":Ja(sd),"out-in-cubic":qa(sd),"in-quart":od,"out-quart":Qa(od),"in-out-quart":Ja(od),"out-in-quart":qa(od),"in-quint":ld,"out-quint":Qa(ld),"in-out-quint":Ja(ld),"out-in-quint":qa(ld),"in-expo":ud,"out-expo":Qa(ud),"in-out-expo":Ja(ud),"out-in-expo":qa(ud),"in-sine":cd,"out-sine":Qa(cd),"in-out-sine":Ja(cd),"out-in-sine":qa(cd),"in-circ":hd,"out-circ":Qa(hd),"in-out-circ":Ja(hd),"out-in-circ":qa(hd),"in-back":dd,"out-back":Qa(dd),"in-out-back":Ja(dd),"out-in-back":qa(dd),"in-bounce":fd,"out-bounce":Qa(fd),"in-out-bounce":Ja(fd),"out-in-bounce":qa(fd),"in-elastic":vd,"out-elastic":Qa(vd),"in-out-elastic":Ja(vd),"out-in-elastic":qa(vd),spring:dc,"spring-in":dc,"spring-out":Qa(dc),"spring-in-out":Ja(dc),"spring-out-in":qa(dc)},HS=function(e){return YS(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},XS=function(e){return py[HS(e)]||py.linear},KS=function(e){return e},$S=1,QS=.5,my=0;function yy(r,e){return function(t){if(t>=1)return 1;var n=1/r;return t+=e*n,t-t%n}}var pd="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",JS=new RegExp("cubic-bezier\\(".concat(pd,",").concat(pd,",").concat(pd,",").concat(pd,"\\)")),qS=/steps\(\s*(\d+)\s*\)/,t_=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Gg(r){var e=JS.exec(r);if(e)return zg.apply(void 0,ea(e.slice(1).map(Number)));var t=qS.exec(r);if(t)return yy(Number(t[1]),my);var n=t_.exec(r);return n?yy(Number(n[1]),{start:$S,middle:QS,end:my}[n[2]]):XS(r)}function e_(r){return Math.abs(n_(r)/(r.playbackRate||1))}function n_(r){var e;return r.duration===0||r.iterations===0?0:(r.duration==="auto"?0:Number(r.duration))*((e=r.iterations)!==null&&e!==void 0?e:1)}var by=0,Wg=1,md=2,xy=3;function r_(r,e,t){if(e===null)return by;var n=t.endTime;return e<Math.min(t.delay,n)?Wg:e>=Math.min(t.delay+r+t.endDelay,n)?md:xy}function i_(r,e,t,n,i){switch(n){case Wg:return e==="backwards"||e==="both"?0:null;case xy:return t-i;case md:return e==="forwards"||e==="both"?r:null;case by:return null}}function a_(r,e,t,n,i){var a=i;return r===0?e!==Wg&&(a+=t):a+=n/r,a}function s_(r,e,t,n,i,a){var s=r===1/0?e%1:r%1;return s===0&&t===md&&n!==0&&(i!==0||a===0)&&(s=1),s}function o_(r,e,t,n){return r===md&&e===1/0?1/0:t===1?Math.floor(n)-1:Math.floor(n)}function l_(r,e,t){var n=r;if(r!=="normal"&&r!=="reverse"){var i=e;r==="alternate-reverse"&&(i+=1),n="normal",i!==1/0&&i%2!==0&&(n="reverse")}return n==="normal"?t:1-t}function u_(r,e,t){var n=r_(r,e,t),i=i_(r,t.fill,e,n,t.delay);if(i===null)return null;var a=t.duration==="auto"?0:t.duration,s=a_(a,n,t.iterations,i,t.iterationStart),o=s_(s,t.iterationStart,n,t.iterations,i,a),l=o_(n,t.iterations,o,s),u=l_(t.direction,l,o);return t.currentIteration=l,t.progress=u,t.easingFunction(u)}function c_(r,e,t){var n=h_(r,e),i=d_(n,t);return function(a,s){if(s!==null)i.filter(function(l){return s>=l.applyFrom&&s<l.applyTo}).forEach(function(l){var u=s-l.startOffset,c=l.endOffset-l.startOffset,h=c===0?0:u/c;a.setAttribute(l.property,l.interpolation(h),!1,!1)});else for(var o in n)Ey(o)&&a.setAttribute(o,null)}}function Ey(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function h_(r,e){for(var t={},n=0;n<r.length;n++)for(var i in r[n])if(Ey(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:Gg(r[n].easing)||e.easingFunction,value:r[n][i]};t[i]=t[i]||[],t[i].push(a)}return t}function d_(r,e){var t=[];for(var n in r)for(var i=r[n],a=0;a<i.length-1;a++){var s=a,o=a+1,l=i[s].computedOffset,u=i[o].computedOffset,c=l,h=u;a===0&&(c=-1/0,u===0&&(o=s)),a===i.length-2&&(h=1/0,l===1&&(s=o)),t.push({applyFrom:c,applyTo:h,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:n,interpolation:f_(n,i[s].value,i[o].value,e)})}return t.sort(function(d,f){return d.startOffset-f.startOffset}),t}var wy=function(e,t,n){return function(i){var a=Sy(e,t,i);return(0,bt.Z)(a)?a:n(a)}};function f_(r,e,t,n){var i=Ze[r];if(i&&i.syntax&&i.int){var a=Ke.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(e,n):e,l=s?s(t,n):t,u=a.mixer(o,l,n);if(u){var c=wy.apply(void 0,ea(u));return function(h){return h===0?e:h===1?t:c(h)}}}}return wy(!1,!0,function(h){return h?t:e})}function Sy(r,e,t){if(typeof r=="number"&&typeof e=="number")return r*(1-t)+e*t;if(typeof r=="boolean"&&typeof e=="boolean"||typeof r=="string"&&typeof e=="string")return t<.5?r:e;if(Array.isArray(r)&&Array.isArray(e)){for(var n=r.length,i=e.length,a=Math.max(n,i),s=[],o=0;o<a;o++)s.push(Sy(r[o<n?o:n-1],e[o<i?o:i-1],t));return s}throw new Error("Mismatched interpolation arguments ".concat(r,":").concat(e))}var v_=function(){function r(){rn(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=KS,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return an(r,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Gg(t),this._easing=t}}])}();function g_(r){var e=[];for(var t in r)if(!(t in["easing","offset","composite"])){var n=r[t];Array.isArray(n)||(n=[n]);for(var i=n.length,a=0;a<i;a++){if(!e[a]){var s={};"offset"in r&&(s.offset=Number(r.offset)),"easing"in r&&(s.easing=r.easing),"composite"in r&&(s.composite=r.composite),e[a]=s}n[a]!==void 0&&n[a]!==null&&(e[a][t]=n[a])}}return e.sort(function(o,l){return(o.computedOffset||0)-(l.computedOffset||0)}),e}function _y(r,e){if(r===null)return[];Array.isArray(r)||(r=g_(r));for(var t=r.map(function(l){var u={};e!=null&&e.composite&&(u.composite="auto");for(var c in l){var h=l[c];if(c==="offset"){if(h!==null){if(h=Number(h),!isFinite(h))throw new Error("Keyframe offsets must be numbers.");if(h<0||h>1)throw new Error("Keyframe offsets must be between 0 and 1.");u.computedOffset=h}}else if(c==="composite"&&["replace","add","accumulate","auto"].indexOf(h)===-1)throw new Error("".concat(h," compositing is not supported"));u[c]=h}return u.offset===void 0&&(u.offset=null),u.easing===void 0&&(u.easing=(e==null?void 0:e.easing)||"linear"),u.composite===void 0&&(u.composite="auto"),u}),n=!0,i=-1/0,a=0;a<t.length;a++){var s=t[a].offset;if((0,be.Z)(s))n=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}t=t.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function o(){var l,u=t,c=u.length;if(t[c-1].computedOffset=Number((l=t[c-1].offset)!==null&&l!==void 0?l:1),c>1){var h;t[0].computedOffset=Number((h=t[0].offset)!==null&&h!==void 0?h:0)}for(var d=0,f=Number(t[0].computedOffset),v=1;v<c;v++){var p=t[v].computedOffset;if(!(0,be.Z)(p)&&!(0,be.Z)(f)){for(var x=1;x<v-d;x++)t[d+x].computedOffset=f+(Number(p)-f)*x/(v-d);d=v,f=Number(p)}}}return n||o(),t}var p_="backwards|forwards|both|none".split("|"),m_="reverse|alternate|alternate-reverse".split("|");function y_(r,e){var t=new v_;return e&&(t.fill="both",t.duration="auto"),typeof r=="number"&&!isNaN(r)?t.duration=r:r!==void 0&&Object.keys(r).forEach(function(n){if(r[n]!==void 0&&r[n]!==null&&r[n]!=="auto"){if((typeof t[n]=="number"||n==="duration")&&(typeof r[n]!="number"||isNaN(r[n]))||n==="fill"&&p_.indexOf(r[n])===-1||n==="direction"&&m_.indexOf(r[n])===-1)return;t[n]=r[n]}}),t}function b_(r,e){var t;return r=x_((t=r)!==null&&t!==void 0?t:{duration:"auto"}),y_(r,e)}function x_(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var E_=function(){function r(e,t,n){var i=this;rn(this,r),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=b_(n,!1),this.timing.effect=this,this.timing.activeDuration=e_(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=_y(t,this.timing),this.interpolations=c_(this.normalizedKeyframes,this.timing,this.target);var a=Ke.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,l){return l==="duration"?o.duration==="auto"?0:o.duration:l==="fill"?o.fill==="auto"?"none":o.fill:l==="localTime"?i.animation&&i.animation.currentTime||null:l==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:l==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[l]},set:function(){return!0}}):this.timing}return an(r,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return t===null?!1:(this.timeFraction=u_(this.timing.activeDuration,t,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=_y(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var n=this;Object.keys(t||{}).forEach(function(i){n.timing[i]=t[i]})}}])}();function My(r,e){return Number(r.id)-Number(e.id)}var w_=function(){function r(e){var t=this;rn(this,r),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(n){t.currentTime=n,t.discardAnimations(),t.animations.length===0?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(n){var i=t.rafCallbacks;t.rafCallbacks=[],n<Number(t.currentTime)&&(n=Number(t.currentTime)),t.animations.sort(My),t.animations=t.tick(n,!0,t.animations)[0],i.forEach(function(a){a[1](n)}),t.applyPendingEffects()},this.document=e}return an(r,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,n,i){var a=new E_(t,n,i),s=new BS(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(t){var n=this;if(!this.inTick){t.markTarget();var i=t.targetAnimations();i.sort(My);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=n.animations.indexOf(s);o!==-1&&n.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){t==null||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return t.playState!=="finished"&&t.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,t]),n}},{key:"requestAnimationFrame",value:function(t){var n=this;return this.rAF(function(i){n.updateAnimationsPromises(),t(i),n.updateAnimationsPromises()})}},{key:"tick",value:function(t,n,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var l=[],u=[],c=[],h=[];return i.forEach(function(d){d.tick(t,n),d._inEffect?(u.push(d.effect),d.markTarget()):(l.push(d.effect),d.unmarkTarget()),d._needsTick&&(a.ticking=!0);var f=d._inEffect||d._needsTick;d._inTimeline=f,f?c.push(d):h.push(d)}),(s=this.pendingEffects).push.apply(s,l),(o=this.pendingEffects).push.apply(o,u),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,h]}}])}();Ke.EasingFunction=Gg,Ke.AnimationTimeline=w_;var yd=g(83914),pi=g(30335);const S_={duration:500},__={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"},v5={CHANGE:"change"};var Qr;(function(r){r.NodeAdded="NodeAdded",r.NodeUpdated="NodeUpdated",r.NodeRemoved="NodeRemoved",r.EdgeAdded="EdgeAdded",r.EdgeUpdated="EdgeUpdated",r.EdgeRemoved="EdgeRemoved",r.ComboAdded="ComboAdded",r.ComboUpdated="ComboUpdated",r.ComboRemoved="ComboRemoved"})(Qr||(Qr={}));var ha;(function(r){r.DRAW="draw",r.COLLAPSE="collapse",r.EXPAND="expand",r.TRANSFORM="transform"})(ha||(ha={}));var ao;(function(r){r.CLICK="canvas:click",r.DBLCLICK="canvas:dblclick",r.POINTER_OVER="canvas:pointerover",r.POINTER_LEAVE="canvas:pointerleave",r.POINTER_ENTER="canvas:pointerenter",r.POINTER_MOVE="canvas:pointermove",r.POINTER_OUT="canvas:pointerout",r.POINTER_DOWN="canvas:pointerdown",r.POINTER_UP="canvas:pointerup",r.CONTEXT_MENU="canvas:contextmenu",r.DRAG_START="canvas:dragstart",r.DRAG="canvas:drag",r.DRAG_END="canvas:dragend",r.DRAG_ENTER="canvas:dragenter",r.DRAG_OVER="canvas:dragover",r.DRAG_LEAVE="canvas:dragleave",r.DROP="canvas:drop",r.WHEEL="canvas:wheel"})(ao||(ao={}));var fl;(function(r){r.CLICK="combo:click",r.DBLCLICK="combo:dblclick",r.POINTER_OVER="combo:pointerover",r.POINTER_LEAVE="combo:pointerleave",r.POINTER_ENTER="combo:pointerenter",r.POINTER_MOVE="combo:pointermove",r.POINTER_OUT="combo:pointerout",r.POINTER_DOWN="combo:pointerdown",r.POINTER_UP="combo:pointerup",r.CONTEXT_MENU="combo:contextmenu",r.DRAG_START="combo:dragstart",r.DRAG="combo:drag",r.DRAG_END="combo:dragend",r.DRAG_ENTER="combo:dragenter",r.DRAG_OVER="combo:dragover",r.DRAG_LEAVE="combo:dragleave",r.DROP="combo:drop"})(fl||(fl={}));var Ue;(function(r){r.CLICK="click",r.DBLCLICK="dblclick",r.POINTER_OVER="pointerover",r.POINTER_LEAVE="pointerleave",r.POINTER_ENTER="pointerenter",r.POINTER_MOVE="pointermove",r.POINTER_OUT="pointerout",r.POINTER_DOWN="pointerdown",r.POINTER_UP="pointerup",r.CONTEXT_MENU="contextmenu",r.DRAG_START="dragstart",r.DRAG="drag",r.DRAG_END="dragend",r.DRAG_ENTER="dragenter",r.DRAG_OVER="dragover",r.DRAG_LEAVE="dragleave",r.DROP="drop",r.KEY_DOWN="keydown",r.KEY_UP="keyup",r.WHEEL="wheel"})(Ue||(Ue={}));var au;(function(r){r.KEY_DOWN="keydown",r.KEY_UP="keyup"})(au||(au={}));var bd;(function(r){r.CLICK="edge:click",r.DBLCLICK="edge:dblclick",r.POINTER_OVER="edge:pointerover",r.POINTER_LEAVE="edge:pointerleave",r.POINTER_ENTER="edge:pointerenter",r.POINTER_MOVE="edge:pointermove",r.POINTER_OUT="edge:pointerout",r.POINTER_DOWN="edge:pointerdown",r.POINTER_UP="edge:pointerup",r.CONTEXT_MENU="edge:contextmenu",r.DRAG_ENTER="edge:dragenter",r.DRAG_OVER="edge:dragover",r.DRAG_LEAVE="edge:dragleave",r.DROP="edge:drop"})(bd||(bd={}));var sn;(function(r){r.BEFORE_CANVAS_INIT="beforecanvasinit",r.AFTER_CANVAS_INIT="aftercanvasinit",r.BEFORE_SIZE_CHANGE="beforesizechange",r.AFTER_SIZE_CHANGE="aftersizechange",r.BEFORE_ELEMENT_CREATE="beforeelementcreate",r.AFTER_ELEMENT_CREATE="afterelementcreate",r.BEFORE_ELEMENT_UPDATE="beforeelementupdate",r.AFTER_ELEMENT_UPDATE="afterelementupdate",r.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",r.AFTER_ELEMENT_DESTROY="afterelementdestroy",r.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",r.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",r.BEFORE_DRAW="beforedraw",r.AFTER_DRAW="afterdraw",r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_ANIMATE="beforeanimate",r.AFTER_ANIMATE="afteranimate",r.BEFORE_LAYOUT="beforelayout",r.AFTER_LAYOUT="afterlayout",r.BEFORE_STAGE_LAYOUT="beforestagelayout",r.AFTER_STAGE_LAYOUT="afterstagelayout",r.BEFORE_TRANSFORM="beforetransform",r.AFTER_TRANSFORM="aftertransform",r.BATCH_START="batchstart",r.BATCH_END="batchend",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.BEFORE_RENDERER_CHANGE="beforerendererchange",r.AFTER_RENDERER_CHANGE="afterrendererchange"})(sn||(sn={}));var Co;(function(r){r.UNDO="undo",r.REDO="redo",r.CANCEL="cancel",r.ADD="add",r.CLEAR="clear",r.CHANGE="change"})(Co||(Co={}));var ts;(function(r){r.CLICK="node:click",r.DBLCLICK="node:dblclick",r.POINTER_OVER="node:pointerover",r.POINTER_LEAVE="node:pointerleave",r.POINTER_ENTER="node:pointerenter",r.POINTER_MOVE="node:pointermove",r.POINTER_OUT="node:pointerout",r.POINTER_DOWN="node:pointerdown",r.POINTER_UP="node:pointerup",r.CONTEXT_MENU="node:contextmenu",r.DRAG_START="node:dragstart",r.DRAG="node:drag",r.DRAG_END="node:dragend",r.DRAG_ENTER="node:dragenter",r.DRAG_OVER="node:dragover",r.DRAG_LEAVE="node:dragleave",r.DROP="node:drop"})(ts||(ts={}));const Ir="combo",es="tree";var fc;(function(r){r.NODE="node",r.EDGE="edge",r.COMBO="combo",r.THEME="theme",r.PALETTE="palette",r.LAYOUT="layout",r.BEHAVIOR="behavior",r.PLUGIN="plugin",r.ANIMATION="animation",r.TRANSFORM="transform",r.SHAPE="shape"})(fc||(fc={}));const Ug={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function so(r,e){var t;const n=(t=Ug[r])===null||t===void 0?void 0:t[e];if(n)return n}function g5(r){return EXTENSION_REGISTRY[r]}const M_="5.0.32",k_="G6";function oo(r){return`[${k_} v${M_}] ${r}`}const da={mute:!1,debug:r=>{!da.mute&&console.debug(oo(r))},info:r=>{!da.mute&&console.info(oo(r))},warn:r=>{!da.mute&&console.warn(oo(r))},error:r=>{!da.mute&&console.error(oo(r))}};function ky(r){const{theme:e}=r;if(!e)return{};const t=so(fc.THEME,e);return t||(da.warn(`The theme of ${e} is not registered.`),{})}function Zg(r,e){if(Array.isArray(r)&&r.length===0)return null;const t=Array.isArray(r)?r[0]:r,n=Array.isArray(r)?r.slice(1):e||[];return new Proxy(t,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...s)=>{i[a](...s),n.forEach(o=>{var l;return(l=o[a])===null||l===void 0?void 0:l.call(o,...s)})}:a==="finished"?Promise.all([t.finished,...n.map(s=>s.finished)]):Reflect.get(i,a)},set(i,a,s){return["onframe","onfinish"].includes(a)||n.forEach(o=>{o[a]=s}),Reflect.set(i,a,s)}})}function Vg(r){const e=r.reduce((n,i)=>(Object.entries(i).forEach(([a,s])=>{n[a]===void 0?n[a]=[s]:n[a].push(s)}),n),{});Object.entries(e).forEach(([n,i])=>{(i.length!==r.length||i.some(a=>(0,be.Z)(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(n)&&(0,pi.Z)(a,i[0])))&&delete e[n]});const t=Object.entries(e).reduce((n,[i,a])=>(a.forEach((s,o)=>{n[o]?n[o][i]=s:n[o]={[i]:s}}),n),[]);return r.length!==0&&t.length===0&&t.push({_:0},{_:0}),t}function vc(r){switch(r){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function Ty(r,e){const{animation:t}=r;if(t===!1||e===!1)return!1;const n=Object.assign({},S_);return(0,ie.Z)(t)&&Object.assign(n,t),(0,ie.Z)(e)&&Object.assign(n,e),n}function T_(r){if(typeof r=="string"){const e=so(fc.ANIMATION,r);return e||(da.warn(`The animation of ${r} is not registered.`),[])}return r}function O_(r,e,t,n){var i,a;const{animation:s}=r,o=(i=r==null?void 0:r[e])===null||i===void 0?void 0:i.animation;if(o===!1)return[];const l=o==null?void 0:o[t];if(l===!1)return[];if(s===!1||n===!1)return[];const u=(a=ky(r)[e])===null||a===void 0?void 0:a.animation,c=(d=[])=>T_(d).map(f=>Object.assign(Object.assign(Object.assign(Object.assign({},__),(0,ie.Z)(s)&&s),f),(0,ie.Z)(n)&&n));if(l)return c(l);if(!u)return[];const h=u[t];return h===!1?[]:c(h)}function Oy(r,e,t,n){if(Array.isArray(n)){let a=!1;const s=[];for(let o=0;o<n.length;o++){const l=n[o];if(l[0]==="translate"){if(l[1]===r&&l[2]===e)return null;a=!0,s.push(["translate",r,e])}else if(l[0]==="translate3d"){if(l[1]===r&&l[2]===e&&l[3]===t)return null;a=!0,s.push(["translate3d",r,e,t])}else s.push(l)}return a||s.splice(0,0,t===0?["translate",r,e]:["translate3d",r,e,t]),s}const i=n?n.replace(/translate(3d)?\([^)]*\)/g,""):"";return t===0?`translate(${r}, ${e})${i}`:`translate3d(${r}, ${e}, ${t})${i}`}var A_=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const C_=(r,e,t)=>{if(!t.length)return null;const[n,i]=e,a=u=>{var c;if(u){const h=r.getShape(u);if(!h)return null;const d=`get${(0,yd.Z)(u)}Style`,f=((c=r==null?void 0:r[d])===null||c===void 0?void 0:c.bind(r))||(x=>x),v=(f==null?void 0:f(n))||{},p=(f==null?void 0:f(i))||{};return{shape:h,fromStyle:v,toStyle:p}}else return{shape:r,fromStyle:n,toStyle:i}};let s;const o=t.map(u=>{var{fields:c,shape:h,states:d}=u,f=A_(u,["fields","shape","states"]);const v=a(h);if(!v)return null;const{shape:p,fromStyle:x,toStyle:A}=v,N=[{},{}];if(c.forEach(K=>{var W,z;Object.assign(N[0],{[K]:(W=x[K])!==null&&W!==void 0?W:vc(K)}),Object.assign(N[1],{[K]:(z=A[K])!==null&&z!==void 0?z:vc(K)})}),N.some(K=>Object.keys(K).some(W=>["x","y","z"].includes(W)))){const{x:K=0,y:W=0,z=0,transform:j=""}=p.attributes||{};N.forEach(Z=>{Z.transform=Oy(Z.x||K,Z.y||W,Z.z||z,j)})}const I=p.animate(Vg(N),f);return h===void 0&&(s=I),I}).filter(Boolean),l=s||(o==null?void 0:o[0]);return l?Zg(l,o.filter(u=>u!==u)):null},P_=[{fields:["opacity"]}],N_=[{fields:["x","y"]}],Ay=[{fields:["x","y"]}],R_=Ay,Cy=[{fields:["sourceNode","targetNode"]}],L_=Cy,Py=[{fields:["childrenNode","x","y"]}],D_=Py,p5=[{fields:["childrenNode","x","y"]}];var xd=g(73584),Ny=g(99711),su=g(83207);function I_(r){return"source"in r&&"target"in r}function F_(r){return r.length===2}function m5(r){return r.length===3}function ou(r){return r instanceof Float32Array?!0:Array.isArray(r)&&(r.length===2||r.length===3)?r.every(e=>typeof e=="number"):!1}function Gs(r,e,t){return r>=e&&r<=t}function Ws(r=0){if(Array.isArray(r)){const[e=0,t=e,n=e,i=t]=r;return[e,t,n,i]}return[r,r,r,r]}function B_(r=0){const e=Ws(r);return e[0]+e[2]}function y5(r=0){const e=Ws(r);return e[1]+e[3]}function Us(r){return r.max[0]-r.min[0]}function Zs(r){return r.max[1]-r.min[1]}function Po(r){return[Us(r),Zs(r)]}function No(r,e){const t=ou(r)?Yg(r):r.getShape("key").getBounds();return e?Ro(t,e):t}function Yg(r){const[e,t,n=0]=r,i=new Ln;return i.setMinMax([e,t,n],[e,t,n]),i}function Ro(r,e){const[t,n,i,a]=Ws(e),[s,o,l]=r.min,[u,c,h]=r.max,d=new Ln;return d.setMinMax([s-a,o-t,l],[u+n,c+i,h]),d}function gc(r){if(r.length===0)return new Ln;if(r.length===1)return r[0];const e=new Ln;e.setMinMax(r[0].min,r[0].max);for(let t=1;t<r.length;t++){const n=r[t];e.setMinMax([Math.min(e.min[0],n.min[0]),Math.min(e.min[1],n.min[1]),Math.min(e.min[2],n.min[2])],[Math.max(e.max[0],n.max[0]),Math.max(e.max[1],n.max[1]),Math.max(e.max[2],n.max[2])])}return e}function z_(r,e){const[t,n]=r.min,[i,a]=r.max,[s,o]=e.min,[l,u]=e.max;return t>=s&&i<=l&&n>=o&&a<=u}function ms(r,e){return Gs(r[0],e.min[0],e.max[0])&&Gs(r[1],e.min[1],e.max[1])}function Ry(r,e,t=!1){const{min:[n,i],max:[a,s]}=e,o=(r[1]===i||r[1]===s)&&(t||Gs(r[0],n,a)),l=(r[0]===n||r[0]===a)&&(t||Gs(r[1],i,s));return o||l}function j_(r,e){return!ms(r,e)}function Ed(r,e){const{center:t}=e;return r[0]===t[0]&&r[1]===t[1]}function pc(r,e){const[t,n]=r,[i,a]=e.min,[s,o]=e.max,l=t-i,u=s-t,c=n-a,h=o-n,d=Math.min(l,u,c,h);return d===l?"left":d===u?"right":d===c?"top":d===h?"bottom":"left"}function vl(r,e){const t=(0,su.Z)(r);if(ms(r,e))switch(pc(r,e)){case"left":t[0]=e.min[0];break;case"right":t[0]=e.max[0];break;case"top":t[1]=e.min[1];break;case"bottom":t[1]=e.max[1];break}else{const[n,i]=r,[a,s]=e.min,[o,l]=e.max;t[0]=Gs(n,a,o)?n:n<a?a:o,t[1]=Gs(i,s,l)?i:i<s?s:l}return t}function G_(r,e){const{center:t}=r,[n,i]=Po(r),a=e==="up"||e==="down"?t[0]:e==="right"?t[0]-n/6:t[0]+n/6,s=e==="left"||e==="right"?t[1]:e==="down"?t[1]-i/6:t[1]+i/6;return[a,s]}function W_(r,e){let[t,n]=Po(r);return[t,n]=e==="up"||e==="down"?[t,n]:[n,t],(Math.pow(n,2)-Math.pow(Math.sqrt(Math.pow(t/2,2)+Math.pow(n,2))-t/2,2))/(2*n)}function U_(r){const{min:[e,t],max:[n,i]}=r,a=[e,i],s=[n,i],o=[n,t],l=[e,t];return[[a,s],[s,o],[o,l],[l,a]]}var Hg=g(73686);function Re(r){if(r.id!==void 0)return r.id;if(r.source!==void 0&&r.target!==void 0)return`${r.source}-${r.target}`;throw new Error(oo("The datum does not have available id."))}function wd(r){return r.combo}function Ly(r,e){const t={nodes:(r.nodes||[]).map(Re),edges:(r.edges||[]).map(Re),combos:(r.combos||[]).map(Re)};return e?Object.values(t).flat():t}const Dy=(r,e,t)=>{var n;switch(t.type){case"degree":{const i=new Map;return(n=r.nodes)===null||n===void 0||n.forEach(a=>{const s=e(Re(a),t.direction).length;i.set(Re(a),s)}),i}case"betweenness":return Z_(r,t.directed,t.weightPropertyName);case"closeness":return V_(r,t.directed,t.weightPropertyName);case"eigenvector":return H_(r,t.directed);case"pagerank":return Y_(r,t.epsilon,t.linkProb);default:return Iy(r)}},Iy=r=>{var e;const t=new Map;return(e=r.nodes)===null||e===void 0||e.forEach(n=>{t.set(Re(n),0)}),t},Z_=(r,e,t)=>{const n=Iy(r),{nodes:i=[]}=r;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=(0,Hg.ni)(r,Re(a),Re(s),e,t),l=o.length;o.flat().forEach(u=>{u!==Re(a)&&u!==Re(s)&&n.set(u,n.get(u)+1/l)})}})}),n},V_=(r,e,t)=>{const n=new Map,{nodes:i=[]}=r;return i.forEach(a=>{const s=i.reduce((o,l)=>{if(a!==l){const{length:u}=(0,Hg.ni)(r,Re(a),Re(l),e,t);o+=u}return o},0);n.set(Re(a),1/s)}),n},Y_=(r,e,t)=>{var n;const i=new Map,a=(0,Hg.EF)(r,e,t);return(n=r.nodes)===null||n===void 0||n.forEach(s=>{i.set(Re(s),a[Re(s)])}),i},H_=(r,e)=>{const{nodes:t=[]}=r,n=X_(r,e),i=K_(n,t.length),a=new Map;return t.forEach((s,o)=>{a.set(Re(s),i[o])}),a},X_=(r,e)=>{const{nodes:t=[],edges:n=[]}=r,i=Array(t.length).fill(null).map(()=>Array(t.length).fill(0));return n.forEach(({source:a,target:s})=>{const o=t.findIndex(u=>Re(u)===a),l=t.findIndex(u=>Re(u)===s);e?i[o][l]=1:(i[o][l]=1,i[l][o]=1)}),i},K_=(r,e,t=100,n=1e-6)=>{let i=Array(e).fill(1),a=1/0;for(let s=0;s<t&&a>n;s++){const o=Array(e).fill(0);for(let u=0;u<e;u++)for(let c=0;c<e;c++)o[u]+=r[u][c]*i[c];const l=Math.sqrt(o.reduce((u,c)=>u+c*c,0));for(let u=0;u<e;u++)o[u]/=l;a=Math.sqrt(o.reduce((u,c,h)=>u+(c-i[h])*c,0)),i=o}return i};function Lo(r,e,t,n=pi.Z){const i=new Map(r.map(d=>[t(d),d])),a=new Map(e.map(d=>[t(d),d])),s=new Set(i.keys()),o=new Set(a.keys()),l=[],u=[],c=[],h=[];return o.forEach(d=>{s.has(d)?n(i.get(d),a.get(d))?h.push(a.get(d)):u.push(a.get(d)):l.push(a.get(d))}),s.forEach(d=>{o.has(d)||c.push(i.get(d))}),{enter:l,exit:c,keep:h,update:u}}const mc=new WeakMap;function gl(r,e,t=!1,n){if(e===void 0)return;const i=(a,s=e)=>{const o=(l=s)=>a.childNodes.forEach(u=>i(u,l));if(n&&!n(a))return o();if(!t&&a===r)r.style.visibility=e,mc.delete(r),o(e);else{mc.has(a)||mc.set(a,a.style.visibility);const l=s==="hidden"||$_(a)==="hidden"?"hidden":"visible";a.style.visibility=l,o(l)}};i(r)}function $_(r){return mc.has(r)?mc.get(r):r.style.visibility}function Q_(r,e,t){const n={},i=a=>(a in n||(n[a]=0),`${e}-${a}-${n[a]++}`);return t.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(r):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class Xg{constructor(e){this.extensions=[],this.extensionMap={},this.context=e}setExtensions(e){const t=Q_(this.context.graph,this.category,e),{enter:n,update:i,exit:a,keep:s}=Lo(this.extensions,t,o=>o.key);this.createExtensions(n),this.updateExtensions([...i,...s]),this.destroyExtensions(a),this.extensions=t}createExtension(e){const{category:t}=this,{key:n,type:i}=e,a=so(t,i);if(!a)return da.warn(`The extension ${i} of ${t} is not registered.`);const s=new a(this.context,e);this.extensionMap[n]=s}createExtensions(e){e.forEach(t=>this.createExtension(t))}updateExtension(e){const{key:t}=e,n=this.extensionMap[t];n&&n.update(e)}updateExtensions(e){e.forEach(t=>this.updateExtension(t))}destroyExtension(e){const t=this.extensionMap[e];t&&(t.destroy(),delete this.extensionMap[e])}destroyExtensions(e){e.forEach(({key:t})=>this.destroyExtension(t))}destroy(){Object.values(this.extensionMap).forEach(e=>e.destroy()),this.context={},this.extensions=[],this.extensionMap={}}}class Kg{constructor(e,t){this.events=[],this.destroyed=!1,this.context=e,this.options=t}update(e){this.options=Object.assign(this.options,e)}destroy(){this.context={},this.options={},this.destroyed=!0}}class ka extends Kg{}class Sd extends ka{constructor(e,t){super(e,Object.assign({},Sd.defaultOptions,t)),this.isOverlapping=(n,i)=>i.some(a=>n.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=n=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],n.forEach(s=>{const o=s.getShape("label").getRenderBounds();i.isInViewport(o,!0)&&!this.isOverlapping(o,this.occupiedBounds)?(a.show.push(s),this.occupiedBounds.push(Ro(o,this.options.padding))):a.hide.push(s)}),a},this.hideLabelIfExceedViewport=(n,i)=>{const{exit:a}=Lo(n,i,s=>s.id);a==null||a.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(n,i)=>{const{model:a}=this.context,s=a.getData(),o=a.getRelatedEdgesData.bind(a);return n.map(u=>(this.nodeCentralities.has(u.id)||(this.nodeCentralities=Dy(s,o,i)),{node:u,centrality:this.nodeCentralities.get(u.id)})).sort((u,c)=>c.centrality-u.centrality).map(u=>u.node)},this.sortLabelElementsInView=n=>{const{sort:i,sortNode:a,sortCombo:s,sortEdge:o}=this.options,{model:l}=this.context;if((0,At.Z)(i))return n.sort((p,x)=>i(l.getElementDataById(p.id),l.getElementDataById(x.id)));const{node:u=[],edge:c=[],combo:h=[]}=(0,xd.Z)(n,p=>p.type),d=(0,At.Z)(s)?h.sort((p,x)=>s(...l.getComboData([p.id,x.id]))):h,f=(0,At.Z)(a)?u.sort((p,x)=>a(...l.getNodeData([p.id,x.id]))):this.sortNodesByCentrality(u,a),v=(0,At.Z)(o)?c.sort((p,x)=>o(...l.getEdgeData([p.id,x.id]))):c;return[...d,...f,...v]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=n=>{var i;if(((i=n.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(n)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const s=this.sortLabelElementsInView(this.labelElementsInView),{show:o,hide:l}=this.detectLabelCollision(s);for(let u=o.length-1;u>=0;u--)this.showLabel(o[u]);l.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=n=>{const i=n.getShape("label");i&&gl(i,"hidden"),this.hiddenElements.set(n.id,n)},this.showLabel=n=>{const i=n.getShape("label");i&&gl(i,"visible"),n.toFront(),this.hiddenElements.delete(n.id)},this.onTransform=(0,Ny.Z)(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=n=>{this.enableToggle&&this.onToggleVisibility(n)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=n=>{this.onToggleVisibility(n),this.enableToggle=!0},this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:e}=this.context.element,t=[];for(const n in e){const i=e[n];i.isVisible()&&i.getShape("label")&&t.push(i)}return t}getLabelElementsInView(){const e=this.context.viewport;return this.getLabelElements().filter(t=>e.isInViewport(t.getShape("key").getRenderBounds()))}bindEvents(){const{graph:e}=this.context;e.on(sn.BEFORE_RENDER,this.onBeforeRender),e.on(sn.AFTER_RENDER,this.onAfterRender),e.on(sn.AFTER_DRAW,this.toggle),e.on(sn.AFTER_LAYOUT,this.toggle),e.on(sn.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:e}=this.context;e.off(sn.BEFORE_RENDER,this.onBeforeRender),e.off(sn.AFTER_RENDER,this.onAfterRender),e.off(sn.AFTER_DRAW,this.toggle),e.off(sn.AFTER_LAYOUT,this.toggle),e.off(sn.AFTER_TRANSFORM,this.onTransform)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}Sd.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var Ta=g(83787);const Fy=[0,0,0];function Qn(r,e){return r.map((t,n)=>t+e[n])}function Fr(r,e){return r.map((t,n)=>t-e[n])}function lo(r,e){return typeof e=="number"?r.map(t=>t*e):r.map((t,n)=>t*e[n])}function ys(r,e){return typeof e=="number"?r.map(t=>t/e):r.map((t,n)=>t/e[n])}function J_(r,e){return r.reduce((t,n,i)=>t+n*e[i],0)}function q_(r,e){const t=yc(r),n=yc(e);return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Do(r,e){return r.map(t=>t*e)}function Hr(r,e){return Math.sqrt(r.reduce((t,n,i)=>t+Math.pow(n-e[i]||0,2),0))}function _d(r,e){return r.reduce((t,n,i)=>t+Math.abs(n-e[i]),0)}function uo(r){const e=r.reduce((t,n)=>t+Math.pow(n,2),0);return r.map(t=>t/Math.sqrt(e))}function $g(r,e,t=!1){const n=r[0]*e[1]-r[1]*e[0];let i=Math.acos(lo(r,e).reduce((a,s)=>a+s,0)/(Hr(r,Fy)*Hr(e,Fy)));return t&&n<0&&(i=2*Math.PI-i),i}function b5(r,e){return r.every((t,n)=>t===e[n])}function Md(r,e=!0){return e?[-r[1],r[0]]:[r[1],-r[0]]}function tM(r,e){return r.map(t=>t%e)}function pl(r){return[r[0],r[1]]}function yc(r){return F_(r)?[r[0],r[1],0]:r}function By(r){const[e,t]=r;return!e&&!t?0:Math.atan2(t,e)}function zy(r,e){const[t,n]=r,[i,a]=e,s=Fr(t,n),o=Fr(i,a);return q_(s,o).every(l=>l===0)}function Qg(r,e,t=!1){if(zy(r,e))return;const[n,i]=r,[a,s]=e,o=((n[0]-a[0])*(a[1]-s[1])-(n[1]-a[1])*(a[0]-s[0]))/((n[0]-i[0])*(a[1]-s[1])-(n[1]-i[1])*(a[0]-s[0])),l=s[0]-a[0]?(n[0]-a[0]+o*(i[0]-n[0]))/(s[0]-a[0]):(n[1]-a[1]+o*(i[1]-n[1]))/(s[1]-a[1]);if(!(!t&&(!Gs(o,0,1)||!Gs(l,0,1))))return[n[0]+o*(i[0]-n[0]),n[1]+o*(i[1]-n[1])]}function jy(r){if(Array.isArray(r))return Gs(r[0],0,1)&&Gs(r[1],0,1)?r:[.5,.5];const e=r.split("-"),t=e.includes("left")?0:e.includes("right")?1:.5,n=e.includes("top")?0:e.includes("bottom")?1:.5;return[t,n]}function Fi(r){const{x:e=0,y:t=0,z:n=0}=r.style||{};return[+e,+t,+n]}function eM(r){const{x:e,y:t,z:n}=r.style||{};return e!==void 0||t!==void 0||n!==void 0}function Gy(r,e){const[t,n]=e,{min:i,max:a}=r;return[i[0]+t*(a[0]-i[0]),i[1]+n*(a[1]-i[1])]}function co(r,e="center"){const t=jy(e);return Gy(r,t)}function x5(r,e){const t=parseAnchor(e);return Gy(r,t)}const E5=r=>{const[e,t]=r;return{left:Math.min(e[0],t[0]),right:Math.max(e[0],t[0]),top:Math.min(e[1],t[1]),bottom:Math.max(e[1],t[1])}};function Bi(r){var e;return[r.x,r.y,(e=r.z)!==null&&e!==void 0?e:0]}function bs(r){var e;return{x:r[0],y:r[1],z:(e=r[2])!==null&&e!==void 0?e:0}}function w5(r){return r.sort((e,t)=>e[0]-t[0]||e[1]-t[1])}function S5(r){const e=new Set;return r.filter(t=>{const n=t.join(",");return e.has(n)?!1:(e.add(n),!0)})}function bc(r,e=0){return r.map(t=>parseFloat(t.toFixed(e)))}function Io(r,e,t,n=!1){if((0,pi.Z)(r,e))return r;const i=n?Fr(r,e):Fr(e,r),a=uo(i),s=[a[0]*t,a[1]*t];return Qn(pl(r),s)}function Wy(r,e){return r[1]===e[1]}function nM(r,e){return r[0]===e[0]}function rM(r,e){return Wy(r,e)||nM(r,e)}function iM(r,e,t){return zy([r,e],[e,t])}function Uy(r,e){return[2*e[0]-r[0],2*e[1]-r[1]]}function Zy(r,e,t,n=!0,i=!1){for(let a=0;a<t.length;a++){let s=t[a],o=t[(a+1)%t.length];n&&(s=Qn(e,s),o=Qn(e,o));const l=i?Uy(r,e):r,u=Qg([e,l],[s,o]);if(u)return{point:u,line:[s,o]}}return{point:e,line:void 0}}function aM(r,e,t,n){const i=r[0],a=r[1];let s=!1;t===void 0&&(t=0),n===void 0&&(n=e.length);const o=n-t;for(let l=0,u=o-1;l<o;u=l++){const c=e[l+t][0],h=e[l+t][1],d=e[u+t][0],f=e[u+t][1];h>a!=f>a&&i<(d-c)*(a-h)/(f-h)+c&&(s=!s)}return s}function sM(r,e,t=!1){const n=co(e,"center"),i=[co(e,"left-top"),co(e,"right-top"),co(e,"right-bottom"),co(e,"left-bottom")];return Zy(r,n,i,!1,t).point}function kd(r,e,t=!1){const n=e.center,i=t?Uy(r,n):r,a=Fr(i,e.center),s=Math.atan2(a[1],a[0]);if(isNaN(s))return n;const o=Us(e)/2,l=Zs(e)/2,u=n[0]+o*Math.cos(s),c=n[1]+l*Math.sin(s);return[u,c]}function oM(r,e){let t=1/0,n=[r[0],e[0]];return r.forEach(i=>{e.forEach(a=>{const s=Hr(i,a);s<t&&(t=s,n=[i,a])})}),n}function lM(r,e){let t=1/0,n=[[0,0],[0,0]];return e.forEach(i=>{const a=uM(r,i);a<t&&(t=a,n=i)}),n}function uM(r,e){const t=Vy(r,e);return Hr(r,t)}function Vy(r,e){const[t,n]=e[0],[i,a]=e[1],[s,o]=r,l=i-t,u=a-n;if(l===0&&u===0)return[t,n];let c=((s-t)*l+(o-n)*u)/(l*l+u*u);c>1?c=1:c<0&&(c=0);const h=t+c*l,d=n+c*u;return[h,d]}function cM(r){const e=r.reduce((t,n)=>Qn(t,n),[0,0]);return ys(e,r.length)}function Yy(r,e=!0){const t=cM(r);return r.sort(([n,i],[a,s])=>{const o=Math.atan2(i-t[1],n-t[0]),l=Math.atan2(s-t[1],a-t[0]);return e?l-o:o-l})}function Hy(r,e){return[r,[r[0],e[1]],e,[e[0],r[1]]]}const Xy=r=>r.map(e=>(0,Gt.Z)(e)?e.toLocaleLowerCase():e);class lu{constructor(e){this.map=new Map,this.recordKey=new Set,this.onKeyDown=t=>{t!=null&&t.key&&(this.recordKey.add(t.key),this.trigger(t))},this.onKeyUp=t=>{t!=null&&t.key&&this.recordKey.delete(t.key)},this.onWheel=t=>{this.triggerExtendKey(Ue.WHEEL,t)},this.onDrag=t=>{this.triggerExtendKey(Ue.DRAG,t)},this.onFocus=()=>{this.recordKey.clear()},this.emitter=e,this.bindEvents()}bind(e,t){e.length!==0&&this.map.set(e,t)}unbind(e,t){this.map.forEach((n,i)=>{(0,pi.Z)(i,e)&&(!t||t===n)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(e){const t=Xy(Array.from(this.recordKey)).sort(),n=Xy(e).sort();return(0,pi.Z)(t,n)}bindEvents(){var e;const{emitter:t}=this;t.on(Ue.KEY_DOWN,this.onKeyDown),t.on(Ue.KEY_UP,this.onKeyUp),t.on(Ue.WHEEL,this.onWheel),t.on(Ue.DRAG,this.onDrag),(e=globalThis.addEventListener)===null||e===void 0||e.call(globalThis,"focus",this.onFocus)}trigger(e){this.map.forEach((t,n)=>{this.match(n)&&t(e)})}triggerExtendKey(e,t){this.map.forEach((n,i)=>{i.includes(e)&&(0,pi.Z)(Array.from(this.recordKey),i.filter(a=>a!==e))&&n(t)})}destroy(){var e;this.unbindAll(),this.emitter.off(Ue.KEY_DOWN,this.onKeyDown),this.emitter.off(Ue.KEY_UP,this.onKeyUp),this.emitter.off(Ue.WHEEL,this.onWheel),this.emitter.off(Ue.DRAG,this.onDrag),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"blur",this.onFocus)}}class xc extends ka{constructor(e,t){super(e,(0,Ta.Z)({},xc.defaultOptions,t)),this.shortcut=new lu(e.graph),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.clearStates=this.clearStates.bind(this),this.bindEvents()}onPointerDown(e){if(!this.validate(e)||!this.isKeydown()||this.startPoint)return;const{canvas:t,graph:n}=this.context,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new ps({id:"g6-brush-select",style:i}),t.appendChild(this.rectShape),this.startPoint=[e.canvas.x,e.canvas.y]}onPointerMove(e){var t;if(!this.startPoint)return;const{immediately:n,mode:i}=this.options;this.endPoint=Td(e),(t=this.rectShape)===null||t===void 0||t.attr({x:Math.min(this.endPoint[0],this.startPoint[0]),y:Math.min(this.endPoint[1],this.startPoint[1]),width:Math.abs(this.endPoint[0]-this.startPoint[0]),height:Math.abs(this.endPoint[1]-this.startPoint[1])}),n&&i==="default"&&this.updateElementsStates(Hy(this.startPoint,this.endPoint))}onPointerUp(e){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=Td(e),this.updateElementsStates(Hy(this.startPoint,this.endPoint)),this.clearBrush()}}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:e}=this.context,t=Object.values(e.getData()).reduce((n,i)=>Object.assign({},n,i.reduce((a,s)=>(a[Re(s)]=[],a),{})),{});e.setElementState(t,this.options.animation)}updateElementsStates(e){const{graph:t}=this.context,{enableElements:n,state:i,mode:a,onSelect:s}=this.options,o=this.selector(t,e,n);let l={};switch(a){case"union":o.forEach(u=>{l[u]=[...t.getElementState(u),i]});break;case"diff":o.forEach(u=>{const c=t.getElementState(u);l[u]=c.includes(i)?c.filter(h=>h!==i):[...c,i]});break;case"intersect":o.forEach(u=>{const c=t.getElementState(u);l[u]=c.includes(i)?[i]:[]});break;case"default":default:o.forEach(u=>{l[u]=[i]});break}(0,At.Z)(s)&&(l=s(l)),t.setElementState(l,this.options.animation)}selector(e,t,n){if(!n||n.length===0)return[];const i=[],a=e.getData();if(n.forEach(s=>{a[`${s}s`].forEach(o=>{const l=Re(o);e.getElementVisibility(l)!=="hidden"&&aM(e.getElementPosition(l),t)&&i.push(l)})}),n.includes("edge")){const s=a.edges;s==null||s.forEach(o=>{const{source:l,target:u}=o;i.includes(l)&&i.includes(u)&&i.push(Re(o))})}return i}clearBrush(){var e;(e=this.rectShape)===null||e===void 0||e.remove(),this.rectShape=void 0,this.startPoint=void 0,this.endPoint=void 0}isKeydown(){const{trigger:e}=this.options,t=Array.isArray(e)?e:[e];return this.shortcut.match(t.filter(n=>n!=="drag"))}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}bindEvents(){const{graph:e}=this.context;e.on(Ue.POINTER_DOWN,this.onPointerDown),e.on(Ue.POINTER_MOVE,this.onPointerMove),e.on(Ue.POINTER_UP,this.onPointerUp),e.on(ao.CLICK,this.clearStates)}unbindEvents(){const{graph:e}=this.context;e.off(Ue.POINTER_DOWN,this.onPointerDown),e.off(Ue.POINTER_MOVE,this.onPointerMove),e.off(Ue.POINTER_UP,this.onPointerUp),e.off(ao.CLICK,this.clearStates)}update(e){this.unbindEvents(),this.options=(0,Ta.Z)(this.options,e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}xc.defaultOptions={animation:!1,enable:!0,enableElements:["node","combo","edge"],immediately:!1,mode:"default",state:"selected",trigger:["shift"],style:{width:0,height:0,lineWidth:1,fill:"#1677FF",stroke:"#1677FF",fillOpacity:.1,zIndex:2,pointerEvents:"none"}};const Td=r=>[r.canvas.x,r.canvas.y],ho=.8,ml=["node","edge","combo"];function yl(r,e,t,n,i=0){n==="TB"&&e(r,i);const a=t(r);if(a)for(const s of a)yl(s,e,t,n,i+1);n==="BT"&&e(r,i)}function hM(r,e,t){const n=[[r,0]];for(;n.length;){const[i,a]=n.shift();e(i,a);const s=t(i);if(s)for(const o of s)n.push([o,a+1])}}function Ky(r,e,t,n,i="both"){if(e==="combo"||e==="node")return Jg(r,t,n,i);const a=r.getEdgeData(t);if(!a)return[];const s=Jg(r,a.source,n-1,i),o=Jg(r,a.target,n-1,i);return Array.from(new Set([...s,...o,t]))}function Jg(r,e,t,n="both"){const i=new Set,a=new Set,s=new Set;return hM(e,(o,l)=>{l>t||(s.add(o),r.getRelatedEdgesData(o,n).forEach(u=>{const c=Re(u);!a.has(c)&&l<t&&(s.add(c),a.add(c))}))},o=>r.getRelatedEdgesData(o,n).map(l=>l.source===o?l.target:l.source).filter(l=>i.has(l)?!1:(i.add(l),!0))),Array.from(s)}function qg(r){return r.states||[]}var Od=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Ad extends ka{constructor(e,t){super(e,Object.assign({},Ad.defaultOptions,t)),this.onClickSelect=n=>Od(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.updateState(n),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.onClickCanvas=n=>Od(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.shortcut=new lu(e.graph),this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),ml.forEach(t=>{e.on(`${t}:${Ue.CLICK}`,this.onClickSelect)}),e.on(ao.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:e,trigger:t}=this.options;return e&&this.shortcut.match(t)}getNeighborIds(e){const{target:t,targetType:n}=e,{graph:i}=this.context,{degree:a}=this.options;return Ky(i,n,t.id,typeof a=="function"?a(e):a).filter(s=>s!==t.id)}updateState(e){return Od(this,void 0,void 0,function*(){const{state:t,unselectedState:n,neighborState:i,animation:a}=this.options;if(!t&&!i&&!n)return;const{target:s}=e,{graph:o}=this.context,l=o.getElementData(s.id),u=qg(l).includes(t)?"unselect":"select",c={},h=this.isMultipleSelect,d=[s.id],f=this.getNeighborIds(e);if(h)if(Object.assign(c,this.getDataStates()),u==="select"){const v=(p,x)=>{p.forEach(A=>{const N=new Set(o.getElementState(A));N.add(x),N.delete(n),c[A]=Array.from(N)})};v(d,t),v(f,i),n&&Object.keys(c).forEach(p=>{const x=c[p];!x.includes(t)&&!x.includes(i)&&!x.includes(n)&&c[p].push(n)})}else{const v=c[s.id];c[s.id]=v.filter(p=>p!==t&&p!==i),v.includes(n)||c[s.id].push(n),f.forEach(p=>{c[p]=c[p].filter(x=>x!==i),c[p].includes(t)||c[p].push(n)})}else if(u==="select"){Object.assign(c,this.getClearStates(!!n));const v=(p,x)=>{p.forEach(A=>{c[A]||(c[A]=o.getElementState(A)),c[A].push(x)})};v(d,t),v(f,i),n&&Object.keys(c).forEach(p=>{!d.includes(p)&&!f.includes(p)&&c[p].push(n)})}else Object.assign(c,this.getClearStates());yield o.setElementState(c,a)})}getDataStates(){const{graph:e}=this.context,{nodes:t,edges:n,combos:i}=e.getData(),a={};return[...t,...n,...i].forEach(s=>{a[Re(s)]=qg(s)}),a}getClearStates(e=!1){const{graph:t}=this.context,{state:n,unselectedState:i,neighborState:a}=this.options,s=new Set([n,i,a]),{nodes:o,edges:l,combos:u}=t.getData(),c={};return[...o,...l,...u].forEach(h=>{const d=qg(h),f=d.filter(v=>!s.has(v));(e||f.length!==d.length)&&(c[Re(h)]=f)}),c}clearState(){return Od(this,void 0,void 0,function*(){const{graph:e}=this.context;yield e.setElementState(this.getClearStates(),this.options.animation)})}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;ml.forEach(t=>{e.off(`${t}:${Ue.CLICK}`,this.onClickSelect)}),e.off(ao.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}Ad.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function Oa(r){var e;return!!(!((e=r.style)===null||e===void 0)&&e.collapsed)}var na=g(53032),Ec=g(17829),dM=g(73576);function wc(r,e){if(!r.startsWith(e))return!1;const t=r[e.length];return t>="A"&&t<="Z"}function $y(r,e){return`${e}${(0,yd.Z)(r)}`}function Qy(r,e,t=!0){if(!e||!wc(r,e))return r;const n=r.slice(e.length);return t?(0,dM.Z)(n):n}function xi(r,e){const t=Object.entries(r).reduce((n,[i,a])=>(i==="className"||i==="class"||wc(i,e)&&Object.assign(n,{[Qy(i,e)]:a}),n),{});if("opacity"in r){const n=$y("opacity",e),i=r.opacity;if(n in r){const a=r[n];Object.assign(t,{opacity:i*a})}else Object.assign(t,{opacity:i})}return t}function tp(r,e){const t=e.length;return Object.keys(r).reduce((n,i)=>{if(i.startsWith(e)){const a=i.slice(t);n[a]=r[i]}return n},{})}function ep(r,e){const t=typeof e=="string"?[e]:e,n={};return Object.keys(r).forEach(i=>{t.find(a=>i.startsWith(a))||(n[i]=r[i])}),n}function _5(r,e,t){return Object.entries(r).reduce((n,[i,a])=>(wc(i,e)?n[$y(Qy(i,e,!1),t)]=a:n[i]=a,n),{})}function ns(r=0){if(typeof r=="number")return[r,r,r];const[e,t=e,n=e]=r;return[e,t,n]}var fM=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function Jy(r,e){const{datum:t,graph:n}=e;return typeof r=="function"?r.call(n,t):Object.fromEntries(Object.entries(r).map(([i,a])=>typeof a=="function"?[i,a.call(n,t)]:[i,a]))}function Ti(r,e){const t=(r==null?void 0:r.style)||{},n=(e==null?void 0:e.style)||{};return Object.assign({},r,e,{style:r!=null&&r.style?Object.assign({},t,n):n})}function vM(r){const{x:e,y:t,z:n,class:i,className:a,transform:s,transformOrigin:o,zIndex:l,visibility:u}=r;return fM(r,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}const np=new WeakMap;function xs(r,e,t){np.has(r)||np.set(r,{});const n=np.get(r);if(!n[e])return n[e]=t,!0;const i=n[e];return qy(i,t)?!1:(n[e]=t,!0)}const qy=(r,e,t=2)=>{if(typeof r!="object"||typeof e!="object")return r===e;const n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(const a of n){const s=r[a],o=e[a];if(t>1&&typeof s=="object"&&typeof o=="object"){if(!qy(s,o,t-1))return!1}else if(s!==o)return!1}return!0};function gM(r,e){const t=ns(r);let n={};return e.text&&!e.fontSize&&(n={fontSize:Math.min(...t)*.5}),e.src&&(!e.width||!e.height)&&(n={width:t[0]*.5,height:t[1]*.5}),n}function t1(r){if(r)return typeof r=="string"||typeof r=="function"||Array.isArray(r)?{type:"group",field:e=>e.id,color:r,invert:!1}:r}function pM(r,e){if(!e)return{};const{type:t,color:n,field:i,invert:a}=e,s=l=>{const u=typeof n=="string"?so("palette",n):n;if(typeof u=="function"){const c={};return l.forEach(([h,d])=>{c[h]=u(a?1-d:d)}),c}else if(Array.isArray(u)){const c=a?[...u].reverse():u,h={};return l.forEach(([d,f])=>{h[d]=c[f%u.length]}),h}return{}},o=(l,u)=>{var c;return typeof l=="string"?(c=u.data)===null||c===void 0?void 0:c[l]:l==null?void 0:l(u)};if(t==="group"){const l=(0,xd.Z)(r,d=>{if(!i)return"default";const f=o(i,d);return f?String(f):"default"}),u=Object.keys(l),c=s(u.map((d,f)=>[d,f])),h={};return Object.entries(l).forEach(([d,f])=>{f.forEach(v=>{h[Re(v)]=c[d]})}),h}else if(t==="value"){const[l,u]=r.reduce(([h,d],f)=>{const v=o(i,f);if(typeof v!="number")throw new Error(oo(`Palette field ${i} is not a number`));return[Math.min(h,v),Math.max(d,v)]},[1/0,-1/0]),c=u-l;return s(r.map(h=>[h.id,(o(i,h)-l)/c]))}}function e1(r){const e=typeof r=="string"?so("palette",r):r;if(typeof e!="function")return e}function n1(r,e){let t=2*r;return typeof e=="string"?t=r*Number(e.replace("%",""))/100:typeof e=="number"&&(t=e),isNaN(t)&&(t=2*r),t}function r1(r,e,t=1,n=!1){const i=n?t:1,a=(r.max[0]-r.min[0])*i;return n1(a,e)}function mM(r,e,t=1){const n=Hr(r[0],r[1])*t;return n1(n,e)}var Vs=g(95904);class Sc extends fS{constructor(e){super(e),this.shapeMap={},this.animateMap={},this.transformPosition(this.attributes),this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(e,t,n,i,a){var s,o,l,u,c,h,d,f;const v=this.shapeMap[e];if(n===!1){v&&((s=a==null?void 0:a.beforeDestroy)===null||s===void 0||s.call(a,v),i.removeChild(v),delete this.shapeMap[e],(o=a==null?void 0:a.afterDestroy)===null||o===void 0||o.call(a,v));return}const p=typeof t=="string"?so(fc.SHAPE,t):t;if(!p)throw new Error(oo(`Shape ${t} not found`));if(!v||v.destroyed||!(v instanceof p)){v&&((l=a==null?void 0:a.beforeDestroy)===null||l===void 0||l.call(a,v),v==null||v.destroy(),(u=a==null?void 0:a.afterDestroy)===null||u===void 0||u.call(a,v)),(c=a==null?void 0:a.beforeCreate)===null||c===void 0||c.call(a);const x=new p({className:e,style:n});return i.appendChild(x),this.shapeMap[e]=x,(h=a==null?void 0:a.afterCreate)===null||h===void 0||h.call(a,x),x}return(d=a==null?void 0:a.beforeUpdate)===null||d===void 0||d.call(a,v),Pp(v,n),(f=a==null?void 0:a.afterUpdate)===null||f===void 0||f.call(a,v),v}transformPosition(e){if("x"in e||"y"in e||"z"in e){const{x:t=0,y:n=0,z:i=0,transform:a}=e,s=Oy(+t,+n,+i,a);s&&(this.style.transform=s)}}update(e={}){const t=Object.assign({},this.attributes,e);this.attr(t),this.render(t,this),this.transformPosition(t),this.setVisibility()}bindEvents(){}getGraphicStyle(e){return vM(e)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(e,t){if(e.length===0)return null;const n=[];if(e[0].x!==void 0||e[0].y!==void 0||e[0].z!==void 0){const{x:a=0,y:s=0,z:o=0}=this.attributes;e.forEach(l=>{const{x:u=a,y:c=s,z:h=o}=l;Object.assign(l,{transform:h?[["translate3d",u,c,h]]:[["translate",u,c]]})})}const i=super.animate(e,t);if(i&&(rp(this,i),n.push(i)),Array.isArray(e)&&e.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(e[0]).some(s=>!a.includes(s))){Object.entries(this.shapeMap).forEach(([o,l])=>{const u=`get${(0,yd.Z)(o)}Style`,c=this[u];if((0,At.Z)(c)){const h=e.map(f=>c.call(this,Object.assign(Object.assign({},this.attributes),f))),d=l.animate(Vg(h),t);d&&(rp(l,d),n.push(d))}});const s=(o,l)=>{if(!(0,Vs.Z)(o)){const u=`get${(0,yd.Z)(l)}Style`,c=this[u];if((0,At.Z)(c)){const h=e.map(d=>c.call(this,Object.assign(Object.assign({},this.attributes),d)));Object.entries(h[0]).map(([d])=>{const f=h.map(p=>p[d]),v=o[d];if(v){const p=v.animate(Vg(f),t);p&&(rp(v,p),n.push(p))}})}}};this.compositeShapes.forEach(([o,l])=>{const u=tp(this.shapeMap,l);s(u,o)})}}return Zg(n)}getShape(e){return this.shapeMap[e]}setVisibility(){const{visibility:e}=this.attributes;gl(this,e,!0)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function rp(r,e){e==null||e.finished.then(()=>{const t=r.activeAnimations.findIndex(n=>n===e);t>-1&&r.activeAnimations.splice(t,1)})}var yM=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Fo extends Sc{constructor(e){super(Ti({style:Fo.defaultStyleProps},e))}isTextStyle(e){return wc(e,"label")}isBackgroundStyle(e){return wc(e,"background")}getTextStyle(e){const t=this.getGraphicStyle(e),{padding:n}=t,i=yM(t,["padding"]);return ep(i,"background")}getBackgroundStyle(e){if(e.background===!1)return!1;const t=this.getGraphicStyle(e),{wordWrap:n,wordWrapWidth:i,padding:a}=t,s=xi(t,"background"),{min:[o,l],center:[u,c],halfExtents:[h,d]}=this.shapeMap.text.getGeometryBounds(),[f,v,p,x]=Ws(a),A=h*2+x+v,{width:N,height:I}=s;N&&I?Object.assign(s,{x:u-Number(N)/2,y:c-Number(I)/2}):Object.assign(s,{x:o-x,y:l-f,width:n?Math.min(A,i+x+v):A,height:d*2+f+p});const{radius:K}=s;if(typeof K=="string"&&K.endsWith("%")){const W=Number(K.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*W}return s}render(e=this.parsedAttributes,t=this){this.upsert("text",ru,this.getTextStyle(e),t),this.upsert("background",ps,this.getBackgroundStyle(e),t)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Fo.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class uu extends Sc{constructor(e){super(Ti({style:uu.defaultStyleProps},e))}getBadgeStyle(e){return this.getGraphicStyle(e)}render(e=this.parsedAttributes,t=this){this.upsert("label",Fo,this.getBadgeStyle(e),t)}getGeometryBounds(){const e=this.getShape("label");return(e.getShape("background")||e.getShape("text")).getGeometryBounds()}}uu.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function bM(r,e=!0){const t=[];return r.forEach((n,i)=>{t.push([i===0?"M":"L",...n])}),e&&t.push(["Z"]),t}const i1={M:["x","y"],m:["dx","dy"],H:["x"],h:["dx"],V:["y"],v:["dy"],L:["x","y"],l:["dx","dy"],Z:[],z:[],C:["x1","y1","x2","y2","x","y"],c:["dx1","dy1","dx2","dy2","dx","dy"],S:["x2","y2","x","y"],s:["dx2","dy2","dx","dy"],Q:["x1","y1","x","y"],q:["dx1","dy1","dx","dy"],T:["x","y"],t:["dx","dy"],A:["rx","ry","rotation","large-arc","sweep","x","y"],a:["rx","ry","rotation","large-arc","sweep","dx","dy"]};function xM(r){const e=r.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),t=[];let n="",i={};for(;e.length>0;){let a=e.shift();a in i1?n=a:e.unshift(a),i={type:n},i1[n].forEach(l=>{a=e.shift(),i[l]=a}),n==="M"?n="L":n==="m"&&(n="l");const[s,...o]=Object.values(i);t.push([s,...o.map(Number)])}return t}function EM(r){const e=[];return(typeof r=="string"?xM(r):r).forEach(n=>{const i=n[0];if(i==="Z"){e.push(e[0]);return}if(i!=="A")for(let a=1;a<n.length;a=a+2)e.push([n[a],n[a+1],0]);else{const a=n.length;e.push([n[a-2],n[a-1],0])}}),e}const a1=r=>{if(r.length<2)return[["M",0,0],["L",0,0]];const e=r[0],t=r[1],n=r[r.length-1],i=r[r.length-2];r.unshift(i,n),r.push(e,t);const a=[["M",n[0],n[1]]];for(let s=1;s<r.length-2;s+=1){const[o,l]=r[s-1],[u,c]=r[s],[h,d]=r[s+1],[f,v]=s!==r.length-2?r[s+2]:[h,d],p=u+(h-o)/6,x=c+(d-l)/6,A=h-(f-u)/6,N=d-(v-c)/6;a.push(["C",p,x,A,N,h,d])}return a};function wM(r,e,t,n,i,a,s){const[o,l]=co(r,e),u={textAlign:e==="left"?"right":e==="right"?"left":"center",textBaseline:e==="top"?"bottom":e==="bottom"?"top":"middle",transform:[["translate",o+t,l+n]]};if(e==="center"||!i)return u;const c=EM(a);if(!c||c.length<=3)return u;const h=c.map((v,p)=>{const x=v,A=c[(p+1)%c.length];return(0,pi.Z)(x,A)?null:[x,A]}).filter(Boolean),d=lM([o,l],h),f=Vy([o,l],d);if(f&&d&&(u.transform=[["translate",f[0]+t,f[1]+n]],s)){const v=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));u.transform.push(["rotate",v/Math.PI*180]),u.textAlign="center",(e==="right"||e==="left")&&(v>0?u.textBaseline=e==="right"?"bottom":"top":u.textBaseline=e==="right"?"top":"bottom")}return u}var SM=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class _c extends Sc{constructor(e){super(Ti({style:_c.defaultStyleProps},e))}getLabelStyle(e){if(!e.label||!e.d||e.d.length===0)return!1;const t=xi(this.getGraphicStyle(e),"label"),{maxWidth:n,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:l}=t,u=SM(t,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),c=this.shapeMap.key,h=c==null?void 0:c.getRenderBounds();return Object.assign(wM(h,o,i,a,l,e.d,s),{wordWrapWidth:r1(h,n)},u)}getKeyStyle(e){return this.getGraphicStyle(e)}render(e,t){this.upsert("key",ro,this.getKeyStyle(e),t),this.upsert("label",Fo,this.getLabelStyle(e),t)}}_c.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function _M(r){const e=[],t=n=>{n!=null&&n.children.length&&n.children.forEach(i=>{e.push(i),t(i)})};return t(r),e}function MM(r){const e=[];let t=r.parentNode;for(;t;)e.push(t),t=t.parentNode;return e}class ip extends qh{constructor(e){super(e),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},cu=this,this.isMutationObserved=!0,this.addEventListener(or.MOUNTED,this.onMounted),this.addEventListener(or.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:e,clipPath:t,width:n=0,height:i=0}=this.attributes;if(e&&n&&i){const[a,s]=this.getBounds().min,o={x:a,y:s,radius:e,width:n,height:i};if(t)Object.assign(this.parsedStyle.clipPath.style,o);else{const l=new ps({style:o});this.style.clipPath=l}}else t&&(this.style.clipPath=null)}}const ap=new WeakMap;let cu=null;const sp=r=>{if(cu&&MM(cu).includes(r)){const e=ap.get(r);e?e.includes(cu)||e.push(cu):ap.set(r,[cu])}},op=r=>{const e=ap.get(r);e&&e.forEach(t=>t.handleRadius())};class s1 extends Sc{constructor(e){super(e)}isImage(){const{src:e}=this.attributes;return!!e}getIconStyle(e=this.attributes){const{width:t=0,height:n=0}=e,i=this.getGraphicStyle(e);return this.isImage()?Object.assign({x:-t/2,y:-n/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(e=this.attributes,t=this){this.upsert("icon",this.isImage()?ip:ru,this.getIconStyle(e),t)}}class o1 extends Sc{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(e,t){const n=super.animate(e,t);return n&&(n.onframe=()=>this.onframe(),n.finished.then(()=>this.onframe())),n}}var Cd=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Es extends o1{constructor(e){super(Ti({style:Es.defaultStyleProps},e)),this.type="node"}getSize(e=this.attributes){const{size:t}=e;return ns(t)}getKeyStyle(e){const t=this.getGraphicStyle(e);return Object.assign(ep(t,["label","halo","icon","badge","port"]))}getLabelStyle(e){if(e.label===!1||!e.labelText)return!1;const t=xi(this.getGraphicStyle(e),"label"),{placement:n,maxWidth:i,offsetX:a,offsetY:s}=t,o=Cd(t,["placement","maxWidth","offsetX","offsetY"]),l=this.getShape("key").getLocalBounds();return Object.assign(fb(l,n,a,s),{wordWrapWidth:r1(l,i)},o)}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getKeyStyle(e),{fill:n}=t,i=Cd(t,["fill"]),a=xi(this.getGraphicStyle(e),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:n}),a)}getIconStyle(e){if(e.icon===!1||!e.iconText&&!e.iconSrc)return!1;const t=xi(this.getGraphicStyle(e),"icon");return Object.assign(gM(e.size,t),t)}getBadgesStyle(e){var t;const n=tp(this.shapeMap,"badge-"),i={};if(Object.keys(n).forEach(h=>{i[h]=!1}),e.badge===!1||!(!((t=e.badges)===null||t===void 0)&&t.length))return i;const{badges:a=[],badgePalette:s,opacity:o=1}=e,l=Cd(e,["badges","badgePalette","opacity"]),u=e1(s),c=xi(this.getGraphicStyle(l),"badge");return a.forEach((h,d)=>{i[d]=Object.assign(Object.assign({backgroundFill:u?u[d%(u==null?void 0:u.length)]:void 0,opacity:o},c),this.getBadgeStyle(h))}),i}getBadgeStyle(e){const t=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:a}=e,s=Cd(e,["placement","offsetX","offsetY"]),o=fb(t.getLocalBounds(),n,i,a,!0);return Object.assign(Object.assign({},o),s)}getPortsStyle(e){var t;const n=this.getPorts(),i={};if(Object.keys(n).forEach(o=>{i[o]=!1}),e.port===!1||!(!((t=e.ports)===null||t===void 0)&&t.length))return i;const a=xi(this.getGraphicStyle(e),"port"),{ports:s=[]}=e;return s.forEach((o,l)=>{const u=o.key||l,c=Object.assign(Object.assign({},a),o);if(cb(c))i[u]=!1;else{const[h,d]=this.getPortXY(e,o);i[u]=Object.assign({transform:[["translate",h,d]]},c)}}),i}getPortXY(e,t){const{placement:n="left"}=t,i=this.getShape("key");return Op(kM(this.context,i),n)}getPorts(){return tp(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return sM(e,n,t)}drawHaloShape(e,t){const n=this.getHaloStyle(e);if(!xs(this,"halo",n))return;const i=this.getShape("key");this.upsert("halo",i.constructor,n,t)}drawIconShape(e,t){const n=this.getIconStyle(e);xs(this,"icon",n)&&(this.upsert("icon",s1,n,t),sp(this))}drawBadgeShapes(e,t){const n=this.getBadgesStyle(e);Object.keys(n).forEach(i=>{const a=n[i];xs(this,`badge-${i}`,a)&&this.upsert(`badge-${i}`,uu,a,t)})}drawPortShapes(e,t){const n=this.getPortsStyle(e);Object.keys(n).forEach(i=>{const a=n[i],s=`port-${i}`;xs(this,s,a)&&this.upsert(s,tu,a,t)})}drawLabelShape(e,t){const n=this.getLabelStyle(e);xs(this,"label",n)&&this.upsert("label",Fo,n,t)}_drawKeyShape(e,t){return this.drawKeyShape(e,t)}render(e=this.parsedAttributes,t=this){this._drawKeyShape(e,t),this.getShape("key")&&(this.drawHaloShape(e,t),this.drawIconShape(e,t),this.drawBadgeShapes(e,t),this.drawLabelShape(e,t),this.drawPortShapes(e,t))}update(e){super.update(e),e&&("x"in e||"y"in e||"z"in e)&&op(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Es.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};function kM(r,e){if(!r)return e.getLocalBounds();const t=r.canvas.getLayer(),n=e.cloneNode();gl(n,"hidden"),t.appendChild(n);const i=n.getLocalBounds();return n.destroy(),i}class bl extends Es{constructor(e){super(Ti({style:bl.defaultStyleProps},e))}drawKeyShape(e,t){return this.upsert("key",tu,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e);return Object.assign(Object.assign({},t),{r:Math.min(...this.getSize(e))/2})}getIconStyle(e){const t=super.getIconStyle(e),{r:n}=this.getShape("key").attributes,i=n*2*ho;return t?Object.assign({width:i,height:i},t):!1}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return kd(e,n,t)}}bl.defaultStyleProps={size:32};class Pd extends Es{constructor(e){super(e)}get parsedAttributes(){return this.attributes}drawKeyShape(e,t){return this.upsert("key",nu,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e);return Object.assign(Object.assign({},t),{points:this.getPoints(e)})}getIntersectPoint(e,t=!1){var n,i;const{points:a}=this.getShape("key").attributes,s=[+(((n=this.attributes)===null||n===void 0?void 0:n.x)||0),+(((i=this.attributes)===null||i===void 0?void 0:i.y)||0)];return Zy(e,s,a,!0,t).point}}class TM extends Pd{constructor(e){super(e)}getPoints(e){const[t,n]=this.getSize(e);return JT(t,n)}}var OM=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Nd extends bl{constructor(e){super(Ti({style:Nd.defaultStyleProps},e))}parseOuterR(){const{size:e}=this.parsedAttributes;return Math.min(...ns(e))/2}parseInnerR(){const{innerR:e}=this.parsedAttributes;return(0,Gt.Z)(e)?parseInt(e)/100*this.parseOuterR():e}drawDonutShape(e,t){const{donuts:n}=e;if(!(n!=null&&n.length))return;const i=n.map(h=>(0,bt.Z)(h)?{value:h}:h),a=xi(this.getGraphicStyle(e),"donut"),s=e1(e.donutPalette);if(!s)return;const o=i.reduce((h,d)=>{var f;return h+((f=d.value)!==null&&f!==void 0?f:0)},0),l=this.parseOuterR(),u=this.parseInnerR();let c=0;i.forEach((h,d)=>{const{value:f=0,color:v=s[d%s.length]}=h,p=OM(h,["value","color"]),x=(o===0?1/i.length:f/o)*360;this.upsert(`round${d}`,ro,Object.assign(Object.assign(Object.assign({},a),{d:PM(l,u,c,c+x),fill:v}),p),t),c+=x})}render(e,t=this){super.render(e,t),this.drawDonutShape(e,t)}}Nd.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const Rd=(r,e,t,n)=>[r+Math.sin(n)*t,e-Math.cos(n)*t],AM=(r,e,t,n)=>n<=0||t<=n?[["M",r-t,e],["A",t,t,0,1,1,r+t,e],["A",t,t,0,1,1,r-t,e],["Z"]]:[["M",r-t,e],["A",t,t,0,1,1,r+t,e],["A",t,t,0,1,1,r-t,e],["Z"],["M",r+n,e],["A",n,n,0,1,0,r-n,e],["A",n,n,0,1,0,r+n,e],["Z"]],CM=(r,e,t,n,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],l=[Rd(r,e,n,s),Rd(r,e,t,s),Rd(r,e,t,o),Rd(r,e,n,o)],u=o-s>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",t,t,0,u,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",n,n,0,u,0,l[0][0],l[0][1]],["Z"]]},PM=(r=0,e=0,t,n)=>{const[i,a]=[0,0];return Math.abs(t-n)%360<1e-6?AM(i,a,r,e):CM(i,a,r,e,t,n)};class Ld extends Es{constructor(e){super(Ti({style:Ld.defaultStyleProps},e))}drawKeyShape(e,t){return this.upsert("key",Qh,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e),[n,i]=this.getSize(e);return Object.assign(Object.assign({},t),{rx:n/2,ry:i/2})}getIconStyle(e){const t=super.getIconStyle(e),{rx:n,ry:i}=this.getShape("key").attributes,a=Math.min(+n,+i)*2*ho;return t?Object.assign({width:a,height:a},t):!1}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return kd(e,n,t)}}Ld.defaultStyleProps={size:[45,35]};class NM extends Pd{constructor(e){super(e)}getOuterR(e){return e.outerR||Math.min(...this.getSize(e))/2}getPoints(e){return tO(this.getOuterR(e))}getIconStyle(e){const t=super.getIconStyle(e),n=this.getOuterR(e)*ho;return t?Object.assign({width:n,height:n},t):!1}}function hu(r){"@babel/helpers - typeof";return hu=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},hu(r)}function RM(r,e){if(hu(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function l1(r){var e=RM(r,"string");return hu(e)=="symbol"?e:e+""}function Aa(r,e,t){return(e=l1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function LM(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,l1(n.key),n)}}function DM(r,e,t){return e&&u1(r.prototype,e),t&&u1(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Dd(r){return Dd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dd(r)}function c1(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c1=function(){return!!r})()}function IM(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function FM(r,e){if(e&&(hu(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IM(r)}function BM(r,e,t){return e=Dd(e),FM(r,c1()?Reflect.construct(e,t||[],Dd(r).constructor):e.apply(r,t))}function lp(r,e){return lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},lp(r,e)}function zM(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&lp(r,e)}function jM(r){if(Array.isArray(r))return r}function GM(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function h1(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function WM(r,e){if(r){if(typeof r=="string")return h1(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h1(r,e):void 0}}function UM(){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 Mc(r,e){return jM(r)||GM(r,e)||WM(r,e)||UM()}function ZM(r,e){var t=e.cx,n=t===void 0?0:t,i=e.cy,a=i===void 0?0:i,s=e.r;r.arc(n,a,s,0,Math.PI*2,!1)}function VM(r,e){var t=e.cx,n=t===void 0?0:t,i=e.cy,a=i===void 0?0:i,s=e.rx,o=e.ry;if(r.ellipse)r.ellipse(n,a,s,o,0,0,Math.PI*2,!1);else{var l=s>o?s:o,u=s>o?1:s/o,c=s>o?o/s:1;r.save(),r.scale(u,c),r.arc(n,a,l,0,Math.PI*2)}}function YM(r,e){var t=e.x1,n=e.y1,i=e.x2,a=e.y2,s=e.markerStart,o=e.markerEnd,l=e.markerStartOffset,u=e.markerEndOffset,c=0,h=0,d=0,f=0,v=0,p,x;s&&pr(s)&&l&&(p=i-t,x=a-n,v=Math.atan2(x,p),c=Math.cos(v)*(l||0),h=Math.sin(v)*(l||0)),o&&pr(o)&&u&&(p=t-i,x=n-a,v=Math.atan2(x,p),d=Math.cos(v)*(u||0),f=Math.sin(v)*(u||0)),r.moveTo(t+c,n+h),r.lineTo(i+d,a+f)}function HM(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.d,o=s.absolutePath,l=s.segments,u=0,c=0,h=0,d=0,f=0,v,p;if(t&&pr(t)&&i){var x=t.parentNode.getStartTangent(),A=Mc(x,2),N=A[0],I=A[1];v=N[0]-I[0],p=N[1]-I[1],f=Math.atan2(p,v),u=Math.cos(f)*(i||0),c=Math.sin(f)*(i||0)}if(n&&pr(n)&&a){var K=n.parentNode.getEndTangent(),W=Mc(K,2),z=W[0],j=W[1];v=z[0]-j[0],p=z[1]-j[1],f=Math.atan2(p,v),h=Math.cos(f)*(a||0),d=Math.sin(f)*(a||0)}for(var Z=0;Z<o.length;Z++){var vt=o[Z],Tt=vt[0],zt=o[Z+1],Qt=Z===0&&(u!==0||c!==0),ae=(Z===o.length-1||zt&&(zt[0]==="M"||zt[0]==="Z"))&&h!==0&&d!==0,fe=Qt?[u,c]:[0,0],ce=Mc(fe,2),ct=ce[0],$=ce[1],Q=ae?[h,d]:[0,0],It=Mc(Q,2),ue=It[0],le=It[1];switch(Tt){case"M":r.moveTo(vt[1]+ct,vt[2]+$);break;case"L":r.lineTo(vt[1]+ue,vt[2]+le);break;case"Q":r.quadraticCurveTo(vt[1],vt[2],vt[3]+ue,vt[4]+le);break;case"C":r.bezierCurveTo(vt[1],vt[2],vt[3],vt[4],vt[5]+ue,vt[6]+le);break;case"A":{var Fe=l[Z].arcParams,Qe=Fe.cx,He=Fe.cy,tn=Fe.rx,vn=Fe.ry,_n=Fe.startAngle,kr=Fe.endAngle,Rr=Fe.xRotation,Ps=Fe.sweepFlag;if(r.ellipse)r.ellipse(Qe,He,tn,vn,Rr,_n,kr,!!(1-Ps));else{var Fl=tn>vn?tn:vn,ja=tn>vn?1:tn/vn,xo=tn>vn?vn/tn:1;r.translate(Qe,He),r.rotate(Rr),r.scale(ja,xo),r.arc(0,0,Fl,_n,kr,!!(1-Ps)),r.scale(1/ja,1/xo),r.rotate(-Rr),r.translate(-Qe,-He)}ae&&r.lineTo(vt[6]+h,vt[7]+d);break}case"Z":r.closePath();break}}}function XM(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.points.points,o=s.length,l=s[0][0],u=s[0][1],c=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,p=0,x=0,A,N;t&&pr(t)&&i&&(A=s[1][0]-s[0][0],N=s[1][1]-s[0][1],x=Math.atan2(N,A),d=Math.cos(x)*(i||0),f=Math.sin(x)*(i||0)),n&&pr(n)&&a&&(A=s[o-1][0]-s[0][0],N=s[o-1][1]-s[0][1],x=Math.atan2(N,A),v=Math.cos(x)*(a||0),p=Math.sin(x)*(a||0)),r.moveTo(l+(d||v),u+(f||p));for(var I=1;I<o-1;I++){var K=s[I];r.lineTo(K[0],K[1])}r.lineTo(c,h)}function KM(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.points.points,o=s.length,l=s[0][0],u=s[0][1],c=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,p=0,x=0,A,N;t&&pr(t)&&i&&(A=s[1][0]-s[0][0],N=s[1][1]-s[0][1],x=Math.atan2(N,A),d=Math.cos(x)*(i||0),f=Math.sin(x)*(i||0)),n&&pr(n)&&a&&(A=s[o-2][0]-s[o-1][0],N=s[o-2][1]-s[o-1][1],x=Math.atan2(N,A),v=Math.cos(x)*(a||0),p=Math.sin(x)*(a||0)),r.moveTo(l+d,u+f);for(var I=1;I<o-1;I++){var K=s[I];r.lineTo(K[0],K[1])}r.lineTo(c+v,h+p)}function $M(r,e){var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,s=e.radius,o=e.width,l=e.height,u=o,c=l,h=s&&s.some(function(W){return W!==0});if(!h)r.rect(n,a,u,c);else{var d=o>0?1:-1,f=l>0?1:-1,v=d+f===0,p=s.map(function(W){return(0,Kt.Z)(W,0,Math.min(Math.abs(u)/2,Math.abs(c)/2))}),x=Mc(p,4),A=x[0],N=x[1],I=x[2],K=x[3];r.moveTo(d*A+n,a),r.lineTo(u-d*N+n,a),N!==0&&r.arc(u-d*N+n,f*N+a,N,-f*Math.PI/2,d>0?0:Math.PI,v),r.lineTo(u+n,c-f*I+a),I!==0&&r.arc(u-d*I+n,c-f*I+a,I,d>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,v),r.lineTo(d*K+n,c+a),K!==0&&r.arc(d*K+n,c-f*K+a,K,f>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,v),r.lineTo(n,f*A+a),A!==0&&r.arc(d*A+n,f*A+a,A,d>0?Math.PI:0,f>0?Math.PI*1.5:Math.PI/2,v)}}var QM=function(r){function e(){var t;LM(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=BM(this,e,[].concat(i)),t.name="canvas-path-generator",t}return zM(e,r),DM(e,[{key:"init",value:function(){var n,i=(n={},Aa(Aa(Aa(Aa(Aa(Aa(Aa(Aa(Aa(Aa(n,he.CIRCLE,ZM),he.ELLIPSE,VM),he.RECT,$M),he.LINE,YM),he.POLYLINE,KM),he.POLYGON,XM),he.PATH,HM),he.TEXT,void 0),he.GROUP,void 0),he.IMAGE,void 0),Aa(Aa(Aa(n,he.HTML,void 0),he.MESH,void 0),he.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(Se);function Bo(r){"@babel/helpers - typeof";return Bo=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},Bo(r)}function JM(r,e){if(Bo(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Bo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function d1(r){var e=JM(r,"string");return Bo(e)=="symbol"?e:e+""}function Ca(r,e,t){return(e=d1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function f1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function v1(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,d1(n.key),n)}}function g1(r,e,t){return e&&v1(r.prototype,e),t&&v1(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Id(r){return Id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Id(r)}function p1(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p1=function(){return!!r})()}function qM(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function tk(r,e){if(e&&(Bo(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qM(r)}function ek(r,e,t){return e=Id(e),tk(r,p1()?Reflect.construct(e,t||[],Id(r).constructor):e.apply(r,t))}function up(r,e){return up=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},up(r,e)}function nk(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&up(r,e)}function m1(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function y1(r,e){if(r){if(typeof r=="string")return m1(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m1(r,e):void 0}}function rk(r,e){var t=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=y1(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function cp(){"use strict";cp=function(){return e};var r,e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(ct,$,Q){ct[$]=Q.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(ct,$,Q){return Object.defineProperty(ct,$,{value:Q,enumerable:!0,configurable:!0,writable:!0}),ct[$]}try{u({},"")}catch(ct){u=function(Q,It,ue){return Q[It]=ue}}function c(ct,$,Q,It){var ue=$&&$.prototype instanceof A?$:A,le=Object.create(ue.prototype),Fe=new fe(It||[]);return i(le,"_invoke",{value:Tt(ct,Q,Fe)}),le}function h(ct,$,Q){try{return{type:"normal",arg:ct.call($,Q)}}catch(It){return{type:"throw",arg:It}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",v="executing",p="completed",x={};function A(){}function N(){}function I(){}var K={};u(K,s,function(){return this});var W=Object.getPrototypeOf,z=W&&W(W(ce([])));z&&z!==t&&n.call(z,s)&&(K=z);var j=I.prototype=A.prototype=Object.create(K);function Z(ct){["next","throw","return"].forEach(function($){u(ct,$,function(Q){return this._invoke($,Q)})})}function vt(ct,$){function Q(ue,le,Fe,Qe){var He=h(ct[ue],ct,le);if(He.type!=="throw"){var tn=He.arg,vn=tn.value;return vn&&Bo(vn)=="object"&&n.call(vn,"__await")?$.resolve(vn.__await).then(function(_n){Q("next",_n,Fe,Qe)},function(_n){Q("throw",_n,Fe,Qe)}):$.resolve(vn).then(function(_n){tn.value=_n,Fe(tn)},function(_n){return Q("throw",_n,Fe,Qe)})}Qe(He.arg)}var It;i(this,"_invoke",{value:function(le,Fe){function Qe(){return new $(function(He,tn){Q(le,Fe,He,tn)})}return It=It?It.then(Qe,Qe):Qe()}})}function Tt(ct,$,Q){var It=d;return function(ue,le){if(It===v)throw Error("Generator is already running");if(It===p){if(ue==="throw")throw le;return{value:r,done:!0}}for(Q.method=ue,Q.arg=le;;){var Fe=Q.delegate;if(Fe){var Qe=zt(Fe,Q);if(Qe){if(Qe===x)continue;return Qe}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(It===d)throw It=p,Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);It=v;var He=h(ct,$,Q);if(He.type==="normal"){if(It=Q.done?p:f,He.arg===x)continue;return{value:He.arg,done:Q.done}}He.type==="throw"&&(It=p,Q.method="throw",Q.arg=He.arg)}}}function zt(ct,$){var Q=$.method,It=ct.iterator[Q];if(It===r)return $.delegate=null,Q==="throw"&&ct.iterator.return&&($.method="return",$.arg=r,zt(ct,$),$.method==="throw")||Q!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),x;var ue=h(It,ct.iterator,$.arg);if(ue.type==="throw")return $.method="throw",$.arg=ue.arg,$.delegate=null,x;var le=ue.arg;return le?le.done?($[ct.resultName]=le.value,$.next=ct.nextLoc,$.method!=="return"&&($.method="next",$.arg=r),$.delegate=null,x):le:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,x)}function Qt(ct){var $={tryLoc:ct[0]};1 in ct&&($.catchLoc=ct[1]),2 in ct&&($.finallyLoc=ct[2],$.afterLoc=ct[3]),this.tryEntries.push($)}function ae(ct){var $=ct.completion||{};$.type="normal",delete $.arg,ct.completion=$}function fe(ct){this.tryEntries=[{tryLoc:"root"}],ct.forEach(Qt,this),this.reset(!0)}function ce(ct){if(ct||ct===""){var $=ct[s];if($)return $.call(ct);if(typeof ct.next=="function")return ct;if(!isNaN(ct.length)){var Q=-1,It=function ue(){for(;++Q<ct.length;)if(n.call(ct,Q))return ue.value=ct[Q],ue.done=!1,ue;return ue.value=r,ue.done=!0,ue};return It.next=It}}throw new TypeError(Bo(ct)+" is not iterable")}return N.prototype=I,i(j,"constructor",{value:I,configurable:!0}),i(I,"constructor",{value:N,configurable:!0}),N.displayName=u(I,l,"GeneratorFunction"),e.isGeneratorFunction=function(ct){var $=typeof ct=="function"&&ct.constructor;return!!$&&($===N||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(ct){return Object.setPrototypeOf?Object.setPrototypeOf(ct,I):(ct.__proto__=I,u(ct,l,"GeneratorFunction")),ct.prototype=Object.create(j),ct},e.awrap=function(ct){return{__await:ct}},Z(vt.prototype),u(vt.prototype,o,function(){return this}),e.AsyncIterator=vt,e.async=function(ct,$,Q,It,ue){ue===void 0&&(ue=Promise);var le=new vt(c(ct,$,Q,It),ue);return e.isGeneratorFunction($)?le:le.next().then(function(Fe){return Fe.done?Fe.value:le.next()})},Z(j),u(j,l,"Generator"),u(j,s,function(){return this}),u(j,"toString",function(){return"[object Generator]"}),e.keys=function(ct){var $=Object(ct),Q=[];for(var It in $)Q.push(It);return Q.reverse(),function ue(){for(;Q.length;){var le=Q.pop();if(le in $)return ue.value=le,ue.done=!1,ue}return ue.done=!0,ue}},e.values=ce,fe.prototype={constructor:fe,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ae),!$)for(var Q in this)Q.charAt(0)==="t"&&n.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=r)},stop:function(){this.done=!0;var $=this.tryEntries[0].completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var Q=this;function It(tn,vn){return Fe.type="throw",Fe.arg=$,Q.next=tn,vn&&(Q.method="next",Q.arg=r),!!vn}for(var ue=this.tryEntries.length-1;ue>=0;--ue){var le=this.tryEntries[ue],Fe=le.completion;if(le.tryLoc==="root")return It("end");if(le.tryLoc<=this.prev){var Qe=n.call(le,"catchLoc"),He=n.call(le,"finallyLoc");if(Qe&&He){if(this.prev<le.catchLoc)return It(le.catchLoc,!0);if(this.prev<le.finallyLoc)return It(le.finallyLoc)}else if(Qe){if(this.prev<le.catchLoc)return It(le.catchLoc,!0)}else{if(!He)throw Error("try statement without catch or finally");if(this.prev<le.finallyLoc)return It(le.finallyLoc)}}}},abrupt:function($,Q){for(var It=this.tryEntries.length-1;It>=0;--It){var ue=this.tryEntries[It];if(ue.tryLoc<=this.prev&&n.call(ue,"finallyLoc")&&this.prev<ue.finallyLoc){var le=ue;break}}le&&($==="break"||$==="continue")&&le.tryLoc<=Q&&Q<=le.finallyLoc&&(le=null);var Fe=le?le.completion:{};return Fe.type=$,Fe.arg=Q,le?(this.method="next",this.next=le.finallyLoc,x):this.complete(Fe)},complete:function($,Q){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&Q&&(this.next=Q),x},finish:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.finallyLoc===$)return this.complete(It.completion,It.afterLoc),ae(It),x}},catch:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.tryLoc===$){var ue=It.completion;if(ue.type==="throw"){var le=ue.arg;ae(It)}return le}}throw Error("illegal catch attempt")},delegateYield:function($,Q,It){return this.delegate={iterator:ce($),resultName:Q,nextLoc:It},this.method==="next"&&(this.arg=r),x}},e}function b1(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(n,i)}function ik(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){b1(a,n,i,s,o,"next",l)}function o(l){b1(a,n,i,s,o,"throw",l)}s(void 0)})}}function ak(r){if(Array.isArray(r))return r}function sk(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function ok(){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 zo(r,e){return ak(r)||sk(r,e)||y1(r,e)||ok()}var lk=g(74873);function x1(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function E1(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(t),!0).forEach(function(n){Ca(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):x1(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var uk=et.Ue(),ck=et.Ue(),hk=et.Ue(),dk=yt.create(),w1=function(){function r(){var e=this;f1(this,r),this.isHit=function(t,n,i,a){var s=e.context.pointInPathPickerFactory[t.nodeName];if(s){var o=yt.invert(dk,i),l=et.fF(ck,et.t8(hk,n[0],n[1],0),o);if(s(t,new Ye(l[0],l[1]),a,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),a=e.context.pathGeneratorFactory[t.nodeName];return a&&(i.beginPath(),a(i,t.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}return g1(r,[{key:"apply",value:function(t,n){var i,a=this,s=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=n;var l=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;s.hooks.pick.tapPromise(r.tag,function(){var u=ik(cp().mark(function c(h){return cp().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",a.pick(l,h));case 1:case"end":return f.stop()}},c)}));return function(c){return u.apply(this,arguments)}}()),s.hooks.pickSync.tap(r.tag,function(u){return a.pick(l,u)})}},{key:"pick",value:function(t,n){var i=n.topmost,a=n.position,s=a.x,o=a.y,l=et.t8(uk,s,o,0),u=t.elementsFromBBox(l[0],l[1],l[0],l[1]),c=[],h=rk(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=f.getWorldTransform(),p=this.isHit(f,l,v,!1);if(p){var x=Ni(f);if(x){var A=x.parsedStyle.clipPath,N=this.isHit(A,l,A.getWorldTransform(),!0);if(N){if(i)return n.picked=[f],n;c.push(f)}}else{if(i)return n.picked=[f],n;c.push(f)}}}}catch(I){h.e(I)}finally{h.f()}return n.picked=c,n}}])}();w1.tag="CanvasPicker";function fk(r,e,t){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.r,u=n.fill,c=n.stroke,h=n.lineWidth,d=h===void 0?1:h,f=n.increasedLineWidthForHitTesting,v=f===void 0?0:f,p=n.pointerEvents,x=p===void 0?"auto":p,A=(d+v)/2,N=(0,U.TE)(a,o,e.x,e.y),I=hi(x,u,c),K=zo(I,2),W=K[0],z=K[1];return W&&z||t?N<=l+A:W?N<=l:z?N>=l-A&&N<=l+A:!1}function Fd(r,e,t,n){return r/(t*t)+e/(n*n)}function vk(r,e,t){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.rx,u=n.ry,c=n.fill,h=n.stroke,d=n.lineWidth,f=d===void 0?1:d,v=n.increasedLineWidthForHitTesting,p=v===void 0?0:v,x=n.pointerEvents,A=x===void 0?"auto":x,N=e.x,I=e.y,K=hi(A,c,h),W=zo(K,2),z=W[0],j=W[1],Z=(f+p)/2,vt=(N-a)*(N-a),Tt=(I-o)*(I-o);return z&&j||t?Fd(vt,Tt,l+Z,u+Z)<=1:z?Fd(vt,Tt,l,u)<=1:j?Fd(vt,Tt,l-Z,u-Z)>=1&&Fd(vt,Tt,l+Z,u+Z)<=1:!1}function xl(r,e,t,n,i,a){return i>=r&&i<=r+t&&a>=e&&a<=e+n}function gk(r,e,t,n,i,a,s){var o=i/2;return xl(r-o,e-o,t,i,a,s)||xl(r+t-o,e-o,i,n,a,s)||xl(r+o,e+n-o,t,i,a,s)||xl(r-o,e+o,i,n,a,s)}function Bd(r,e,t,n,i,a,s,o){var l=(Math.atan2(o-e,s-r)+Math.PI*2)%(Math.PI*2),u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return(0,U.TE)(u.x,u.y,s,o)<=a/2}function jo(r,e,t,n,i,a,s){var o=Math.min(r,t),l=Math.max(r,t),u=Math.min(e,n),c=Math.max(e,n),h=i/2;return a>=o-h&&a<=l+h&&s>=u-h&&s<=c+h?(0,U._x)(r,e,t,n,a,s)<=i/2:!1}function S1(r,e,t,n,i){var a=r.length;if(a<2)return!1;for(var s=0;s<a-1;s++){var o=r[s][0],l=r[s][1],u=r[s+1][0],c=r[s+1][1];if(jo(o,l,u,c,e,t,n))return!0}if(i){var h=r[0],d=r[a-1];if(jo(h[0],h[1],d[0],d[1],e,t,n))return!0}return!1}var pk=1e-6;function hp(r){return Math.abs(r)<pk?0:r<0?-1:1}function mk(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function _1(r,e,t){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var s=r[a],o=r[(a+1)%i];if(mk(s,o,[e,t]))return!0;hp(s[1]-t)>0!=hp(o[1]-t)>0&&hp(e-(t-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(n=!n)}return n}function M1(r,e,t){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=_1(a,e,t),n)break}return n}function yk(r,e,t){var n=r.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2,l=n.lineWidth,u=l===void 0?1:l,c=n.increasedLineWidthForHitTesting,h=c===void 0?0:c,d=n.pointerEvents,f=d===void 0?"auto":d,v=n.fill,p=n.stroke,x=hi(f,v,p),A=zo(x,2),N=A[1];return!N&&!t||!u?!1:jo(i,a,s,o,u+h,e.x,e.y)}function bk(r,e,t,n,i){for(var a=!1,s=e/2,o=0;o<r.length;o++){var l=r[o],u=l.currentPoint,c=l.params,h=l.prePoint,d=l.box;if(!(d&&!xl(d.x-s,d.y-s,d.width+e,d.height+e,t,n)))switch(l.command){case"L":case"Z":if(a=jo(h[0],h[1],u[0],u[1],e,t,n),a)return!0;break;case"Q":var f=(0,U.Y1)(h[0],h[1],c[1],c[2],c[3],c[4],t,n);if(a=f<=e/2,a)return!0;break;case"C":var v=(0,U.ph)(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],t,n,i);if(a=v<=e/2,a)return!0;break;case"A":l.cubicParams||(l.cubicParams=(0,lk.W)(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var p=l.cubicParams,x=h,A=0;A<p.length;A+=6){var N=(0,U.ph)(x[0],x[1],p[A],p[A+1],p[A+2],p[A+3],p[A+4],p[A+5],t,n,i);if(x=[p[A+4],p[A+5]],a=N<=e/2,a)return!0}break}}return a}function xk(r,e,t,n,i,a){var s=r.parsedStyle,o=s.lineWidth,l=o===void 0?1:o,u=s.increasedLineWidthForHitTesting,c=u===void 0?0:u,h=s.stroke,d=s.fill,f=s.d,v=s.pointerEvents,p=v===void 0?"auto":v,x=f.segments,A=f.hasArc,N=f.polylines,I=f.polygons,K=hi(p,(I==null?void 0:I.length)&&d,h),W=zo(K,2),z=W[0],j=W[1],Z=Zl(r),vt=!1;return z||t?(A?vt=n(r,e):vt=M1(I,e.x,e.y)||M1(N,e.x,e.y),vt):((j||t)&&(vt=bk(x,l+c,e.x,e.y,Z)),vt)}function Ek(r,e,t){var n=r.parsedStyle,i=n.stroke,a=n.fill,s=n.lineWidth,o=s===void 0?1:s,l=n.increasedLineWidthForHitTesting,u=l===void 0?0:l,c=n.points,h=n.pointerEvents,d=h===void 0?"auto":h,f=hi(d,a,i),v=zo(f,2),p=v[0],x=v[1],A=!1;return(x||t)&&(A=S1(c.points,o+u,e.x,e.y,!0)),!A&&(p||t)&&(A=_1(c.points,e.x,e.y)),A}function wk(r,e,t){var n=r.parsedStyle,i=n.lineWidth,a=i===void 0?1:i,s=n.increasedLineWidthForHitTesting,o=s===void 0?0:s,l=n.points,u=n.pointerEvents,c=u===void 0?"auto":u,h=n.fill,d=n.stroke,f=hi(c,h,d),v=zo(f,2),p=v[1];return!p&&!t||!a?!1:S1(l.points,a+o,e.x,e.y,!1)}function Sk(r,e,t,n,i){var a=r.parsedStyle,s=a.radius,o=a.fill,l=a.stroke,u=a.lineWidth,c=u===void 0?1:u,h=a.increasedLineWidthForHitTesting,d=h===void 0?0:h,f=a.x,v=f===void 0?0:f,p=a.y,x=p===void 0?0:p,A=a.width,N=a.height,I=a.pointerEvents,K=I===void 0?"auto":I,W=hi(K,o,l),z=zo(W,2),j=z[0],Z=z[1],vt=s&&s.some(function(ae){return ae!==0}),Tt=c+d;if(vt){var Qt=!1;return(Z||t)&&(Qt=_k(v,x,A,N,s.map(function(ae){return(0,Kt.Z)(ae,0,Math.min(Math.abs(A)/2,Math.abs(N)/2))}),Tt,e.x,e.y)),!Qt&&(j||t)&&(Qt=n(r,e)),Qt}else{var zt=Tt/2;if(j&&Z||t)return xl(v-zt,x-zt,A+zt,N+zt,e.x,e.y);if(j)return xl(v,x,A,N,e.x,e.y);if(Z)return gk(v,x,A,N,Tt,e.x,e.y)}return!1}function _k(r,e,t,n,i,a,s,o){var l=zo(i,4),u=l[0],c=l[1],h=l[2],d=l[3];return jo(r+u,e,r+t-c,e,a,s,o)||jo(r+t,e+c,r+t,e+n-h,a,s,o)||jo(r+t-h,e+n,r+d,e+n,a,s,o)||jo(r,e+n-d,r,e+u,a,s,o)||Bd(r+t-c,e+c,c,1.5*Math.PI,2*Math.PI,a,s,o)||Bd(r+t-h,e+n-h,h,0,.5*Math.PI,a,s,o)||Bd(r+d,e+n-d,d,.5*Math.PI,Math.PI,a,s,o)||Bd(r+u,e+u,u,Math.PI,1.5*Math.PI,a,s,o)}function Mk(r,e,t,n,i,a){var s=r.parsedStyle,o=s.pointerEvents,l=o===void 0?"auto":o,u=s.x,c=u===void 0?0:u,h=s.y,d=h===void 0?0:h,f=s.width,v=s.height;if(l==="non-transparent-pixel"){var p=i.config.offscreenCanvas,x=a.offscreenCanvasCreator.getOrCreateCanvas(p),A=a.offscreenCanvasCreator.getOrCreateContext(p,{willReadFrequently:!0});x.width=f,x.height=v,i.defaultStyleRendererFactory[he.IMAGE].render(A,E1(E1({},r.parsedStyle),{},{x:0,y:0}),r,void 0,void 0,void 0);var N=A.getImageData(e.x-c,e.y-d,1,1).data;return N.every(function(I){return I!==0})}return!0}function kk(r,e,t,n){var i=r.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var Tk=function(r){function e(){var t;f1(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=ek(this,e,[].concat(i)),t.name="canvas-picker",t}return nk(e,r),g1(e,[{key:"init",value:function(){var n,i=(n={},Ca(Ca(Ca(Ca(Ca(Ca(Ca(Ca(Ca(Ca(n,he.CIRCLE,fk),he.ELLIPSE,vk),he.RECT,Sk),he.LINE,yk),he.POLYLINE,wk),he.POLYGON,Ek),he.PATH,xk),he.TEXT,kk),he.GROUP,null),he.IMAGE,Mk),Ca(Ca(n,he.HTML,null),he.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new w1)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(Se);function du(r){"@babel/helpers - typeof";return du=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},du(r)}function Ok(r,e){if(du(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function k1(r){var e=Ok(r,"string");return du(e)=="symbol"?e:e+""}function fa(r,e,t){return(e=k1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function T1(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dp(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?T1(Object(t),!0).forEach(function(n){fa(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):T1(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function O1(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,k1(n.key),n)}}function vu(r,e,t){return e&&O1(r.prototype,e),t&&O1(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function zd(r){return zd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zd(r)}function A1(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A1=function(){return!!r})()}function Ak(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ck(r,e){if(e&&(du(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ak(r)}function jd(r,e,t){return e=zd(e),Ck(r,A1()?Reflect.construct(e,t||[],zd(r).constructor):e.apply(r,t))}function fp(r,e){return fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},fp(r,e)}function Gd(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&fp(r,e)}function Pk(r){if(Array.isArray(r))return r}function Nk(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function vp(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function C1(r,e){if(r){if(typeof r=="string")return vp(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vp(r,e):void 0}}function Rk(){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 Wd(r,e){return Pk(r)||Nk(r,e)||C1(r,e)||Rk()}function Lk(r){if(Array.isArray(r))return vp(r)}function Dk(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ik(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fk(r){return Lk(r)||Dk(r)||C1(r)||Ik()}function Ys(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Bk=0;function zk(r){return"__private_"+Bk+++"_"+r}function kc(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Go(r){"@babel/helpers - typeof";return Go=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},Go(r)}function jk(r,e){if(Go(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Go(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function P1(r){var e=jk(r,"string");return Go(e)=="symbol"?e:e+""}function N1(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,P1(n.key),n)}}function Tc(r,e,t){return e&&N1(r.prototype,e),t&&N1(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Ud(r){return Ud=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ud(r)}function R1(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R1=function(){return!!r})()}function Gk(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Wk(r,e){if(e&&(Go(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gk(r)}function Uk(r,e,t){return e=Ud(e),Wk(r,R1()?Reflect.construct(e,t||[],Ud(r).constructor):e.apply(r,t))}function gp(r,e){return gp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},gp(r,e)}function Zk(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&gp(r,e)}function Oc(){"use strict";Oc=function(){return e};var r,e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(ct,$,Q){ct[$]=Q.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(ct,$,Q){return Object.defineProperty(ct,$,{value:Q,enumerable:!0,configurable:!0,writable:!0}),ct[$]}try{u({},"")}catch(ct){u=function(Q,It,ue){return Q[It]=ue}}function c(ct,$,Q,It){var ue=$&&$.prototype instanceof A?$:A,le=Object.create(ue.prototype),Fe=new fe(It||[]);return i(le,"_invoke",{value:Tt(ct,Q,Fe)}),le}function h(ct,$,Q){try{return{type:"normal",arg:ct.call($,Q)}}catch(It){return{type:"throw",arg:It}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",v="executing",p="completed",x={};function A(){}function N(){}function I(){}var K={};u(K,s,function(){return this});var W=Object.getPrototypeOf,z=W&&W(W(ce([])));z&&z!==t&&n.call(z,s)&&(K=z);var j=I.prototype=A.prototype=Object.create(K);function Z(ct){["next","throw","return"].forEach(function($){u(ct,$,function(Q){return this._invoke($,Q)})})}function vt(ct,$){function Q(ue,le,Fe,Qe){var He=h(ct[ue],ct,le);if(He.type!=="throw"){var tn=He.arg,vn=tn.value;return vn&&Go(vn)=="object"&&n.call(vn,"__await")?$.resolve(vn.__await).then(function(_n){Q("next",_n,Fe,Qe)},function(_n){Q("throw",_n,Fe,Qe)}):$.resolve(vn).then(function(_n){tn.value=_n,Fe(tn)},function(_n){return Q("throw",_n,Fe,Qe)})}Qe(He.arg)}var It;i(this,"_invoke",{value:function(le,Fe){function Qe(){return new $(function(He,tn){Q(le,Fe,He,tn)})}return It=It?It.then(Qe,Qe):Qe()}})}function Tt(ct,$,Q){var It=d;return function(ue,le){if(It===v)throw Error("Generator is already running");if(It===p){if(ue==="throw")throw le;return{value:r,done:!0}}for(Q.method=ue,Q.arg=le;;){var Fe=Q.delegate;if(Fe){var Qe=zt(Fe,Q);if(Qe){if(Qe===x)continue;return Qe}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(It===d)throw It=p,Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);It=v;var He=h(ct,$,Q);if(He.type==="normal"){if(It=Q.done?p:f,He.arg===x)continue;return{value:He.arg,done:Q.done}}He.type==="throw"&&(It=p,Q.method="throw",Q.arg=He.arg)}}}function zt(ct,$){var Q=$.method,It=ct.iterator[Q];if(It===r)return $.delegate=null,Q==="throw"&&ct.iterator.return&&($.method="return",$.arg=r,zt(ct,$),$.method==="throw")||Q!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),x;var ue=h(It,ct.iterator,$.arg);if(ue.type==="throw")return $.method="throw",$.arg=ue.arg,$.delegate=null,x;var le=ue.arg;return le?le.done?($[ct.resultName]=le.value,$.next=ct.nextLoc,$.method!=="return"&&($.method="next",$.arg=r),$.delegate=null,x):le:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,x)}function Qt(ct){var $={tryLoc:ct[0]};1 in ct&&($.catchLoc=ct[1]),2 in ct&&($.finallyLoc=ct[2],$.afterLoc=ct[3]),this.tryEntries.push($)}function ae(ct){var $=ct.completion||{};$.type="normal",delete $.arg,ct.completion=$}function fe(ct){this.tryEntries=[{tryLoc:"root"}],ct.forEach(Qt,this),this.reset(!0)}function ce(ct){if(ct||ct===""){var $=ct[s];if($)return $.call(ct);if(typeof ct.next=="function")return ct;if(!isNaN(ct.length)){var Q=-1,It=function ue(){for(;++Q<ct.length;)if(n.call(ct,Q))return ue.value=ct[Q],ue.done=!1,ue;return ue.value=r,ue.done=!0,ue};return It.next=It}}throw new TypeError(Go(ct)+" is not iterable")}return N.prototype=I,i(j,"constructor",{value:I,configurable:!0}),i(I,"constructor",{value:N,configurable:!0}),N.displayName=u(I,l,"GeneratorFunction"),e.isGeneratorFunction=function(ct){var $=typeof ct=="function"&&ct.constructor;return!!$&&($===N||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(ct){return Object.setPrototypeOf?Object.setPrototypeOf(ct,I):(ct.__proto__=I,u(ct,l,"GeneratorFunction")),ct.prototype=Object.create(j),ct},e.awrap=function(ct){return{__await:ct}},Z(vt.prototype),u(vt.prototype,o,function(){return this}),e.AsyncIterator=vt,e.async=function(ct,$,Q,It,ue){ue===void 0&&(ue=Promise);var le=new vt(c(ct,$,Q,It),ue);return e.isGeneratorFunction($)?le:le.next().then(function(Fe){return Fe.done?Fe.value:le.next()})},Z(j),u(j,l,"Generator"),u(j,s,function(){return this}),u(j,"toString",function(){return"[object Generator]"}),e.keys=function(ct){var $=Object(ct),Q=[];for(var It in $)Q.push(It);return Q.reverse(),function ue(){for(;Q.length;){var le=Q.pop();if(le in $)return ue.value=le,ue.done=!1,ue}return ue.done=!0,ue}},e.values=ce,fe.prototype={constructor:fe,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ae),!$)for(var Q in this)Q.charAt(0)==="t"&&n.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=r)},stop:function(){this.done=!0;var $=this.tryEntries[0].completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var Q=this;function It(tn,vn){return Fe.type="throw",Fe.arg=$,Q.next=tn,vn&&(Q.method="next",Q.arg=r),!!vn}for(var ue=this.tryEntries.length-1;ue>=0;--ue){var le=this.tryEntries[ue],Fe=le.completion;if(le.tryLoc==="root")return It("end");if(le.tryLoc<=this.prev){var Qe=n.call(le,"catchLoc"),He=n.call(le,"finallyLoc");if(Qe&&He){if(this.prev<le.catchLoc)return It(le.catchLoc,!0);if(this.prev<le.finallyLoc)return It(le.finallyLoc)}else if(Qe){if(this.prev<le.catchLoc)return It(le.catchLoc,!0)}else{if(!He)throw Error("try statement without catch or finally");if(this.prev<le.finallyLoc)return It(le.finallyLoc)}}}},abrupt:function($,Q){for(var It=this.tryEntries.length-1;It>=0;--It){var ue=this.tryEntries[It];if(ue.tryLoc<=this.prev&&n.call(ue,"finallyLoc")&&this.prev<ue.finallyLoc){var le=ue;break}}le&&($==="break"||$==="continue")&&le.tryLoc<=Q&&Q<=le.finallyLoc&&(le=null);var Fe=le?le.completion:{};return Fe.type=$,Fe.arg=Q,le?(this.method="next",this.next=le.finallyLoc,x):this.complete(Fe)},complete:function($,Q){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&Q&&(this.next=Q),x},finish:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.finallyLoc===$)return this.complete(It.completion,It.afterLoc),ae(It),x}},catch:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.tryLoc===$){var ue=It.completion;if(ue.type==="throw"){var le=ue.arg;ae(It)}return le}}throw Error("illegal catch attempt")},delegateYield:function($,Q,It){return this.delegate={iterator:ce($),resultName:Q,nextLoc:It},this.method==="next"&&(this.arg=r),x}},e}function Vk(r,e,t){return(e=P1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function L1(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Wo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?L1(Object(t),!0).forEach(function(n){Vk(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):L1(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Yk(r){if(Array.isArray(r))return r}function Hk(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function D1(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Xk(r,e){if(r){if(typeof r=="string")return D1(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D1(r,e):void 0}}function Kk(){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 $k(r,e){return Yk(r)||Hk(r,e)||Xk(r,e)||Kk()}function I1(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(n,i)}function F1(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){I1(a,n,i,s,o,"next",l)}function o(l){I1(a,n,i,s,o,"throw",l)}s(void 0)})}}var Qk=function(){function r(){kc(this,r),this.cacheStore=new Map}return Tc(r,[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,n,i){return this.cacheStore.has(t)?!1:(this.cacheStore.set(t,{value:n,counter:new Set([i])}),this.onRefAdded(i),!0)}},{key:"get",value:function(t,n){var i=this.cacheStore.get(t);return i?(i.counter.has(n)||(i.counter.add(n),this.onRefAdded(n)),i.value):null}},{key:"update",value:function(t,n,i){var a=this.cacheStore.get(t);return a?(a.value=Wo(Wo({},a.value),n),a.counter.has(i)||(a.counter.add(i),this.onRefAdded(i)),!0):!1}},{key:"release",value:function(t,n){var i=this.cacheStore.get(t);return i?(i.counter.delete(n),i.counter.size<=0&&this.cacheStore.delete(t),!0):!1}},{key:"releaseRef",value:function(t){var n=this;Array.from(this.cacheStore.keys()).forEach(function(i){n.release(i,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),pp=[],mp=[],yp=function(){function r(){kc(this,r)}return Tc(r,null,[{key:"stop",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;r.rafId&&(t.cancelAnimationFrame(r.rafId),r.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;pp.length<=0&&mp.length<=0||(mp.forEach(function(n){return n()}),mp=pp.splice(0,r.TASK_NUM_PER_FRAME),r.rafId=t.requestAnimationFrame(function(){r.executeTask(t)}))}},{key:"sliceImage",value:function(t,n,i,a){for(var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:r.api,l=t.naturalWidth||t.width,u=t.naturalHeight||t.height,c=n-s,h=i-s,d=Math.ceil(l/c),f=Math.ceil(u/h),v={tileSize:[n,i],gridSize:[f,d],tiles:Array(f).fill(null).map(function(){return Array(d).fill(null)})},p=function(N){for(var I=function(z){pp.push(function(){var j=z*c,Z=N*h,vt=[Math.min(n,l-j),Math.min(i,u-Z)],Tt=vt[0],zt=vt[1],Qt=o.createCanvas();Qt.width=n,Qt.height=i;var ae=Qt.getContext("2d");ae.drawImage(t,j,Z,Tt,zt,0,0,Tt,zt),v.tiles[N][z]={x:j,y:Z,tileX:z,tileY:N,data:Qt},a()})},K=0;K<d;K++)I(K)},x=0;x<f;x++)p(x);return r.stop(),r.executeTask(),v}}])}();yp.TASK_NUM_PER_FRAME=10;var Pa=new Qk;Pa.onRefAdded=function(e){var t=this;e.addEventListener(or.DESTROY,function(){t.releaseRef(e)},{once:!0})};var bp=function(){function r(e,t){kc(this,r),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=t}return Tc(r,[{key:"getImageSync",value:function(t,n,i){var a=(0,Gt.Z)(t)?t:t.src;if(Pa.has(a)){var s=Pa.get(a,n);if(s.img.complete)return i==null||i(s),s}return this.getOrCreateImage(t,n).then(function(o){i==null||i(o)}).catch(function(){}),null}},{key:"getOrCreateImage",value:function(t,n){var i=(0,Gt.Z)(t)?t:t.src;if(!(0,Gt.Z)(t)&&!Pa.has(i)){var a={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:Zd(t)};Pa.put(i,a,n)}if(Pa.has(i)){var s=Pa.get(i,n);return s.img.complete?Promise.resolve(s):new Promise(function(l,u){s.img.addEventListener("load",function(){s.size=[s.img.naturalWidth||s.img.width,s.img.naturalHeight||s.img.height],s.tileSize=Zd(s.img),l(s)}),s.img.addEventListener("error",function(c){u(c)})})}var o=this.context.config.createImage;return new Promise(function(l,u){var c;if(o?c=o(i):Zn&&(c=new window.Image),c){var h={img:c,size:[0,0],tileSize:Zd(c)};Pa.put(i,h,n),c.onload=function(){h.size=[c.naturalWidth||c.width,c.naturalHeight||c.height],h.tileSize=Zd(h.img),l(h)},c.onerror=function(d){u(d)},c.crossOrigin="Anonymous",c.src=i}})}},{key:"createDownSampledImage",value:function(){var e=F1(Oc().mark(function n(i,a){var s,o,l,u,c,h,d,f,v,p,x,A,N,I;return Oc().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,this.getOrCreateImage(i,a);case 2:if(s=W.sent,typeof s.downSamplingRate=="undefined"){W.next=5;break}return W.abrupt("return",s);case 5:if(o=this.context.config.enableLargeImageOptimization,l=typeof o=="boolean"?{}:o,u=l.maxDownSampledImageSize,c=u===void 0?2048:u,h=l.downSamplingRateThreshold,d=h===void 0?.5:h,f=this.runtime.globalThis.createImageBitmap,v=$k(s.size,2),p=v[0],x=v[1],A=s.img,N=Math.min((c+c)/(p+x),Math.max(.01,Math.min(d,.5))),I=Wo(Wo({},s),{},{downSamplingRate:N}),Pa.update(s.img.src,I,a),!f){W.next=25;break}return W.prev=14,W.next=17,f(s.img,{resizeWidth:p*N,resizeHeight:x*N});case 17:A=W.sent,W.next=23;break;case 20:W.prev=20,W.t0=W.catch(14),N=1;case 23:W.next=26;break;case 25:N=1;case 26:return I=Wo(Wo({},this.getImageSync(i,a)),{},{downSampled:A,downSamplingRate:N}),Pa.update(s.img.src,I,a),W.abrupt("return",I);case 29:case"end":return W.stop()}},n,this,[[14,20]])}));function t(n,i){return e.apply(this,arguments)}return t}()},{key:"createImageTiles",value:function(){var e=F1(Oc().mark(function n(i,a,s,o){var l,u,c,h,d;return Oc().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.getOrCreateImage(i,o);case 2:return l=v.sent,u=o.ownerDocument.defaultView,c=u.requestAnimationFrame,h=u.cancelAnimationFrame,yp.api={requestAnimationFrame:c,cancelAnimationFrame:h,createCanvas:function(){return _g.createCanvas()}},d=Wo(Wo({},l),yp.sliceImage(l.img,l.tileSize[0],l.tileSize[0],s)),Pa.update(l.img.src,d,o),v.abrupt("return",d);case 8:case"end":return v.stop()}},n,this)}));function t(n,i,a,s){return e.apply(this,arguments)}return t}()},{key:"releaseImage",value:function(t,n){Pa.release((0,Gt.Z)(t)?t:t.src,n)}},{key:"releaseImageRef",value:function(t){Pa.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,n,i,a,s,o,l){var u=this.generatePatternKey(n);if(u&&this.patternCache[u])return this.patternCache[u];var c=n.image,h=n.repetition,d=n.transform,f,v=!1;if((0,Gt.Z)(c)){var p=this.getImageSync(c,t,l);f=p==null?void 0:p.img}else a?(f=a,v=!0):f=c;var x=f&&i.createPattern(f,h);if(x){var A;d?A=Yh(Uh(d),new ni({})):A=yt.identity(yt.create()),v&&yt.scale(A,A,[1/s,1/s,1]),x.setTransform({a:A[0],b:A[1],c:A[4],d:A[5],e:A[12]+o[0],f:A[13]+o[1]})}return u&&x&&(this.patternCache[u]=x),x}},{key:"getOrCreateGradient",value:function(t,n){var i=this.generateGradientKey(t),a=t.type,s=t.steps,o=t.min,l=t.width,u=t.height,c=t.angle,h=t.cx,d=t.cy,f=t.size;if(this.gradientCache[i])return this.gradientCache[i];var v=null;if(a===Rs.LinearGradient){var p=$v(o,l,u,c),x=p.x1,A=p.y1,N=p.x2,I=p.y2;v=n.createLinearGradient(x,A,N,I)}else if(a===Rs.RadialGradient){var K=Qu(o,l,u,h,d,f),W=K.x,z=K.y,j=K.r;v=n.createRadialGradient(W,z,0,W,z,j)}return v&&(s.forEach(function(Z){var vt=Z.offset,Tt=Z.color;if(vt.unit===ln.kPercentage){var zt;(zt=v)===null||zt===void 0||zt.addColorStop(vt.value/100,Tt.toString())}}),this.gradientCache[i]=v),this.gradientCache[i]}},{key:"generateGradientKey",value:function(t){var n=t.type,i=t.min,a=t.width,s=t.height,o=t.steps,l=t.angle,u=t.cx,c=t.cy,h=t.size;return"gradient-".concat(n,"-").concat((l==null?void 0:l.toString())||0,"-").concat((u==null?void 0:u.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat((h==null?void 0:h.toString())||0,"-").concat(i[0],"-").concat(i[1],"-").concat(a,"-").concat(s,"-").concat(o.map(function(d){var f=d.offset,v=d.color;return"".concat(f).concat(v)}).join("-"))}},{key:"generatePatternKey",value:function(t){var n=t.image,i=t.repetition;if((0,Gt.Z)(n))return"pattern-".concat(n,"-").concat(i);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(i)}}])}();bp.isSupportTile=!!_g.createCanvas();function Zd(r){if(!r.complete)return[0,0];var e=r.naturalWidth||r.width,t=r.naturalHeight||r.height,n=256;return[256,512].forEach(function(i){var a=Math.ceil(t/i),s=Math.ceil(e/i);a*s<1e3&&(n=i)}),[n,n]}var B1=function(){function r(){kc(this,r)}return Tc(r,[{key:"apply",value:function(t){var n=t.renderingService,i=t.renderingContext,a=t.imagePool,s=i.root.ownerDocument.defaultView,o=function(h,d,f){var v=h.parsedStyle,p=v.width,x=v.height;p&&!x?h.setAttribute("height",f/d*p):!p&&x&&h.setAttribute("width",d/f*x)},l=function(h){var d=h.target,f=d.nodeName,v=d.attributes;if(f===he.IMAGE){var p=v.src,x=v.keepAspectRatio;a.getImageSync(p,d,function(A){var N=A.img,I=N.width,K=N.height;x&&o(d,I,K),d.renderable.dirty=!0,n.dirtify()})}},u=function(h){var d=h.target,f=h.attrName,v=h.prevValue,p=h.newValue;d.nodeName!==he.IMAGE||f!=="src"||(v!==p&&a.releaseImage(v,d),(0,Gt.Z)(p)&&a.getOrCreateImage(p,d).then(function(x){var A=x.img,N=A.width,I=A.height;d.attributes.keepAspectRatio&&o(d,N,I),d.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(r.tag,function(){s.addEventListener(or.MOUNTED,l),s.addEventListener(or.ATTR_MODIFIED,u)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener(or.MOUNTED,l),s.removeEventListener(or.ATTR_MODIFIED,u)})}}])}();B1.tag="LoadImage";var Jk=function(r){function e(){var t;kc(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=Uk(this,e,[].concat(i)),t.name="image-loader",t}return Zk(e,r),Tc(e,[{key:"init",value:function(n){this.context.imagePool=new bp(this.context,n),this.addRenderingPlugin(new B1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Se);var mi=zk("renderState"),z1=function(){function r(e){fu(this,r),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,mi,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=yt.create(),this.dprMatrix=yt.create(),this.tmpMat4=yt.create(),this.vec3a=et.Ue(),this.vec3b=et.Ue(),this.vec3c=et.Ue(),this.vec3d=et.Ue(),this.canvasRendererPluginOptions=e}return vu(r,[{key:"apply",value:function(t,n){var i=this;this.context=t;var a=this.context,s=a.config,o=a.camera,l=a.renderingService,u=a.renderingContext,c=a.rBushRoot,h=a.pathGeneratorFactory,d=s.renderer.getConfig().enableRenderingOptimization;s.renderer.getConfig().enableDirtyCheck=!1,s.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=c,this.pathGeneratorFactory=h;var f=t.contextService,v=u.root.ownerDocument.defaultView,p=function(I){var K=I.target,W=K.rBushNode;W.aabb&&i.removedRBushNodeAABBs.push(W.aabb)},x=function(I){var K=I.target,W=K.rBushNode;W.aabb&&i.removedRBushNodeAABBs.push(W.aabb)};l.hooks.init.tap(r.tag,function(){v.addEventListener(or.UNMOUNTED,p),v.addEventListener(or.CULLED,x);var N=f.getDPR(),I=s.width,K=s.height,W=f.getContext();i.clearRect(W,0,0,I*N,K*N,s.background)}),l.hooks.destroy.tap(r.tag,function(){v.removeEventListener(or.UNMOUNTED,p),v.removeEventListener(or.CULLED,x),i.renderQueue=[],i.removedRBushNodeAABBs=[],Ys(i,mi)[mi]={restoreStack:[],prevObject:null,currentContext:null}}),l.hooks.beginFrame.tap(r.tag,function(){var N,I=f.getContext(),K=f.getDPR(),W=s.width,z=s.height,j=i.canvasRendererPluginOptions,Z=j.dirtyObjectNumThreshold,vt=j.dirtyObjectRatioThreshold,Tt=l.getStats(),zt=Tt.total,Qt=Tt.rendered,ae=Qt/zt;i.clearFullScreen=i.clearFullScreenLastFrame||!((N=v.context.renderingPlugins[1])!==null&&N!==void 0&&N.isFirstTimeRenderingFinished)||l.disableDirtyRectangleRendering()||Qt>Z&&ae>vt,I&&(typeof I.resetTransform=="function"?I.resetTransform():I.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(I,0,0,W*K,z*K,s.background))});var A=function(I,K){for(var W=[I];W.length>0;){var z=W.pop();z.isVisible()&&!z.isCulled()&&(d?i.renderDisplayObjectOptimized(z,K,i.context,Ys(i,mi)[mi],n):i.renderDisplayObject(z,K,i.context,Ys(i,mi)[mi],n));for(var j=z.sortable.sorted||z.childNodes,Z=j.length-1;Z>=0;Z--)W.push(j[Z])}};l.hooks.endFrame.tap(r.tag,function(){if(u.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}d=s.renderer.getConfig().enableRenderingOptimization,Ys(i,mi)[mi]={restoreStack:[],prevObject:null,currentContext:Ys(i,mi)[mi].currentContext},Ys(i,mi)[mi].currentContext.clear(),i.clearFullScreenLastFrame=!1;var N=f.getContext(),I=f.getDPR();if(yt.fromScaling(i.dprMatrix,[I,I,1]),yt.multiply(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(N.save(),A(u.root,N),N.restore()):A(u.root,N),i.removedRBushNodeAABBs=[];else{var K=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat(Fk(i.removedRBushNodeAABBs.map(function(tn){var vn=tn.minX,_n=tn.minY,kr=tn.maxX,Rr=tn.maxY,Ps=new Ln;return Ps.setMinMax([vn,_n,0],[kr,Rr,0]),Ps}))));if(i.removedRBushNodeAABBs=[],Ln.isEmpty(K)){i.renderQueue=[];return}var W=i.convertAABB2Rect(K),z=W.x,j=W.y,Z=W.width,vt=W.height,Tt=et.fF(i.vec3a,[z,j,0],i.vpMatrix),zt=et.fF(i.vec3b,[z+Z,j,0],i.vpMatrix),Qt=et.fF(i.vec3c,[z,j+vt,0],i.vpMatrix),ae=et.fF(i.vec3d,[z+Z,j+vt,0],i.vpMatrix),fe=Math.min(Tt[0],zt[0],ae[0],Qt[0]),ce=Math.min(Tt[1],zt[1],ae[1],Qt[1]),ct=Math.max(Tt[0],zt[0],ae[0],Qt[0]),$=Math.max(Tt[1],zt[1],ae[1],Qt[1]),Q=Math.floor(fe),It=Math.floor(ce),ue=Math.ceil(ct-fe),le=Math.ceil($-ce);N.save(),i.clearRect(N,Q,It,ue,le,s.background),N.beginPath(),N.rect(Q,It,ue,le),N.clip(),N.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var Fe=s.renderer.getConfig(),Qe=Fe.enableDirtyRectangleRenderingDebug;Qe&&v.dispatchEvent(new Si(Ma.DIRTY_RECTANGLE,{dirtyRect:{x:Q,y:It,width:ue,height:le}}));var He=i.searchDirtyObjects(K);He.sort(function(tn,vn){return tn.sortable.renderOrder-vn.sortable.renderOrder}).forEach(function(tn){tn&&tn.isVisible()&&!tn.isCulled()&&i.renderDisplayObject(tn,N,i.context,Ys(i,mi)[mi],n)}),N.restore(),i.renderQueue.forEach(function(tn){i.saveDirtyAABB(tn)}),i.renderQueue=[]}Ys(i,mi)[mi].restoreStack.forEach(function(){N.restore()}),Ys(i,mi)[mi].restoreStack=[]}),l.hooks.render.tap(r.tag,function(N){i.clearFullScreen||i.renderQueue.push(N)})}},{key:"clearRect",value:function(t,n,i,a,s,o){t.clearRect(n,i,a,s),o&&(t.fillStyle=o,t.fillRect(n,i,a,s))}},{key:"renderDisplayObjectOptimized",value:function(t,n,i,a,s){var o=t.nodeName,l=!1,u=!1,c=this.context.styleRendererFactory[o],h=this.pathGeneratorFactory[o],d=t.parsedStyle.clipPath;if(d){l=!a.prevObject||!yt.exactEquals(d.getWorldTransform(),a.prevObject.getWorldTransform()),l&&(this.applyWorldTransform(n,d),a.prevObject=null);var f=this.pathGeneratorFactory[d.nodeName];f&&(n.save(),u=!0,n.beginPath(),f(n,d.parsedStyle),n.closePath(),n.clip())}if(c){l=!a.prevObject||!yt.exactEquals(t.getWorldTransform(),a.prevObject.getWorldTransform()),l&&this.applyWorldTransform(n,t);var v=!a.prevObject;if(!v){var p=a.prevObject.nodeName;o===he.TEXT?v=p!==he.TEXT:o===he.IMAGE?v=p!==he.IMAGE:v=p===he.TEXT||p===he.IMAGE}c.applyStyleToContext(n,t,v,a),a.prevObject=t}h&&(n.beginPath(),h(n,t.parsedStyle),o!==he.LINE&&o!==he.PATH&&o!==he.POLYLINE&&n.closePath()),c&&c.drawToContext(n,t,Ys(this,mi)[mi],this,s),u&&n.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,n,i,a,s){var o=t.nodeName,l=a.restoreStack[a.restoreStack.length-1];l&&!(t.compareDocumentPosition(l)&ei.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),a.restoreStack.pop());var u=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],h=t.parsedStyle.clipPath;if(h){this.applyWorldTransform(n,h);var d=this.pathGeneratorFactory[h.nodeName];d&&(n.save(),a.restoreStack.push(t),n.beginPath(),d(n,h.parsedStyle),n.closePath(),n.clip())}u&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),o!==he.LINE&&o!==he.PATH&&o!==he.POLYLINE&&n.closePath()),u&&(u.render(n,t.parsedStyle,t,i,this,s),n.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,n){var i=n.parsedStyle,a=i.stroke,s=i.fill,o=i.opacity,l=i.lineDash,u=i.lineDashOffset;l&&t.setLineDash(l),(0,be.Z)(u)||(t.lineDashOffset=u),(0,be.Z)(o)||(t.globalAlpha*=o),!(0,be.Z)(a)&&!Array.isArray(a)&&!a.isNone&&(t.strokeStyle=n.attributes.stroke),!(0,be.Z)(s)&&!Array.isArray(s)&&!s.isNone&&(t.fillStyle=n.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var n=t.getMin(),i=t.getMax(),a=Math.floor(n[0]),s=Math.floor(n[1]),o=Math.ceil(i[0]),l=Math.ceil(i[1]),u=o-a,c=l-s;return{x:a,y:s,width:u,height:c}}},{key:"mergeDirtyAABBs",value:function(t){var n=new Ln;return t.forEach(function(i){var a=i.getRenderBounds();n.add(a);var s=i.renderable.dirtyRenderBounds;s&&n.add(s)}),n}},{key:"searchDirtyObjects",value:function(t){var n=t.getMin(),i=Wd(n,2),a=i[0],s=i[1],o=t.getMax(),l=Wd(o,2),u=l[0],c=l[1],h=this.rBush.search({minX:a,minY:s,maxX:u,maxY:c});return h.map(function(d){var f=d.displayObject;return f})}},{key:"saveDirtyAABB",value:function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Ln);var i=t.getRenderBounds();i&&n.dirtyRenderBounds.update(i.center,i.halfExtents)}},{key:"applyWorldTransform",value:function(t,n,i){i?(yt.copy(this.tmpMat4,n.getLocalTransform()),yt.multiply(this.tmpMat4,i,this.tmpMat4),yt.multiply(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(yt.copy(this.tmpMat4,n.getWorldTransform()),yt.multiply(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new Ln,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return i.forEach(function(s){t.add(s)}),t}}])}();z1.tag="CanvasRenderer";function Vd(r,e,t,n,i,a,s){var o,l;if(r.image.nodeName==="rect"){var u=r.image.parsedStyle,c=u.width,h=u.height;l=n.contextService.getDPR();var d=n.config.offscreenCanvas;o=a.offscreenCanvasCreator.getOrCreateCanvas(d),o.width=c*l,o.height=h*l;var f=a.offscreenCanvasCreator.getOrCreateContext(d),v={restoreStack:[],prevObject:null,currentContext:new Map};r.image.forEach(function(x){i.renderDisplayObject(x,f,n,v,a)}),v.restoreStack.forEach(function(){f.restore()})}var p=s.getOrCreatePatternSync(e,r,t,o,l,e.getGeometryBounds().min,function(){e.renderable.dirty=!0,n.renderingService.dirtify()});return p}function Yd(r,e,t,n){var i;if(r.type===Rs.LinearGradient||r.type===Rs.RadialGradient){var a=e.getGeometryBounds(),s=a&&a.halfExtents[0]*2||1,o=a&&a.halfExtents[1]*2||1,l=a&&a.min||[0,0];i=n.getOrCreateGradient(dp(dp({type:r.type},r.value),{},{min:l,width:s,height:o}),t)}return i}var Hd=["shadowBlur","shadowOffsetX","shadowOffsetY"],j1=["lineCap","lineJoin","miterLimit"],Ei={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},G1={};function oi(r,e,t,n){var i=n.has(e)?n.get(e):Ei[e];return i!==t&&(e==="lineDash"?r.setLineDash(t):r[e]=t,n.set(e,t)),i}var qk=function(){function r(e){fu(this,r),this.imagePool=e}return vu(r,[{key:"applyAttributesToContext",value:function(t,n){}},{key:"render",value:function(t,n,i,a,s,o){}},{key:"applyCommonStyleToContext",value:function(t,n,i,a){var s=i?G1:a.prevObject.parsedStyle,o=n.parsedStyle;(i||o.opacity!==s.opacity)&&oi(t,"globalAlpha",(0,be.Z)(o.opacity)?Ei.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&oi(t,"globalCompositeOperation",(0,be.Z)(o.blend)?Ei.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,n,i,a){var s=i?G1:a.prevObject.parsedStyle,o=n.parsedStyle,l=o.lineWidth,u=l===void 0?Ei.lineWidth:l,c=o.fill&&!o.fill.isNone,h=o.stroke&&!o.stroke.isNone&&u>0;if(h){if(i||n.attributes.stroke!==a.prevObject.attributes.stroke){var d=!(0,be.Z)(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?n.attributes.stroke:Ei.strokeStyle;oi(t,"strokeStyle",d,a.currentContext)}(i||o.lineWidth!==s.lineWidth)&&oi(t,"lineWidth",(0,be.Z)(o.lineWidth)?Ei.lineWidth:o.lineWidth,a.currentContext),(i||o.lineDash!==s.lineDash)&&oi(t,"lineDash",o.lineDash||Ei.lineDash,a.currentContext),(i||o.lineDashOffset!==s.lineDashOffset)&&oi(t,"lineDashOffset",(0,be.Z)(o.lineDashOffset)?Ei.lineDashOffset:o.lineDashOffset,a.currentContext);for(var f=0;f<j1.length;f++){var v=j1[f];(i||o[v]!==s[v])&&oi(t,v,(0,be.Z)(o[v])?Ei[v]:o[v],a.currentContext)}}if(c&&(i||n.attributes.fill!==a.prevObject.attributes.fill)){var p=!(0,be.Z)(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?n.attributes.fill:Ei.fillStyle;oi(t,"fillStyle",p,a.currentContext)}}},{key:"applyStyleToContext",value:function(t,n,i,a){var s=n.nodeName;this.applyCommonStyleToContext(t,n,i,a),s===he.IMAGE||this.applyStrokeFillStyleToContext(t,n,i,a)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,n,i,a){var s=n.parsedStyle;if(i){oi(t,"shadowColor",s.shadowColor.toString(),a.currentContext);for(var o=0;o<Hd.length;o++){var l=Hd[o];oi(t,l,s[l]||Ei[l],a.currentContext)}}s.filter&&s.filter.length&&oi(t,"filter",n.attributes.filter,a.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n){oi(t,"shadowColor",Ei.shadowColor,a.currentContext);for(var o=0;o<Hd.length;o++){var l=Hd[o];oi(t,l,Ei[l],a.currentContext)}}if(i)if(n&&s){var u=t.filter;!(0,be.Z)(u)&&u.indexOf("drop-shadow")>-1&&oi(t,"filter",u.replace(/drop-shadow\([^)]*\)/,"").trim()||Ei.filter,a.currentContext)}else oi(t,"filter",Ei.filter,a.currentContext)}},{key:"fillToContext",value:function(t,n,i,a,s){var o=this,l=n.parsedStyle,u=l.fill,c=l.fillRule,h=null;if(Array.isArray(u)&&u.length>0)u.forEach(function(f){var v,p=oi(t,"fillStyle",Yd(f,n,t,o.imagePool),i.currentContext);h=(v=h)!==null&&v!==void 0?v:p,c?t.fill(c):t.fill()});else{if(Ls(u)){var d=Vd(u,n,t,n.ownerDocument.defaultView.context,a,s,this.imagePool);d&&(t.fillStyle=d,h=!0)}c?t.fill(c):t.fill()}h!==null&&oi(t,"fillStyle",h,i.currentContext)}},{key:"strokeToContext",value:function(t,n,i,a,s){var o=this,l=n.parsedStyle.stroke,u=null;if(Array.isArray(l)&&l.length>0)l.forEach(function(f){var v,p=oi(t,"strokeStyle",Yd(f,n,t,o.imagePool),i.currentContext);u=(v=u)!==null&&v!==void 0?v:p,t.stroke()});else{if(Ls(l)){var c=Vd(l,n,t,n.ownerDocument.defaultView.context,a,s,this.imagePool);if(c){var h,d=oi(t,"strokeStyle",c,i.currentContext);u=(h=u)!==null&&h!==void 0?h:d}}t.stroke()}u!==null&&oi(t,"strokeStyle",u,i.currentContext)}},{key:"drawToContext",value:function(t,n,i,a,s){var o,l=n.nodeName,u=n.parsedStyle,c=u.opacity,h=c===void 0?Ei.globalAlpha:c,d=u.fillOpacity,f=d===void 0?Ei.fillOpacity:d,v=u.strokeOpacity,p=v===void 0?Ei.strokeOpacity:v,x=u.lineWidth,A=x===void 0?Ei.lineWidth:x,N=u.fill&&!u.fill.isNone,I=u.stroke&&!u.stroke.isNone&&A>0;if(!(!N&&!I)){var K=!(0,be.Z)(u.shadowColor)&&u.shadowBlur>0,W=u.shadowType==="inner",z=((o=u.fill)===null||o===void 0?void 0:o.alpha)===0,j=!!(u.filter&&u.filter.length),Z=K&&I&&(l===he.PATH||l===he.LINE||l===he.POLYLINE||z||W),vt=null;if(N){Z||this.applyShadowAndFilterStyleToContext(t,n,K,i);var Tt=h*f;vt=oi(t,"globalAlpha",Tt,i.currentContext),this.fillToContext(t,n,i,a,s),Z||this.clearShadowAndFilterStyleForContext(t,K,j,i)}if(I){var zt=!1,Qt=h*p,ae=oi(t,"globalAlpha",Qt,i.currentContext);if(vt=N?vt:ae,Z&&(this.applyShadowAndFilterStyleToContext(t,n,K,i),zt=!0,W)){var fe=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,n,i,a,s),t.globalCompositeOperation=fe,this.clearShadowAndFilterStyleForContext(t,K,j,i,!0)}this.strokeToContext(t,n,i,a,s),zt&&this.clearShadowAndFilterStyleForContext(t,K,j,i)}vt!==null&&oi(t,"globalAlpha",vt,i.currentContext)}}}])}(),xp=function(r){function e(){return fu(this,e),jd(this,e,arguments)}return Gd(e,r),vu(e,[{key:"render",value:function(n,i,a,s,o,l){var u=i.fill,c=i.fillRule,h=i.opacity,d=h===void 0?1:h,f=i.fillOpacity,v=f===void 0?1:f,p=i.stroke,x=i.strokeOpacity,A=x===void 0?1:x,N=i.lineWidth,I=N===void 0?1:N,K=i.lineCap,W=i.lineJoin,z=i.shadowType,j=i.shadowColor,Z=i.shadowBlur,vt=i.filter,Tt=i.miterLimit,zt=u&&!u.isNone,Qt=p&&!p.isNone&&I>0,ae=(u==null?void 0:u.alpha)===0,fe=!!(vt&&vt.length),ce=!(0,be.Z)(j)&&Z>0,ct=a.nodeName,$=z==="inner",Q=Qt&&ce&&(ct===he.PATH||ct===he.LINE||ct===he.POLYLINE||ae||$);zt&&(n.globalAlpha=d*v,Q||Xd(a,n,ce),W1(n,a,u,c,s,o,l,this.imagePool),Q||this.clearShadowAndFilter(n,fe,ce)),Qt&&(n.globalAlpha=d*A,n.lineWidth=I,(0,be.Z)(Tt)||(n.miterLimit=Tt),(0,be.Z)(K)||(n.lineCap=K),(0,be.Z)(W)||(n.lineJoin=W),Q&&($&&(n.globalCompositeOperation="source-atop"),Xd(a,n,!0),$&&(Ep(n,a,p,s,o,l,this.imagePool),n.globalCompositeOperation=Ei.globalCompositeOperation,this.clearShadowAndFilter(n,fe,!0))),Ep(n,a,p,s,o,l,this.imagePool))}},{key:"clearShadowAndFilter",value:function(n,i,a){if(a&&(n.shadowColor="transparent",n.shadowBlur=0),i){var s=n.filter;!(0,be.Z)(s)&&s.indexOf("drop-shadow")>-1&&(n.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(qk);function Xd(r,e,t){var n=r.parsedStyle,i=n.filter,a=n.shadowColor,s=n.shadowBlur,o=n.shadowOffsetX,l=n.shadowOffsetY;i&&i.length&&(e.filter=r.style.filter),t&&(e.shadowColor=a.toString(),e.shadowBlur=s||0,e.shadowOffsetX=o||0,e.shadowOffsetY=l||0)}function W1(r,e,t,n,i,a,s,o){var l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(t)?t.forEach(function(u){r.fillStyle=Yd(u,e,r,o),l||(n?r.fill(n):r.fill())}):(Ls(t)&&(r.fillStyle=Vd(t,e,r,i,a,s,o)),l||(n?r.fill(n):r.fill()))}function Ep(r,e,t,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(t)?t.forEach(function(l){r.strokeStyle=Yd(l,e,r,s),o||r.stroke()}):(Ls(t)&&(r.strokeStyle=Vd(t,e,r,n,i,a,s)),o||r.stroke())}function tT(r,e){var t=Wd(r,4),n=t[0],i=t[1],a=t[2],s=t[3],o=Wd(e,4),l=o[0],u=o[1],c=o[2],h=o[3],d=Math.max(n,l),f=Math.max(i,u),v=Math.min(n+a,l+c),p=Math.min(i+s,u+h);return v<=d||p<=f?null:[d,f,v-d,p-f]}function eT(r,e){var t=et.fF(et.Ue(),[r[0],r[1],0],e),n=et.fF(et.Ue(),[r[0]+r[2],r[1],0],e),i=et.fF(et.Ue(),[r[0],r[1]+r[3],0],e),a=et.fF(et.Ue(),[r[0]+r[2],r[1]+r[3],0],e);return[Math.min(t[0],n[0],i[0],a[0]),Math.min(t[1],n[1],i[1],a[1]),Math.max(t[0],n[0],i[0],a[0])-Math.min(t[0],n[0],i[0],a[0]),Math.max(t[1],n[1],i[1],a[1])-Math.min(t[1],n[1],i[1],a[1])]}var nT=function(r){function e(){return fu(this,e),jd(this,e,arguments)}return Gd(e,r),vu(e,[{key:"renderDownSampled",value:function(n,i,a,s){var o=s.src,l=s.imageCache;if(!l.downSampled){this.imagePool.createDownSampledImage(o,a).then(function(u){a.renderable.dirty=!0,a.ownerDocument.defaultView.context.renderingService.dirtify()}).catch(function(){});return}n.drawImage(l.downSampled,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}},{key:"renderTile",value:function(n,i,a,s){var o=s.src,l=s.imageCache,u=s.imageRect,c=s.drawRect,h=l.size,d=n.getTransform(),f=d.a,v=d.b,p=d.c,x=d.d,A=d.e,N=d.f;if(n.resetTransform(),!(l!=null&&l.gridSize)){this.imagePool.createImageTiles(o,[],function(){a.renderable.dirty=!0,a.ownerDocument.defaultView.context.renderingService.dirtify()},a).catch(function(){});return}for(var I=[h[0]/u[2],h[1]/u[3]],K=[l.tileSize[0]/I[0],l.tileSize[1]/I[1]],W=[Math.floor((c[0]-u[0])/K[0]),Math.ceil((c[0]+c[2]-u[0])/K[0])],z=W[0],j=W[1],Z=[Math.floor((c[1]-u[1])/K[1]),Math.ceil((c[1]+c[3]-u[1])/K[1])],vt=Z[0],Tt=Z[1],zt=vt;zt<=Tt;zt++)for(var Qt=z;Qt<=j;Qt++){var ae=l.tiles[zt][Qt];if(ae){var fe=[Math.floor(u[0]+ae.tileX*K[0]),Math.floor(u[1]+ae.tileY*K[1]),Math.ceil(K[0]),Math.ceil(K[1])];n.drawImage(ae.data,fe[0],fe[1],fe[2],fe[3])}}n.setTransform(f,v,p,x,A,N)}},{key:"render",value:function(n,i,a){var s=i.x,o=s===void 0?0:s,l=i.y,u=l===void 0?0:l,c=i.width,h=i.height,d=i.src,f=i.shadowColor,v=i.shadowBlur,p=this.imagePool.getImageSync(d,a),x=p==null?void 0:p.img,A=c,N=h;if(x){A||(A=x.width),N||(N=x.height);var I=!(0,be.Z)(f)&&v>0;Xd(a,n,I);try{var K=a.ownerDocument.defaultView.getContextService().getDomElement(),W=K.width,z=K.height,j=n.getTransform(),Z=j.a,vt=j.b,Tt=j.c,zt=j.d,Qt=j.e,ae=j.f,fe=yt.fromValues(Z,Tt,0,0,vt,zt,0,0,0,0,1,0,Qt,ae,0,1),ce=eT([o,u,A,N],fe),ct=tT([0,0,W,z],ce);if(!ct)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){e.renderFull(n,i,a,{image:x,drawRect:[o,u,A,N]});return}var $=ce[2]/p.size[0];if($<(p.downSamplingRate||.5)){this.renderDownSampled(n,i,a,{src:d,imageCache:p,drawRect:[o,u,A,N]});return}if(!bp.isSupportTile){e.renderFull(n,i,a,{image:x,drawRect:[o,u,A,N]});return}this.renderTile(n,i,a,{src:d,imageCache:p,imageRect:ce,drawRect:ct})}catch(Q){}}}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i)}}],[{key:"renderFull",value:function(n,i,a,s){n.drawImage(s.image,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}}])}(xp),rT=function(r){function e(){return fu(this,e),jd(this,e,arguments)}return Gd(e,r),vu(e,[{key:"render",value:function(n,i,a,s,o,l){a.getBounds();var u=i.lineWidth,c=u===void 0?1:u,h=i.textAlign,d=h===void 0?"start":h,f=i.textBaseline,v=f===void 0?"alphabetic":f,p=i.lineJoin,x=p===void 0?"miter":p,A=i.miterLimit,N=A===void 0?10:A,I=i.letterSpacing,K=I===void 0?0:I,W=i.stroke,z=i.fill,j=i.fillRule,Z=i.fillOpacity,vt=Z===void 0?1:Z,Tt=i.strokeOpacity,zt=Tt===void 0?1:Tt,Qt=i.opacity,ae=Qt===void 0?1:Qt,fe=i.metrics,ce=i.x,ct=ce===void 0?0:ce,$=i.y,Q=$===void 0?0:$,It=i.dx,ue=i.dy,le=i.shadowColor,Fe=i.shadowBlur,Qe=fe.font,He=fe.lines,tn=fe.height,vn=fe.lineHeight,_n=fe.lineMetrics;n.font=Qe,n.lineWidth=c,n.textAlign=d==="middle"?"center":d;var kr=v;kr==="alphabetic"&&(kr="bottom"),n.lineJoin=x,(0,be.Z)(N)||(n.miterLimit=N);var Rr=Q;v==="middle"?Rr+=-tn/2-vn/2:v==="bottom"||v==="alphabetic"||v==="ideographic"?Rr+=-tn:(v==="top"||v==="hanging")&&(Rr+=-vn);var Ps=ct+(It||0);Rr+=ue||0,He.length===1&&(kr==="bottom"?(kr="middle",Rr-=.5*tn):kr==="top"&&(kr="middle",Rr+=.5*tn)),n.textBaseline=kr;var Fl=!(0,be.Z)(le)&&Fe>0;Xd(a,n,Fl);for(var ja=0;ja<He.length;ja++){var xo=c/2+Ps;Rr+=vn,!(0,be.Z)(W)&&!W.isNone&&c&&this.drawLetterSpacing(n,a,He[ja],_n[ja],d,xo,Rr,K,z,j,vt,W,zt,ae,!0,s,o,l),(0,be.Z)(z)||this.drawLetterSpacing(n,a,He[ja],_n[ja],d,xo,Rr,K,z,j,vt,W,zt,ae,!1,s,o,l)}}},{key:"drawLetterSpacing",value:function(n,i,a,s,o,l,u,c,h,d,f,v,p,x,A,N,I,K){if(c===0){A?this.strokeText(n,i,a,l,u,v,p,N,I,K):this.fillText(n,i,a,l,u,h,d,f,x,N,I,K);return}var W=n.textAlign;n.textAlign="left";var z=l;o==="center"||o==="middle"?z=l-s.width/2:(o==="right"||o==="end")&&(z=l-s.width);for(var j=Array.from(a),Z=n.measureText(a).width,vt=0,Tt=0;Tt<j.length;++Tt){var zt=j[Tt];A?this.strokeText(n,i,zt,z,u,v,p,N,I,K):this.fillText(n,i,zt,z,u,h,d,f,x,N,I,K),vt=n.measureText(a.substring(Tt+1)).width,z+=Z-vt+c,Z=vt}n.textAlign=W}},{key:"fillText",value:function(n,i,a,s,o,l,u,c,h,d,f,v){W1(n,i,l,u,d,f,v,this.imagePool,!0);var p,x=!(0,be.Z)(c)&&c!==1;x&&(p=n.globalAlpha,n.globalAlpha=c*h),n.fillText(a,s,o),x&&(n.globalAlpha=p)}},{key:"strokeText",value:function(n,i,a,s,o,l,u,c,h,d){Ep(n,i,l,c,h,d,this.imagePool,!0);var f,v=!(0,be.Z)(u)&&u!==1;v&&(f=n.globalAlpha,n.globalAlpha=u),n.strokeText(a,s,o),v&&(n.globalAlpha=f)}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])}(xp),iT=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fu(this,e),t=jd(this,e),t.name="canvas-renderer",t.options=n,t}return Gd(e,r),vu(e,[{key:"init",value:function(){var n,i=dp({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new xp(a),o=(n={},fa(fa(fa(fa(fa(fa(fa(fa(fa(fa(n,he.CIRCLE,s),he.ELLIPSE,s),he.RECT,s),he.IMAGE,new nT(a)),he.TEXT,new rT(a)),he.LINE,s),he.POLYLINE,s),he.POLYGON,s),he.PATH,s),he.GROUP,void 0),fa(fa(fa(n,he.HTML,void 0),he.MESH,void 0),he.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new z1(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(Se);var U1=function(){function r(){rn(this,r)}return an(r,[{key:"apply",value:function(t,n){var i=this,a=t.renderingService,s=t.renderingContext,o=t.config;this.context=t;var l=s.root.ownerDocument.defaultView,u=function(Z){a.hooks.pointerMove.call(Z)},c=function(Z){a.hooks.pointerUp.call(Z)},h=function(Z){a.hooks.pointerDown.call(Z)},d=function(Z){a.hooks.pointerOver.call(Z)},f=function(Z){a.hooks.pointerOut.call(Z)},v=function(Z){a.hooks.pointerCancel.call(Z)},p=function(Z){a.hooks.pointerWheel.call(Z)},x=function(Z){a.hooks.click.call(Z)},A=function(Z){n.globalThis.document.addEventListener("pointermove",u,!0),Z.addEventListener("pointerdown",h,!0),Z.addEventListener("pointerleave",f,!0),Z.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",v,!0)},N=function(Z){Z.addEventListener("touchstart",h,!0),Z.addEventListener("touchend",c,!0),Z.addEventListener("touchmove",u,!0),Z.addEventListener("touchcancel",v,!0)},I=function(Z){n.globalThis.document.addEventListener("mousemove",u,!0),Z.addEventListener("mousedown",h,!0),Z.addEventListener("mouseout",f,!0),Z.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",c,!0)},K=function(Z){n.globalThis.document.removeEventListener("pointermove",u,!0),Z.removeEventListener("pointerdown",h,!0),Z.removeEventListener("pointerleave",f,!0),Z.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",c,!0),n.globalThis.removeEventListener("pointercancel",v,!0)},W=function(Z){Z.removeEventListener("touchstart",h,!0),Z.removeEventListener("touchend",c,!0),Z.removeEventListener("touchmove",u,!0),Z.removeEventListener("touchcancel",v,!0)},z=function(Z){n.globalThis.document.removeEventListener("mousemove",u,!0),Z.removeEventListener("mousedown",h,!0),Z.removeEventListener("mouseout",f,!0),Z.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",c,!0)};a.hooks.init.tap(r.tag,function(){var j=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(j.style.msContentZooming="none",j.style.msTouchAction="none"):l.supportsPointerEvents&&(j.style.touchAction="none"),l.supportsPointerEvents?A(j):I(j),l.supportsTouchEvents&&N(j),o.useNativeClickEvent&&j.addEventListener("click",x,!0),j.addEventListener("wheel",p,{passive:!0,capture:!0})}),a.hooks.destroy.tap(r.tag,function(){var j=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(j.style.msContentZooming="",j.style.msTouchAction=""):l.supportsPointerEvents&&(j.style.touchAction=""),l.supportsPointerEvents?K(j):z(j),l.supportsTouchEvents&&W(j),o.useNativeClickEvent&&j.removeEventListener("click",x,!0),j.removeEventListener("wheel",p,!0)})}}])}();U1.tag="DOMInteraction";var aT=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.name="dom-interaction",t}return fr(e,r),an(e,[{key:"init",value:function(){this.addRenderingPlugin(new U1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Se);var sT="g-canvas-camera",Z1=function(){function r(){rn(this,r),this.displayObjectHTMLElementMap=new WeakMap}return an(r,[{key:"joinTransformMatrix",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+n[0],t[13]+n[1]].join(","),")")}},{key:"apply",value:function(t,n){var i=this,a=t.camera,s=t.renderingContext,o=t.renderingService;this.context=t;var l=s.root.ownerDocument.defaultView,u=l.context.eventService.nativeHTMLMap,c=function(A,N){N.style.transform=i.joinTransformMatrix(A.getWorldTransform(),A.getOrigin())},h=function(A){var N=A.target;if(N.nodeName===he.HTML){i.$camera||(i.$camera=i.createCamera(a));var I=i.getOrCreateEl(N);i.$camera.appendChild(I),Object.keys(N.attributes).forEach(function(K){i.updateAttribute(K,N)}),c(N,I),u.set(I,N)}},d=function(A){var N=A.target;if(N.nodeName===he.HTML&&i.$camera){var I=i.getOrCreateEl(N);I&&(I.remove(),u.delete(I))}},f=function(A){var N=A.target;if(N.nodeName===he.HTML){var I=A.attrName;i.updateAttribute(I,N)}},v=function(A){var N=A.target,I=N.nodeName===he.FRAGMENT?N.childNodes:[N];I.forEach(function(K){if(K.nodeName===he.HTML){var W=i.getOrCreateEl(K);c(K,W)}})},p=function(){if(i.$camera){var A=i.context.config,N=A.width,I=A.height;i.$camera.parentElement.style.width="".concat(N||0,"px"),i.$camera.parentElement.style.height="".concat(I||0,"px")}};o.hooks.init.tap(r.tag,function(){l.addEventListener(Ma.RESIZE,p),l.addEventListener(or.MOUNTED,h),l.addEventListener(or.UNMOUNTED,d),l.addEventListener(or.ATTR_MODIFIED,f),l.addEventListener(or.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(r.tag,function(){i.$camera&&s.renderReasons.has(Jl.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(a.getOrthoMatrix()))}),o.hooks.destroy.tap(r.tag,function(){i.$camera&&i.$camera.remove(),l.removeEventListener(Ma.RESIZE,p),l.removeEventListener(or.MOUNTED,h),l.removeEventListener(or.UNMOUNTED,d),l.removeEventListener(or.ATTR_MODIFIED,f),l.removeEventListener(or.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(t){var n=this.context.config,i=n.document,a=n.width,s=n.height,o=this.context.contextService.getDomElement(),l=o.parentNode;if(l){var u=sT,c=l.querySelector("#".concat(u));if(!c){var h=(i||document).createElement("div");h.style.overflow="hidden",h.style.pointerEvents="none",h.style.position="absolute",h.style.left="0px",h.style.top="0px",h.style.width="".concat(a||0,"px"),h.style.height="".concat(s||0,"px");var d=(i||document).createElement("div");c=d,d.id=u,d.style.position="absolute",d.style.left="".concat(o.offsetLeft||0,"px"),d.style.top="".concat(o.offsetTop||0,"px"),d.style.transformOrigin="left top",d.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),d.style.pointerEvents="none",d.style.width="100%",d.style.height="100%",h.appendChild(d),l.appendChild(h)}return c}return null}},{key:"getOrCreateEl",value:function(t){var n=this.context.config.document,i=this.displayObjectHTMLElementMap.get(t);return i||(i=(n||document).createElement("div"),t.parsedStyle.$el=i,this.displayObjectHTMLElementMap.set(t,i),t.id&&(i.id=t.id),t.name&&i.setAttribute("name",t.name),t.className&&(i.className=t.className),i.style.position="absolute",i.style["will-change"]="transform",i.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),i}},{key:"updateAttribute",value:function(t,n){var i=this.getOrCreateEl(n);switch(t){case"innerHTML":var a=n.parsedStyle.innerHTML;(0,Gt.Z)(a)?i.innerHTML=a:(i.innerHTML="",i.appendChild(a));break;case"x":i.style.left="".concat(n.parsedStyle.x,"px");break;case"y":i.style.top="".concat(n.parsedStyle.y,"px");break;case"transformOrigin":var s=n.parsedStyle.transformOrigin;i.style["transform-origin"]="".concat(s[0].buildCSSText(null,null,"")," ").concat(s[1].buildCSSText(null,null,""));break;case"width":var o=n.parsedStyle.width;i.style.width=(0,bt.Z)(o)?"".concat(o,"px"):o.toString();break;case"height":var l=n.parsedStyle.height;i.style.height=(0,bt.Z)(l)?"".concat(l,"px"):l.toString();break;case"zIndex":var u=n.parsedStyle.zIndex;i.style["z-index"]="".concat(u);break;case"visibility":var c=n.parsedStyle.visibility;i.style.visibility=c;break;case"pointerEvents":var h=n.parsedStyle.pointerEvents,d=h===void 0?"auto":h;i.style.pointerEvents=d;break;case"opacity":var f=n.parsedStyle.opacity;i.style.opacity="".concat(f);break;case"fill":var v=n.parsedStyle.fill,p="";to(v)?v.isNone?p="transparent":p=n.getAttribute("fill"):Array.isArray(v)?p=n.getAttribute("fill"):Ls(v),i.style.background=p;break;case"stroke":var x=n.parsedStyle.stroke,A="";to(x)?x.isNone?A="transparent":A=n.getAttribute("stroke"):Array.isArray(x)?A=n.getAttribute("stroke"):Ls(x),i.style["border-color"]=A,i.style["border-style"]="solid";break;case"lineWidth":var N=n.parsedStyle.lineWidth;i.style["border-width"]="".concat(N||0,"px");break;case"lineDash":i.style["border-style"]="dashed";break;case"filter":var I=n.style.filter;i.style.filter=I;break;default:!(0,be.Z)(n.style[t])&&n.style[t]!==""&&(i.style[t]=n.style[t])}}}])}();Z1.tag="HTMLRendering";var oT=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.name="html-renderer",t}return fr(e,r),an(e,[{key:"init",value:function(){this.addRenderingPlugin(new Z1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Se);function Ac(){"use strict";Ac=function(){return e};var r,e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(ct,$,Q){ct[$]=Q.value},a=typeof Symbol=="function"?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(ct,$,Q){return Object.defineProperty(ct,$,{value:Q,enumerable:!0,configurable:!0,writable:!0}),ct[$]}try{u({},"")}catch(ct){u=function(Q,It,ue){return Q[It]=ue}}function c(ct,$,Q,It){var ue=$&&$.prototype instanceof A?$:A,le=Object.create(ue.prototype),Fe=new fe(It||[]);return i(le,"_invoke",{value:Tt(ct,Q,Fe)}),le}function h(ct,$,Q){try{return{type:"normal",arg:ct.call($,Q)}}catch(It){return{type:"throw",arg:It}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",v="executing",p="completed",x={};function A(){}function N(){}function I(){}var K={};u(K,s,function(){return this});var W=Object.getPrototypeOf,z=W&&W(W(ce([])));z&&z!==t&&n.call(z,s)&&(K=z);var j=I.prototype=A.prototype=Object.create(K);function Z(ct){["next","throw","return"].forEach(function($){u(ct,$,function(Q){return this._invoke($,Q)})})}function vt(ct,$){function Q(ue,le,Fe,Qe){var He=h(ct[ue],ct,le);if(He.type!=="throw"){var tn=He.arg,vn=tn.value;return vn&&Ao(vn)=="object"&&n.call(vn,"__await")?$.resolve(vn.__await).then(function(_n){Q("next",_n,Fe,Qe)},function(_n){Q("throw",_n,Fe,Qe)}):$.resolve(vn).then(function(_n){tn.value=_n,Fe(tn)},function(_n){return Q("throw",_n,Fe,Qe)})}Qe(He.arg)}var It;i(this,"_invoke",{value:function(le,Fe){function Qe(){return new $(function(He,tn){Q(le,Fe,He,tn)})}return It=It?It.then(Qe,Qe):Qe()}})}function Tt(ct,$,Q){var It=d;return function(ue,le){if(It===v)throw Error("Generator is already running");if(It===p){if(ue==="throw")throw le;return{value:r,done:!0}}for(Q.method=ue,Q.arg=le;;){var Fe=Q.delegate;if(Fe){var Qe=zt(Fe,Q);if(Qe){if(Qe===x)continue;return Qe}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(It===d)throw It=p,Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);It=v;var He=h(ct,$,Q);if(He.type==="normal"){if(It=Q.done?p:f,He.arg===x)continue;return{value:He.arg,done:Q.done}}He.type==="throw"&&(It=p,Q.method="throw",Q.arg=He.arg)}}}function zt(ct,$){var Q=$.method,It=ct.iterator[Q];if(It===r)return $.delegate=null,Q==="throw"&&ct.iterator.return&&($.method="return",$.arg=r,zt(ct,$),$.method==="throw")||Q!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),x;var ue=h(It,ct.iterator,$.arg);if(ue.type==="throw")return $.method="throw",$.arg=ue.arg,$.delegate=null,x;var le=ue.arg;return le?le.done?($[ct.resultName]=le.value,$.next=ct.nextLoc,$.method!=="return"&&($.method="next",$.arg=r),$.delegate=null,x):le:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,x)}function Qt(ct){var $={tryLoc:ct[0]};1 in ct&&($.catchLoc=ct[1]),2 in ct&&($.finallyLoc=ct[2],$.afterLoc=ct[3]),this.tryEntries.push($)}function ae(ct){var $=ct.completion||{};$.type="normal",delete $.arg,ct.completion=$}function fe(ct){this.tryEntries=[{tryLoc:"root"}],ct.forEach(Qt,this),this.reset(!0)}function ce(ct){if(ct||ct===""){var $=ct[s];if($)return $.call(ct);if(typeof ct.next=="function")return ct;if(!isNaN(ct.length)){var Q=-1,It=function ue(){for(;++Q<ct.length;)if(n.call(ct,Q))return ue.value=ct[Q],ue.done=!1,ue;return ue.value=r,ue.done=!0,ue};return It.next=It}}throw new TypeError(Ao(ct)+" is not iterable")}return N.prototype=I,i(j,"constructor",{value:I,configurable:!0}),i(I,"constructor",{value:N,configurable:!0}),N.displayName=u(I,l,"GeneratorFunction"),e.isGeneratorFunction=function(ct){var $=typeof ct=="function"&&ct.constructor;return!!$&&($===N||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(ct){return Object.setPrototypeOf?Object.setPrototypeOf(ct,I):(ct.__proto__=I,u(ct,l,"GeneratorFunction")),ct.prototype=Object.create(j),ct},e.awrap=function(ct){return{__await:ct}},Z(vt.prototype),u(vt.prototype,o,function(){return this}),e.AsyncIterator=vt,e.async=function(ct,$,Q,It,ue){ue===void 0&&(ue=Promise);var le=new vt(c(ct,$,Q,It),ue);return e.isGeneratorFunction($)?le:le.next().then(function(Fe){return Fe.done?Fe.value:le.next()})},Z(j),u(j,l,"Generator"),u(j,s,function(){return this}),u(j,"toString",function(){return"[object Generator]"}),e.keys=function(ct){var $=Object(ct),Q=[];for(var It in $)Q.push(It);return Q.reverse(),function ue(){for(;Q.length;){var le=Q.pop();if(le in $)return ue.value=le,ue.done=!1,ue}return ue.done=!0,ue}},e.values=ce,fe.prototype={constructor:fe,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ae),!$)for(var Q in this)Q.charAt(0)==="t"&&n.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=r)},stop:function(){this.done=!0;var $=this.tryEntries[0].completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var Q=this;function It(tn,vn){return Fe.type="throw",Fe.arg=$,Q.next=tn,vn&&(Q.method="next",Q.arg=r),!!vn}for(var ue=this.tryEntries.length-1;ue>=0;--ue){var le=this.tryEntries[ue],Fe=le.completion;if(le.tryLoc==="root")return It("end");if(le.tryLoc<=this.prev){var Qe=n.call(le,"catchLoc"),He=n.call(le,"finallyLoc");if(Qe&&He){if(this.prev<le.catchLoc)return It(le.catchLoc,!0);if(this.prev<le.finallyLoc)return It(le.finallyLoc)}else if(Qe){if(this.prev<le.catchLoc)return It(le.catchLoc,!0)}else{if(!He)throw Error("try statement without catch or finally");if(this.prev<le.finallyLoc)return It(le.finallyLoc)}}}},abrupt:function($,Q){for(var It=this.tryEntries.length-1;It>=0;--It){var ue=this.tryEntries[It];if(ue.tryLoc<=this.prev&&n.call(ue,"finallyLoc")&&this.prev<ue.finallyLoc){var le=ue;break}}le&&($==="break"||$==="continue")&&le.tryLoc<=Q&&Q<=le.finallyLoc&&(le=null);var Fe=le?le.completion:{};return Fe.type=$,Fe.arg=Q,le?(this.method="next",this.next=le.finallyLoc,x):this.complete(Fe)},complete:function($,Q){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&Q&&(this.next=Q),x},finish:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.finallyLoc===$)return this.complete(It.completion,It.afterLoc),ae(It),x}},catch:function($){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var It=this.tryEntries[Q];if(It.tryLoc===$){var ue=It.completion;if(ue.type==="throw"){var le=ue.arg;ae(It)}return le}}throw Error("illegal catch attempt")},delegateYield:function($,Q,It){return this.delegate={iterator:ce($),resultName:Q,nextLoc:It},this.method==="next"&&(this.arg=r),x}},e}function V1(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(n,i)}function Y1(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){V1(a,n,i,s,o,"next",l)}function o(l){V1(a,n,i,s,o,"throw",l)}s(void 0)})}}var lT=function(){function r(e){rn(this,r),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}return an(r,[{key:"init",value:function(){var t=this.canvasConfig,n=t.container,i=t.canvas;if(i)this.$canvas=i,n&&i.parentElement!==n&&n.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=(0,Gt.Z)(n)?document.getElementById(n):n,this.$container)){var a=document.createElement("canvas");this.$container.appendChild(a),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=a}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,n){var i=this.canvasConfig.devicePixelRatio,a=i||Zn&&window.devicePixelRatio||1;a=a>=1?Math.ceil(a):1,this.dpr=a,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,Li(this.$canvas,t,n)),this.renderingContext.renderReasons.add(Jl.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:function(){var e=Y1(Ac().mark(function n(){var i,a,s,o=arguments;return Ac().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:{},a=i.type,s=i.encoderOptions,u.abrupt("return",this.context.canvas.toDataURL(a,s));case 3:case"end":return u.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()}])}(),uT=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.name="canvas-context-register",t}return fr(e,r),an(e,[{key:"init",value:function(){this.context.ContextService=lT}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(Se),Kd=function(r){function e(t){var n;return rn(this,e),n=dr(this,e,[t]),n.registerPlugin(new uT),n.registerPlugin(new Jk),n.registerPlugin(new QM),n.registerPlugin(new iT),n.registerPlugin(new aT),n.registerPlugin(new Tk),n.registerPlugin(new oT),n}return fr(e,r),an(e)}(nn),El=g(23413),cT=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class $d extends Es{constructor(e){super(Object.assign(Object.assign({},e),{style:Object.assign({},$d.defaultStyleProps,e.style)})),this.rootPointerEvent=new ko(null),this.forwardEvents=t=>{const n=this.context.canvas,i=n.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,i).forEach(s=>{const o=this.bootstrapEvent(this.rootPointerEvent,s,i,t);(0,Ec.Z)(n.context.eventService,"mappingTable.pointerupoutside",[]),n.context.eventService.mapEvent(o)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[Ue.CLICK,Ue.POINTER_DOWN,Ue.POINTER_MOVE,Ue.POINTER_UP,Ue.POINTER_OVER,Ue.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}getKeyStyle(e){const t=(0,El.Z)(e,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=t,a=cT(t,["dx","dy"]),[s,o]=this.getSize(e);return Object.assign(Object.assign({x:n,y:i},a),{width:s,height:o})}drawKeyShape(e,t){const n=this.getKeyStyle(e),{x:i,y:a,width:s=0,height:o=0}=n,l=this.upsert("key-container",ps,{x:i,y:a,width:s,height:o,opacity:0},t);return this.upsert("key",Jh,n,l)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof Kd))return;const n=this.getDomElement();this.events.forEach(i=>{n.addEventListener(i,this.forwardEvents)})}attributeChangedCallback(e,t,n){e==="zIndex"&&t!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const e=this.getDomElement();this.events.forEach(t=>{e.removeEventListener(t,this.forwardEvents)}),super.destroy()}normalizeToPointerEvent(e,t){const n=[];if(t.isTouchEvent(e))for(let i=0;i<e.changedTouches.length;i++){const a=e.changedTouches[i];(0,Yt.Z)(a.button)&&(a.button=0),(0,Yt.Z)(a.buttons)&&(a.buttons=1),(0,Yt.Z)(a.isPrimary)&&(a.isPrimary=e.touches.length===1&&e.type==="touchstart"),(0,Yt.Z)(a.width)&&(a.width=a.radiusX||1),(0,Yt.Z)(a.height)&&(a.height=a.radiusY||1),(0,Yt.Z)(a.tiltX)&&(a.tiltX=0),(0,Yt.Z)(a.tiltY)&&(a.tiltY=0),(0,Yt.Z)(a.pointerType)&&(a.pointerType="touch"),(0,Yt.Z)(a.pointerId)&&(a.pointerId=a.identifier||0),(0,Yt.Z)(a.pressure)&&(a.pressure=a.force||.5),(0,Yt.Z)(a.twist)&&(a.twist=0),(0,Yt.Z)(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=e.type,n.push(a)}else if(t.isMouseEvent(e)){const i=e;(0,Yt.Z)(i.isPrimary)&&(i.isPrimary=!0),(0,Yt.Z)(i.width)&&(i.width=1),(0,Yt.Z)(i.height)&&(i.height=1),(0,Yt.Z)(i.tiltX)&&(i.tiltX=0),(0,Yt.Z)(i.tiltY)&&(i.tiltY=0),(0,Yt.Z)(i.pointerType)&&(i.pointerType="mouse"),(0,Yt.Z)(i.pointerId)&&(i.pointerId=1),(0,Yt.Z)(i.pressure)&&(i.pressure=.5),(0,Yt.Z)(i.twist)&&(i.twist=0),(0,Yt.Z)(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,n.push(i)}else n.push(e);return n}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.ctrlKey=t.ctrlKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.screen.x=t.screenX,e.screen.y=t.screenY,e.relatedTarget=null}bootstrapEvent(e,t,n,i){e.view=n,e.originalEvent=null,e.nativeEvent=i,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t);const{x:a,y:s}=this.getViewportXY(t);e.viewport.x=a,e.viewport.y=s;const[o,l]=this.context.canvas.getCanvasByViewport([a,s]);return e.canvas.x=o,e.canvas.y=l,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=i.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e}getViewportXY(e){let t,n;const{offsetX:i,offsetY:a,clientX:s,clientY:o}=e;if(this.context.canvas.context.config.supportsCSSTransform&&!(0,be.Z)(i)&&!(0,be.Z)(a))t=i,n=a;else{const l=this.eventService.client2Viewport({x:s,y:o});t=l.x,n=l.y}return{x:t,y:n}}onframe(){super.onframe();const{opacity:e}=this.attributes;this.getDomElement().style.opacity=`${e}`}}$d.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var H1=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Qd extends Es{constructor(e){super(Ti({style:Qd.defaultStyleProps},e))}getKeyStyle(e){const[t,n]=this.getSize(e),i=super.getKeyStyle(e),{fillOpacity:a,opacity:s=a}=i,o=H1(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:s},o),{width:t,height:n,x:-t/2,y:-n/2})}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getShape("key").attributes,{fill:n,stroke:i}=t,a=H1(t,["fill","stroke"]),s=xi(this.getGraphicStyle(e),"halo"),o=Number(s.lineWidth),[l,u]=Qn(this.getSize(e),[o,o]);return Object.assign(Object.assign({},s),{width:l,height:u,fill:"transparent",x:-l/2,y:-u/2})}getIconStyle(e){const t=super.getIconStyle(e),[n,i]=this.getSize(e);return t?Object.assign({width:n*ho,height:i*ho},t):!1}drawKeyShape(e,t){const n=this.upsert("key",ip,this.getKeyStyle(e),t);return sp(this),n}drawHaloShape(e,t){this.upsert("halo",ps,this.getHaloStyle(e),t)}update(e){super.update(e),e&&("x"in e||"y"in e||"z"in e)&&op(this)}}Qd.defaultStyleProps={size:32};class hT extends Es{constructor(e){super(e)}getKeyStyle(e){const[t,n]=this.getSize(e);return Object.assign(Object.assign({},super.getKeyStyle(e)),{width:t,height:n,x:-t/2,y:-n/2})}getIconStyle(e){const t=super.getIconStyle(e),{width:n,height:i}=this.getShape("key").attributes;return t?Object.assign({width:n*ho,height:i*ho},t):!1}drawKeyShape(e,t){return this.upsert("key",ps,this.getKeyStyle(e),t)}}class dT extends Pd{constructor(e){super(e)}getInnerR(e){return e.innerR||this.getOuterR(e)*3/8}getOuterR(e){return Math.min(...this.getSize(e))/2}getPoints(e){return XT(this.getOuterR(e),this.getInnerR(e))}getIconStyle(e){const t=super.getIconStyle(e),n=this.getInnerR(e)*2*ho;return t?Object.assign({width:n,height:n},t):!1}getPortXY(e,t){const{placement:n="top"}=t,i=this.getShape("key").getLocalBounds(),a=KT(this.getOuterR(e),this.getInnerR(e));return Op(i,n,a,!1)}}class Jd extends Pd{constructor(e){super(Ti({style:Jd.defaultStyleProps},e))}getPoints(e){const{direction:t}=e,[n,i]=this.getSize(e);return $T(n,i,t)}getPortXY(e,t){const{direction:n}=e,{placement:i="top"}=t,a=this.getShape("key").getLocalBounds(),[s,o]=this.getSize(e),l=QT(s,o,n);return Op(a,i,l,!1)}getIconStyle(e){const{icon:t,iconText:n,iconSrc:i,direction:a}=e;if(t===!1||(0,Vs.Z)(n||i))return!1;const s=xi(this.getGraphicStyle(e),"icon"),o=this.getShape("key").getLocalBounds(),[l,u]=G_(o,a),c=W_(o,a)*2*ho;return Object.assign({x:l,y:u,width:c,height:c},s)}}Jd.defaultStyleProps={size:40,direction:"up"};var X1=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class gu extends Es{constructor(e){super(Ti({style:gu.defaultStyleProps},e)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(e){const{collapsed:t,childrenNode:n=[]}=e;return n.length===0?this.getEmptyKeySize(e):t?this.getCollapsedKeySize(e):this.getExpandedKeySize(e)}getEmptyKeySize(e){const{padding:t,collapsedSize:n}=e,[i,a,s,o]=Ws(t);return Qn(ns(n),[o+a,i+s,0])}getCollapsedKeySize(e){return ns(e.collapsedSize)}getExpandedKeySize(e){const t=this.getContentBBox(e);return[Us(t),Zs(t),0]}getContentBBox(e){const{childrenNode:t=[],padding:n}=e,i=t.map(s=>this.context.element.getElement(s)).filter(Boolean);if(i.length===0){const s=new Ln,{x:o=0,y:l=0,size:u}=e,[c,h]=ns(u);return s.setMinMax([o-c/2,l-h/2,0],[o+c/2,l+h/2,0]),s}const a=gc(i.map(s=>s.getBounds()));return n?Ro(a,n):a}drawCollapsedMarkerShape(e,t){const n=this.getCollapsedMarkerStyle(e);xs(this,"collapsedMarker",n)&&(this.upsert("collapsed-marker",s1,n,t),sp(this))}getCollapsedMarkerStyle(e){if(!e.collapsed||!e.collapsedMarker)return!1;const t=xi(this.getGraphicStyle(e),"collapsedMarker"),{type:n}=t,i=X1(t,["type"]),a=this.getShape("key"),[s,o]=co(a.getLocalBounds(),"center"),l=Object.assign(Object.assign({},i),{x:s,y:o});if(n){const u=this.getCollapsedMarkerText(n,e);Object.assign(l,{text:u})}return l}getCollapsedMarkerText(e,t){const{childrenData:n=[]}=t,{model:i}=this.context;return e==="descendant-count"?i.getDescendantsData(this.id).length.toString():e==="child-count"?n.length.toString():e==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(Re(a))==="node").length.toString():(0,At.Z)(e)?e(n):""}getComboPosition(e){const{x:t=0,y:n=0,collapsed:i,childrenData:a=[]}=e;if(a.length===0)return[+t,+n,0];if(i){const{model:s}=this.context,o=s.getDescendantsData(this.id).filter(l=>!s.isCombo(Re(l)));if(o.length>0&&o.some(eM)){const l=o.reduce((u,c)=>Qn(u,Fi(c)),[0,0,0]);return ys(l,o.length)}return[+t,+n,0]}return this.getContentBBox(e).center}getComboStyle(e){const[t,n]=this.getComboPosition(e);return{x:t,y:n,transform:[["translate",t,n]]}}updateComboPosition(e){const t=this.getComboStyle(e);Object.assign(this.style,t);const{x:n,y:i}=t;this.context.model.syncComboDatum({id:this.id,style:{x:n,y:i}}),op(this)}render(e,t=this){super.render(e,t),this.drawCollapsedMarkerShape(e,t)}update(e={}){super.update(e),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(e,t){const n=super.animate(this.attributes.collapsed?e:e.map(i=>{var{x:a,y:s,z:o,transform:l}=i,u=X1(i,["x","y","z","transform"]);return u}),t);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}gu.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};class fT extends gu{constructor(e){super(e)}drawKeyShape(e,t){return this.upsert("key",tu,this.getKeyStyle(e),t)}getKeyStyle(e){const{collapsed:t}=e,n=super.getKeyStyle(e),[i]=this.getKeySize(e);return Object.assign(Object.assign(Object.assign({},n),t&&xi(n,"collapsed")),{r:i/2})}getCollapsedKeySize(e){const[t,n]=ns(e.collapsedSize),i=Math.max(t,n)/2;return[i*2,i*2,0]}getExpandedKeySize(e){const t=this.getContentBBox(e),[n,i]=Po(t),a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[a*2,a*2,0]}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return kd(e,n,t)}}class vT extends gu{constructor(e){super(e)}drawKeyShape(e,t){return this.upsert("key",ps,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e),[n,i]=this.getKeySize(e);return Object.assign(Object.assign(Object.assign({},t),e.collapsed&&xi(t,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}var gT=g(50814);const pT={padding:10};function K1(r,e,t,n,i,a){const{padding:s}=Object.assign(pT,a),o=No(t,s),l=No(n,s),u=[r,...i,e];let c=null;const h=[];for(let d=0,f=u.length;d<f-1;d++){const v=d+1,p=u[d],x=u[v],A=rM(p,x);let N=null;if(d===0)if(v===f-1)if(o.intersects(l))N=Sp(p,x,o,l);else if(!Ed(p,o)&&!Ed(x,l)){const I=vl(p,o),K=vl(x,l);N=Q1(I,K,ra(I,K)),N.points.unshift(I),N.points.push(K)}else A||(N=yT(p,x,o,l));else ms(x,o)?N=Sp(p,x,o,No(x,s),c):A||(N=qd(p,x,o));else v===f-1?ms(p,l)?N=Sp(p,x,No(p,s),l,c):A||(N=J1(p,x,l,c)):A||(N=Q1(p,x,c));N?(h.push(...N.points),c=N.direction):c=ra(p,x),v<f-1&&h.push(x)}return h.map(pl)}const mT={N:"S",S:"N",W:"E",E:"W"},$1={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function ra(r,e){const[t,n]=r,[i,a]=e;return t===i?n>a?"N":"S":n===a?t>i?"W":"E":null}function wp(r,e){return e==="N"||e==="S"?Zs(r):Us(r)}function Q1(r,e,t){const n=[r[0],e[1]],i=[e[0],r[1]],a=ra(r,n),s=ra(r,i),o=t?mT[t]:null,l=a===t||a!==o&&s!==t?n:i;return{points:[l],direction:ra(l,e)}}function qd(r,e,t){if(Ed(r,t)){const n=Cc(r,e,t);return{points:[n],direction:ra(n,e)}}else{const n=vl(r,t),a=["left","right"].includes(pc(r,t))?[e[0],n[1]]:[n[0],e[1]];return{points:[a],direction:ra(a,e)}}}function J1(r,e,t,n){const i=Ed(e,t)?e:vl(e,t),a=[[i[0],r[1]],[r[0],i[1]]],s=a.filter(l=>j_(l,t)&&!Ry(l,t,!0)),o=s.filter(l=>ra(l,r)!==n);if(o.length>0){const l=o.find(u=>ra(r,u)===n)||o[0];return{points:[l],direction:ra(l,e)}}else{const l=(0,gT.Z)(a,s)[0],u=Io(e,l,wp(t,n)/2);return{points:[Cc(u,r,t),u],direction:ra(u,e)}}}function yT(r,e,t,n){let i=qd(r,e,t);const a=yc(i.points[0]);if(ms(a,n)){i=qd(e,r,n);const s=yc(i.points[0]);if(ms(s,t)){const o=Io(r,a,wp(t,ra(r,a))/2),l=Io(e,s,wp(n,ra(e,s))/2),u=[(o[0]+l[0])/2,(o[1]+l[1])/2],c=qd(r,u,t),h=J1(u,e,n,c.direction);i.points=[c.points[0],h.points[0]],i.direction=h.direction}}return i}function Sp(r,e,t,n,i){const s=gc([t,n]),o=Hr(e,s.center)>Hr(r,s.center),[l,u]=o?[e,r]:[r,e],c=Zs(s)+Us(s);let h;if(i){const v=[l[0]+c*Math.cos($1[i]),l[1]+c*Math.sin($1[i])];h=Io(vl(v,s),v,.01)}else h=Io(vl(l,s),l,-.01);let d=Cc(h,u,s),f=[bc(h,2),bc(d,2)];if((0,pi.Z)(bc(h),bc(d))){const v=$g(Fr(h,l),[1,0,0])+Math.PI/2;d=[u[0]+c*Math.cos(v),u[1]+c*Math.sin(v),0],d=bc(Io(vl(d,s),u,-.01),2);const p=Cc(h,d,s);f=[h,p,d]}return{points:o?f.reverse():f,direction:ra(o?h:d,e)}}function Cc(r,e,t){let n=[r[0],e[1]];return ms(n,t)&&(n=[e[0],r[1]]),n}function q1(r,e,t,n,i){let l=typeof e=="number"?e:.5;e==="start"&&(l=0),e==="end"&&(l=.99);const u=Bi(r.getPoint(l)),c=Bi(r.getPoint(l+.01));let h=e==="start"?"left":e==="end"?"right":"center";if(Wy(u,c)||!t){const[A,N]=tb(r,l,n,i);return{transform:[["translate",A,N]],textAlign:h}}let d=Math.atan2(c[1]-u[1],c[0]-u[0]);c[0]<u[0]&&(h=h==="center"?h:h==="left"?"right":"left",n*=-1,d+=Math.PI);const[v,p]=tb(r,l,n,i,d),x=[["translate",v,p],["rotate",d/Math.PI*180]];return{textAlign:h,transform:x}}function bT(r,e,t,n,i){var a,s;const o=((a=r.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,l=((s=r.label)===null||s===void 0?void 0:s.getGeometryBounds().halfExtents[0])*2||0;return q1(r.key,t,!0,(l?(l/2+o/2)*(e==="suffix"?1:-1):0)+n,i)}function tb(r,e,t,n,i){const[a,s]=Bi(r.getPoint(e));let o=t,l=n;return i&&(o=t*Math.cos(i)-n*Math.sin(i),l=t*Math.sin(i)+n*Math.cos(i)),[a+o,s+l]}function _p(r,e,t,n){if((0,pi.Z)(r,e))return r;const i=Fr(e,r),a=[r[0]+t*i[0],r[1]+t*i[1]],s=uo(Md(i,!1));return a[0]+=n*s[0],a[1]+=n*s[1],a}function xT(r){return(0,bt.Z)(r)?[r,-r]:r}function ET(r){return(0,bt.Z)(r)?[r,1-r]:r}function wT(r,e,t){return[["M",r[0],r[1]],["Q",t[0],t[1],e[0],e[1]]]}function eb(r,e,t){return[["M",r[0],r[1]],["C",t[0][0],t[0][1],t[1][0],t[1][1],e[0],e[1]]]}function Mp(r,e=0,t=!1){const n=r[0],i=r[r.length-1],a=r.slice(1,r.length-1),s=[["M",n[0],n[1]]];return a.forEach((o,l)=>{const u=a[l-1]||n,c=a[l+1]||i;if(!iM(u,o,c)&&e){const[h,d]=ST(u,o,c,e);s.push(["L",h[0],h[1]],["Q",o[0],o[1],d[0],d[1]],["L",d[0],d[1]])}else s.push(["L",o[0],o[1]])}),s.push(["L",i[0],i[1]]),t&&s.push(["Z"]),s}function ST(r,e,t,n){const i=_d(r,e),a=_d(t,e),s=Math.min(n,Math.min(i,a)/2),o=[e[0]-s/i*(e[0]-r[0]),e[1]-s/i*(e[1]-r[1])],l=[e[0]-s/a*(e[0]-t[0]),e[1]-s/a*(e[1]-t[1])];return[o,l]}const _T=r=>{const e=Math.PI/2,t=Zs(r)/2,n=Us(r)/2,i=Math.atan2(t,n)/2,a=Math.atan2(n,t)/2;return{top:[-e-a,-e+a],"top-right":[-e+a,-i],"right-top":[-e+a,-i],right:[-i,i],"bottom-right":[i,e-a],"right-bottom":[i,e-a],bottom:[e-a,e+a],"bottom-left":[e+a,Math.PI-i],"left-bottom":[e+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-e-a],"left-top":[Math.PI+i,-e-a]}};function nb(r,e,t,n,i){const a=No(r),s=r.getCenter();let o=n&&Zo(n),l=i&&Zo(i);if(!o||!l){const u=_T(a),c=u[e][0],h=u[e][1],[d,f]=Po(a),v=Math.max(d,f),p=Qn(s,[v*Math.cos(c),v*Math.sin(c),0]),x=Qn(s,[v*Math.cos(h),v*Math.sin(h),0]);o=Cp(r,p),l=Cp(r,x),t||([o,l]=[l,o])}return[o,l]}function MT(r,e,t,n,i,a){const s=r.getPorts()[i||a],o=r.getPorts()[a||i];let[l,u]=nb(r,e,t,s,o);const c=kT(r,l,u,n);return s&&(l=Nc(s,c[0])),o&&(u=Nc(o,c[c.length-1])),eb(l,u,c)}function kT(r,e,t,n){const i=r.getCenter();if((0,pi.Z)(e,t)){const a=Fr(e,i),s=[n*Math.sign(a[0])||n/2,n*Math.sign(a[1])||-n/2,0];return[Qn(e,s),Qn(t,lo(s,[1,-1,1]))]}return[Io(i,e,Hr(i,e)+n),Io(i,t,Hr(i,t)+n)]}function TT(r,e,t,n,i,a,s){const o=Ap(r),l=o[a||s],u=o[s||a];let[c,h]=nb(r,t,n,l,u);const d=OT(r,c,h,i);return l&&(c=Nc(l,d[0])),u&&(h=Nc(u,d[d.length-1])),Mp([c,...d,h],e)}function OT(r,e,t,n){const i=[],a=No(r);if((0,pi.Z)(e,t))switch(pc(e,a)){case"left":i.push([e[0]-n,e[1]]),i.push([e[0]-n,e[1]+n]),i.push([e[0],e[1]+n]);break;case"right":i.push([e[0]+n,e[1]]),i.push([e[0]+n,e[1]+n]),i.push([e[0],e[1]+n]);break;case"top":i.push([e[0],e[1]-n]),i.push([e[0]+n,e[1]-n]),i.push([e[0]+n,e[1]]);break;case"bottom":i.push([e[0],e[1]+n]),i.push([e[0]+n,e[1]+n]),i.push([e[0]+n,e[1]]);break}else{const s=pc(e,a),o=pc(t,a);if(s===o){const l=s;let u,c;switch(l){case"left":u=Math.min(e[0],t[0])-n,i.push([u,e[1]]),i.push([u,t[1]]);break;case"right":u=Math.max(e[0],t[0])+n,i.push([u,e[1]]),i.push([u,t[1]]);break;case"top":c=Math.min(e[1],t[1])-n,i.push([e[0],c]),i.push([t[0],c]);break;case"bottom":c=Math.max(e[1],t[1])+n,i.push([e[0],c]),i.push([t[0],c]);break}}else{const l=(d,f)=>({left:[f[0]-n,f[1]],right:[f[0]+n,f[1]],top:[f[0],f[1]-n],bottom:[f[0],f[1]+n]})[d],u=l(s,e),c=l(o,t),h=Cc(u,c,a);i.push(u,h,c)}}return i}function kp(r,e){const t=new Set,n=new Set,i=new Set;return r.forEach(a=>{e(a).forEach(o=>{t.add(o),r.includes(o.source)&&r.includes(o.target)?n.add(o):i.add(o)})}),{edges:Array.from(t),internal:Array.from(n),external:Array.from(i)}}function rb(r,e){const t=[];let n=r;for(;n;){t.push(n);const i=e(Re(n));if(i)n=i;else break}if(t.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=t.reverse().findIndex(Oa);return t[i]||t.at(-1)}return r}function AT(r,e){return e||(r<4?10:r===4?12:r*2.5)}const CT=(r,e)=>{const t=Math.max(r,e)/2;return[["M",-r/2,0],["A",t,t,0,1,0,2*t-r/2,0],["A",t,t,0,1,0,-r/2,0],["Z"]]},ib=(r,e)=>[["M",-r/2,0],["L",r/2,-e/2],["L",r/2,e/2],["Z"]],PT=(r,e)=>[["M",-r/2,0],["L",0,-e/2],["L",r/2,0],["L",0,e/2],["Z"]],NT=(r,e)=>[["M",-r/2,0],["L",r/2,-e/2],["L",4*r/5-r/2,0],["L",r/2,e/2],["Z"]],RT=(r,e)=>[["M",-r/2,-e/2],["L",r/2,-e/2],["L",r/2,e/2],["L",-r/2,e/2],["Z"]],LT=(r,e)=>{const t=r/2,n=r/7,i=r-n;return[["M",-t,0],["L",0,-e/2],["L",0,e/2],["Z"],["M",i-t,-e/2],["L",i+n-t,-e/2],["L",i+n-t,e/2],["L",i-t,e/2],["Z"]]},DT=(r,e)=>[["M",r/2,-e/2],["L",-r/2,0],["L",r/2,0],["L",-r/2,0],["L",r/2,e/2]];var tf=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Uo extends o1{constructor(e){super(Ti({style:Uo.defaultStyleProps},e)),this.type="edge"}get sourceNode(){const{sourceNode:e}=this.parsedAttributes;return this.context.element.getElement(e)}get targetNode(){const{targetNode:e}=this.parsedAttributes;return this.context.element.getElement(e)}getKeyStyle(e){const t=this.getGraphicStyle(e),{loop:n}=t,i=tf(t,["loop"]),{sourceNode:a,targetNode:s}=this,o=n&&ZT(a,s)?this.getLoopPath(e):this.getKeyPath(e);return Object.assign({d:o},ep(i,["halo","label","startArrow","endArrow"]))}getLoopPath(e){const{sourcePort:t,targetPort:n}=e,i=this.sourceNode,a=No(i),s=Math.max(Us(a),Zs(a)),{placement:o,clockwise:l,dist:u=s}=xi(this.getGraphicStyle(e),"loop");return MT(i,o,l,u,t,n)}getEndpoints(e,t=!0,n=[]){const{sourcePort:i,targetPort:a}=e,{sourceNode:s,targetNode:o}=this,[l,u]=YT(s,o,i,a);if(!t){const f=l?Zo(l):s.getCenter(),v=u?Zo(u):o.getCenter();return[f,v]}const c=typeof n=="function"?n():n,h=db(l||s,c[0]||u||o),d=db(u||o,c[c.length-1]||l||s);return[h,d]}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getKeyStyle(e),n=xi(this.getGraphicStyle(e),"halo");return Object.assign(Object.assign({},t),n)}getLabelStyle(e){if(e.label===!1||!e.labelText)return!1;const t=xi(this.getGraphicStyle(e),"label"),{placement:n,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=t,l=tf(t,["placement","offsetX","offsetY","autoRotate","maxWidth"]),u=q1(this.shapeMap.key,n,s,i,a),c=this.shapeMap.key.getLocalBounds(),h=mM([c.min,c.max],o);return Object.assign({wordWrapWidth:h},u,l)}getBadgeStyle(e){if(e.badge===!1||!e.badgeText)return!1;const t=xi(e,"badge"),{offsetX:n,offsetY:i,placement:a}=t,s=tf(t,["offsetX","offsetY","placement"]);return Object.assign(s,bT(this.shapeMap,a,e.labelPlacement,n,i))}drawArrow(e,t){var n;const i=t==="start",s=e[t==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(s){const l=this.getArrowStyle(e,i);if(!xs(this,`arrow-${t}`,l))return;const[u,c,h]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],d=o.parsedStyle[u];if(d)d.attr(l);else{const f=l.src?qh:ro,v=new f({style:l});o.style[u]=v}o.style[c]=e[h]||l.width/2+ +l.lineWidth}else{const l=i?"markerStart":"markerEnd";(n=o.style[l])===null||n===void 0||n.destroy(),o.style[l]=null}}getArrowStyle(e,t){const n=this.getShape("key").attributes,i=t?"startArrow":"endArrow",a=xi(this.getGraphicStyle(e),i),{size:s,type:o}=a,l=tf(a,["size","type"]),[u,c]=ns(AT(n.lineWidth,s)),d=((0,At.Z)(o)?o:m[o]||ib)(u,c);return Object.assign((0,El.Z)(n,["stroke","strokeOpacity","fillOpacity"]),{width:u,height:c},Object.assign({},d&&{d,fill:o==="simple"?"":n.stroke}),l)}drawLabelShape(e,t){const n=this.getLabelStyle(e);xs(this,"label",n)&&this.upsert("label",Fo,n,t)}drawHaloShape(e,t){const n=this.getHaloStyle(e);xs(this,"halo",n)&&this.upsert("halo",ro,n,t)}drawBadgeShape(e,t){const n=this.getBadgeStyle(e);xs(this,"badge",n)&&this.upsert("badge",uu,n,t)}drawSourceArrow(e){this.drawArrow(e,"start")}drawTargetArrow(e){this.drawArrow(e,"end")}drawKeyShape(e,t){const n=this.getKeyStyle(e);if(xs(this,"key",n))return this.upsert("key",ro,n,t)}render(e=this.parsedAttributes,t=this){this.drawKeyShape(e,t),this.getShape("key")&&(this.drawSourceArrow(e),this.drawTargetArrow(e),this.drawLabelShape(e,t),this.drawHaloShape(e,t),this.drawBadgeShape(e,t))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(e,t){const n=super.animate(e,t);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}Uo.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class wl extends Uo{constructor(e){super(Ti({style:wl.defaultStyleProps},e))}getKeyPath(e){const[t,n]=this.getEndpoints(e),{controlPoints:i,curvePosition:a,curveOffset:s}=e,o=this.getControlPoints(t,n,ET(a),xT(s),i);return eb(t,n,o)}getControlPoints(e,t,n,i,a){return(a==null?void 0:a.length)===2?a:[_p(e,t,n[0],i[0]),_p(e,t,n[1],i[1])]}}wl.defaultStyleProps={curvePosition:.5,curveOffset:20};class ef extends wl{constructor(e){super(Ti({style:ef.defaultStyleProps},e))}getControlPoints(e,t,n,i){const a=t[0]-e[0];return[[e[0]+a*n[0]+i[0],e[1]],[t[0]-a*n[1]+i[1],t[1]]]}}ef.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class nf extends wl{constructor(e){super(Ti({style:nf.defaultStyleProps},e))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(e){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(e);const t=Fi(this.ref),n=this.sourceNode.getIntersectPoint(t,!0),i=this.targetNode.getIntersectPoint(t);return[n,i]}toRadialCoordinate(e){const t=Fi(this.ref),n=Hr(e,t),i=By(Fr(e,t));return[n,i]}getControlPoints(e,t,n,i){const[a,s]=this.toRadialCoordinate(e),[o]=this.toRadialCoordinate(t),l=o-a;return[[e[0]+(l*n[0]+i[0])*Math.cos(s),e[1]+(l*n[0]+i[0])*Math.sin(s)],[t[0]-(l*n[1]-i[0])*Math.cos(s),t[1]-(l*n[1]-i[0])*Math.sin(s)]]}}nf.defaultStyleProps={curvePosition:.5,curveOffset:20};class rf extends wl{constructor(e){super(Ti({style:rf.defaultStyleProps},e))}getControlPoints(e,t,n,i){const a=t[1]-e[1];return[[e[0],e[1]+a*n[0]+i[0]],[t[0],t[1]-a*n[1]+i[1]]]}}rf.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class af extends Uo{constructor(e){super(Ti({style:af.defaultStyleProps},e))}getKeyPath(e){const[t,n]=this.getEndpoints(e);return[["M",t[0],t[1]],["L",n[0],n[1]]]}}af.defaultStyleProps={};const IT={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:_d},fo=r=>`${Math.round(r[0])}|||${Math.round(r[1])}`;function Sl(r,e){const t=n=>Math.round(n/e);return(0,bt.Z)(r)?t(r):r.map(t)}function FT(r,e){const t=Math.abs(r-e);return t>Math.PI?2*Math.PI-t:t}function ab(r,e){const t=e[0]-r[0],n=e[1]-r[1];return!t&&!n?0:Math.atan2(n,t)}function sb(r,e,t,n){const i=ab(r,e),a=t[fo(r)],o=ab(a||n,r);return FT(o,i)}const BT=(r,e)=>{const{offset:t,gridSize:n}=e,i={};return r.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const s=Ro(a.getRenderBounds(),t);for(let o=Sl(s.min[0],n);o<=Sl(s.max[0],n);o+=1)for(let l=Sl(s.min[1],n);l<=Sl(s.max[1],n);l+=1)i[`${o}|||${l}`]=!0}),i};function ob(r,e,t){return Math.min(...e.map(n=>t(r,n)))}function zT(r,e,t){let n=r[0],i=t(r[0],e);for(let a=0;a<r.length;a++){const s=r[a],o=t(s,e);o<i&&(n=s,i=o)}return n}const lb=(r,e,t,n)=>{if(!e)return[r];const{directionMap:i,offset:a}=n,s=Ro(e.getRenderBounds(),a),o=Object.keys(i).reduce((l,u)=>{if(t.includes(u)){const c=i[u],[h,d]=Po(s),f=[r[0]+c.stepX*h,r[1]+c.stepY*d],v=U_(s);for(let p=0;p<v.length;p++){const x=Qg([r,f],v[p]);x&&Ry(x,s)&&l.push(x)}}return l},[]);return ms(r,s)||o.push(r),o.map(l=>Sl(l,n.gridSize))},jT=(r,e,t,n,i,a,s)=>{const o=[];let l=[a[0]===n[0]?n[0]:r[0]*s,a[1]===n[1]?n[1]:r[1]*s];o.unshift(l);let u=r,c=e[fo(u)];for(;c;){const f=c,v=u;sb(f,v,e,t)&&(l=[f[0]===v[0]?l[0]:f[0]*s,f[1]===v[1]?l[1]:f[1]*s],o.unshift(l)),c=e[fo(f)],u=f}const h=i.map(f=>[f[0]*s,f[1]*s]),d=zT(h,l,_d);return o.unshift(d),o};function GT(r,e,t,n){const i=pl(r.getCenter()),a=pl(e.getCenter()),s=Object.assign(IT,n),{gridSize:o}=s,l=s.enableObstacleAvoidance?t:[r,e],u=BT(l,s),c=Sl(i,o),h=Sl(a,o),d=lb(i,r,s.startDirections,s),f=lb(a,e,s.endDirections,s);d.forEach(Z=>delete u[fo(Z)]),f.forEach(Z=>delete u[fo(Z)]);const v={},p={},x={},A={},N={},I=new WT;for(let Z=0;Z<d.length;Z++){const vt=d[Z],Tt=fo(vt);v[Tt]=vt,A[Tt]=0,N[Tt]=ob(vt,f,s.distFunc),I.add({id:Tt,value:N[Tt]})}const K=f.map(Z=>fo(Z));let W=s.maximumLoops,z,j=1/0;for(const[Z,vt]of Object.entries(v))N[Z]<=j&&(j=N[Z],z=vt);for(;Object.keys(v).length>0&&W>0;){const Z=I.minId(!1);if(Z)z=v[Z];else break;const vt=fo(z);if(K.includes(vt))return jT(z,x,c,a,d,h,o);delete v[vt],I.remove(vt),p[vt]=!0;for(const Tt of Object.values(s.directionMap)){const zt=Qn(z,[Tt.stepX,Tt.stepY]),Qt=fo(zt);if(p[Qt])continue;const ae=sb(z,zt,x,c);if(ae>s.maxAllowedDirectionChange||u[Qt])continue;v[Qt]||(v[Qt]=zt);const fe=s.penalties[ae],ce=s.distFunc(z,zt)+(isNaN(fe)?o:fe),ct=A[vt]+ce,$=A[Qt];$&&ct>=$||(x[Qt]=z,A[Qt]=ct,N[Qt]=ct+ob(zt,f,s.distFunc),I.add({id:Qt,value:N[Qt]}))}W-=1}return[]}class WT{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(e,t){let n=0,i=t-1;for(;i-n>1;){const a=Math.floor((n+i)/2);if(this.arr[a].value>e.value)i=a;else if(this.arr[a].value<e.value)n=a;else{this.arr.splice(a,0,e),this.map[e.id]=!0;return}}this.arr.splice(i,0,e),this.map[e.id]=!0}add(e){delete this.map[e.id];const t=this.arr.length;if(!t||this.arr[t-1].value<e.value){this.arr.push(e),this.map[e.id]=!0;return}this._innerAdd(e,t)}remove(e){this.map[e]&&delete this.map[e]}_clearAndGetMinId(){let e;for(let t=this.arr.length-1;t>=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e}_findFirstId(){for(;this.arr.length;){const e=this.arr.shift();if(this.map[e.id])return e.id}}minId(e){return e?this._clearAndGetMinId():this._findFirstId()}}class sf extends Uo{constructor(e){super(Ti({style:sf.defaultStyleProps},e))}getControlPoints(e){const{router:t}=e,{sourceNode:n,targetNode:i}=this,[a,s]=this.getEndpoints(e,!1);let o=[];if(!t)o=e.controlPoints;else if(t.type==="shortest-path"){const l=this.context.element.getNodes();o=GT(n,i,l,t),o.length||(o=K1(a,s,n,i,e.controlPoints,{padding:t.offset}))}else t.type==="orth"&&(o=K1(a,s,n,i,e.controlPoints,t));return o}getPoints(e){const t=this.getControlPoints(e),[n,i]=this.getEndpoints(e,!0,t);return[n,...t,i]}getKeyPath(e){const t=this.getPoints(e);return Mp(t,e.radius)}getLoopPath(e){const{sourcePort:t,targetPort:n,radius:i}=e,a=this.sourceNode,s=No(a),o=Math.max(Us(s),Zs(s))/4,{placement:l,clockwise:u,dist:c=o}=xi(this.getGraphicStyle(e),"loop");return TT(a,i,l,u,c,t,n)}}sf.defaultStyleProps={radius:0,controlPoints:[],router:!1};class of extends Uo{constructor(e){super(Ti({style:of.defaultStyleProps},e))}getKeyPath(e){const{curvePosition:t,curveOffset:n}=e,[i,a]=this.getEndpoints(e),s=e.controlPoint||_p(i,a,t,n);return wT(i,a,s)}}of.defaultStyleProps={curvePosition:.5,curveOffset:30};function Pc(r){return r instanceof Es&&r.type==="node"}function ub(r){return r instanceof Uo}function Tp(r){return r instanceof gu}function UT(r){return Pc(r)||ub(r)||Tp(r)}function ZT(r,e){return!r||!e?!1:r===e}const VT={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],default:[.5,.5]};function Op(r,e,t=VT,n=!0){const i=[.5,.5],a=(0,Gt.Z)(e)?(0,na.Z)(t,e.toLocaleLowerCase(),i):e;if(!n&&(0,Gt.Z)(e))return a;const[s,o]=a||i;return[r.min[0]+Us(r)*s,r.min[1]+Zs(r)*o]}function Ap(r){if(!r)return{};const e=r.getPorts();return(r.attributes.ports||[]).forEach((n,i)=>{var a;const{key:s,placement:o}=n;cb(n)&&(e[a=s||i]||(e[a]=co(r.getShape("key").getBounds(),o)))}),e}function cb(r){const{r:e}=r;return!e||Number(e)===0}function Zo(r){return ou(r)?r:r.getPosition()}function YT(r,e,t,n){const i=hb(r,e,t,n),a=hb(e,r,n,t);return[i,a]}function hb(r,e,t,n){const i=Ap(r);if(t)return i[t];const a=Object.values(i);if(a.length===0)return;const s=a.map(u=>Zo(u)),o=HT(e,n),[l]=oM(s,o);return a.find(u=>Zo(u)===l)}function HT(r,e){const t=Ap(r);if(e)return[Zo(t[e])];const n=Object.values(t);return n.length>0?n.map(i=>Zo(i)):[r.getCenter()]}function db(r,e){return Tp(r)||Pc(r)?Cp(r,e):Nc(r,e)}function Nc(r,e){if(!r||!e)return[0,0,0];if(ou(r))return r;if(r.attributes.linkToCenter)return r.getPosition();const t=ou(e)?e:Pc(e)?e.getCenter():e.getPosition();return kd(t,r.getBounds())}function Cp(r,e){if(!r||!e)return[0,0,0];const t=ou(e)?e:Pc(e)?e.getCenter():e.getPosition();return r.getIntersectPoint(t)||r.getCenter()}function fb(r,e="bottom",t=0,n=0,i=!1){const a=e.split("-"),[s,o]=co(r,e),l=a.includes("left")?"right":a.includes("right")?"left":"center";let u=a.includes("top")?"bottom":a.includes("bottom")?"top":"middle";return i&&(u=u==="top"?"bottom":u==="bottom"?"top":u),{transform:[["translate",s+t,o+n]],textBaseline:u,textAlign:l}}function XT(r,e){return[[0,-r],[e*Math.cos(3*Math.PI/10),-e*Math.sin(3*Math.PI/10)],[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[e*Math.cos(Math.PI/10),e*Math.sin(Math.PI/10)],[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[0,e],[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[-e*Math.cos(Math.PI/10),e*Math.sin(Math.PI/10)],[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[-e*Math.cos(3*Math.PI/10),-e*Math.sin(3*Math.PI/10)]]}function KT(r,e){const t={};return t.top=[0,-r],t.left=[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],t["left-bottom"]=[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],t.bottom=[0,e],t["right-bottom"]=[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],t.right=t.default=[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],t}function $T(r,e,t){const n=e/2,i=r/2,a={up:[[-i,n],[i,n],[0,-n]],left:[[-i,0],[i,n],[i,-n]],right:[[-i,n],[-i,-n],[i,0]],down:[[-i,-n],[i,-n],[0,n]]};return a[t]||a.up}function QT(r,e,t){const n=e/2,i=r/2,a={};return t==="down"?(a.bottom=a.default=[0,n],a.right=[i,-n],a.left=[-i,-n]):t==="left"?(a.top=[i,-n],a.bottom=[i,n],a.left=a.default=[-i,0]):t==="right"?(a.top=[-i,-n],a.bottom=[-i,n],a.right=a.default=[i,0]):(a.left=[-i,n],a.top=a.default=[0,-n],a.right=[i,n]),a}function M5(r,e){return[[r/2,-e/2],[r/2,e/2],[-r/2,e/2],[-r/2,-e/2]]}function JT(r,e){return[[0,-e/2],[r/2,0],[0,e/2],[-r/2,0]]}function qT(r){return(0,na.Z)(r,["style","visibility"])!=="hidden"}function Pp(r,e){"update"in r?r.update(e):r.attr(e)}function tO(r){return[[0,r],[r*Math.sqrt(3)/2,r/2],[r*Math.sqrt(3)/2,-r/2],[0,-r],[-r*Math.sqrt(3)/2,-r/2],[-r*Math.sqrt(3)/2,r/2]]}function eO(r){(0,Ec.Z)(r,"__to_be_destroyed__",!0)}function lf(r){return(0,na.Z)(r,"__to_be_destroyed__",!1)}var nO=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class uf extends ka{constructor(e,t){super(e,Object.assign({},uf.defaultOptions,t)),this.onCollapseExpand=n=>nO(this,void 0,void 0,function*(){if(!this.validate(n))return;const{target:i}=n;if(!UT(i))return;const a=i.id,{model:s,graph:o}=this.context,l=s.getElementDataById(a);if(!l)return!1;const{onCollapse:u,onExpand:c,animation:h}=this.options;Oa(l)?(yield o.expandElement(a,h),c==null||c(a)):(yield o.collapseElement(a,h),u==null||u(a))}),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.on(`node:${t}`,this.onCollapseExpand),e.on(`combo:${t}`,this.onCollapseExpand)}unbindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.off(`node:${t}`,this.onCollapseExpand),e.off(`combo:${t}`,this.onCollapseExpand)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}uf.defaultOptions={enable:!0,animation:!0,trigger:Ue.DBLCLICK};var rO=g(71701),cf=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};const iO="g6-create-edge-assist-edge-id",hf="g6-create-edge-assist-node-id";class df extends ka{constructor(e,t){super(e,Object.assign({},df.defaultOptions,t)),this.drop=n=>cf(this,void 0,void 0,function*(){const{targetType:i}=n;["combo","node"].includes(i)&&this.source?yield this.handleCreateEdge(n):yield this.cancelEdge()}),this.handleCreateEdge=n=>cf(this,void 0,void 0,function*(){var i,a,s;if(!this.validate(n))return;const{graph:o,canvas:l,batch:u,element:c}=this.context,{style:h}=this.options;if(this.source){this.createEdge(n),yield this.cancelEdge();return}u.startBatch(),l.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([n.target.id])[0];const d=o.getElementData(this.source);o.addNodeData([{id:hf,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:(i=d.style)===null||i===void 0?void 0:i.x,y:(a=d.style)===null||a===void 0?void 0:a.y}}]),o.addEdgeData([{id:iO,source:this.source,target:hf,style:Object.assign({pointerEvents:"none"},h)}]),yield(s=c.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=n=>cf(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(hf,[n.canvas.x,n.canvas.y]),yield(i=s.draw({animation:!1,silence:!0}))===null||i===void 0?void 0:i.finished}),this.createEdge=n=>{var i,a;const{graph:s}=this.context,{style:o,onFinish:l,onCreate:u}=this.options;if(((i=n.target)===null||i===void 0?void 0:i.id)===void 0||this.source===void 0)return;const h=(a=this.getSelectedNodeIDs([n.target.id]))===null||a===void 0?void 0:a[0],d=`${this.source}-${h}-${(0,rO.Z)()}`,f=u({id:d,source:this.source,target:h,style:o});s.addEdgeData([f]),l(f)},this.cancelEdge=()=>cf(this,void 0,void 0,function*(){var n;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([hf]),this.source=void 0,yield(n=a.draw({animation:!1}))===null||n===void 0?void 0:n.finished,s.endBatch()}),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;this.unbindEvents(),t==="click"?(e.on(ts.CLICK,this.handleCreateEdge),e.on(fl.CLICK,this.handleCreateEdge),e.on(ao.CLICK,this.cancelEdge),e.on(bd.CLICK,this.cancelEdge)):(e.on(ts.DRAG_START,this.handleCreateEdge),e.on(fl.DRAG_START,this.handleCreateEdge),e.on(Ue.POINTER_UP,this.drop)),e.on(Ue.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(e){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(t=>t.id).concat(e)))}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;e.off(ts.CLICK,this.handleCreateEdge),e.off(fl.CLICK,this.handleCreateEdge),e.off(ao.CLICK,this.cancelEdge),e.off(bd.CLICK,this.cancelEdge),e.off(ts.DRAG_START,this.handleCreateEdge),e.off(fl.DRAG_START,this.handleCreateEdge),e.off(Ue.POINTER_UP,this.drop),e.off(Ue.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}df.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:r=>r,onFinish:()=>{}};var Rc=g(68040),vb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class ff extends ka{constructor(e,t){super(e,Object.assign({},ff.defaultOptions,t)),this.isDragging=!1,this.onDragStart=n=>{this.validate(n)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=n=>{if(!this.isDragging)return;const{x:i,y:a}=n.movement;i|a&&this.translate([i,a],!1)},this.onDragEnd=()=>{var n,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},this.invokeOnFinish=(0,Rc.Z)(()=>{var n,i;(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},300),this.shortcut=new lu(e.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{trigger:e}=this.options;if((0,ie.Z)(e)){const{up:t=[],down:n=[],left:i=[],right:a=[]}=e;this.shortcut.bind(t,s=>this.onTranslate([0,1],s)),this.shortcut.bind(n,s=>this.onTranslate([0,-1],s)),this.shortcut.bind(i,s=>this.onTranslate([1,0],s)),this.shortcut.bind(a,s=>this.onTranslate([-1,0],s))}else{const{graph:t}=this.context;t.on(Ue.DRAG_START,this.onDragStart),t.on(Ue.DRAG,this.onDrag),t.on(Ue.DRAG_END,this.onDragEnd)}}onTranslate(e,t){return vb(this,void 0,void 0,function*(){if(!this.validate(t))return;const{sensitivity:n}=this.options,i=n*-1;yield this.translate(lo(e,i),this.options.animation),this.invokeOnFinish()})}translate(e,t){return vb(this,void 0,void 0,function*(){e=this.clampByDirection(e),e=this.clampByRange(e),yield this.context.graph.translateBy(e,t)})}clampByDirection([e,t]){const{direction:n}=this.options;return n==="x"?t=0:n==="y"&&(e=0),[e,t]}clampByRange([e,t]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,u,c]=Ws(this.options.range),h=[s*o,a*l,s*u,a*c],d=Ro(Yg(n.getCanvasCenter()),h),f=Fr(n.getViewportCenter(),[e,t,0]);if(!ms(f,d)){const{min:[v,p],max:[x,A]}=d;(f[0]<v&&e>0||f[0]>x&&e<0)&&(e=0),(f[1]<p&&t>0||f[1]>A&&t<0)&&(t=0)}return[e,t]}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return typeof t=="function"?t(e):!!t}unbindEvents(){this.shortcut.unbindAll();const{graph:e}=this.context;e.off(Ue.DRAG_START,this.onDragStart),e.off(Ue.DRAG,this.onDrag),e.off(Ue.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}ff.defaultOptions={enable:r=>"targetType"in r?r.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var gb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Lc extends ka{constructor(e,t){super(e,Object.assign({},Lc.defaultOptions,t)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=n=>gb(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:s}=this.context,o=n.target.id;this.target.forEach(l=>{const u=a.getParentData(l,Ir);u&&Re(u)===o&&a.refreshComboData(o),a.setParent(l,o,Ir)}),yield(i=s==null?void 0:s.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=n=>{if(this.isDragging)return;const{type:i}=n,{canvas:a}=this.context,{cursor:s}=this.options;i===Ue.POINTER_ENTER?a.setCursor((s==null?void 0:s.grab)||"grab"):a.setCursor((s==null?void 0:s.default)||"default")},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{graph:e,canvas:t}=this.context,n=t.getLayer().getContextService().$canvas;n&&(n.addEventListener("blur",this.onDragEnd),n.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{e.on(`${i}:${Ue.DRAG_START}`,this.onDragStart),e.on(`${i}:${Ue.DRAG}`,this.onDrag),e.on(`${i}:${Ue.DRAG_END}`,this.onDragEnd),e.on(`${i}:${Ue.POINTER_ENTER}`,this.setCursor),e.on(`${i}:${Ue.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(e.on(fl.DROP,this.onDrop),e.on(ao.DROP,this.onDrop))}getSelectedNodeIDs(e){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(t=>t.id).concat(e)))}getDelta(e){const t=this.context.graph.getZoom();return ys([e.dx,e.dy],t)}onDragStart(e){var t;if(this.enable=this.validate(e),!this.enable)return;const{batch:n,canvas:i}=this.context;i.setCursor(((t=this.options.cursor)===null||t===void 0?void 0:t.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch(),this.target=this.getSelectedNodeIDs([e.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(e){if(!this.enable)return;const t=this.getDelta(e);this.options.shadow?this.moveShadow(t):this.moveElement(this.target,t)}onDragEnd(){var e,t,n;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:s=0,y:o=0}=this.shadow.attributes,[l,u]=Fr([+s,+o],this.shadowOrigin);this.moveElement(this.target,[l,u])}this.showEdges(),(t=(e=this.options).onFinish)===null||t===void 0||t.call(e,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((n=this.options.cursor)===null||n===void 0?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}moveElement(e,t){return gb(this,void 0,void 0,function*(){const{graph:n,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&e.forEach(s=>i.refreshComboData(s)),n.translateElementBy(Object.fromEntries(e.map(s=>[s,t])),!1)})}moveShadow(e){if(!this.shadow)return;const{x:t=0,y:n=0}=this.shadow.attributes,[i,a]=e;this.shadow.attr({x:+t+i,y:+n+a})}createShadow(e){const t=xi(this.options,"shadow"),n=gc(e.map(u=>this.context.element.getElement(u).getBounds())),[i,a]=n.min;this.shadowOrigin=[i,a];const[s,o]=Po(n),l={width:s,height:o,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},t),l),{visibility:"visible"})):(this.shadow=new ps({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},t),l),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:e,shadow:t}=this.options;if(e==="none"||t)return;const{graph:n}=this.context;e==="all"?this.hiddenEdges=n.getEdgeData().map(Re):this.hiddenEdges=Array.from(new Set(this.target.map(i=>n.getRelatedEdgesData(i,e).map(Re)).flat())),n.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:e,canvas:t}=this.context,n=t.getLayer().getContextService().$canvas;n&&(n.removeEventListener("blur",this.onDragEnd),n.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{e.off(`${i}:${Ue.DRAG_START}`,this.onDragStart),e.off(`${i}:${Ue.DRAG}`,this.onDrag),e.off(`${i}:${Ue.DRAG_END}`,this.onDragEnd),e.off(`${i}:${Ue.POINTER_ENTER}`,this.setCursor),e.off(`${i}:${Ue.POINTER_LEAVE}`,this.setCursor)}),e.off(`combo:${Ue.DROP}`,this.onDrop),e.off(`canvas:${Ue.DROP}`,this.onDrop)}destroy(){var e;this.unbindEvents(),(e=this.shadow)===null||e===void 0||e.destroy(),super.destroy()}}Lc.defaultOptions={animation:!0,enable:r=>["node","combo"].includes(r.targetType),dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var _i=g(44326);class Np{constructor(e,t){this.context=e,this.options=t||{}}}var aO=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})},sO=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function k5(r){const{type:e}=r;return!!(["comboCombined","comboForce"].includes(e)||e==="antv-dagre"&&r.sortByCombo)}function oO(r){const{type:e}=r;return["compact-box","mindmap","dendrogram","indented"].includes(e)}function T5(r){return isNumber(r.x)&&isNumber(r.y)}function vf(r){const{nodes:e,edges:t}=r,n={nodes:[],edges:[],combos:[]};return e.forEach(i=>{const a=i.data._isCombo?n.combos:n.nodes,{x:s,y:o,z:l=0}=i.data;a==null||a.push({id:i.id,style:{x:s,y:o,z:l}})}),t.forEach(i=>{const{id:a,source:s,target:o,data:{points:l=[],controlPoints:u=l.slice(1,l.length-1)}}=i;n.edges.push({id:a,source:s,target:o,style:Object.assign({},u!=null&&u.length?{controlPoints:u.map(Bi)}:{})})}),n}function lO(r,e){class t extends Np{constructor(i,a){if(super(i,a),this.instance=new r({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const s=this.instance;this.stop=s.stop.bind(s),this.tick=o=>{const l=s.tick(o);return vf(l)}}}execute(i,a){return aO(this,void 0,void 0,function*(){return vf(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions((0,Ta.Z)({},this.options,a))))})}transformOptions(i){const{onTick:a}=i;return a&&(i.onTick=s=>a(vf(s))),i}graphData2LayoutModel(i){const{nodes:a=[],edges:s=[],combos:o=[]}=i,l=a.map(f=>{const v=Re(f),{data:p,style:x,combo:A}=f,N=sO(f,["data","style","combo"]),I={id:v,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p),{data:p}),A?{parentId:A}:{}),{style:x}),N)};return x!=null&&x.x&&Object.assign(I.data,{x:x.x}),x!=null&&x.y&&Object.assign(I.data,{y:x.y}),x!=null&&x.z&&Object.assign(I.data,{z:x.z}),I}),u=new Map(l.map(f=>[f.id,f])),c=s.filter(f=>{const{source:v,target:p}=f;return u.has(v)&&u.has(p)}).map(f=>{const{source:v,target:p,data:x,style:A}=f;return{id:Re(f),source:v,target:p,data:Object.assign({},x),style:Object.assign({},A)}}),h=o.map(f=>({id:Re(f),data:Object.assign({_isCombo:!0},f.data),style:Object.assign({},f.style)})),d=new _i.k({nodes:[...l,...h],edges:c});return e.model.model.hasTreeStructure(Ir)&&(d.attachTreeStructure(Ir),l.forEach(f=>{const v=e.model.model.getParent(f.id,Ir);v&&d.hasNode(v.id)&&d.setParent(f.id,v.id,Ir)})),d}}return t}function Rp(r,e,...t){if(e in r)return r[e](...t);if("instance"in r){const n=r.instance;if(e in n)return n[e](...t)}return null}function pb(r,e){if(e in r)return r[e];if("instance"in r){const t=r.instance;if(e in t)return t[e]}return null}var uO=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class cO extends Lc{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find(e=>["d3-force","d3-force-3d"].includes(e==null?void 0:e.id))}validate(e){return this.context.layout?this.forceLayoutInstance?super.validate(e):(da.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(e,t){return uO(this,void 0,void 0,function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(e).forEach((i,a)=>{const{x:s=0,y:o=0}=i.style||{};n&&Rp(n,"setFixedPosition",e[a],[...Qn([+s,+o],t)])})})}onDragStart(e){if(this.enable=this.validate(e),!this.enable)return;this.target=this.getSelectedNodeIDs([e.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const t=this.forceLayoutInstance;t&&pb(t,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(n=>{const{x:i=0,y:a=0}=n.style||{};t&&Rp(t,"setFixedPosition",Re(n),[+i,+a])})}onDrag(e){if(!this.enable)return;const t=this.getDelta(e);this.moveElement(this.target,t)}onDragEnd(){const e=this.forceLayoutInstance;e&&pb(e,"simulation").alphaTarget(0),this.context.graph.getNodeData(this.target).forEach(t=>{e&&Rp(e,"setFixedPosition",Re(t),[null,null,null])})}}var mb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class gf extends ka{constructor(e,t){super(e,Object.assign({},gf.defaultOptions,t)),this.isZoomEvent=n=>!!(n.data&&"scale"in n.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=n=>mb(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context,{state:a,nodeFilter:s,edgeFilter:o,comboFilter:l}=this.options,u=(a?i.getElementDataByState("node",a):i.getNodeData()).filter(s),c=(a?i.getElementDataByState("edge",a):i.getEdgeData()).filter(o),h=(a?i.getElementDataByState("combo",a):i.getComboData()).filter(l),d=this.isZoomEvent(n)?this.zoom=Math.max(.01,Math.min(n.data.scale,10)):this.zoom,f=[...u,...h];f.length>0&&f.forEach(v=>this.fixNodeLike(v,d)),this.updateRelatedEdges(),c.length>0&&c.forEach(v=>this.fixEdge(v,d))}),this.cachedStyles=new Map,this.getOriginalFieldValue=(n,i,a)=>{var s;const o=this.cachedStyles.get(n)||[],l=((s=o.find(u=>u.shape===i))===null||s===void 0?void 0:s.style)||{};return a in l||(l[a]=i.attributes[a],this.cachedStyles.set(n,[...o.filter(u=>u.shape!==i),{shape:i,style:l}])),l[a]},this.scaleEntireElement=(n,i,a)=>{i.setLocalScale(1/a);const s=this.cachedStyles.get(n)||[];s.push({shape:i}),this.cachedStyles.set(n,s)},this.scaleSpecificShapes=(n,i,a)=>{const s=_M(n);(Array.isArray(a)?a:[a]).forEach(l=>{const{shape:u,fields:c}=l,h=typeof u=="function"?u(s):n.getShape(u);if(h){if(!c){this.scaleEntireElement(n.id,h,i);return}c.forEach(d=>{const f=this.getOriginalFieldValue(n.id,h,d);(0,bt.Z)(f)&&(h.style[d]=f/i)})}})},this.skipIfExceedViewport=n=>{const{viewport:i}=this.context;return!(i!=null&&i.isInViewport(n.getRenderBounds(),!1,30))},this.fixNodeLike=(n,i)=>{const a=Re(n),{element:s,model:o}=this.context,l=s.getElement(a);if(!l||this.skipIfExceedViewport(l))return;o.getRelatedEdgesData(a).forEach(h=>this.relatedEdgeToUpdate.add(Re(h)));const c=this.options[l.type];if(!c){this.scaleEntireElement(a,l,i);return}this.scaleSpecificShapes(l,i,c)},this.fixEdge=(n,i)=>{const a=Re(n),s=this.context.element.getElement(a);if(!s||this.skipIfExceedViewport(s))return;const o=this.options.edge;if(!o){s.style.transformOrigin="center",this.scaleEntireElement(a,s,i);return}this.scaleSpecificShapes(s,i,o)},this.updateRelatedEdges=()=>{const{element:n}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach(i=>{const a=n.getElement(i);a==null||a.update({})}),this.relatedEdgeToUpdate.clear()},this.resetTransform=n=>mb(this,void 0,void 0,function*(){var i;!((i=n.data)===null||i===void 0)&&i.firstRender||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))}),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach(i=>{i.forEach(({shape:a,style:s})=>{if((0,Vs.Z)(s))a.setLocalScale(1);else{if(this.options.state)return;Object.entries(s).forEach(([o,l])=>a.style[o]=l)}})});const{graph:e,element:t}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter(i=>i&&e.getElementType(i)==="node");if(n.length>0){const i=new Set;n.forEach(a=>{e.getRelatedEdgesData(a).forEach(s=>i.add(Re(s)))}),i.forEach(a=>{const s=t==null?void 0:t.getElement(a);s==null||s.update({})})}}}bindEvents(){const{graph:e}=this.context;e.on(sn.AFTER_DRAW,this.resetTransform),e.on(sn.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:e}=this.context;e.off(sn.AFTER_DRAW,this.resetTransform),e.off(sn.AFTER_TRANSFORM,this.fixElementSize)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}gf.defaultOptions={enable:r=>r.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var hO=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class pf extends ka{constructor(e,t){super(e,Object.assign({},pf.defaultOptions,t)),this.focus=n=>hO(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context;yield i.focusElement(n.target.id,this.options.animation)}),this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),ml.forEach(t=>{e.on(`${t}:${Ue.CLICK}`,this.focus)})}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;ml.forEach(t=>{e.off(`${t}:${Ue.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),super.destroy()}}pf.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class mf extends ka{constructor(e,t){super(e,Object.assign({},mf.defaultOptions,t)),this.isFrozen=!1,this.toggleFrozen=n=>{this.isFrozen=n.type==="dragstart"},this.hoverElement=n=>{if(!this.validate(n))return;const i=n.type===Ue.POINTER_ENTER;this.updateElementsState(n,i);const{onHover:a,onHoverEnd:s}=this.options;i?a==null||a(n):s==null||s(n)},this.updateElementsState=(n,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:s,animation:o,inactiveState:l}=this.options,u=this.getActiveIds(n),c={};if(s&&Object.assign(c,this.getElementsState(u,s,i)),l){const h=Ly(a.getData(),!0).filter(d=>!u.includes(d));Object.assign(c,this.getElementsState(h,l,i))}a.setElementState(c,o)},this.getElementsState=(n,i,a)=>{const{graph:s}=this.context,o={};return n.forEach(l=>{const u=s.getElementState(l);a?o[l]=u.includes(i)?u:[...u,i]:o[l]=u.filter(c=>c!==i)}),o},this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),ml.forEach(n=>{e.on(`${n}:${Ue.POINTER_ENTER}`,this.hoverElement),e.on(`${n}:${Ue.POINTER_LEAVE}`,this.hoverElement)});const t=this.context.canvas.document;t.addEventListener(`${Ue.DRAG_START}`,this.toggleFrozen),t.addEventListener(`${Ue.DRAG_END}`,this.toggleFrozen)}getActiveIds(e){const{graph:t}=this.context,{degree:n,direction:i}=this.options,a=e.target.id;return n?Ky(t,e.targetType,a,typeof n=="function"?n(e):n,i):[a]}validate(e){if(this.destroyed||this.isFrozen||lf(e.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;ml.forEach(n=>{e.off(`${n}:${Ue.POINTER_ENTER}`,this.hoverElement),e.off(`${n}:${Ue.POINTER_LEAVE}`,this.hoverElement)});const t=this.context.canvas.document;t.removeEventListener(`${Ue.DRAG_START}`,this.toggleFrozen),t.removeEventListener(`${Ue.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}mf.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class dO extends xc{onPointerDown(e){if(!super.validate(e)||!super.isKeydown()||this.points)return;const{canvas:t}=this.context;this.pathShape=new ro({id:"g6-lasso-select",style:this.options.style}),t.appendChild(this.pathShape),this.points=[Td(e)]}onPointerMove(e){var t;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(Td(e)),(t=this.pathShape)===null||t===void 0||t.setAttribute("d",bM(this.points)),n&&i==="default"&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){if(this.points){if(this.points.length<2){this.clearLasso();return}super.updateElementsStates(this.points),this.clearLasso()}}clearLasso(){var e;(e=this.pathShape)===null||e===void 0||e.remove(),this.pathShape=void 0,this.points=void 0}}class yf extends ka{constructor(e,t){super(e,Object.assign({},yf.defaultOptions,t)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(n,i,a)=>{n.filter(Boolean).forEach(s=>{i==="hidden"&&!s.isVisible()?this.hiddenShapes.push(s):i==="visible"&&this.hiddenShapes.includes(s)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(s),1):gl(s,i,!1,a)})},this.filterShapes=(n,i)=>{if((0,At.Z)(i))return s=>!i(n,s);const a=i==null?void 0:i[n];return s=>s.className?!(a!=null&&a.includes(s.className)):!0},this.hideShapes=n=>{if(!this.validate(n)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=(0,Rc.Z)(n=>{if(!this.validate(n)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:e}=this.context;e.on(sn.BEFORE_TRANSFORM,this.hideShapes),e.on(sn.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:e}=this.context;e.off(sn.BEFORE_TRANSFORM,this.hideShapes),e.off(sn.AFTER_TRANSFORM,this.showShapes)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}yf.defaultOptions={enable:!0,debounce:200,shapes:r=>r==="node"};var yb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class bf extends ka{constructor(e,t){super(e,Object.assign({},bf.defaultOptions,t)),this.onWheel=n=>yb(this,void 0,void 0,function*(){this.options.preventDefault&&n.preventDefault();const i=n.deltaX,a=n.deltaY;yield this.scroll([-i,-a],n)}),this.shortcut=new lu(e.graph),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){var e,t;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),(0,ie.Z)(n)){(e=this.graphDom)===null||e===void 0||e.removeEventListener(Ue.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:s=[],right:o=[]}=n;this.shortcut.bind(i,l=>this.scroll([0,-10],l)),this.shortcut.bind(a,l=>this.scroll([0,10],l)),this.shortcut.bind(s,l=>this.scroll([-10,0],l)),this.shortcut.bind(o,l=>this.scroll([10,0],l))}else(t=this.graphDom)===null||t===void 0||t.addEventListener(Ue.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(e){const{sensitivity:t}=this.options;return e=lo(e,t),e=this.clampByDirection(e),e=this.clampByRange(e),e}clampByDirection([e,t]){const{direction:n}=this.options;return n==="x"?t=0:n==="y"&&(e=0),[e,t]}clampByRange([e,t]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,u,c]=Ws(this.options.range),h=[s*o,a*l,s*u,a*c],d=Ro(Yg(n.getCanvasCenter()),h),f=Fr(n.getViewportCenter(),[e,t,0]);if(!ms(f,d)){const{min:[v,p],max:[x,A]}=d;(f[0]<v&&e>0||f[0]>x&&e<0)&&(e=0),(f[1]<p&&t>0||f[1]>A&&t<0)&&(t=0)}return[e,t]}scroll(e,t){return yb(this,void 0,void 0,function*(){if(!this.validate(t))return;const{onFinish:n}=this.options,i=this.context.graph,a=this.formatDisplacement(e);yield i.translateBy(a,!1),n==null||n()})}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}destroy(){var e;this.shortcut.destroy(),(e=this.graphDom)===null||e===void 0||e.removeEventListener(Ue.WHEEL,this.onWheel),super.destroy()}}bf.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var bb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class xf extends ka{constructor(e,t){super(e,Object.assign({},xf.defaultOptions,t)),this.zoom=(n,i,a)=>bb(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:s}=this.context;let o;"viewport"in i&&(o=Bi(i.viewport));const{sensitivity:l,onFinish:u}=this.options,c=1+(0,Kt.Z)(n,-50,50)*l/100,h=s.getZoom();yield s.zoomTo(h*c,a,o),u==null||u()}),this.onReset=()=>bb(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=n=>{this.options.preventDefault&&n.preventDefault()},this.shortcut=new lu(e.graph),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){var e;const{trigger:t}=this.options;if(this.shortcut.unbindAll(),Array.isArray(t)&&((e=this.context.canvas.getContainer())===null||e===void 0||e.addEventListener(Ue.WHEEL,this.preventDefault),this.shortcut.bind([...t,Ue.WHEEL],n=>{const{deltaX:i,deltaY:a}=n;this.zoom(-(a!=null?a:i),n,!1)})),typeof t=="object"){const{zoomIn:n=[],zoomOut:i=[],reset:a=[]}=t;this.shortcut.bind(n,s=>this.zoom(10,s,this.options.animation)),this.shortcut.bind(i,s=>this.zoom(-10,s,this.options.animation)),this.shortcut.bind(a,this.onReset)}}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return(0,At.Z)(t)?t(e):!!t}destroy(){var e;this.shortcut.destroy(),(e=this.context.canvas.getContainer())===null||e===void 0||e.removeEventListener(Ue.WHEEL,this.preventDefault),super.destroy()}}xf.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var Ef=g(81746),Lp=function(r,e){return Lp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Lp(r,e)};function O5(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Lp(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xb=function(){return xb=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xb.apply(this,arguments)};function Eb(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function A5(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var o=r.length-1;o>=0;o--)(s=r[o])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function C5(r,e){return function(t,n){e(t,n,r)}}function P5(r,e,t,n,i,a){function s(A){if(A!==void 0&&typeof A!="function")throw new TypeError("Function expected");return A}for(var o=n.kind,l=o==="getter"?"get":o==="setter"?"set":"value",u=!e&&r?n.static?r:r.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h,d=!1,f=t.length-1;f>=0;f--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(A){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(A||null))};var x=(0,t[f])(o==="accessor"?{get:c.get,set:c.set}:c[l],v);if(o==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(h=s(x.get))&&(c.get=h),(h=s(x.set))&&(c.set=h),(h=s(x.init))&&i.push(h)}else(h=s(x))&&(o==="field"?i.push(h):c[l]=h)}u&&Object.defineProperty(u,n.name,c),d=!0}function N5(r,e,t){for(var n=arguments.length>2,i=0;i<e.length;i++)t=n?e[i].call(r,t):e[i].call(r);return n?t:void 0}function R5(r){return typeof r=="symbol"?r:"".concat(r)}function L5(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function D5(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Jn(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})}function I5(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(c){u=[6,c],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var wb=Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]};function F5(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wb(e,r,t)}function Sb(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fO(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return a}function B5(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(fO(arguments[e]));return r}function z5(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n}function j5(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}function wf(r){return this instanceof wf?(this.v=r,this):new wf(r)}function G5(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(d){n[d]&&(i[d]=function(f){return new Promise(function(v,p){a.push([d,f,v,p])>1||o(d,f)})})}function o(d,f){try{l(n[d](f))}catch(v){h(a[0][3],v)}}function l(d){d.value instanceof wf?Promise.resolve(d.value.v).then(u,c):h(a[0][2],d)}function u(d){o("next",d)}function c(d){o("throw",d)}function h(d,f){d(f),a.shift(),a.length&&o(a[0][0],a[0][1])}}function W5(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=r[i]?function(s){return(t=!t)?{value:wf(r[i](s)),done:!1}:a?a(s):s}:a}}function U5(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Sb=="function"?Sb(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=r[a]&&function(s){return new Promise(function(o,l){s=r[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(u){a({value:u,done:o})},s)}}function Z5(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}var vO=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};function V5(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&wb(e,r,t);return vO(e,r),e}function Y5(r){return r&&r.__esModule?r:{default:r}}function H5(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function X5(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}function K5(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}const gO=(r,e)=>{if(r!=="next"&&r!=="prev")return e},_b=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev};class pO{constructor(){const e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){const e=this.shortcut,t=e.prev;if(t&&t!==e)return _b(t),t}enqueue(e){const t=this.shortcut;e.prev&&e.next&&_b(e),e.next=t.next,t.next.prev=e,t.next=e,e.prev=t}toString(){const e=[],t=this.shortcut;let n=t.prev;for(;n!==t;)e.push(JSON.stringify(n,gO)),n=n==null?void 0:n.prev;return`[${e.join(", ")}]`}}class mO extends pO{}const yO=()=>1,bO=(r,e)=>{var t;if(r.getAllNodes().length<=1)return[];const n=EO(r,e||yO);return(t=xO(n.graph,n.buckets,n.zeroIdx).map(a=>r.getRelatedEdges(a.v,"out").filter(({target:s})=>s===a.w)))===null||t===void 0?void 0:t.flat()},xO=(r,e,t)=>{let n=[];const i=e[e.length-1],a=e[0];let s;for(;r.getAllNodes().length;){for(;s=a.dequeue();)Dp(r,e,t,s);for(;s=i.dequeue();)Dp(r,e,t,s);if(r.getAllNodes().length){for(let o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(Dp(r,e,t,s,!0));break}}}return n},Dp=(r,e,t,n,i)=>{var a,s;const o=[];return r.hasNode(n.v)&&((a=r.getRelatedEdges(n.v,"in"))===null||a===void 0||a.forEach(l=>{const u=l.data.weight,c=r.getNode(l.source);i&&o.push({v:l.source,w:l.target,in:0,out:0}),c.data.out===void 0&&(c.data.out=0),c.data.out-=u,Ip(e,t,Object.assign({v:c.id},c.data))}),(s=r.getRelatedEdges(n.v,"out"))===null||s===void 0||s.forEach(l=>{const u=l.data.weight,c=l.target,h=r.getNode(c);h.data.in===void 0&&(h.data.in=0),h.data.in-=u,Ip(e,t,Object.assign({v:h.id},h.data))}),r.removeNode(n.v)),i?o:void 0},EO=(r,e)=>{const t=new _i.k;let n=0,i=0;r.getAllNodes().forEach(l=>{t.addNode({id:l.id,data:{v:l.id,in:0,out:0}})}),r.getAllEdges().forEach(l=>{const u=t.getRelatedEdges(l.source,"out").find(h=>h.target===l.target),c=(e==null?void 0:e(l))||1;u?t.updateEdgeData(u==null?void 0:u.id,Object.assign(Object.assign({},u.data),{weight:u.data.weight+c})):t.addEdge({id:l.id,source:l.source,target:l.target,data:{weight:c}}),i=Math.max(i,t.getNode(l.source).data.out+=c),n=Math.max(n,t.getNode(l.target).data.in+=c)});const a=[],s=i+n+3;for(let l=0;l<s;l++)a.push(new mO);const o=n+1;return t.getAllNodes().forEach(l=>{Ip(a,o,Object.assign({v:l.id},t.getNode(l.id).data))}),{buckets:a,zeroIdx:o,graph:t}},Ip=(r,e,t)=>{t.out?t.in?r[t.out-t.in+e].enqueue(t):r[r.length-1].enqueue(t):r[0].enqueue(t)},wO=(r,e)=>{const n=e==="greedy"?bO(r,(i=>a=>a.data.weight||1)(r)):SO(r);n==null||n.forEach(i=>{const a=i.data;r.removeEdge(i.id),a.forwardName=i.data.name,a.reversed=!0,r.addEdge({id:i.id,source:i.target,target:i.source,data:Object.assign({},a)})})},SO=r=>{const e=[],t={},n={},i=a=>{n[a]||(n[a]=!0,t[a]=!0,r.getRelatedEdges(a,"out").forEach(s=>{t[s.target]?e.push(s):i(s.target)}),delete t[a])};return r.getAllNodes().forEach(a=>i(a.id)),e},_O=r=>{r.getAllEdges().forEach(e=>{const t=e.data;if(t.reversed){r.removeEdge(e.id);const n=t.forwardName;delete t.reversed,delete t.forwardName,r.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign(Object.assign({},t),{forwardName:n})})}})},MO=(r,e)=>Number(r)-Number(e),pu=(r,e,t,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return t.dummy=e,r.addNode({id:i,data:t}),i},kO=r=>{const e=new _i.k;return r.getAllNodes().forEach(t=>{e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{const n=e.getRelatedEdges(t.source,"out").find(i=>i.target===t.target);n?e.updateEdgeData(n==null?void 0:n.id,Object.assign(Object.assign({},n.data),{weight:n.data.weight+t.data.weight||0,minlen:Math.max(n.data.minlen,t.data.minlen||1)})):e.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||0,minlen:t.data.minlen||1}})}),e},Mb=r=>{const e=new _i.k;return r.getAllNodes().forEach(t=>{r.getChildren(t.id).length||e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{e.addEdge(t)}),e},kb=(r,e)=>r==null?void 0:r.reduce((t,n,i)=>(t[n]=e[i],t),{}),$5=r=>{const e={};return r.getAllNodes().forEach(t=>{const n={};r.getRelatedEdges(t.id,"out").forEach(i=>{n[i.target]=(n[i.target]||0)+(i.data.weight||0)}),e[t.id]=n}),e},Q5=r=>{const e=r.getAllNodes(),t=e.map(n=>{const i={};return r.getRelatedEdges(n.id,"in").forEach(a=>{i[a.source]=(i[a.source]||0)+a.data.weight}),i});return kb(e.map(n=>n.id),t)},Tb=(r,e)=>{const t=Number(r.x),n=Number(r.y),i=Number(e.x)-t,a=Number(e.y)-n;let s=Number(r.width)/2,o=Number(r.height)/2;if(!i&&!a)return{x:0,y:0};let l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:t+l,y:n+u}},Dc=r=>{const e=[],t=Ab(r)+1;for(let n=0;n<t;n++)e.push([]);r.getAllNodes().forEach(n=>{const i=n.data.rank;i!==void 0&&e[i]&&e[i].push(n.id)});for(let n=0;n<t;n++)e[n]=e[n].sort((i,a)=>MO(r.getNode(i).data.order,r.getNode(a).data.order));return e},TO=r=>{const e=r.getAllNodes().filter(n=>n.data.rank!==void 0).map(n=>n.data.rank),t=Math.min(...e);r.getAllNodes().forEach(n=>{n.data.hasOwnProperty("rank")&&t!==1/0&&(n.data.rank-=t)})},OO=(r,e=0)=>{const t=r.getAllNodes(),n=t.filter(o=>o.data.rank!==void 0).map(o=>o.data.rank),i=Math.min(...n),a=[];t.forEach(o=>{const l=(o.data.rank||0)-i;a[l]||(a[l]=[]),a[l].push(o.id)});let s=0;for(let o=0;o<a.length;o++){const l=a[o];l===void 0?o%e!==0&&(s-=1):s&&(l==null||l.forEach(u=>{const c=r.getNode(u);c&&(c.data.rank=c.data.rank||0,c.data.rank+=s)}))}},Ob=(r,e,t,n)=>{const i={width:0,height:0};return(0,bt.Z)(t)&&(0,bt.Z)(n)&&(i.rank=t,i.order=n),pu(r,"border",i,e)},Ab=r=>{let e;return r.getAllNodes().forEach(t=>{const n=t.data.rank;n!==void 0&&(e===void 0||n>e)&&(e=n)}),e||(e=0),e},AO=(r,e)=>{const t={lhs:[],rhs:[]};return r==null||r.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t},Fp=(r,e)=>r.reduce((t,n)=>{const i=e(t),a=e(n);return i>a?n:t}),Cb=(r,e,t,n,i,a)=>{n.includes(e.id)||(n.push(e.id),t||a.push(e.id),i(e.id).forEach(s=>Cb(r,s,t,n,i,a)),t&&a.push(e.id))},Pb=(r,e,t,n)=>{const i=Array.isArray(e)?e:[e],a=l=>n?r.getSuccessors(l):r.getNeighbors(l),s=[],o=[];return i.forEach(l=>{if(r.hasNode(l.id))Cb(r,l,t==="post",o,a,s);else throw new Error(`Graph does not have node: ${l}`)}),s},CO=r=>{const e=t=>{const n=r.getChildren(t),i=r.getNode(t);if(n!=null&&n.length&&n.forEach(a=>e(a.id)),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let a=i.data.minRank,s=i.data.maxRank+1;a<s;a+=1)Nb(r,"borderLeft","_bl",t,i,a),Nb(r,"borderRight","_br",t,i,a)}};r.getRoots().forEach(t=>e(t.id))},Nb=(r,e,t,n,i,a)=>{const s={rank:a,borderType:e,width:0,height:0},o=i.data[e][a-1],l=pu(r,"border",s,t);i.data[e][a]=l,r.setParent(l,n),o&&r.addEdge({id:`e${Math.random()}`,source:o,target:l,data:{weight:1}})},PO=(r,e)=>{const t=e.toLowerCase();(t==="lr"||t==="rl")&&Rb(r)},NO=(r,e)=>{const t=e.toLowerCase();(t==="bt"||t==="rl")&&RO(r),(t==="lr"||t==="rl")&&(LO(r),Rb(r))},Rb=r=>{r.getAllNodes().forEach(e=>{Lb(e)}),r.getAllEdges().forEach(e=>{Lb(e)})},Lb=r=>{const e=r.data.width;r.data.width=r.data.height,r.data.height=e},RO=r=>{r.getAllNodes().forEach(e=>{Bp(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(n=>Bp(n)),e.data.hasOwnProperty("y")&&Bp(e.data)})},Bp=r=>{r!=null&&r.y&&(r.y=-r.y)},LO=r=>{r.getAllNodes().forEach(e=>{zp(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(n=>zp(n)),e.data.hasOwnProperty("x")&&zp(e.data)})},zp=r=>{const e=r.x;r.x=r.y,r.y=e},DO=r=>{const e=pu(r,"root",{},"_root"),t=IO(r);let n=Math.max(...Object.values(t));Math.abs(n)===1/0&&(n=1);const i=n-1,a=2*i+1;r.getAllEdges().forEach(o=>{o.data.minlen*=a});const s=FO(r)+1;return r.getRoots().forEach(o=>{Db(r,e,a,s,i,t,o.id)}),{nestingRoot:e,nodeRankFactor:a}},Db=(r,e,t,n,i,a,s)=>{const o=r.getChildren(s);if(!(o!=null&&o.length)){s!==e&&r.addEdge({id:`e${Math.random()}`,source:e,target:s,data:{weight:0,minlen:t}});return}const l=Ob(r,"_bt"),u=Ob(r,"_bb"),c=r.getNode(s);r.setParent(l,s),c.data.borderTop=l,r.setParent(u,s),c.data.borderBottom=u,o==null||o.forEach(h=>{Db(r,e,t,n,i,a,h.id);const d=h.data.borderTop?h.data.borderTop:h.id,f=h.data.borderBottom?h.data.borderBottom:h.id,v=h.data.borderTop?n:2*n,p=d!==f?1:i-a[s]+1;r.addEdge({id:`e${Math.random()}`,source:l,target:d,data:{minlen:p,weight:v,nestingEdge:!0}}),r.addEdge({id:`e${Math.random()}`,source:f,target:u,data:{minlen:p,weight:v,nestingEdge:!0}})}),r.getParent(s)||r.addEdge({id:`e${Math.random()}`,source:e,target:l,data:{weight:0,minlen:i+a[s]}})},IO=r=>{const e={},t=(n,i)=>{const a=r.getChildren(n);a==null||a.forEach(s=>t(s.id,i+1)),e[n]=i};return r.getRoots().forEach(n=>t(n.id,1)),e},FO=r=>{let e=0;return r.getAllEdges().forEach(t=>{e+=t.data.weight}),e},BO=(r,e)=>{e&&r.removeNode(e),r.getAllEdges().forEach(t=>{t.data.nestingEdge&&r.removeEdge(t.id)})},zO="edge",Ib="edge-label",jO=(r,e)=>{r.getAllEdges().forEach(t=>GO(r,t,e))},GO=(r,e,t)=>{let n=e.source,i=r.getNode(n).data.rank;const a=e.target,s=r.getNode(a).data.rank,o=e.data.labelRank;if(s===i+1)return;r.removeEdge(e.id);let l,u,c;for(c=0,++i;i<s;++c,++i)e.data.points=[],u={originalEdge:e,width:0,height:0,rank:i},l=pu(r,zO,u,"_d"),i===o&&(u.width=e.data.width,u.height=e.data.height,u.dummy=Ib,u.labelpos=e.data.labelpos),r.addEdge({id:`e${Math.random()}`,source:n,target:l,data:{weight:e.data.weight}}),c===0&&t.push(l),n=l;r.addEdge({id:`e${Math.random()}`,source:n,target:a,data:{weight:e.data.weight}})},WO=(r,e)=>{e.forEach(t=>{let n=r.getNode(t);const{data:i}=n,a=i.originalEdge;let s;a&&r.addEdge(a);let o=t;for(;n.data.dummy;)s=r.getSuccessors(o)[0],r.removeNode(o),a.data.points.push({x:n.data.x,y:n.data.y}),n.data.dummy===Ib&&(a.data.x=n.data.x,a.data.y=n.data.y,a.data.width=n.data.width,a.data.height=n.data.height),o=s.id,n=r.getNode(o)})},UO=(r,e,t)=>{const n={};let i;t==null||t.forEach(a=>{let s=r.getParent(a),o,l;for(;s;){if(o=r.getParent(s.id),o?(l=n[o.id],n[o.id]=s.id):(l=i,i=s.id),l&&l!==s.id){e.hasNode(l)||e.addNode({id:l,data:{}}),e.hasNode(s.id)||e.addNode({id:s.id,data:{}}),e.hasEdge(`e${l}-${s.id}`)||e.addEdge({id:`e${l}-${s.id}`,source:l,target:s.id,data:{}});return}s=o}})},ZO=(r,e,t)=>{const n=VO(r),i=new _i.k({tree:[{id:n,children:[],data:{}}]});return r.getAllNodes().forEach(a=>{const s=r.getParent(a.id);(a.data.rank===e||a.data.minRank<=e&&e<=a.data.maxRank)&&(i.hasNode(a.id)||i.addNode(Object.assign({},a)),s!=null&&s.id&&!i.hasNode(s==null?void 0:s.id)&&i.addNode(Object.assign({},s)),i.setParent(a.id,(s==null?void 0:s.id)||n),r.getRelatedEdges(a.id,t).forEach(o=>{const l=o.source===a.id?o.target:o.source;i.hasNode(l)||i.addNode(Object.assign({},r.getNode(l)));const u=i.getRelatedEdges(l,"out").find(({target:h})=>h===a.id),c=u!==void 0?u.data.weight:0;u?i.updateEdgeData(u.id,Object.assign(Object.assign({},u.data),{weight:o.data.weight+c})):i.addEdge({id:o.id,source:l,target:a.id,data:{weight:o.data.weight+c}})}),a.data.hasOwnProperty("minRank")&&i.updateNodeData(a.id,Object.assign(Object.assign({},a.data),{borderLeft:a.data.borderLeft[e],borderRight:a.data.borderRight[e]})))}),i},VO=r=>{let e;for(;r.hasNode(e=`_root${Math.random()}`););return e},YO=(r,e,t)=>{const n=kb(t,t.map((c,h)=>h)),a=e.map(c=>{const h=r.getRelatedEdges(c,"out").map(d=>({pos:n[d.target]||0,weight:d.data.weight}));return h==null?void 0:h.sort((d,f)=>d.pos-f.pos)}).flat().filter(c=>c!==void 0);let s=1;for(;s<t.length;)s<<=1;const o=2*s-1;s-=1;const l=Array(o).fill(0,0,o);let u=0;return a==null||a.forEach(c=>{if(c){let h=c.pos+s;l[h]+=c.weight;let d=0;for(;h>0;)h%2&&(d+=l[h+1]),h=h-1>>1,l[h]+=c.weight;u+=c.weight*d}}),u},Fb=(r,e)=>{let t=0;for(let n=1;n<(e==null?void 0:e.length);n+=1)t+=YO(r,e[n-1],e[n]);return t},Bb=r=>{const e={},t=r.getAllNodes(),n=t.map(u=>{var c;return(c=u.data.rank)!==null&&c!==void 0?c:-1/0}),i=Math.max(...n),a=[];for(let u=0;u<i+1;u++)a.push([]);const s=t.sort((u,c)=>r.getNode(u.id).data.rank-r.getNode(c.id).data.rank),l=s.filter(u=>r.getNode(u.id).data.fixorder!==void 0).sort((u,c)=>r.getNode(u.id).data.fixorder-r.getNode(c.id).data.fixorder);return l==null||l.forEach(u=>{isNaN(r.getNode(u.id).data.rank)||a[r.getNode(u.id).data.rank].push(u.id),e[u.id]=!0}),s==null||s.forEach(u=>r.dfsTree(u.id,c=>{if(e.hasOwnProperty(c.id))return!0;e[c.id]=!0,isNaN(c.data.rank)||a[c.data.rank].push(c.id)})),a},HO=(r,e)=>e.map(t=>{const n=r.getRelatedEdges(t,"in");if(!(n!=null&&n.length))return{v:t};const i={sum:0,weight:0};return n==null||n.forEach(a=>{const s=r.getNode(a.source);i.sum+=a.data.weight*s.data.order,i.weight+=a.data.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}),XO=(r,e)=>{var t,n,i;const a={};r==null||r.forEach((o,l)=>{a[o.v]={i:l,indegree:0,in:[],out:[],vs:[o.v]};const u=a[o.v];o.barycenter!==void 0&&(u.barycenter=o.barycenter,u.weight=o.weight)}),(t=e.getAllEdges())===null||t===void 0||t.forEach(o=>{const l=a[o.source],u=a[o.target];l!==void 0&&u!==void 0&&(u.indegree++,l.out.push(a[o.target]))});const s=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,o=>!o.indegree);return KO(s)},KO=r=>{var e,t;const n=[],i=l=>u=>{u.merged||(u.barycenter===void 0||l.barycenter===void 0||u.barycenter>=l.barycenter)&&$O(l,u)},a=l=>u=>{u.in.push(l),--u.indegree===0&&r.push(u)};for(;r!=null&&r.length;){const l=r.pop();n.push(l),(e=l.in.reverse())===null||e===void 0||e.forEach(u=>i(l)(u)),(t=l.out)===null||t===void 0||t.forEach(u=>a(l)(u))}const s=n.filter(l=>!l.merged),o=["vs","i","barycenter","weight"];return s.map(l=>{const u={};return o==null||o.forEach(c=>{l[c]!==void 0&&(u[c]=l[c])}),u})},$O=(r,e)=>{var t;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),r.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(e.i,r.i),e.merged=!0};var QO=XO;const JO=(r,e,t,n)=>{const i=AO(r,d=>{const f=d.hasOwnProperty("fixorder")&&!isNaN(d.fixorder);return n?!f&&d.hasOwnProperty("barycenter"):f||d.hasOwnProperty("barycenter")}),a=i.lhs,s=i.rhs.sort((d,f)=>-d.i- -f.i),o=[];let l=0,u=0,c=0;a==null||a.sort(qO(!!e,!!t)),c=zb(o,s,c),a==null||a.forEach(d=>{var f;c+=(f=d.vs)===null||f===void 0?void 0:f.length,o.push(d.vs),l+=d.barycenter*d.weight,u+=d.weight,c=zb(o,s,c)});const h={vs:o.flat()};return u&&(h.barycenter=l/u,h.weight=u),h},zb=(r,e,t)=>{let n=t,i;for(;e.length&&(i=e[e.length-1]).i<=n;)e.pop(),r==null||r.push(i.vs),n++;return n},qO=(r,e)=>(t,n)=>{if(t.fixorder!==void 0&&n.fixorder!==void 0)return t.fixorder-n.fixorder;if(t.barycenter<n.barycenter)return-1;if(t.barycenter>n.barycenter)return 1;if(e&&t.order!==void 0&&n.order!==void 0){if(t.order<n.order)return-1;if(t.order>n.order)return 1}return r?n.i-t.i:t.i-n.i},jb=(r,e,t,n,i,a)=>{var s,o,l,u;let c=r.getChildren(e).map(N=>N.id);const h=r.getNode(e),d=h?h.data.borderLeft:void 0,f=h?h.data.borderRight:void 0,v={};d&&(c=c==null?void 0:c.filter(N=>N!==d&&N!==f));const p=HO(r,c||[]);p==null||p.forEach(N=>{var I;if(!((I=r.getChildren(N.v))===null||I===void 0)&&I.length){const K=jb(r,N.v,t,n,a);v[N.v]=K,K.hasOwnProperty("barycenter")&&eA(N,K)}});const x=QO(p,t);tA(x,v),(s=x.filter(N=>N.vs.length>0))===null||s===void 0||s.forEach(N=>{const I=r.getNode(N.vs[0]);I&&(N.fixorder=I.data.fixorder,N.order=I.data.order)});const A=JO(x,n,i,a);if(d&&(A.vs=[d,A.vs,f].flat(),!((o=r.getPredecessors(d))===null||o===void 0)&&o.length)){const N=r.getNode(((l=r.getPredecessors(d))===null||l===void 0?void 0:l[0].id)||""),I=r.getNode(((u=r.getPredecessors(f))===null||u===void 0?void 0:u[0].id)||"");A.hasOwnProperty("barycenter")||(A.barycenter=0,A.weight=0),A.barycenter=(A.barycenter*A.weight+N.data.order+I.data.order)/(A.weight+2),A.weight+=2}return A},tA=(r,e)=>{r==null||r.forEach(t=>{var n;const i=(n=t.vs)===null||n===void 0?void 0:n.map(a=>e[a]?e[a].vs:a);t.vs=i.flat()})},eA=(r,e)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight):(r.barycenter=e.barycenter,r.weight=e.weight)},nA=(r,e)=>{const t=Ab(r),n=[],i=[];for(let c=1;c<t+1;c++)n.push(c);for(let c=t-1;c>-1;c--)i.push(c);const a=Gb(r,n,"in"),s=Gb(r,i,"out");let o=Bb(r);jp(r,o);let l=Number.POSITIVE_INFINITY,u;for(let c=0,h=0;h<4;++c,++h){Wb(c%2?a:s,c%4>=2,!1,e),o=Dc(r);const d=Fb(r,o);d<l&&(h=0,u=(0,su.Z)(o),l=d)}o=Bb(r),jp(r,o);for(let c=0,h=0;h<4;++c,++h){Wb(c%2?a:s,c%4>=2,!0,e),o=Dc(r);const d=Fb(r,o);d<l&&(h=0,u=(0,su.Z)(o),l=d)}jp(r,u)},Gb=(r,e,t)=>e.map(n=>ZO(r,n,t)),Wb=(r,e,t,n)=>{const i=new _i.k;r==null||r.forEach(a=>{var s;const o=a.getRoots()[0].id,l=jb(a,o,i,e,t,n);for(let u=0;u<((s=l.vs)===null||s===void 0?void 0:s.length);u++){const c=a.getNode(l.vs[u]);c&&(c.data.order=u)}UO(a,i,l.vs)})},jp=(r,e)=>{e==null||e.forEach(t=>{t==null||t.forEach((n,i)=>{r.getNode(n).data.order=i})})},rA=(r,e)=>{const n=r.getAllNodes().filter(s=>{var o;return!(!((o=r.getChildren(s.id))===null||o===void 0)&&o.length)}).map(s=>s.data.rank),i=Math.max(...n),a=[];for(let s=0;s<i+1;s++)a[s]=[];e==null||e.forEach(s=>{const o=r.getNode(s);!o||o.data.dummy||isNaN(o.data.rank)||(o.data.fixorder=a[o.data.rank].length,a[o.data.rank].push(s))})},iA=r=>{const e={};let t=0;const n=i=>{const a=t;r.getChildren(i).forEach(s=>n(s.id)),e[i]={low:a,lim:t++}};return r.getRoots().forEach(i=>n(i.id)),e},aA=(r,e,t,n)=>{var i,a;const s=[],o=[],l=Math.min(e[t].low,e[n].low),u=Math.max(e[t].lim,e[n].lim);let c,h;c=t;do c=(i=r.getParent(c))===null||i===void 0?void 0:i.id,s.push(c);while(c&&(e[c].low>l||u>e[c].lim));for(h=c,c=n;c&&c!==h;)o.push(c),c=(a=r.getParent(c))===null||a===void 0?void 0:a.id;return{lca:h,path:s.concat(o.reverse())}},sA=(r,e)=>{const t=iA(r);e.forEach(n=>{var i,a;let s=n,o=r.getNode(s);const l=o.data.originalEdge;if(!l)return;const u=aA(r,t,l.source,l.target),c=u.path,h=u.lca;let d=0,f=c[d],v=!0;for(;s!==l.target;){if(o=r.getNode(s),v){for(;f!==h&&((i=r.getNode(f))===null||i===void 0?void 0:i.data.maxRank)<o.data.rank;)d++,f=c[d];f===h&&(v=!1)}if(!v){for(;d<c.length-1&&((a=r.getNode(c[d+1]))===null||a===void 0?void 0:a.data.minRank)<=o.data.rank;)d++;f=c[d]}r.hasNode(f)&&r.setParent(s,f),s=r.getSuccessors(s)[0].id}})},Ub=(r,e)=>{const t={},n=(i,a)=>{let s=0,o=0;const l=i.length,u=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((c,h)=>{var d;const f=oA(r,c),v=f?r.getNode(f.id).data.order:l;(f||c===u)&&((d=a.slice(o,h+1))===null||d===void 0||d.forEach(p=>{var x;(x=r.getPredecessors(p))===null||x===void 0||x.forEach(A=>{var N;const I=r.getNode(A.id),K=I.data.order;(K<s||v<K)&&!(I.data.dummy&&(!((N=r.getNode(p))===null||N===void 0)&&N.data.dummy))&&Vb(t,A.id,p)})}),o=h+1,s=v)}),a};return e!=null&&e.length&&e.reduce(n),t},Zb=(r,e)=>{const t={};function n(o,l,u,c,h){var d,f;let v;for(let p=l;p<u;p++)v=o[p],!((d=r.getNode(v))===null||d===void 0)&&d.data.dummy&&((f=r.getPredecessors(v))===null||f===void 0||f.forEach(x=>{const A=r.getNode(x.id);A.data.dummy&&(A.data.order<c||A.data.order>h)&&Vb(t,x.id,v)}))}function i(o){return JSON.stringify(o.slice(1))}function a(o,l){const u=i(o);l.get(u)||(n(...o),l.set(u,!0))}const s=(o,l)=>{let u=-1,c,h=0;const d=new Map;return l==null||l.forEach((f,v)=>{var p;if(((p=r.getNode(f))===null||p===void 0?void 0:p.data.dummy)==="border"){const x=r.getPredecessors(f)||[];x.length&&(c=r.getNode(x[0].id).data.order,a([l,h,v,u,c],d),h=v,u=c)}a([l,h,l.length,c,o.length],d)}),l};return e!=null&&e.length&&e.reduce(s),t},oA=(r,e)=>{var t,n;if(!((t=r.getNode(e))===null||t===void 0)&&t.data.dummy)return(n=r.getPredecessors(e))===null||n===void 0?void 0:n.find(i=>r.getNode(i.id).data.dummy)},Vb=(r,e,t)=>{let n=e,i=t;if(n>i){const s=n;n=i,i=s}let a=r[n];a||(r[n]=a={}),a[i]=!0},lA=(r,e,t)=>{let n=e,i=t;if(n>i){const a=e;n=i,i=a}return!!r[n]},Yb=(r,e,t,n)=>{const i={},a={},s={};return e==null||e.forEach(o=>{o==null||o.forEach((l,u)=>{i[l]=l,a[l]=l,s[l]=u})}),e==null||e.forEach(o=>{let l=-1;o==null||o.forEach(u=>{let c=n(u).map(h=>h.id);if(c.length){c=c.sort((d,f)=>s[d]-s[f]);const h=(c.length-1)/2;for(let d=Math.floor(h),f=Math.ceil(h);d<=f;++d){const v=c[d];a[u]===u&&l<s[v]&&!lA(t,u,v)&&(a[v]=u,a[u]=i[u]=i[v],l=s[v])}}})}),{root:i,align:a}},Hb=(r,e,t,n,i,a,s)=>{var o;const l={},u=uA(r,e,t,i,a,s),c=s?"borderLeft":"borderRight",h=(v,p)=>{let x=u.getAllNodes(),A=x.pop();const N={};for(;A;)N[A.id]?v(A.id):(N[A.id]=!0,x.push(A),x=x.concat(p(A.id))),A=x.pop()},d=v=>{l[v]=(u.getRelatedEdges(v,"in")||[]).reduce((p,x)=>Math.max(p,(l[x.source]||0)+x.data.weight),0)},f=v=>{const p=(u.getRelatedEdges(v,"out")||[]).reduce((A,N)=>Math.min(A,(l[N.target]||0)-N.data.weight),Number.POSITIVE_INFINITY),x=r.getNode(v);p!==Number.POSITIVE_INFINITY&&x.data.borderType!==c&&(l[v]=Math.max(l[v],p))};return h(d,u.getPredecessors.bind(u)),h(f,u.getSuccessors.bind(u)),(o=Object.values(n))===null||o===void 0||o.forEach(v=>{l[v]=l[t[v]]}),l},uA=(r,e,t,n,i,a)=>{const s=new _i.k,o=cA(n,i,a);return e==null||e.forEach(l=>{let u;l==null||l.forEach(c=>{const h=t[c];if(s.hasNode(h)||s.addNode({id:h,data:{}}),u){const d=t[u],f=s.getRelatedEdges(d,"out").find(v=>v.target===h);f?s.updateEdgeData(f.id,Object.assign(Object.assign({},f.data),{weight:Math.max(o(r,c,u),f.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:d,target:h,data:{weight:Math.max(o(r,c,u),0)}})}u=c})}),s},Xb=(r,e)=>Fp(Object.values(e),t=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(t))===null||n===void 0||n.forEach(s=>{const o=t[s],l=hA(r,s)/2;i=Math.max(o+l,i),a=Math.min(o-l,a)}),i-a});function Kb(r,e){const t=Object.values(e),n=Math.min(...t),i=Math.max(...t);["u","d"].forEach(a=>{["l","r"].forEach(s=>{const o=a+s,l=r[o];let u;if(l===e)return;const c=Object.values(l);u=s==="l"?n-Math.min(...c):i-Math.max(...c),u&&(r[o]={},Object.keys(l).forEach(h=>{r[o][h]=l[h]+u}))})})}const $b=(r,e)=>{const t={};return Object.keys(r.ul).forEach(n=>{if(e)t[n]=r[e.toLowerCase()][n];else{const i=Object.values(r).map(a=>a[n]);t[n]=(i[0]+i[1])/2}}),t},J5=(r,e)=>{const{align:t,nodesep:n=0,edgesep:i=0}=e||{},a=buildLayerMatrix(r),s=Object.assign(Ub(r,a),Zb(r,a)),o={};let l;["u","d"].forEach(c=>{l=c==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(p=>Object.values(p).reverse()));const d=(c==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=Yb(r,l,s,d),v=Hb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(p=>{v[p]=-v[p]}),o[c+h]=v})});const u=Xb(r,o);return Kb(o,u),$b(o,t)},cA=(r,e,t)=>(n,i,a)=>{const s=n.getNode(i),o=n.getNode(a);let l=0,u=0;if(l+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":u=-s.data.width/2;break;case"r":u=s.data.width/2;break}if(u&&(l+=t?u:-u),u=0,l+=(s.data.dummy?e:r)/2,l+=(o.data.dummy?e:r)/2,l+=o.data.width/2,o.data.labelpos)switch((o.data.labelpos||"").toLowerCase()){case"l":u=o.data.width/2;break;case"r":u=-o.data.width/2;break}return u&&(l+=t?u:-u),u=0,l},hA=(r,e)=>r.getNode(e).data.width||0,dA=(r,e)=>{const{ranksep:t=0}=e||{},n=Dc(r);let i=0;n==null||n.forEach(a=>{const s=a.map(l=>r.getNode(l).data.height),o=Math.max(...s,0);a==null||a.forEach(l=>{r.getNode(l).data.y=i+o/2}),i+=o+t})},fA=(r,e)=>{const{align:t,nodesep:n=0,edgesep:i=0}=e||{},a=Dc(r),s=Object.assign(Ub(r,a),Zb(r,a)),o={};let l=[];["u","d"].forEach(c=>{l=c==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(p=>Object.values(p).reverse()));const d=(c==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=Yb(r,l,s,d),v=Hb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(p=>v[p]=-v[p]),o[c+h]=v})});const u=Xb(r,o);return u&&Kb(o,u),$b(o,t)},vA=(r,e)=>{var t;const n=Mb(r);dA(n,e);const i=fA(n,e);(t=Object.keys(i))===null||t===void 0||t.forEach(a=>{n.getNode(a).data.x=i[a]})},Qb=r=>{const e={},t=n=>{var i;const a=r.getNode(n);if(!a)return 0;if(e[n])return a.data.rank;e[n]=!0;let s;return(i=r.getRelatedEdges(n,"out"))===null||i===void 0||i.forEach(o=>{const l=t(o.target),u=o.data.minlen,c=l-u;c&&(s===void 0||c<s)&&(s=c)}),s||(s=0),a.data.rank=s,s};r.getAllNodes().filter(n=>r.getRelatedEdges(n.id,"in").length===0).forEach(n=>t(n.id))},gA=r=>{const e={};let t;const n=s=>{var o;const l=r.getNode(s);if(!l)return 0;if(e[s])return l.data.rank;e[s]=!0;let u;return(o=r.getRelatedEdges(s,"out"))===null||o===void 0||o.forEach(c=>{const h=n(c.target),d=c.data.minlen,f=h-d;f&&(u===void 0||f<u)&&(u=f)}),u||(u=0),(t===void 0||u<t)&&(t=u),l.data.rank=u,u};r.getAllNodes().filter(s=>r.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&n(s.id)}),t===void 0&&(t=0);const i={},a=(s,o)=>{var l;const u=r.getNode(s),c=isNaN(u.data.layer)?o:u.data.layer;(u.data.rank===void 0||u.data.rank<c)&&(u.data.rank=c),!i[s]&&(i[s]=!0,(l=r.getRelatedEdges(s,"out"))===null||l===void 0||l.forEach(h=>{a(h.target,c+h.data.minlen)}))};r.getAllNodes().forEach(s=>{const o=s.data;o&&(isNaN(o.layer)?o.rank-=t:a(s.id,o.layer))})},Vo=(r,e)=>r.getNode(e.target).data.rank-r.getNode(e.source).data.rank-e.data.minlen,pA=r=>{const e=new _i.k({tree:[]}),t=r.getAllNodes()[0],n=r.getAllNodes().length;e.addNode(t);let i,a;for(;mA(e,r)<n;)i=Jb(e,r),a=e.hasNode(i.source)?Vo(r,i):-Vo(r,i),qb(e,r,a);return e},mA=(r,e)=>{const t=n=>{e.getRelatedEdges(n,"both").forEach(i=>{const a=i.source,s=n===a?i.target:a;!r.hasNode(s)&&!Vo(e,i)&&(r.addNode({id:s,data:{}}),r.addEdge({id:i.id,source:n,target:s,data:{}}),t(s))})};return r.getAllNodes().forEach(n=>t(n.id)),r.getAllNodes().length},yA=r=>{const e=new _i.k({tree:[]}),t=r.getAllNodes()[0],n=r.getAllNodes().length;e.addNode(t);let i,a;for(;bA(e,r)<n;)i=Jb(e,r),a=e.hasNode(i.source)?Vo(r,i):-Vo(r,i),qb(e,r,a);return e},bA=(r,e)=>{const t=n=>{var i;(i=e.getRelatedEdges(n,"both"))===null||i===void 0||i.forEach(a=>{const s=a.source,o=n===s?a.target:s;!r.hasNode(o)&&(e.getNode(o).data.layer!==void 0||!Vo(e,a))&&(r.addNode({id:o,data:{}}),r.addEdge({id:a.id,source:n,target:o,data:{}}),t(o))})};return r.getAllNodes().forEach(n=>t(n.id)),r.getAllNodes().length},Jb=(r,e)=>Fp(e.getAllEdges(),t=>r.hasNode(t.source)!==r.hasNode(t.target)?Vo(e,t):1/0),qb=(r,e,t)=>{r.getAllNodes().forEach(n=>{const i=e.getNode(n.id);i.data.rank||(i.data.rank=0),i.data.rank+=t})},xA=r=>{const e=kO(r);Qb(e);const t=pA(e);ex(t),tx(t,e);let n,i;for(;n=SA(t);)i=_A(t,e,n),MA(t,e,n,i)},tx=(r,e)=>{let t=Pb(r,r.getAllNodes(),"post",!1);t=t.slice(0,(t==null?void 0:t.length)-1),t.forEach(n=>{EA(r,e,n)})},EA=(r,e,t)=>{const i=r.getNode(t).data.parent,a=r.getRelatedEdges(t,"both").find(s=>s.target===i||s.source===i);a.data.cutvalue=wA(r,e,t)},wA=(r,e,t)=>{const i=r.getNode(t).data.parent;let a=!0,s=e.getRelatedEdges(t,"out").find(l=>l.target===i),o=0;return s||(a=!1,s=e.getRelatedEdges(i,"out").find(l=>l.target===t)),o=s.data.weight,e.getRelatedEdges(t,"both").forEach(l=>{const u=l.source===t,c=u?l.target:l.source;if(c!==i){const h=u===a,d=l.data.weight;if(o+=h?d:-d,TA(r,t,c)){const f=r.getRelatedEdges(t,"both").find(v=>v.source===c||v.target===c).data.cutvalue;o+=h?-f:f}}}),o},ex=(r,e=r.getAllNodes()[0].id)=>{nx(r,{},1,e)},nx=(r,e,t,n,i)=>{var a;const s=t;let o=t;const l=r.getNode(n);return e[n]=!0,(a=r.getNeighbors(n))===null||a===void 0||a.forEach(u=>{e[u.id]||(o=nx(r,e,o,u.id,n))}),l.data.low=s,l.data.lim=o++,i?l.data.parent=i:delete l.data.parent,o},SA=r=>r.getAllEdges().find(e=>e.data.cutvalue<0),_A=(r,e,t)=>{let n=t.source,i=t.target;e.getRelatedEdges(n,"out").find(c=>c.target===i)||(n=t.target,i=t.source);const a=r.getNode(n),s=r.getNode(i);let o=a,l=!1;a.data.lim>s.data.lim&&(o=s,l=!0);const u=e.getAllEdges().filter(c=>l===rx(r.getNode(c.source),o)&&l!==rx(r.getNode(c.target),o));return Fp(u,c=>Vo(e,c))},MA=(r,e,t,n)=>{const i=r.getRelatedEdges(t.source,"both").find(a=>a.source===t.target||a.target===t.target);i&&r.removeEdge(i.id),r.addEdge({id:`e${Math.random()}`,source:n.source,target:n.target,data:{}}),ex(r),tx(r,e),kA(r,e)},kA=(r,e)=>{const t=r.getAllNodes().find(i=>!i.data.parent);let n=Pb(r,t,"pre",!1);n=n.slice(1),n.forEach(i=>{const a=r.getNode(i).data.parent;let s=e.getRelatedEdges(i,"out").find(l=>l.target===a),o=!1;!s&&e.hasNode(a)&&(s=e.getRelatedEdges(a,"out").find(l=>l.target===i),o=!0),e.getNode(i).data.rank=(e.hasNode(a)&&e.getNode(a).data.rank||0)+(o?s==null?void 0:s.data.minlen:-(s==null?void 0:s.data.minlen))})},TA=(r,e,t)=>r.getRelatedEdges(e,"both").find(n=>n.source===t||n.target===t),rx=(r,e)=>e.data.low<=r.data.lim&&r.data.lim<=e.data.lim,OA=(r,e)=>{switch(e){case"network-simplex":CA(r);break;case"tight-tree":ix(r);break;case"longest-path":AA(r);break;default:ix(r)}},AA=Qb,ix=r=>{gA(r),yA(r)},CA=r=>{xA(r)},PA=(r,e)=>{const{edgeLabelSpace:t,keepNodeOrder:n,prevGraph:i,rankdir:a,ranksep:s}=e;!n&&i&&RA(r,i);const o=zA(r);t&&(e.ranksep=jA(o,{rankdir:a,ranksep:s}));let l;try{l=NA(o,e)}catch(u){if(u.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
|
|
|
`,u);return}throw u}return LA(r,o),l},NA=(r,e)=>{const{acyclicer:t,ranker:n,rankdir:i="tb",nodeOrder:a,keepNodeOrder:s,align:o,nodesep:l=50,edgesep:u=20,ranksep:c=50}=e;KA(r),wO(r,t);const{nestingRoot:h,nodeRankFactor:d}=DO(r);OA(Mb(r),n),GA(r),OO(r,d),BO(r,h),TO(r),WA(r),UA(r);const f=[];jO(r,f),sA(r,f),CO(r),s&&rA(r,a),nA(r,s),$A(r),PO(r,i),vA(r,{align:o,nodesep:l,edgesep:u,ranksep:c}),QA(r),XA(r),WO(r,f),YA(r),NO(r,i);const{width:v,height:p}=ZA(r);return VA(r),HA(r),_O(r),{width:v,height:p}},RA=(r,e)=>{r.getAllNodes().forEach(t=>{const n=r.getNode(t.id);if(e.hasNode(t.id)){const i=e.getNode(t.id);n.data.fixorder=i.data._order,delete i.data._order}else delete n.data.fixorder})},LA=(r,e)=>{r.getAllNodes().forEach(t=>{var n;const i=r.getNode(t.id);if(i){const a=e.getNode(t.id);i.data.x=a.data.x,i.data.y=a.data.y,i.data._order=a.data.order,i.data._rank=a.data.rank,!((n=e.getChildren(t.id))===null||n===void 0)&&n.length&&(i.data.width=a.data.width,i.data.height=a.data.height)}}),r.getAllEdges().forEach(t=>{const n=r.getEdge(t.id),i=e.getEdge(t.id);n.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(n.data.x=i.data.x,n.data.y=i.data.y)})},DA=["width","height","layer","fixorder"],IA={width:0,height:0},FA=["minlen","weight","width","height","labeloffset"],BA={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Gp=["labelpos"],zA=r=>{const e=new _i.k({tree:[]});return r.getAllNodes().forEach(t=>{const n=sx(r.getNode(t.id).data),i=Object.assign(Object.assign({},IA),n),a=ax(i,DA);e.hasNode(t.id)||e.addNode({id:t.id,data:Object.assign({},a)});const s=r.hasTreeStructure("combo")?r.getParent(t.id,"combo"):r.getParent(t.id);(0,be.Z)(s)||(e.hasNode(s.id)||e.addNode(Object.assign({},s)),e.setParent(t.id,s.id))}),r.getAllEdges().forEach(t=>{const n=sx(r.getEdge(t.id).data),i={};Gp==null||Gp.forEach(a=>{n[a]!==void 0&&(i[a]=n[a])}),e.addEdge({id:t.id,source:t.source,target:t.target,data:Object.assign({},BA,ax(n,FA),i)})}),e},jA=(r,e)=>{const{ranksep:t=0,rankdir:n}=e;return r.getAllNodes().forEach(i=>{isNaN(i.data.layer)||i.data.layer||(i.data.layer=0)}),r.getAllEdges().forEach(i=>{var a;i.data.minlen*=2,((a=i.data.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(n==="TB"||n==="BT"?i.data.width+=i.data.labeloffset:i.data.height+=i.data.labeloffset)}),t/2},GA=r=>{r.getAllEdges().forEach(e=>{if(e.data.width&&e.data.height){const t=r.getNode(e.source),n=r.getNode(e.target),i={e,rank:(n.data.rank-t.data.rank)/2+t.data.rank};pu(r,"edge-proxy",i,"_ep")}})},WA=r=>{let e=0;return r.getAllNodes().forEach(t=>{var n,i;t.data.borderTop&&(t.data.minRank=(n=r.getNode(t.data.borderTop))===null||n===void 0?void 0:n.data.rank,t.data.maxRank=(i=r.getNode(t.data.borderBottom))===null||i===void 0?void 0:i.data.rank,e=Math.max(e,t.data.maxRank||-1/0))}),e},UA=r=>{r.getAllNodes().forEach(e=>{e.data.dummy==="edge-proxy"&&(r.getEdge(e.data.e.id).data.labelRank=e.data.rank,r.removeNode(e.id))})},ZA=(r,e)=>{let t,n=0,i,a=0;const{marginx:s=0,marginy:o=0}=e||{},l=u=>{if(!u.data)return;const c=u.data.x,h=u.data.y,d=u.data.width,f=u.data.height;!isNaN(c)&&!isNaN(d)&&(t===void 0&&(t=c-d/2),t=Math.min(t,c-d/2),n=Math.max(n,c+d/2)),!isNaN(h)&&!isNaN(f)&&(i===void 0&&(i=h-f/2),i=Math.min(i,h-f/2),a=Math.max(a,h+f/2))};return r.getAllNodes().forEach(u=>{l(u)}),r.getAllEdges().forEach(u=>{u!=null&&u.data.hasOwnProperty("x")&&l(u)}),t-=s,i-=o,r.getAllNodes().forEach(u=>{u.data.x-=t,u.data.y-=i}),r.getAllEdges().forEach(u=>{var c;(c=u.data.points)===null||c===void 0||c.forEach(h=>{h.x-=t,h.y-=i}),u.data.hasOwnProperty("x")&&(u.data.x-=t),u.data.hasOwnProperty("y")&&(u.data.y-=i)}),{width:n-t+s,height:a-i+o}},VA=r=>{r.getAllEdges().forEach(e=>{const t=r.getNode(e.source),n=r.getNode(e.target);let i,a;e.data.points?(i=e.data.points[0],a=e.data.points[e.data.points.length-1]):(e.data.points=[],i={x:n.data.x,y:n.data.y},a={x:t.data.x,y:t.data.y}),e.data.points.unshift(Tb(t.data,i)),e.data.points.push(Tb(n.data,a))})},YA=r=>{r.getAllEdges().forEach(e=>{if(e.data.hasOwnProperty("x"))switch((e.data.labelpos==="l"||e.data.labelpos==="r")&&(e.data.width-=e.data.labeloffset),e.data.labelpos){case"l":e.data.x-=e.data.width/2+e.data.labeloffset;break;case"r":e.data.x+=e.data.width/2+e.data.labeloffset;break}})},HA=r=>{r.getAllEdges().forEach(e=>{var t;e.data.reversed&&((t=e.data.points)===null||t===void 0||t.reverse())})},XA=r=>{r.getAllNodes().forEach(e=>{var t,n,i;if(!((t=r.getChildren(e.id))===null||t===void 0)&&t.length){const a=r.getNode(e.id),s=r.getNode(a.data.borderTop),o=r.getNode(a.data.borderBottom),l=r.getNode(a.data.borderLeft[((n=a.data.borderLeft)===null||n===void 0?void 0:n.length)-1]),u=r.getNode(a.data.borderRight[((i=a.data.borderRight)===null||i===void 0?void 0:i.length)-1]);a.data.width=Math.abs((u==null?void 0:u.data.x)-(l==null?void 0:l.data.x))||10,a.data.height=Math.abs((o==null?void 0:o.data.y)-(s==null?void 0:s.data.y))||10,a.data.x=((l==null?void 0:l.data.x)||0)+a.data.width/2,a.data.y=((s==null?void 0:s.data.y)||0)+a.data.height/2}}),r.getAllNodes().forEach(e=>{e.data.dummy==="border"&&r.removeNode(e.id)})},KA=r=>{r.getAllEdges().forEach(e=>{if(e.source===e.target){const t=r.getNode(e.source);t.data.selfEdges||(t.data.selfEdges=[]),t.data.selfEdges.push(e),r.removeEdge(e.id)}})},$A=r=>{const e=Dc(r);e==null||e.forEach(t=>{let n=0;t==null||t.forEach((i,a)=>{var s;const o=r.getNode(i);o.data.order=a+n,(s=o.data.selfEdges)===null||s===void 0||s.forEach(l=>{pu(r,"selfedge",{width:l.data.width,height:l.data.height,rank:o.data.rank,order:a+ ++n,e:l},"_se")}),delete o.data.selfEdges})})},QA=r=>{r.getAllNodes().forEach(e=>{const t=r.getNode(e.id);if(t.data.dummy==="selfedge"){const n=r.getNode(t.data.e.source),i=n.data.x+n.data.width/2,a=n.data.y,s=t.data.x-i,o=n.data.height/2;r.hasEdge(t.data.e.id)?r.updateEdgeData(t.data.e.id,t.data.e.data):r.addEdge({id:t.data.e.id,source:t.data.e.source,target:t.data.e.target,data:t.data.e.data}),r.removeNode(e.id),t.data.e.data.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{y:a,x:i+s},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],t.data.e.data.x=t.data.x,t.data.e.data.y=t.data.y}})},ax=(r,e)=>{const t={};return e==null||e.forEach(n=>{r[n]!==void 0&&(t[n]=+r[n])}),t},sx=(r={})=>{const e={};return Object.keys(r).forEach(t=>{e[t.toLowerCase()]=r[t]}),e};function Ic(r){if(!r)return[0,0,0];if((0,bt.Z)(r))return[r,r,r];if(r.length===0)return[0,0,0];const[e,t=e,n=e]=r;return[e,t,n]}function _l(r,e){let t;return(0,At.Z)(e)?t=e:(0,bt.Z)(e)?t=()=>e:t=()=>r,t}function Wp(r,e,t=!0){return!e&&e!==0?n=>{const{size:i}=n.data||{};return i?Array.isArray(i)?t?Math.max(...i)||r:i:(0,ie.Z)(i)&&i.width&&i.height?t?Math.max(i.width,i.height)||r:[i.width,i.height]:i:r}:(0,At.Z)(e)?e:(0,bt.Z)(e)?()=>e:Array.isArray(e)?()=>t?Math.max(...e)||r:e:(0,ie.Z)(e)&&e.width&&e.height?()=>t?Math.max(e.width,e.height)||r:[e.width,e.height]:()=>r}const Up=(r,e,t=10)=>{let n;const i=typeof e=="function"?e:()=>e||0;return r?Array.isArray(r)?n=s=>r:(0,At.Z)(r)?n=r:n=s=>r:n=s=>{var o,l,u;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return(l=s.data)===null||l===void 0?void 0:l.bboxSize;if(!((u=s.data)===null||u===void 0)&&u.size){const c=s.data.size;return Array.isArray(c)?c:(0,ie.Z)(c)?[c.width,c.height]:c}return t},s=>{const o=n(s),l=i(s);return Math.max(...Ic(o))+l}},Zp=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){const e=[];return r.forEach(t=>{e.push(t)}),e.map(t=>Zp(t))}if(typeof r=="object"){const e={};return Object.keys(r).forEach(t=>{e[t]=Zp(r[t])}),e}return r},Na=(r,e)=>{const t=Zp(r);return t.data=t.data||{},e&&((0,bt.Z)(t.data.x)||(t.data.x=Math.random()*e[0]),(0,bt.Z)(t.data.y)||(t.data.y=Math.random()*e[1])),t},JA={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class qA{constructor(e={}){this.options=e,this.id="antv-dagre",this.options=Object.assign(Object.assign({},JA),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,t)})}genericDagreLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{nodeSize:a,align:s,rankdir:o="TB",ranksep:l,nodesep:u,ranksepFunc:c,nodesepFunc:h,edgeLabelSpace:d,ranker:f,nodeOrder:v,begin:p,controlPoints:x,radial:A,sortByCombo:N,preset:I}=i,K=new _i.k({tree:[]}),W=_l(l||50,c),z=_l(u||50,h);let j=z,Z=W;(o==="LR"||o==="RL")&&(j=W,Z=z);const vt=Wp(10,a,!1),Tt=t.getAllNodes(),zt=t.getAllEdges();Tt.forEach(Q=>{const It=Ic(vt(Q)),ue=Z(Q),le=j(Q),Fe=It[0]+2*le,Qe=It[1]+2*ue,He=Q.data.layer;(0,bt.Z)(He)?K.addNode({id:Q.id,data:{width:Fe,height:Qe,layer:He}}):K.addNode({id:Q.id,data:{width:Fe,height:Qe}})}),N&&(K.attachTreeStructure("combo"),Tt.forEach(Q=>{const{parentId:It}=Q.data;It!==void 0&&K.hasNode(It)&&K.setParent(Q.id,It,"combo")})),zt.forEach(Q=>{K.addEdge({id:Q.id,source:Q.source,target:Q.target,data:{weight:Q.data.weight||1}})});let Qt;I!=null&&I.length&&(Qt=new _i.k({nodes:I})),PA(K,{prevGraph:Qt,edgeLabelSpace:d,keepNodeOrder:!!v,nodeOrder:v||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:u,align:s});const ae=[0,0];if(p){let Q=1/0,It=1/0;K.getAllNodes().forEach(ue=>{Q>ue.data.x&&(Q=ue.data.x),It>ue.data.y&&(It=ue.data.y)}),K.getAllEdges().forEach(ue=>{var le;(le=ue.data.points)===null||le===void 0||le.forEach(Fe=>{Q>Fe.x&&(Q=Fe.x),It>Fe.y&&(It=Fe.y)})}),ae[0]=p[0]-Q,ae[1]=p[1]-It}const fe=o==="LR"||o==="RL";if(!A){const Q=new Set,ue=o==="BT"||o==="RL"?(He,tn)=>tn-He:(He,tn)=>He-tn;K.getAllNodes().forEach(He=>{He.data.x=He.data.x+ae[0],He.data.y=He.data.y+ae[1],Q.add(fe?He.data.x:He.data.y)});const le=Array.from(Q).sort(ue),Fe=fe?(He,tn)=>He.x!==tn.x:(He,tn)=>He.y!==tn.y,Qe=fe?(He,tn,vn)=>{const _n=Math.max(tn.y,vn.y),kr=Math.min(tn.y,vn.y);return He.filter(Rr=>Rr.y<=_n&&Rr.y>=kr)}:(He,tn,vn)=>{const _n=Math.max(tn.x,vn.x),kr=Math.min(tn.x,vn.x);return He.filter(Rr=>Rr.x<=_n&&Rr.x>=kr)};K.getAllEdges().forEach((He,tn)=>{var vn;d&&x&&He.data.type!=="loop"&&(He.data.controlPoints=tC((vn=He.data.points)===null||vn===void 0?void 0:vn.map(({x:_n,y:kr})=>({x:_n+ae[0],y:kr+ae[1]})),K.getNode(He.source),K.getNode(He.target),le,fe,Fe,Qe))})}let ce=[];ce=K.getAllNodes().map(Q=>Na(Q));const ct=K.getAllEdges();return e&&(ce.forEach(Q=>{t.mergeNodeData(Q.id,{x:Q.data.x,y:Q.data.y})}),ct.forEach(Q=>{t.mergeEdgeData(Q.id,{controlPoints:Q.data.controlPoints})})),{nodes:ce,edges:ct}})}}const tC=(r,e,t,n,i,a,s)=>{let o=(r==null?void 0:r.slice(1,r.length-1))||[];if(e&&t){let{x:l,y:u}=e.data,{x:c,y:h}=t.data;if(i&&(l=e.data.y,u=e.data.x,c=t.data.y,h=t.data.x),h!==u&&l!==c){const d=n.indexOf(u),f=n[d+1];if(f){const x=o[0],A=i?{x:(u+f)/2,y:(x==null?void 0:x.y)||c}:{x:(x==null?void 0:x.x)||c,y:(u+f)/2};(!x||a(x,A))&&o.unshift(A)}const v=n.indexOf(h),p=Math.abs(v-d);if(p===1)o=s(o,e.data,t.data),o.length||o.push(i?{x:(u+h)/2,y:l}:{x:l,y:(u+h)/2});else if(p>1){const x=n[v-1];if(x){const A=o[o.length-1],N=i?{x:(h+x)/2,y:(A==null?void 0:A.y)||c}:{x:(A==null?void 0:A.x)||l,y:(h+x)/2};(!A||a(A,N))&&o.push(N)}}}}return o},Ml=(r,e,t)=>{const n=r.getAllNodes(),i=r.getAllEdges();if(!(n!=null&&n.length))return{nodes:[],edges:i};if(n.length===1)return e&&r.mergeNodeData(n[0].id,{x:t[0],y:t[1]}),{nodes:[Object.assign(Object.assign({},n[0]),{data:Object.assign(Object.assign({},n[0].data),{x:t[0],y:t[1]})})],edges:i}},eC={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class nC{constructor(e={}){this.options=e,this.id="circular",this.options=Object.assign(Object.assign({},eC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,e,t)})}genericCircularLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,divisions:l,startAngle:u=0,endAngle:c=2*Math.PI,angleRatio:h,ordering:d,clockwise:f,nodeSpacing:v,nodeSize:p}=i,x=t.getAllNodes(),A=t.getAllEdges(),[N,I,K]=iC(a,s,o),W=x==null?void 0:x.length;if(!W||W===1)return Ml(t,e,K);const z=(c-u)/W;let{radius:j,startRadius:Z,endRadius:vt}=i;if(v){const fe=_l(10,v),ce=Wp(10,p);let ct=-1/0;x.forEach(Q=>{const It=ce(Q);ct<It&&(ct=It)});let $=0;x.forEach((Q,It)=>{It===0?$+=ct||10:$+=(fe(Q)||0)+(ct||10)}),j=$/(2*Math.PI)}else!j&&!Z&&!vt?j=Math.min(I,N)/2:!Z&&vt?Z=vt:Z&&!vt&&(vt=Z);const Tt=z*h;let zt=[];d==="topology"?zt=ox(t,x):d==="topology-directed"?zt=ox(t,x,!0):d==="degree"?zt=rC(t,x):zt=x.map(fe=>Na(fe));const Qt=Math.ceil(W/l);for(let fe=0;fe<W;++fe){let ce=j;!ce&&Z!==null&&vt!==null&&(ce=Z+fe*(vt-Z)/(W-1)),ce||(ce=10+fe*100/(W-1));let ct=u+fe%Qt*Tt+2*Math.PI/l*Math.floor(fe/Qt);f||(ct=c-fe%Qt*Tt-2*Math.PI/l*Math.floor(fe/Qt)),zt[fe].data.x=K[0]+Math.cos(ct)*ce,zt[fe].data.y=K[1]+Math.sin(ct)*ce}return e&&zt.forEach(fe=>{t.mergeNodeData(fe.id,{x:fe.data.x,y:fe.data.y})}),{nodes:zt,edges:A}})}}const ox=(r,e,t=!1)=>{const n=[Na(e[0])],i={},a=e.length;i[e[0].id]=!0;let s=0;return e.forEach((o,l)=>{if(l!==0)if((l===a-1||r.getDegree(o.id,"both")!==r.getDegree(e[l+1].id,"both")||r.areNeighbors(n[s].id,o.id))&&!i[o.id])n.push(Na(o)),i[o.id]=!0,s++;else{const u=t?r.getSuccessors(n[s].id):r.getNeighbors(n[s].id);let c=!1;for(let d=0;d<u.length;d++){const f=u[d];if(r.getDegree(f.id)===r.getDegree(o.id)&&!i[f.id]){n.push(Na(f)),i[f.id]=!0,c=!0;break}}let h=0;for(;!c&&(i[e[h].id]||(n.push(Na(e[h])),i[e[h].id]=!0,c=!0),h++,h!==a););}}),n};function rC(r,e){const t=[];return e.forEach((n,i)=>{t.push(Na(n))}),t.sort((n,i)=>r.getDegree(n.id,"both")-r.getDegree(i.id,"both")),t}const iC=(r,e,t)=>{let n=r,i=e,a=t;return!n&&typeof window!="undefined"&&(n=window.innerWidth),!i&&typeof window!="undefined"&&(i=window.innerHeight),a||(a=[n/2,i/2]),[n,i,a]},vo=Array.isArray,aC={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Vp{constructor(e={}){this.options=e,this.id="concentric",this.options=Object.assign(Object.assign({},aC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,e,t)})}genericConcentricLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o,sortBy:l,maxLevelDiff:u,sweep:c,clockwise:h,equidistant:d,preventOverlap:f,startAngle:v=3/2*Math.PI,nodeSize:p,nodeSpacing:x}=i,A=t.getAllNodes(),N=t.getAllEdges(),I=!s&&typeof window!="undefined"?window.innerWidth:s,K=!o&&typeof window!="undefined"?window.innerHeight:o,W=a||[I/2,K/2];if(!(A!=null&&A.length)||A.length===1)return Ml(t,e,W);const z=[];let j,Z=0;vo(p)?j=Math.max(p[0],p[1]):(0,At.Z)(p)?(j=-1/0,A.forEach(Q=>{const It=Math.max(...Ic(p(Q)));It>j&&(j=It)})):j=p,vo(x)?Z=Math.max(x[0],x[1]):(0,bt.Z)(x)&&(Z=x),A.forEach(Q=>{const It=Na(Q);z.push(It);let ue=j;const{data:le}=It;vo(le.size)?ue=Math.max(le.size[0],le.size[1]):(0,bt.Z)(le.size)?ue=le.size:(0,ie.Z)(le.size)&&(ue=Math.max(le.size.width,le.size.height)),j=Math.max(j,ue),(0,At.Z)(x)&&(Z=Math.max(x(Q),Z))});const vt={};z.forEach((Q,It)=>{vt[Q.id]=It});let Tt=l;(!(0,Gt.Z)(Tt)||z[0].data[Tt]===void 0)&&(Tt="degree"),Tt==="degree"?z.sort((Q,It)=>t.getDegree(It.id,"both")-t.getDegree(Q.id,"both")):z.sort((Q,It)=>It.data[Tt]-Q.data[Tt]);const zt=z[0],Qt=(u||(Tt==="degree"?t.getDegree(zt.id,"both"):zt.data[Tt]))/4,ae=[{nodes:[]}];let fe=ae[0];z.forEach(Q=>{if(fe.nodes.length>0){const It=Math.abs(Tt==="degree"?t.getDegree(fe.nodes[0].id,"both")-t.getDegree(Q.id,"both"):fe.nodes[0].data[Tt]-Q.data[Tt]);Qt&&It>=Qt&&(fe={nodes:[]},ae.push(fe))}fe.nodes.push(Q)});let ce=j+Z;if(!f){const Q=ae.length>0&&ae[0].nodes.length>1,ue=(Math.min(I,K)/2-ce)/(ae.length+(Q?1:0));ce=Math.min(ce,ue)}let ct=0;if(ae.forEach(Q=>{const It=c===void 0?2*Math.PI-2*Math.PI/Q.nodes.length:c;if(Q.dTheta=It/Math.max(1,Q.nodes.length-1),Q.nodes.length>1&&f){const ue=Math.cos(Q.dTheta)-Math.cos(0),le=Math.sin(Q.dTheta)-Math.sin(0),Fe=Math.sqrt(ce*ce/(ue*ue+le*le));ct=Math.max(Fe,ct)}Q.r=ct,ct+=ce}),d){let Q=0,It=0;for(let ue=0;ue<ae.length;ue++){const Fe=(ae[ue].r||0)-It;Q=Math.max(Q,Fe)}It=0,ae.forEach((ue,le)=>{le===0&&(It=ue.r||0),ue.r=It,It+=Q})}return ae.forEach(Q=>{const It=Q.dTheta||0,ue=Q.r||0;Q.nodes.forEach((le,Fe)=>{const Qe=v+(h?1:-1)*It*Fe;le.data.x=W[0]+ue*Math.cos(Qe),le.data.y=W[1]+ue*Math.sin(Qe)})}),e&&z.forEach(Q=>t.mergeNodeData(Q.id,{x:Q.data.x,y:Q.data.y})),{nodes:z,edges:N}})}}var sC=g(46632),oC=g(67217);const lC=.81,Yp=.1;function uC(r,e,t,n,i=2){const a=e/t,s=r.getAllNodes(),o=s.map((c,h)=>{const{nodeStrength:d,x:f,y:v,z:p,size:x}=c.data;return{x:f,y:v,z:p,size:x,index:h,id:c.id,vx:0,vy:0,vz:0,weight:a*d}}),l=(i===2?(0,sC.Z)(o,c=>c.x,c=>c.y):(0,oC.Z)(o,c=>c.x,c=>c.y,c=>c.z)).visitAfter(cC),u=new Map;return o.forEach(c=>{u.set(c.id,c),dC(c,l,i)}),o.map((c,h)=>{const{id:d,data:f}=s[h],{mass:v=1}=f;n[d]={x:c.vx/v,y:c.vy/v,z:c.vz/v}}),n}function cC(r){let e=0,t=0,n=0,i=0,a=0;const s=r.length;if(s){for(let o=0;o<s;o++){const l=r[o];l&&l.weight&&(e+=l.weight,t+=l.x*l.weight,n+=l.y*l.weight,i+=l.z*l.weight,a+=l.size*l.weight)}r.x=t/e,r.y=n/e,r.z=i/e,r.size=a/e,r.weight=e}else{const o=r;r.x=o.data.x,r.y=o.data.y,r.z=o.data.z,r.size=o.data.size,r.weight=o.data.weight}}const hC=(r,e,t,n,i,a,s)=>{var o;if(((o=r.data)===null||o===void 0?void 0:o.id)===a.id)return;const l=[t,n,i][s-1],u=a.x-r.x||Yp,c=a.y-r.y||Yp,h=a.z-r.z||Yp,d=[u,c,h],f=l-e;let v=0;for(let A=0;A<s;A++)v+=d[A]*d[A];const x=Math.sqrt(v)*v;if(f*f*lC<v){const A=r.weight/x;return a.vx+=u*A,a.vy+=c*A,a.vz+=h*A,!0}if(r.length)return!1;if(r.data!==a){const A=r.data.weight/x;a.vx+=u*A,a.vy+=c*A,a.vz+=h*A}};function dC(r,e,t){e.visit((n,i,a,s,o)=>hC(n,i,a,s,o,r,t))}const fC={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class lx{constructor(e={}){this.options=e,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},fC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericForceLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;(this.judgingDistance>this.lastOptions.minMovement||n<1)&&n<e;n++)this.runOneStep(this.lastCalcGraph,this.lastGraph,n,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),t}genericForceLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),a=t.getAllNodes(),s=t.getAllEdges(),o=this.formatOptions(i,t),{dimensions:l,width:u,height:c,nodeSize:h,getMass:d,nodeStrength:f,edgeStrength:v,linkDistance:p}=o,x=a.map((Z,vt)=>Object.assign(Object.assign({},Z),{data:Object.assign(Object.assign({},Z.data),{x:(0,bt.Z)(Z.data.x)?Z.data.x:Math.random()*u,y:(0,bt.Z)(Z.data.y)?Z.data.y:Math.random()*c,z:(0,bt.Z)(Z.data.z)?Z.data.z:Math.random()*Math.sqrt(u*c),size:h(Z)||30,mass:d(Z),nodeStrength:f(Z)})})),A=s.map(Z=>Object.assign(Object.assign({},Z),{data:Object.assign(Object.assign({},Z.data),{edgeStrength:v(Z),linkDistance:p(Z,t.getNode(Z.source),t.getNode(Z.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const N={};a.forEach((Z,vt)=>{N[Z.id]={x:0,y:0,z:0}});const I=new _i.k({nodes:x,edges:A});this.formatCentripetal(o,I);const{maxIteration:K,minMovement:W,onTick:z}=o;if(this.lastLayoutNodes=x,this.lastLayoutEdges=A,this.lastAssign=e,this.lastGraph=t,this.lastCalcGraph=I,this.lastOptions=o,this.lastVelMap=N,typeof window=="undefined")return;let j=0;return new Promise(Z=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&Z({nodes:Hp(t,x),edges:s}),this.runOneStep(I,t,j,N,o),this.updatePosition(t,I,N,o),e&&x.forEach(vt=>t.mergeNodeData(vt.id,{x:vt.data.x,y:vt.data.y,z:l===3?vt.data.z:void 0})),z==null||z({nodes:Hp(t,x),edges:s}),j++,(j>=K||this.judgingDistance<W)&&(window.clearInterval(this.timeInterval),Z({nodes:Hp(t,x),edges:s}))},0),this.running=!0})})}formatOptions(e,t){const n=Object.assign({},e),{width:i,height:a,getMass:s}=e;n.width=!i&&typeof window!="undefined"?window.innerWidth:i,n.height=!a&&typeof window!="undefined"?window.innerHeight:a,e.center||(n.center=[n.width/2,n.height/2]),s||(n.getMass=l=>{let u=1;(0,bt.Z)(l==null?void 0:l.data.mass)&&(u=l==null?void 0:l.data.mass);const c=t.getDegree(l.id,"both");return!c||c<5?u:c*5*u}),n.nodeSize=Up(e.nodeSize,e.nodeSpacing);const o=e.linkDistance?_l(1,e.linkDistance):l=>1+n.nodeSize(t.getNode(l.source))+n.nodeSize(t.getNode(l.target));return n.linkDistance=o,n.nodeStrength=_l(1,e.nodeStrength),n.edgeStrength=_l(1,e.edgeStrength),n}formatCentripetal(e,t){const{dimensions:n,centripetalOptions:i,center:a,clusterNodeStrength:s,leafCluster:o,clustering:l,nodeClusterBy:u}=e,c=t.getAllNodes(),h=i||{leaf:2,single:2,others:1,center:A=>({x:a[0],y:a[1],z:n===3?a[2]:void 0})};typeof s!="function"&&(e.clusterNodeStrength=A=>s);let d,f;if(o&&u&&(d=ux(t,u),f=Array.from(new Set(c==null?void 0:c.map(A=>A.data[u])))||[],e.centripetalOptions=Object.assign(h,{single:100,leaf:A=>{const{siblingLeaves:N,sameTypeLeaves:I}=d[A.id]||{};return(I==null?void 0:I.length)===(N==null?void 0:N.length)||(f==null?void 0:f.length)===1?1:e.clusterNodeStrength(A)},others:1,center:A=>{const N=t.getDegree(A.id,"both");if(!N)return{x:100,y:100,z:0};let I;if(N===1){const{sameTypeLeaves:K=[]}=d[A.id]||{};K.length===1?I=void 0:K.length>1&&(I=cx(K))}else I=void 0;return{x:I==null?void 0:I.x,y:I==null?void 0:I.y,z:I==null?void 0:I.z}}})),l&&u){d||(d=ux(t,u)),f||(f=Array.from(new Set(c.map(N=>N.data[u])))),f=f.filter(N=>N!==void 0);const A={};f.forEach(N=>{const I=c.filter(K=>K.data[u]===N).map(K=>t.getNode(K.id));A[N]=cx(I)}),e.centripetalOptions=Object.assign(h,{single:N=>e.clusterNodeStrength(N),leaf:N=>e.clusterNodeStrength(N),others:N=>e.clusterNodeStrength(N),center:N=>{const I=A[N.data[u]];return{x:I==null?void 0:I.x,y:I==null?void 0:I.y,z:I==null?void 0:I.z}}})}const{leaf:v,single:p,others:x}=e.centripetalOptions||{};v&&typeof v!="function"&&(e.centripetalOptions.leaf=()=>v),p&&typeof p!="function"&&(e.centripetalOptions.single=()=>p),x&&typeof x!="function"&&(e.centripetalOptions.others=()=>x)}runOneStep(e,t,n,i,a){const s={},o=e.getAllNodes(),l=e.getAllEdges();if(!(o!=null&&o.length))return;const{monitor:u}=a;if(this.calRepulsive(e,s,a),l&&this.calAttractive(e,s,a),this.calGravity(e,t,s,a),this.updateVelocity(e,s,i,a),u){const c=this.calTotalEnergy(s,o);u({energy:c,nodes:t.getAllNodes(),edges:t.getAllEdges(),iterations:n})}}calTotalEnergy(e,t){if(!(t!=null&&t.length))return 0;let n=0;return t.forEach((i,a)=>{const s=e[i.id].x,o=e[i.id].y,l=this.options.dimensions===3?e[i.id].z:0,u=s*s+o*o+l*l,{mass:c=1}=i.data;n+=c*u*.5}),n}calRepulsive(e,t,n){const{dimensions:i,factor:a,coulombDisScale:s}=n;uC(e,a,s*s,t,i)}calAttractive(e,t,n){const{dimensions:i,nodeSize:a}=n;e.getAllEdges().forEach((s,o)=>{const{source:l,target:u}=s,c=e.getNode(l),h=e.getNode(u);if(!c||!h)return;let d=h.data.x-c.data.x,f=h.data.y-c.data.y,v=i===3?h.data.z-c.data.z:0;!d&&!f&&(d=Math.random()*.01,f=Math.random()*.01,i===3&&!v&&(v=Math.random()*.01));const p=Math.sqrt(d*d+f*f+v*v);if(p<a(c)+a(h))return;const x=d/p,A=f/p,N=v/p,{linkDistance:I=200,edgeStrength:K=200}=s.data||{},z=(I-p)*K,j=c.data.mass||1,Z=h.data.mass||1,vt=1/j,Tt=1/Z,zt=x*z,Qt=A*z,ae=N*z;t[l].x-=zt*vt,t[l].y-=Qt*vt,t[l].z-=ae*vt,t[u].x+=zt*Tt,t[u].y+=Qt*Tt,t[u].z+=ae*Tt})}calGravity(e,t,n,i){const{getCenter:a}=i,s=e.getAllNodes(),o=t.getAllNodes(),l=t.getAllEdges(),{width:u,height:c,center:h,gravity:d,centripetalOptions:f}=i;s&&s.forEach(v=>{const{id:p,data:x}=v,{mass:A,x:N,y:I,z:K}=x,W=t.getNode(p);let z=0,j=0,Z=0,vt=d;const Tt=e.getDegree(p,"in"),zt=e.getDegree(p,"out"),Qt=e.getDegree(p,"both"),ae=a==null?void 0:a(W,Qt);if(ae){const[fe,ce,ct]=ae;z=N-fe,j=I-ce,vt=ct}else z=N-h[0],j=I-h[1],Z=K-h[2];if(vt&&(n[p].x-=vt*z/A,n[p].y-=vt*j/A,n[p].z-=vt*Z/A),f){const{leaf:fe,single:ce,others:ct,center:$}=f,{x:Q,y:It,z:ue,centerStrength:le}=($==null?void 0:$(W,o,l,u,c))||{x:0,y:0,z:0,centerStrength:0};if(!(0,bt.Z)(Q)||!(0,bt.Z)(It))return;const Fe=(N-Q)/A,Qe=(I-It)/A,He=(K-ue)/A;if(le&&(n[p].x-=le*Fe,n[p].y-=le*Qe,n[p].z-=le*He),Qt===0){const vn=ce(W);if(!vn)return;n[p].x-=vn*Fe,n[p].y-=vn*Qe,n[p].z-=vn*He;return}if(Tt===0||zt===0){const vn=fe(W,o,l);if(!vn)return;n[p].x-=vn*Fe,n[p].y-=vn*Qe,n[p].z-=vn*He;return}const tn=ct(W);if(!tn)return;n[p].x-=tn*Fe,n[p].y-=tn*Qe,n[p].z-=tn*He}})}updateVelocity(e,t,n,i){const{damping:a,maxSpeed:s,interval:o,dimensions:l}=i,u=e.getAllNodes();u!=null&&u.length&&u.forEach(c=>{const{id:h}=c;let d=(n[h].x+t[h].x*o)*a||.01,f=(n[h].y+t[h].y*o)*a||.01,v=l===3?(n[h].z+t[h].z*o)*a||.01:0;const p=Math.sqrt(d*d+f*f+v*v);if(p>s){const x=s/p;d=x*d,f=x*f,v=x*v}n[h]={x:d,y:f,z:v}})}updatePosition(e,t,n,i){const{distanceThresholdMode:a,interval:s,dimensions:o}=i,l=t.getAllNodes();if(!(l!=null&&l.length)){this.judgingDistance=0;return}let u=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),l.forEach(c=>{const{id:h}=c,d=e.getNode(h);if((0,bt.Z)(d.data.fx)&&(0,bt.Z)(d.data.fy)){t.mergeNodeData(h,{x:d.data.fx,y:d.data.fy,z:o===3?d.data.fz:void 0});return}const f=n[h].x*s,v=n[h].y*s,p=o===3?n[h].z*s:0;t.mergeNodeData(h,{x:c.data.x+f,y:c.data.y+v,z:c.data.z+p});const x=Math.sqrt(f*f+v*v+p*p);switch(a){case"max":this.judgingDistance<x&&(this.judgingDistance=x);break;case"min":this.judgingDistance>x&&(this.judgingDistance=x);break;default:u=u+x;break}}),(!a||a==="mean")&&(this.judgingDistance=u/l.length)}}const ux=(r,e)=>{const t=r.getAllNodes();if(!(t!=null&&t.length))return{};const n={};return t.forEach((i,a)=>{r.getDegree(i.id,"both")===1&&(n[i.id]=vC(r,"leaf",i,e))}),n},vC=(r,e,t,n)=>{const i=r.getDegree(t.id,"in"),a=r.getDegree(t.id,"out");let s=t,o=[];i===0?(s=r.getSuccessors(t.id)[0],o=r.getNeighbors(s.id)):a===0&&(s=r.getPredecessors(t.id)[0],o=r.getNeighbors(s.id)),o=o.filter(u=>r.getDegree(u.id,"in")===0||r.getDegree(u.id,"out")===0);const l=gC(r,e,n,t,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:l}},gC=(r,e,t,n,i)=>{const a=n.data[t]||"";let s=(i==null?void 0:i.filter(o=>o.data[t]===a))||[];return e==="leaf"&&(s=s.filter(o=>r.getDegree(o.id,"in")===0||r.getDegree(o.id,"out")===0)),s},cx=r=>{const e={x:0,y:0};r.forEach(n=>{const{x:i,y:a}=n.data;e.x+=i||0,e.y+=a||0});const t=r.length||1;return{x:e.x/t,y:e.y/t}},Hp=(r,e)=>e.map(t=>{const{id:n,data:i}=t,a=r.getNode(n);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});var Hs=g(92770);const hx=r=>{const e=[],t=r.length;for(let n=0;n<t;n+=1){e[n]=[];for(let i=0;i<t;i+=1)n===i?e[n][i]=0:r[n][i]===0||!r[n][i]?e[n][i]=1/0:e[n][i]=r[n][i]}for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)for(let a=0;a<t;a+=1)e[i][a]>e[i][n]+e[n][a]&&(e[i][a]=e[i][n]+e[n][a]);return e},dx=(r,e)=>{const{nodes:t,edges:n}=r,i=[],a={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach((s,o)=>{a[s.id]=o;const l=[];i.push(l)}),n==null||n.forEach(s=>{const{source:o,target:l}=s,u=a[o],c=a[l];u===void 0||c===void 0||(i[u][c]=1,e||(i[c][u]=1))}),i},pC=(r,e)=>{const t=[];return r.forEach(n=>{const i=[];n.forEach(a=>{i.push(a*e)}),t.push(i)}),t},mC=r=>{let e=1/0,t=1/0,n=-1/0,i=-1/0;return r.forEach(a=>{let s=a.data.size;vo(s)?s.length===1&&(s=[s[0],s[0]]):(0,bt.Z)(s)?s=[s,s]:(s===void 0||isNaN(s))&&(s=[30,30]);const o=[s[0]/2,s[1]/2],l=a.data.x-o[0],u=a.data.x+o[0],c=a.data.y-o[1],h=a.data.y+o[1];e>l&&(e=l),t>c&&(t=c),n<u&&(n=u),i<h&&(i=h)}),{minX:e,minY:t,maxX:n,maxY:i}},fx=(r,e)=>Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)),Xp=(r,e,t,n="TB",i,a={})=>{if(!(e!=null&&e.length))return;const{stopBranchFn:s,stopAllFn:o}=a;for(let l=0;l<e.length;l++){const u=e[l];if(r.hasNode(u.id)&&!(s!=null&&s(u))){if(o!=null&&o(u))return;n==="TB"&&t(u),Xp(r,r.getChildren(u.id,i),t,n,i,a),n!=="TB"&&t(u)}}},yC={center:[0,0],linkDistance:50};class vx{constructor(e={}){this.options=e,this.id="mds",this.options=Object.assign(Object.assign({},yC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,e,t)})}genericMDSLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a=[0,0],linkDistance:s=50}=i,o=t.getAllNodes(),l=t.getAllEdges();if(!(o!=null&&o.length)||o.length===1)return Ml(t,e,a);const u=dx({nodes:o,edges:l},!1),c=hx(u);bC(c);const h=pC(c,s),d=xC(h),f=[];return d.forEach((p,x)=>{const A=Na(o[x]);A.data.x=p[0]+a[0],A.data.y=p[1]+a[1],f.push(A)}),e&&f.forEach(p=>t.mergeNodeData(p.id,{x:p.data.x,y:p.data.y})),{nodes:f,edges:l}})}}const bC=r=>{let e=-999999;r.forEach(t=>{t.forEach(n=>{n!==1/0&&e<n&&(e=n)})}),r.forEach((t,n)=>{t.forEach((i,a)=>{i===1/0&&(r[n][a]=e)})})},xC=r=>{const t=Hs.y3.mul(Hs.y3.pow(r,2),-.5),n=t.mean("row"),i=t.mean("column"),a=t.mean();t.add(a).subRowVector(n).subColumnVector(i);const s=new Hs.Sc(t),o=Hs.y3.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(l=>Hs.y3.mul([l],[o]).toJSON()[0].splice(0,2))};function Kp(r){return!!r.tick&&!!r.stop}const EC={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},wC={center:[0,0],comboPadding:10,treeKey:"combo"};class SC{constructor(e={}){this.options=e,this.id="comboCombined",this.options=Object.assign(Object.assign({},wC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,e,t)})}genericComboCombinedLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=this.initVals(Object.assign(Object.assign({},this.options),n)),{center:a,treeKey:s,outerLayout:o}=i,l=t.getAllNodes().filter(Z=>!Z.data._isCombo),u=t.getAllNodes().filter(Z=>Z.data._isCombo),c=t.getAllEdges(),h=l==null?void 0:l.length;if(!h||h===1)return Ml(t,e,a);const d=[],f=new Map;l.forEach(Z=>{f.set(Z.id,Z)});const v=new Map;u.forEach(Z=>{v.set(Z.id,Z)});const p=new Map,x=this.getInnerGraphs(t,s,f,v,c,i,p);yield Promise.all(x);const A=new Map,N=[],I=new Map;let K=!0;t.getRoots(s).forEach(Z=>{const vt=p.get(Z.id),Tt=v.get(Z.id)||f.get(Z.id),zt={id:Z.id,data:Object.assign(Object.assign({},Z.data),{x:vt.data.x||Tt.data.x,y:vt.data.y||Tt.data.y,fx:vt.data.fx||Tt.data.fx,fy:vt.data.fy||Tt.data.fy,mass:vt.data.mass||Tt.data.mass,size:vt.data.size})};N.push(zt),A.set(Z.id,!0),!isNaN(zt.data.x)&&zt.data.x!==0&&!isNaN(zt.data.y)&&zt.data.y!==0?K=!1:(zt.data.x=Math.random()*100,zt.data.y=Math.random()*100),Xp(t,[Z],Qt=>{Qt.id!==Z.id&&I.set(Qt.id,Z.id)},"TB",s)});const W=[];c.forEach(Z=>{const vt=I.get(Z.source)||Z.source,Tt=I.get(Z.target)||Z.target;vt!==Tt&&A.has(vt)&&A.has(Tt)&&W.push({id:Z.id,source:vt,target:Tt,data:{}})});let z;if(N!=null&&N.length){if(N.length===1)N[0].data.x=a[0],N[0].data.y=a[1];else{const Z=new _i.k({nodes:N,edges:W}),vt=o||new lx;K&&EC[vt.id]&&(yield(N.length<100?new vx:new Vp).assign(Z));const Tt=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},vt.id==="force"?{gravity:1,factor:4,linkDistance:(zt,Qt,ae)=>{const fe=Math.max(...Qt.data.size)||32,ce=Math.max(...ae.data.size)||32;return fe/2+ce/2+200}}:{});z=yield gx(vt,Z,Tt)}p.forEach(Z=>{var vt;const Tt=z.nodes.find(ae=>ae.id===Z.id);if(Tt){const{x:ae,y:fe}=Tt.data;Z.data.visited=!0,Z.data.x=ae,Z.data.y=fe,d.push({id:Z.id,data:{x:ae,y:fe}})}const{x:zt,y:Qt}=Z.data;(vt=Z.data.nodes)===null||vt===void 0||vt.forEach(ae=>{d.push({id:ae.id,data:{x:ae.data.x+zt,y:ae.data.y+Qt}})})}),p.forEach(({data:Z})=>{const{x:vt,y:Tt,visited:zt,nodes:Qt}=Z;Qt==null||Qt.forEach(ae=>{if(!zt){const fe=d.find(ce=>ce.id===ae.id);fe.data.x+=vt||0,fe.data.y+=Tt||0}})})}return e&&d.forEach(Z=>{t.mergeNodeData(Z.id,{x:Z.data.x,y:Z.data.y})}),{nodes:d,edges:c}})}initVals(e){const t=Object.assign({},e),{nodeSize:n,spacing:i,comboPadding:a}=e;let s,o;if((0,bt.Z)(i)?o=()=>i:(0,At.Z)(i)?o=i:o=()=>0,t.spacing=o,!n)s=u=>{const c=o(u);return u.size?vo(u.size)?((u.size[0]>u.size[1]?u.size[0]:u.size[1])+c)/2:(0,ie.Z)(u.size)?((u.size.width>u.size.height?u.size.width:u.size.height)+c)/2:(u.size+c)/2:32+c/2};else if((0,At.Z)(n))s=u=>{const c=n(u),h=o(u);return vo(u.size)?((u.size[0]>u.size[1]?u.size[0]:u.size[1])+h)/2:((c||32)+h)/2};else if(vo(n)){const c=(n[0]>n[1]?n[0]:n[1])/2;s=h=>c+o(h)/2}else{const u=n/2;s=c=>u+o(c)/2}t.nodeSize=s;let l;return(0,bt.Z)(a)?l=()=>a:vo(a)?l=()=>Math.max.apply(null,a):(0,At.Z)(a)?l=a:l=()=>0,t.comboPadding=l,t}getInnerGraphs(e,t,n,i,a,s,o){const{nodeSize:l,comboPadding:u,spacing:c,innerLayout:h}=s,d=h||new Vp({}),f={center:[0,0],preventOverlap:!0,nodeSpacing:c},v=[],p=x=>{let A=(u==null?void 0:u(x))||10;return vo(A)&&(A=Math.max(...A)),{size:A?[A*2,A*2]:[30,30],padding:A}};return e.getRoots(t).forEach(x=>{o.set(x.id,{id:x.id,data:{nodes:[],size:p(x).size}});let A=Promise.resolve();Xp(e,[x],N=>{var I;if(!N.data._isCombo)return;const{size:K,padding:W}=p(N);if(!(!((I=e.getChildren(N.id,t))===null||I===void 0)&&I.length))o.set(N.id,{id:N.id,data:Object.assign(Object.assign({},N.data),{size:K})});else{const z=o.get(N.id);o.set(N.id,{id:N.id,data:Object.assign({nodes:[]},z==null?void 0:z.data)});const j=new Map,Z=e.getChildren(N.id,t).map(zt=>{if(zt.data._isCombo)return o.has(zt.id)||o.set(zt.id,{id:zt.id,data:Object.assign({},zt.data)}),j.set(zt.id,!0),o.get(zt.id);const Qt=n.get(zt.id)||i.get(zt.id);return j.set(zt.id,!0),{id:zt.id,data:Object.assign(Object.assign({},Qt.data),zt.data)}}),vt={nodes:Z,edges:a.filter(zt=>j.has(zt.source)&&j.has(zt.target))};let Tt=1/0;Z.forEach(zt=>{var Qt;let{size:ae}=zt.data;ae||(ae=((Qt=o.get(zt.id))===null||Qt===void 0?void 0:Qt.data.size)||(l==null?void 0:l(zt))||[30,30]),(0,bt.Z)(ae)&&(ae=[ae,ae]);const[fe,ce]=ae;Tt>fe&&(Tt=fe),Tt>ce&&(Tt=ce),zt.data.size=ae}),A=A.then(()=>Jn(this,void 0,void 0,function*(){const zt=new _i.k(vt);yield gx(d,zt,f,!0);const{minX:Qt,minY:ae,maxX:fe,maxY:ce}=mC(Z),ct={x:(fe+Qt)/2,y:(ce+ae)/2};vt.nodes.forEach(Q=>{Q.data.x-=ct.x,Q.data.y-=ct.y});const $=[Math.max(fe-Qt,Tt)+W*2,Math.max(ce-ae,Tt)+W*2];o.get(N.id).data.size=$,o.get(N.id).data.nodes=Z}))}return!0},"BT",t),v.push(A)}),v}}function gx(r,e,t,n){var i;return Jn(this,void 0,void 0,function*(){return Kp(r)?(r.execute(e,t),r.stop(),r.tick((i=t.iterations)!==null&&i!==void 0?i:300)):n?yield r.assign(e,t):yield r.execute(e,t)})}var _C=g(56561),MC=g(65475),kC=g(46846),TC=g(89281),OC=g(61217),AC=g(70341),CC=g(12688),PC=g(80616);class NC{constructor(e){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:_C.Z,manyBody:MC.Z,center:kC.Z,collide:TC.Z,radial:OC.Z,x:AC.Z,y:CC.Z},this.options={link:{id:t=>t.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},(0,Ta.Z)(this.options,e),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericLayout(!0,e,t)})}stop(){this.simulation.stop()}tick(e){return this.simulation.tick(e),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(e,t){const n=this.context.nodes.find(i=>i.id===e);n&&t.forEach((i,a)=>{if(typeof i=="number"||i===null){const s=["fx","fy","fz"][a];n[s]=i}})}getOptions(e){var t,n;const i=(0,Ta.Z)({},this.options,e);return i.collide&&((t=i.collide)===null||t===void 0?void 0:t.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(n=i.nodeSize)!==null&&n!==void 0?n:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(e,t,n){var i;return Jn(this,void 0,void 0,function*(){const a=this.getOptions(n),s=t.getAllNodes().map(({id:c,data:h})=>Object.assign(Object.assign({id:c},h),(0,El.Z)(h.data,this.config.inputNodeAttrs))),o=t.getAllEdges().map(c=>Object.assign({},c));Object.assign(this.context,{assign:e,nodes:s,edges:o,graph:t});const l=new Promise(c=>{this.resolver=c}),u=this.setSimulation(a);return u.nodes(s),(i=u.force("link"))===null||i===void 0||i.links(o),l})}getResult(){const{assign:e,nodes:t,edges:n,graph:i}=this.context,a=t.map(o=>({id:o.id,data:Object.assign(Object.assign({},o.data),(0,El.Z)(o,this.config.outputNodeAttrs))})),s=n.map(({id:o,source:l,target:u,data:c})=>({id:o,source:typeof l=="object"?l.id:l,target:typeof u=="object"?u.id:u,data:c}));return e&&a.forEach(o=>i.mergeNodeData(o.id,o.data)),{nodes:a,edges:s}}initSimulation(){return(0,PC.Z)()}setSimulation(e){const t=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=t.on("tick",()=>{var n;return(n=e.onTick)===null||n===void 0?void 0:n.call(e,this.getResult())}).on("end",()=>{var n;return(n=this.resolver)===null||n===void 0?void 0:n.call(this,this.getResult())})),px(t,this.config.simulationAttrs.map(n=>[n,e[n]])),Object.entries(this.forceMap).forEach(([n,i])=>{const a=n;if(e[n]){let s=t.force(a);s||(s=i(),t.force(a,s)),px(s,Object.entries(e[a]))}else t.force(a,null)}),t}}const px=(r,e)=>e.reduce((t,[n,i])=>!t[n]||i===void 0?t:t[n].call(r,i),r);var mx=g(70681),RC=g.n(mx);class Sf{constructor(e){this.id="dagre",this.options={},Object.assign(this.options,Sf.defaultOptions,e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,Object.assign(Object.assign({},this.options),t))})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,Object.assign(Object.assign({},this.options),t))})}genericDagreLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const{nodeSize:i}=n,a=new mx.graphlib.Graph;a.setGraph(n),a.setDefaultEdgeLabel(()=>({}));const s=t.getAllNodes(),o=t.getAllEdges();[...s,...o].some(({id:u})=>(0,bt.Z)(u))&&console.error("Dagre layout only support string id, it will convert number to string."),t.getAllNodes().forEach(u=>{const{id:c}=u,h=Object.assign({},u.data);if(i!==void 0){const[d,f]=Ic((0,At.Z)(i)?i(u):i);Object.assign(h,{width:d,height:f})}a.setNode(c.toString(),h)}),t.getAllEdges().forEach(({id:u,source:c,target:h})=>{a.setEdge(c.toString(),h.toString(),{id:u})}),RC().layout(a);const l={nodes:[],edges:[]};return a.nodes().forEach(u=>{const c=a.node(u);l.nodes.push({id:u,data:c}),e&&t.mergeNodeData(u,c)}),a.edges().forEach(u=>{const c=a.edge(u),{id:h}=c,d=Eb(c,["id"]),{v:f,w:v}=u;l.edges.push({id:h,source:f,target:v,data:d}),e&&t.mergeEdgeData(h,d)}),l})}}Sf.defaultOptions={};class $p{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){const t=this.rx-e.rx,n=this.ry-e.ry;return Math.hypot(t,n)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){const t=e.rx-this.rx,n=e.ry-this.ry;let i=Math.hypot(t,n);i=i<1e-4?1e-4:i;const a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*n/i}in(e){return e.contains(this.rx,this.ry)}add(e){const t=this.mass+e.mass,n=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,s={rx:n,ry:i,mass:t,degree:a};return new $p(s)}}class mu{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){const n=this.length/2;return e<=this.xmid+n&&e>=this.xmid-n&&t<=this.ymid+n&&t>=this.ymid-n}NW(){const e=this.xmid-this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new mu(i)}NE(){const e=this.xmid+this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new mu(i)}SW(){const e=this.xmid-this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new mu(i)}SE(){const e=this.xmid+this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new mu(i)}}class yu{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new yu(this.quad.NW()),this.NE=new yu(this.quad.NE()),this.SW=new yu(this.quad.SW()),this.SE=new yu(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))}_putBody(e){this.quad&&(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{const t=this.quad?this.quad.getLength():0,n=this.body.distanceTo(e);t/n<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}}}const LC={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};class DC{constructor(e={}){this.options=e,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},LC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,e,t)})}genericForceAtlas2Layout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=t.getAllEdges(),a=t.getAllNodes(),s=this.formatOptions(n,a.length),{width:o,height:l,prune:u,maxIteration:c,nodeSize:h,center:d}=s;if(!(a!=null&&a.length)||a.length===1)return Ml(t,e,d);const f=a.map(A=>Na(A,[o,l])),v=i.filter(A=>{const{source:N,target:I}=A;return N!==I}),p=new _i.k({nodes:f,edges:v}),x=this.getSizes(p,h);if(this.run(p,t,c,x,e,s),u){for(let N=0;N<v.length;N+=1){const{source:I,target:K}=v[N],W=p.getDegree(I),z=p.getDegree(I);if(W<=1){const j=p.getNode(K);p.mergeNodeData(I,{x:j.data.x,y:j.data.y})}else if(z<=1){const j=p.getNode(I);p.mergeNodeData(K,{x:j.data.x,y:j.data.y})}}const A=Object.assign(Object.assign({},s),{prune:!1,barnesHut:!1});this.run(p,t,100,x,e,A)}return{nodes:f,edges:i}})}getSizes(e,t){const n=e.getAllNodes(),i={};for(let a=0;a<n.length;a+=1){const s=n[a];i[s.id]=Up(t,void 0)(s)}return i}formatOptions(e={},t){const n=Object.assign(Object.assign({},this.options),e),{center:i,width:a,height:s,barnesHut:o,prune:l,maxIteration:u,kr:c,kg:h}=n;return n.width=!a&&typeof window!="undefined"?window.innerWidth:a,n.height=!s&&typeof window!="undefined"?window.innerHeight:s,n.center=i||[n.width/2,n.height/2],o===void 0&&t>250&&(n.barnesHut=!0),l===void 0&&t>100&&(n.prune=!0),u===0&&!l?(n.maxIteration=250,t<=200&&t>100?n.maxIteration=1e3:t>200&&(n.maxIteration=1200)):u===0&&l&&(n.maxIteration=100,t<=200&&t>100?n.maxIteration=500:t>200&&(n.maxIteration=950)),c||(n.kr=50,t>100&&t<=500?n.kr=20:t>500&&(n.kr=1)),h||(n.kg=20,t>100&&t<=500?n.kg=10:t>500&&(n.kg=1)),n}run(e,t,n,i,a,s){const{kr:o,barnesHut:l,onTick:u}=s,c=e.getAllNodes();let h=0,d=n;const f={},v={},p={};for(let x=0;x<c.length;x+=1){const{data:A,id:N}=c[x];if(f[N]=[0,0],l){const I={id:x,rx:A.x,ry:A.y,mass:1,g:o,degree:e.getDegree(N)};p[N]=new $p(I)}}for(;d>0;)h=this.oneStep(e,{iter:d,preventOverlapIters:50,krPrime:100,sg:h,forces:f,preForces:v,bodies:p,sizes:i},s),d--,u==null||u({nodes:c,edges:t.getAllEdges()});return e}oneStep(e,t,n){const{iter:i,preventOverlapIters:a,krPrime:s,sg:o,preForces:l,bodies:u,sizes:c}=t;let{forces:h}=t;const{preventOverlap:d,barnesHut:f}=n,v=e.getAllNodes();for(let p=0;p<v.length;p+=1){const{id:x}=v[p];l[x]=[...h[x]],h[x]=[0,0]}return h=this.getAttrForces(e,i,a,c,h,n),f&&(d&&i>a||!d)?h=this.getOptRepGraForces(e,h,u,n):h=this.getRepGraForces(e,i,a,h,s,c,n),this.updatePos(e,h,l,o,n)}getAttrForces(e,t,n,i,a,s){const{preventOverlap:o,dissuadeHubs:l,mode:u,prune:c}=s,h=e.getAllEdges();for(let d=0;d<h.length;d+=1){const{source:f,target:v}=h[d],p=e.getNode(f),x=e.getNode(v),A=e.getDegree(f),N=e.getDegree(v);if(c&&(A<=1||N<=1))continue;const I=[x.data.x-p.data.x,x.data.y-p.data.y];let K=Math.hypot(I[0],I[1]);K=K<1e-4?1e-4:K,I[0]=I[0]/K,I[1]=I[1]/K,o&&t<n&&(K=K-i[f]-i[v]);let W=K,z=W;u==="linlog"&&(W=Math.log(1+K),z=W),l&&(W=K/A,z=K/N),o&&t<n&&K<=0?(W=0,z=0):o&&t<n&&K>0&&(W=K,z=K),a[f][0]+=W*I[0],a[v][0]-=z*I[0],a[f][1]+=W*I[1],a[v][1]-=z*I[1]}return a}getOptRepGraForces(e,t,n,i){const{kg:a,center:s,prune:o}=i,l=e.getAllNodes(),u=l.length;let c=9e10,h=-9e10,d=9e10,f=-9e10;for(let N=0;N<u;N+=1){const{id:I,data:K}=l[N];o&&e.getDegree(I)<=1||(n[I].setPos(K.x,K.y),K.x>=h&&(h=K.x),K.x<=c&&(c=K.x),K.y>=f&&(f=K.y),K.y<=d&&(d=K.y))}const v=Math.max(h-c,f-d),p={xmid:(h+c)/2,ymid:(f+d)/2,length:v,massCenter:s,mass:u},x=new mu(p),A=new yu(x);for(let N=0;N<u;N+=1){const{id:I}=l[N];o&&e.getDegree(I)<=1||n[I].in(x)&&A.insert(n[I])}for(let N=0;N<u;N+=1){const{id:I,data:K}=l[N],W=e.getDegree(I);if(o&&W<=1)continue;n[I].resetForce(),A.updateForce(n[I]),t[I][0]-=n[I].fx,t[I][1]-=n[I].fy;const z=[K.x-s[0],K.y-s[1]];let j=Math.hypot(z[0],z[1]);j=j<1e-4?1e-4:j,z[0]=z[0]/j,z[1]=z[1]/j;const Z=a*(W+1);t[I][0]-=Z*z[0],t[I][1]-=Z*z[1]}return t}getRepGraForces(e,t,n,i,a,s,o){const{preventOverlap:l,kr:u,kg:c,center:h,prune:d}=o,f=e.getAllNodes(),v=f.length;for(let p=0;p<v;p+=1){const x=f[p],A=e.getDegree(x.id);for(let W=p+1;W<v;W+=1){const z=f[W],j=e.getDegree(z.id);if(d&&(A<=1||j<=1))continue;const Z=[z.data.x-x.data.x,z.data.y-x.data.y];let vt=Math.hypot(Z[0],Z[1]);vt=vt<1e-4?1e-4:vt,Z[0]=Z[0]/vt,Z[1]=Z[1]/vt,l&&t<n&&(vt=vt-s[x.id]-s[z.id]);let Tt=u*(A+1)*(j+1)/vt;l&&t<n&&vt<0?Tt=a*(A+1)*(j+1):l&&t<n&&vt===0?Tt=0:l&&t<n&&vt>0&&(Tt=u*(A+1)*(j+1)/vt),i[x.id][0]-=Tt*Z[0],i[z.id][0]+=Tt*Z[0],i[x.id][1]-=Tt*Z[1],i[z.id][1]+=Tt*Z[1]}const N=[x.data.x-h[0],x.data.y-h[1]],I=Math.hypot(N[0],N[1]);N[0]=N[0]/I,N[1]=N[1]/I;const K=c*(A+1);i[x.id][0]-=K*N[0],i[x.id][1]-=K*N[1]}return i}updatePos(e,t,n,i,a){const{ks:s,tao:o,prune:l,ksmax:u}=a,c=e.getAllNodes(),h=c.length,d=[],f=[];let v=0,p=0,x=i;for(let N=0;N<h;N+=1){const{id:I}=c[N],K=e.getDegree(I);if(l&&K<=1)continue;const W=[t[I][0]-n[I][0],t[I][1]-n[I][1]],z=Math.hypot(W[0],W[1]),j=[t[I][0]+n[I][0],t[I][1]+n[I][1]],Z=Math.hypot(j[0],j[1]);d[N]=z,f[N]=Z/2,v+=(K+1)*d[N],p+=(K+1)*f[N]}const A=x;x=o*p/v,A!==0&&(x=x>1.5*A?1.5*A:x);for(let N=0;N<h;N+=1){const{id:I,data:K}=c[N],W=e.getDegree(I);if(l&&W<=1||(0,bt.Z)(K.fx)&&(0,bt.Z)(K.fy))continue;let z=s*x/(1+x*Math.sqrt(d[N])),j=Math.hypot(t[I][0],t[I][1]);j=j<1e-4?1e-4:j;const Z=u/j;z=z>Z?Z:z;const vt=z*t[I][0],Tt=z*t[I][1];e.mergeNodeData(I,{x:K.x+vt,y:K.y+Tt})}return x}}const IC={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},FC=800;class BC{constructor(e={}){this.options=e,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},IC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;n<e;n++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),t}genericFruchtermanLayout(e,t,n){return Jn(this,void 0,void 0,function*(){if(this.running)return;const i=this.formatOptions(n),{dimensions:a,width:s,height:o,center:l,clustering:u,nodeClusterBy:c,maxIteration:h,onTick:d}=i,f=t.getAllNodes(),v=t.getAllEdges();if(!(f!=null&&f.length)){const I={nodes:[],edges:v};return this.lastResult=I,I}if(f.length===1){e&&t.mergeNodeData(f[0].id,{x:l[0],y:l[1],z:a===3?l[2]:void 0});const I={nodes:[Object.assign(Object.assign({},f[0]),{data:Object.assign(Object.assign({},f[0].data),{x:l[0],y:l[1],z:a===3?l[2]:void 0})})],edges:v};return this.lastResult=I,I}const p=f.map(I=>Na(I,[s,o])),x=new _i.k({nodes:p,edges:v}),A={};if(u&&p.forEach(I=>{const K=I.data[c];A[K]||(A[K]={name:K,cx:0,cy:0,count:0})}),this.lastLayoutNodes=p,this.lastLayoutEdges=v,this.lastAssign=e,this.lastGraph=x,this.lastOptions=i,this.lastClusterMap=A,typeof window=="undefined")return;let N=0;return new Promise(I=>{this.timeInterval=window.setInterval(()=>{if(!this.running){I({nodes:p,edges:v});return}this.runOneStep(x,A,i),e&&p.forEach(({id:K,data:W})=>t.mergeNodeData(K,{x:W.x,y:W.y,z:a===3?W.z:void 0})),d==null||d({nodes:p,edges:v}),N++,N>=h&&(window.clearInterval(this.timeInterval),I({nodes:p,edges:v}))},0),this.running=!0})})}formatOptions(e={}){const t=Object.assign(Object.assign({},this.options),e),{clustering:n,nodeClusterBy:i}=t,{center:a,width:s,height:o}=t;return t.width=!s&&typeof window!="undefined"?window.innerWidth:s,t.height=!o&&typeof window!="undefined"?window.innerHeight:o,t.center=a||[t.width/2,t.height/2],t.clustering=n&&!!i,t}runOneStep(e,t,n){const{dimensions:i,height:a,width:s,gravity:o,center:l,speed:u,clustering:c,nodeClusterBy:h,clusterGravity:d}=n,f=a*s,v=Math.sqrt(f)/10,p=e.getAllNodes(),x=f/(p.length+1),A=Math.sqrt(x),N={};if(this.applyCalculate(e,N,A,x),c){for(const K in t)t[K].cx=0,t[K].cy=0,t[K].count=0;p.forEach(K=>{const{data:W}=K,z=t[W[h]];(0,bt.Z)(W.x)&&(z.cx+=W.x),(0,bt.Z)(W.y)&&(z.cy+=W.y),z.count++});for(const K in t)t[K].cx/=t[K].count,t[K].cy/=t[K].count;const I=d||o;p.forEach((K,W)=>{const{id:z,data:j}=K;if(!(0,bt.Z)(j.x)||!(0,bt.Z)(j.y))return;const Z=t[j[h]],vt=Math.sqrt((j.x-Z.cx)*(j.x-Z.cx)+(j.y-Z.cy)*(j.y-Z.cy)),Tt=A*I;N[z].x-=Tt*(j.x-Z.cx)/vt,N[z].y-=Tt*(j.y-Z.cy)/vt})}p.forEach((I,K)=>{const{id:W,data:z}=I;if(!(0,bt.Z)(z.x)||!(0,bt.Z)(z.y))return;const j=.01*A*o;N[W].x-=j*(z.x-l[0]),N[W].y-=j*(z.y-l[1]),i===3&&(N[W].z-=j*(z.z-l[2]))}),p.forEach((I,K)=>{const{id:W,data:z}=I;if((0,bt.Z)(z.fx)&&(0,bt.Z)(z.fy)){z.x=z.fx,z.y=z.fy,i===3&&(z.z=z.fz);return}if(!(0,bt.Z)(z.x)||!(0,bt.Z)(z.y))return;const j=Math.sqrt(N[W].x*N[W].x+N[W].y*N[W].y+(i===3?N[W].z*N[W].z:0));if(j>0){const Z=Math.min(v*(u/FC),j);e.mergeNodeData(W,{x:z.x+N[W].x/j*Z,y:z.y+N[W].y/j*Z,z:i===3?z.z+N[W].z/j*Z:void 0})}})}applyCalculate(e,t,n,i){this.calRepulsive(e,t,i),this.calAttractive(e,t,n)}calRepulsive(e,t,n){const i=e.getAllNodes();i.forEach(({data:a,id:s},o)=>{t[s]={x:0,y:0,z:0},i.forEach(({data:l,id:u},c)=>{if(o<=c||!(0,bt.Z)(a.x)||!(0,bt.Z)(l.x)||!(0,bt.Z)(a.y)||!(0,bt.Z)(l.y))return;let h=a.x-l.x,d=a.y-l.y,f=this.options.dimensions===3?a.z-l.z:0,v=h*h+d*d+f*f;v===0&&(v=1,h=.01,d=.01,f=.01);const p=n/v,x=h*p,A=d*p,N=f*p;t[s].x+=x,t[s].y+=A,t[u].x-=x,t[u].y-=A,this.options.dimensions===3&&(t[s].z+=N,t[u].z-=N)})})}calAttractive(e,t,n){e.getAllEdges().forEach(a=>{const{source:s,target:o}=a;if(!s||!o||s===o)return;const{data:l}=e.getNode(s),{data:u}=e.getNode(o);if(!(0,bt.Z)(u.x)||!(0,bt.Z)(l.x)||!(0,bt.Z)(u.y)||!(0,bt.Z)(l.y))return;const c=u.x-l.x,h=u.y-l.y,d=this.options.dimensions===3?u.z-l.z:0,f=Math.sqrt(c*c+h*h+d*d)/n,v=c*f,p=h*f,x=d*f;t[s].x+=v,t[s].y+=p,t[o].x-=v,t[o].y-=p,this.options.dimensions===3&&(t[s].z+=x,t[o].z-=x)})}}const zC={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};class jC{constructor(e={}){this.options=e,this.id="grid",this.options=Object.assign(Object.assign({},zC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericGridLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,e,t)})}genericGridLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{begin:a=[0,0],condense:s,preventOverlapPadding:o,preventOverlap:l,rows:u,cols:c,nodeSpacing:h,nodeSize:d,width:f,height:v,position:p}=i;let{sortBy:x}=i;const A=t.getAllNodes(),N=t.getAllEdges(),I=A==null?void 0:A.length;if(!I||I===1)return Ml(t,e,a);const K=A.map(ce=>Na(ce));x!=="id"&&(!(0,Gt.Z)(x)||K[0].data[x]===void 0)&&(x="degree"),x==="degree"?K.sort((ce,ct)=>t.getDegree(ct.id,"both")-t.getDegree(ce.id,"both")):x==="id"?K.sort((ce,ct)=>(0,bt.Z)(ct.id)&&(0,bt.Z)(ce.id)?ct.id-ce.id:`${ce.id}`.localeCompare(`${ct.id}`)):K.sort((ce,ct)=>ct.data[x]-ce.data[x]);const W=!f&&typeof window!="undefined"?window.innerWidth:f,z=!v&&typeof window!="undefined"?window.innerHeight:v,j=I,Z={rows:u,cols:c};if(u!=null&&c!=null)Z.rows=u,Z.cols=c;else if(u!=null&&c==null)Z.rows=u,Z.cols=Math.ceil(j/Z.rows);else if(u==null&&c!=null)Z.cols=c,Z.rows=Math.ceil(j/Z.cols);else{const ce=Math.sqrt(j*z/W);Z.rows=Math.round(ce),Z.cols=Math.round(W/z*ce)}if(Z.rows=Math.max(Z.rows,1),Z.cols=Math.max(Z.cols,1),Z.cols*Z.rows>j){const ce=_f(Z),ct=Mf(Z);(ce-1)*ct>=j?_f(Z,ce-1):(ct-1)*ce>=j&&Mf(Z,ct-1)}else for(;Z.cols*Z.rows<j;){const ce=_f(Z),ct=Mf(Z);(ct+1)*ce>=j?Mf(Z,ct+1):_f(Z,ce+1)}let vt=s?0:W/Z.cols,Tt=s?0:z/Z.rows;if(l||h){const ce=_l(10,h),ct=Wp(30,d,!1);K.forEach($=>{(!$.data.x||!$.data.y)&&($.data.x=0,$.data.y=0);const Q=t.getNode($.id),[It,ue]=Ic(ct(Q)||30),le=ce!==void 0?ce($):o,Fe=It+le,Qe=ue+le;vt=Math.max(vt,Fe),Tt=Math.max(Tt,Qe)})}const zt={},Qt={row:0,col:0},ae={};for(let ce=0;ce<K.length;ce++){const ct=K[ce];let $;if(p&&($=p(t.getNode(ct.id))),$&&($.row!==void 0||$.col!==void 0)){const Q={row:$.row,col:$.col};if(Q.col===void 0)for(Q.col=0;Qp(zt,Q);)Q.col++;else if(Q.row===void 0)for(Q.row=0;Qp(zt,Q);)Q.row++;ae[ct.id]=Q,yx(zt,Q)}GC(ct,a,vt,Tt,ae,Z,Qt,zt)}const fe={nodes:K,edges:N};return e&&K.forEach(ce=>{t.mergeNodeData(ce.id,{x:ce.data.x,y:ce.data.y})}),fe})}}const _f=(r,e)=>{let t;const n=r.rows||5,i=r.cols||5;return e==null?t=Math.min(n,i):Math.min(n,i)===r.rows?r.rows=e:r.cols=e,t},Mf=(r,e)=>{let t;const n=r.rows||5,i=r.cols||5;return e==null?t=Math.max(n,i):Math.max(n,i)===r.rows?r.rows=e:r.cols=e,t},Qp=(r,e)=>r[`c-${e.row}-${e.col}`]||!1,yx=(r,e)=>r[`c-${e.row}-${e.col}`]=!0,bx=(r,e)=>{const t=r.cols||5;e.col++,e.col>=t&&(e.col=0,e.row++)},GC=(r,e,t,n,i,a,s,o)=>{let l,u;const c=i[r.id];if(c)l=c.col*t+t/2+e[0],u=c.row*n+n/2+e[1];else{for(;Qp(o,s);)bx(a,s);l=s.col*t+t/2+e[0],u=s.row*n+n/2+e[1],yx(o,s),bx(a,s)}r.data.x=l,r.data.y=u},WC=(r,e,t)=>{try{const n=Hs.y3.mul(Hs.y3.pow(e,2),-.5),i=n.mean("row"),a=n.mean("column"),s=n.mean();n.add(s).subRowVector(i).subColumnVector(a);const o=new Hs.Sc(n),l=Hs.y3.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(u=>Hs.y3.mul([u],[l]).toJSON()[0].splice(0,r))}catch(n){const i=[];for(let a=0;a<e.length;a++){const s=Math.random()*t,o=Math.random()*t;i.push([s,o])}return i}},UC=800,ZC={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},VC=(r,e)=>{const t=Object.assign(Object.assign({},ZC),e),{positions:n,iterations:i,width:a,k:s,speed:o=100,strictRadial:l,focusIdx:u,radii:c=[],nodeSizeFunc:h}=t,d=r.getAllNodes(),f=[],v=a/10;for(let p=0;p<i;p++)n.forEach((x,A)=>{f[A]={x:0,y:0}}),YC(d,n,f,s,c,h),HC(n,f,o,l,u,v,a,c);return n},YC=(r,e,t,n,i,a)=>{e.forEach((s,o)=>{t[o]={x:0,y:0},e.forEach((l,u)=>{if(o===u||i[o]!==i[u])return;let c=s.x-l.x,h=s.y-l.y,d=Math.sqrt(c*c+h*h);if(d===0){d=1;const f=o>u?1:-1;c=.01*f,h=.01*f}if(d<a(r[o])/2+a(r[u])/2){const f=n*n/d;t[o].x+=c/d*f,t[o].y+=h/d*f}})})},HC=(r,e,t,n,i,a,s,o)=>{const l=a||s/10;return n&&e.forEach((u,c)=>{const h=r[c].x-r[i].x,d=r[c].y-r[i].y,f=Math.sqrt(h*h+d*d);let v=d/f,p=-h/f;const x=Math.sqrt(u.x*u.x+u.y*u.y);let A=Math.acos((v*u.x+p*u.y)/x);A>Math.PI/2&&(A-=Math.PI/2,v*=-1,p*=-1);const N=Math.cos(A)*x;u.x=v*N,u.y=p*N}),r.forEach((u,c)=>{if(c===i)return;const h=Math.sqrt(e[c].x*e[c].x+e[c].y*e[c].y);if(h>0&&c!==i){const d=Math.min(l*(t/UC),h);if(u.x+=e[c].x/h*d,u.y+=e[c].y/h*d,n){let f=u.x-r[i].x,v=u.y-r[i].y;const p=Math.sqrt(f*f+v*v);f=f/p*o[c],v=v/p*o[c],u.x=r[i].x+f,u.y=r[i].y+v}}}),r},XC={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class KC{constructor(e={}){this.options=e,this.id="radial",this.options=Object.assign(Object.assign({},XC),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,e,t)})}genericRadialLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,focusNode:l,unitRadius:u,nodeSize:c,nodeSpacing:h,strictRadial:d,preventOverlap:f,maxPreventOverlapIteration:v,sortBy:p,linkDistance:x=50,sortStrength:A=10,maxIteration:N=1e3}=i,I=t.getAllNodes(),K=t.getAllEdges(),W=!a&&typeof window!="undefined"?window.innerWidth:a,z=!s&&typeof window!="undefined"?window.innerHeight:s,j=o||[W/2,z/2];if(!(I!=null&&I.length)||I.length===1)return Ml(t,e,j);let Z=I[0];if((0,Gt.Z)(l)){for(let _n=0;_n<I.length;_n++)if(I[_n].id===l){Z=I[_n];break}}else Z=l||I[0];const vt=JC(I,Z.id),Tt=dx({nodes:I,edges:K},!1),zt=hx(Tt),Qt=tP(zt,vt);qC(zt,vt,Qt+1);const ae=zt[vt];let fe=W-j[0]>j[0]?j[0]:W-j[0],ce=z-j[1]>j[1]?j[1]:z-j[1];fe===0&&(fe=W/2),ce===0&&(ce=z/2);const ct=Math.min(fe,ce),$=Math.max(...ae),Q=[],It=u||ct/$;ae.forEach((_n,kr)=>{Q[kr]=_n*It});const ue=$C(I,zt,x,Q,It,p,A),le=QC(ue),Fe=WC(x,ue,x);let Qe=Fe.map(([_n,kr])=>({x:(isNaN(_n)?Math.random()*x:_n)-Fe[vt][0],y:(isNaN(kr)?Math.random()*x:kr)-Fe[vt][1]}));this.run(N,Qe,le,ue,Q,vt);let He;if(f){He=Up(c,h);const _n={nodes:I,nodeSizeFunc:He,positions:Qe,radii:Q,height:z,width:W,strictRadial:!!d,focusIdx:vt,iterations:v||200,k:Qe.length/4.5};Qe=VC(t,_n)}const tn=[];return Qe.forEach((_n,kr)=>{const Rr=Na(I[kr]);Rr.data.x=_n.x+j[0],Rr.data.y=_n.y+j[1],tn.push(Rr)}),e&&tn.forEach(_n=>t.mergeNodeData(_n.id,{x:_n.data.x,y:_n.data.y})),{nodes:tn,edges:K}})}run(e,t,n,i,a,s){for(let o=0;o<=e;o++){const l=o/e;this.oneIteration(l,t,a,i,n,s)}}oneIteration(e,t,n,i,a,s){const o=1-e;t.forEach((l,u)=>{const c=fx(l,{x:0,y:0}),h=c===0?0:1/c;if(u===s)return;let d=0,f=0,v=0;t.forEach((x,A)=>{if(u===A)return;const N=fx(l,x),I=N===0?0:1/N,K=i[A][u];v+=a[u][A],d+=a[u][A]*(x.x+K*(l.x-x.x)*I),f+=a[u][A]*(x.y+K*(l.y-x.y)*I)});const p=n[u]===0?0:1/n[u];v*=o,v+=e*p*p,d*=o,d+=e*p*l.x*h,l.x=d/v,f*=o,f+=e*p*l.y*h,l.y=f/v})}}const $C=(r,e,t,n,i,a,s)=>{if(!r)return[];const o=[];if(e){const l={};e.forEach((u,c)=>{const h=[];u.forEach((d,f)=>{var v,p;if(c===f)h.push(0);else if(n[c]===n[f])if(a==="data")h.push(d*(Math.abs(c-f)*s)/(n[c]/i));else if(a){let x,A;if(l[r[c].id])x=l[r[c].id];else{const N=(a==="id"?r[c].id:(v=r[c].data)===null||v===void 0?void 0:v[a])||0;(0,Gt.Z)(N)?x=N.charCodeAt(0):x=N,l[r[c].id]=x}if(l[r[f].id])A=l[r[f].id];else{const N=(a==="id"?r[f].id:(p=r[f].data)===null||p===void 0?void 0:p[a])||0;(0,Gt.Z)(N)?A=N.charCodeAt(0):A=N,l[r[f].id]=A}h.push(d*(Math.abs(x-A)*s)/(n[c]/i))}else h.push(d*t/(n[c]/i));else{const x=(t+i)/2;h.push(d*x)}}),o.push(h)})}return o},QC=r=>{const e=r.length,t=r[0].length,n=[];for(let i=0;i<e;i++){const a=[];for(let s=0;s<t;s++)r[i][s]!==0?a.push(1/(r[i][s]*r[i][s])):a.push(0);n.push(a)}return n},JC=(r,e)=>{let t=-1;return r.forEach((n,i)=>{n.id===e&&(t=i)}),Math.max(t,0)},qC=(r,e,t)=>{const n=r.length;for(let i=0;i<n;i++)if(r[e][i]===1/0){r[e][i]=t,r[i][e]=t;for(let a=0;a<n;a++)r[i][a]!==1/0&&r[e][a]===1/0&&(r[e][a]=t+r[i][a],r[a][e]=t+r[i][a])}for(let i=0;i<n;i++)if(i!==e){for(let a=0;a<n;a++)if(r[i][a]===1/0){let s=Math.abs(r[e][i]-r[e][a]);s=s===0?1:s,r[i][a]=s}}},tP=(r,e)=>{let t=0;for(let n=0;n<r[e].length;n++)r[e][n]!==1/0&&(t=r[e][n]>t?r[e][n]:t);return t},eP={center:[0,0],width:300,height:300};class nP{constructor(e={}){this.options=e,this.id="random",this.options=Object.assign(Object.assign({},eP),e)}execute(e,t){return Jn(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,e,t)})}assign(e,t){return Jn(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,e,t)})}genericRandomLayout(e,t,n){return Jn(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o}=i,l=t.getAllNodes(),u=.9,c=!s&&typeof window!="undefined"?window.innerWidth:s,h=!o&&typeof window!="undefined"?window.innerHeight:o,d=a||[c/2,h/2],f=[];return l&&l.forEach(p=>{f.push({id:p.id,data:{x:(Math.random()-.5)*u*c+d[0],y:(Math.random()-.5)*u*h+d[1]}})}),e&&f.forEach(p=>t.mergeNodeData(p.id,{x:p.data.x,y:p.data.y})),{nodes:f,edges:t.getAllEdges()}})}}var Jp=g(92426),qp=g(35278);class zi extends Kg{}function bu(r,e=!0,t){const n=document.createElement("div");return n.setAttribute("class",`g6-${r}`),Object.assign(n.style,{position:"absolute",display:"block"}),e&&Object.assign(n.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),t&&Object.assign(n.style,t),n}function t0(r,e="div",t={},n="",i=document.body){const a=document.getElementById(r);a&&a.remove();const s=document.createElement(e);return s.innerHTML=n,s.id=r,Object.assign(s.style,t),i.appendChild(s),s}var rP=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class kf extends zi{constructor(e,t){super(e,Object.assign({},kf.defaultOptions,t)),this.$element=bu("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return rP(this,void 0,void 0,function*(){t.update.call(this,e),Object.assign(this.$element.style,(0,qp.Z)(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}kf.defaultOptions={transition:"background 0.5s",backgroundSize:"cover"};var xu=g(89558),iP=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Tf extends zi{constructor(e,t){super(e,(0,Ta.Z)({},Tf.defaultOptions,t)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:n,bubbleSetOptions:i}=this.parseOptions();(0,pi.Z)(this.bubbleSetOptions,i)||this.init(),this.bubbleSetOptions=Object.assign({},i);const a=Object.assign(Object.assign({},n),{d:this.getPath()});this.shape?this.shape.update(a):(this.shape=new _c({style:a}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=n=>{if(!this.shape)return;const i=Re(n.data);[...this.options.members,...this.options.avoidMembers].includes(i)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(i)}))},this.getPath=n=>{const{graph:i}=this.context,a=this.options.members,s=[...this.members.keys()],o=this.options.avoidMembers,l=[...this.avoidMembers.keys()];if(!n&&(0,pi.Z)(a,s)&&(0,pi.Z)(o,l))return this.path;const{enter:u=[],exit:c=[]}=Lo(s,a,x=>x),{enter:h=[],exit:d=[]}=Lo(l,o,x=>x);n&&(c.push(n),u.push(n));const f=(x,A,N)=>{x.forEach(I=>{const K=N?this.members:this.avoidMembers,W=N?"pushMember":"pushNonMember",z=N?"removeMember":"removeNonMember";if(A){let j;i.getElementType(I)==="edge"?([j]=sP(i,I),this.bubbleSets.pushEdge(j)):([j]=aP(i,I),this.bubbleSets[W](j)),K.set(I,j)}else{const j=K.get(I);j&&(i.getElementType(I)==="edge"?this.bubbleSets.removeEdge(j):this.bubbleSets[z](j),K.delete(I))}})};f(c,!1,!0),f(u,!0,!0),f(d,!1,!1),f(h,!0,!1);const p=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=a1(p.points.map(Bi)),this.path},this.bindEvents(),this.bubbleSets=new xu.CF(this.options)}bindEvents(){this.context.graph.on(sn.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(sn.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new xu.CF(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const e=this.options,{type:t,key:n,members:i,avoidMembers:a}=e,s=iP(e,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((l,u)=>(u in xu.vC?l.bubbleSetOptions[u]=s[u]:l.style[u]=s[u],l),{style:{},bubbleSetOptions:{}});return Object.assign({type:t,key:n,members:i,avoidMembers:a},o)}addMember(e){const t=Array.isArray(e)?e:[e];t.some(n=>this.options.avoidMembers.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!t.includes(n))),this.options.members=[...new Set([...this.options.members,...t])],this.drawBubbleSets()}removeMember(e){const t=Array.isArray(e)?e:[e];this.options.members=this.options.members.filter(n=>!t.includes(n)),this.drawBubbleSets()}updateMember(e){this.options.members=(0,At.Z)(e)?e(this.options.members):e,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(e){const t=Array.isArray(e)?e:[e];t.some(n=>this.options.members.includes(n))&&(this.options.members=this.options.members.filter(n=>!t.includes(n))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...t])],this.drawBubbleSets()}removeAvoidMember(e){const t=Array.isArray(e)?e:[e];this.options.avoidMembers.some(n=>t.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!t.includes(n)),this.drawBubbleSets())}updateAvoidMember(e){this.options.avoidMembers=Array.isArray(e)?e:[e],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(sn.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(sn.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}Tf.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},xu.vC);const aP=(r,e)=>(Array.isArray(e)?e:[e]).map(n=>{const i=r.getElementRenderBounds(n);return new xu.Ae(i.min[0],i.min[1],Us(i),Zs(i))}),sP=(r,e)=>(Array.isArray(e)?e:[e]).map(n=>{const i=r.getEdgeData(n),a=r.getElementPosition(i.source),s=r.getElementPosition(i.target);return xu.x1.from({x1:a[0],y1:a[1],x2:s[0],y2:s[1]})});class q5 extends null{constructor(e,t){super(e,t),this.setOptions=n=>{const i={cameraType:"setType",near:"setNear",far:"setFar",fov:"setFov",aspect:"setAspect",projectionMode:"setProjectionMode",distance:"setDistance",minDistance:"setMinDistance",maxDistance:"setMaxDistance",roll:"setRoll",elevation:"setElevation",azimuth:"setAzimuth"},a=(s,o)=>{switch(s){case"projectionMode":return o==="perspective"?1:0;case"cameraType":return{orbiting:0,exploring:1,tracking:2}[o];case"aspect":return typeof o=="number"?o:this.getCanvasAspect();default:return o}};Object.entries(i).forEach(([s,o])=>{const l=n[s];if(l!==void 0){const u=a(s,l);this.context.canvas.getCamera()[o](u)}})},this.bindEvents()}update(e){this.setOptions(e),super.update(e)}bindEvents(){this.context.graph.once(GraphEvent.BEFORE_DRAW,()=>this.setOptions(this.options))}getCanvasAspect(){const[e,t]=this.context.viewport.getCanvasSize();return e/t}}function oP(r){return`
|
|
|
<ul class="g6-contextmenu-ul">
|
|
|
${r.map(e=>`<li class="g6-contextmenu-li" value="${e.value}">${e.name}</li>`).join("")}
|
|
|
</ul>
|
|
|
`}const lP=`
|
|
|
.g6-contextmenu {
|
|
|
font-size: 12px;
|
|
|
background-color: rgba(255, 255, 255, 0.96);
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
|
|
|
transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-ul {
|
|
|
max-width: 256px;
|
|
|
min-width: 96px;
|
|
|
list-style: none;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-li {
|
|
|
padding: 8px 12px;
|
|
|
cursor: pointer;
|
|
|
user-select: none;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-li:hover {
|
|
|
background-color: #f5f5f5;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
`;var xx=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Of extends zi{constructor(e,t){super(e,Object.assign({},Of.defaultOptions,t)),this.targetElement=null,this.onTriggerEvent=n=>{var i;(i=n.preventDefault)===null||i===void 0||i.call(n),this.show(n)},this.onMenuItemClick=n=>{const{onClick:i,trigger:a}=this.options;if(n.target instanceof HTMLElement&&n.target.className.includes("g6-contextmenu-li")){const s=n.target.getAttribute("value");i==null||i(s,n.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(t)}initElement(){this.$element=bu("contextmenu",!1,{zIndex:"99"});const{className:e}=this.options;e&&this.$element.classList.add(e),this.context.canvas.getContainer().appendChild(this.$element),t0("g6-contextmenu-css","style",{},lP,document.head)}show(e){return xx(this,void 0,void 0,function*(){const{enable:t,offset:n}=this.options;if(typeof t=="function"&&!t(e)||!t){this.hide();return}const i=yield this.getDOMContent(e);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${e.client.x-a.left+n[0]}px`,this.$element.style.top=`${e.client.y-a.top+n[1]}px`,this.$element.style.display="block",this.targetElement=e.target})}hide(){this.$element.style.display="none",this.targetElement=null}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(e){return xx(this,void 0,void 0,function*(){const{getContent:t,getItems:n}=this.options;return n?oP(yield n(e)):yield t(e)})}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.on(`canvas:${t}`,this.onTriggerEvent),e.on(`node:${t}`,this.onTriggerEvent),e.on(`edge:${t}`,this.onTriggerEvent),e.on(`combo:${t}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.off(`canvas:${t}`,this.onTriggerEvent),e.off(`node:${t}`,this.onTriggerEvent),e.off(`edge:${t}`,this.onTriggerEvent),e.off(`combo:${t}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}Of.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class Af extends zi{constructor(e,t){super(e,Object.assign({},Af.defaultOptions,t)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:n,element:i}=this.context,a=n.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:s,iterRate:o,divRate:l}=this.options;let{lambda:u,divisions:c,iterations:h}=this.options;for(let d=0;d<s;d++){for(let f=0;f<h;f++){const v={};a.forEach(p=>{var x;if(p.source===p.target)return;const A=Re(p);v[A]=this.getEdgeForces(p,c,u);for(let N=0;N<c+1;N++)(x=this.edgePoints)[A]||(x[A]=[]),this.edgePoints[A][N]=Qn(this.edgePoints[A][N],v[A][N])})}u/=2,c*=l,h*=o,this.divideEdges(c)}a.forEach(d=>{const f=Re(d),v=i.getElement(f);v==null||v.update({d:Mp(this.edgePoints[f])})})},this.bindEvents()}get nodeMap(){const e=this.context.model.getNodeData();return Object.fromEntries(e.map(t=>[Re(t),pl(Fi(t))]))}divideEdges(e){this.context.model.getEdgeData().forEach(n=>{var i;const a=Re(n);(i=this.edgePoints)[a]||(i[a]=[]);const s=this.nodeMap[n.source],o=this.nodeMap[n.target];if(e===1)this.edgePoints[a].push(s),this.edgePoints[a].push(ys(Qn(s,o),2)),this.edgePoints[a].push(o);else{const u=(this.edgePoints[a].length===0?Hr(s,o):fP(this.edgePoints[a]))/(e+1);let c=u;const h=[s];for(let d=1;d<this.edgePoints[a].length;d++){const f=this.edgePoints[a][d-1],v=this.edgePoints[a][d];let p=Hr(v,f);for(;p>c;){const x=c/p,A=Qn(f,lo(Fr(v,f),x));h.push(A),p-=c,c=u}c-=p}h.push(o),this.edgePoints[a]=h}})}getVectorPosition(e){const t=this.nodeMap[e.source],n=this.nodeMap[e.target],[i,a]=Fr(n,t),s=Hr(t,n);return{source:t,target:n,vx:i,vy:a,length:s}}measureEdgeCompatibility(e,t){const n=this.getVectorPosition(e),i=this.getVectorPosition(t),a=uP(n,i),s=cP(n,i),o=hP(n,i),l=dP(n,i);return a*s*o*l}getEdgeBundles(){const e={},t=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach((i,a)=>{n.forEach((s,o)=>{var l,u;if(o<=a)return;this.measureEdgeCompatibility(i,s)>=t&&(e[l=Re(i)]||(e[l]=[]),e[Re(i)].push(s),e[u=Re(s)]||(e[u]=[]),e[Re(s)].push(i))})}),e}getSpringForce(e,t){const{pre:n,cur:i,next:a}=e;return lo(Fr(Qn(n,a),lo(i,2)),t)}getElectrostaticForce(e,t){(0,Vs.Z)(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[Re(t)];let i=[0,0];return n==null||n.forEach(a=>{const s=this.edgePoints[Re(a)][e],o=this.edgePoints[Re(t)][e],l=Fr(s,o),u=Hr(s,o);i=Qn(i,lo(l,1/u))}),i}getEdgeForces(e,t,n){const i=this.nodeMap[e.source],a=this.nodeMap[e.target],s=this.options.K/(Hr(i,a)*(t+1)),o=[[0,0]],l=Re(e);for(let u=1;u<t;u++){const c=this.getSpringForce({pre:this.edgePoints[l][u-1],cur:this.edgePoints[l][u],next:this.edgePoints[l][u+1]||[0,0]},s),h=this.getElectrostaticForce(u,e);o.push(lo(Qn(c,h),n))}return o.push([0,0]),o}bindEvents(){const{graph:e}=this.context;e.on(sn.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:e}=this.context;e.off(sn.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}Af.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const uP=(r,e)=>Math.abs(J_([r.vx,r.vy],[e.vx,e.vy])/(r.length*e.length)),cP=(r,e)=>{const t=(r.length+e.length)/2;return 2/(t/Math.min(r.length,e.length)+Math.max(r.length,e.length)/t)},hP=(r,e)=>{const t=(r.length+e.length)/2,n=ys(Qn(r.source,r.target),2),i=ys(Qn(e.source,e.target),2);return t/(t+Hr(n,i))},Ex=(r,e)=>{if(e.source[0]===e.target[0])return[e.source[0],r[1]];if(e.source[1]===e.target[1])return[r[0],e.source[1]];const t=(e.source[1]-e.target[1])/(e.source[0]-e.target[0]),n=(t*t*e.source[0]+t*(r[1]-e.source[1])+r[0])/(t*t+1),i=t*(n-e.source[0])+e.source[1];return[n,i]},wx=(r,e)=>{const t=Ex(e.source,r),n=Ex(e.target,r),i=ys(Qn(t,n),2),a=ys(Qn(r.source,r.target),2);return Hr(t,n)===0?0:Math.max(0,1-2*Hr(a,i)/Hr(t,n))},dP=(r,e)=>Math.min(wx(r,e),wx(e,r)),fP=r=>{let e=0;for(let t=1;t<r.length;t++)e+=Hr(r[t],r[t-1]);return e},vP={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},Sx=.05;class Cf extends zi{constructor(e,t){super(e,Object.assign({},Cf.defaultOptions,t)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=Bi(n.canvas);this.renderLens(i),this.renderFocusElements()},this.renderLens=n=>{const i=Object.assign({},vP,this.options.style);this.isLensOn||(this.lens=new bl({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,bs(n),{size:this.r*2}),this.lens.update(i)},this.getFilterData=()=>{const{filter:n}=this.options,{model:i}=this.context,a=i.getData();if(!n)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(u=>n(Re(u),"node")),edges:o.filter(u=>n(Re(u),"edge")),combos:l.filter(u=>n(Re(u),"combo"))}},this.getFocusElements=n=>{const{nodes:i,edges:a}=this.getFilterData(),s=i.filter(u=>Hr(Fi(u),n)<this.r),o=s.map(u=>Re(u)),l=a.filter(u=>{const{source:c,target:h}=u,d=o.includes(c),f=o.includes(h);switch(this.options.nodeType){case"both":return d&&f;case"either":return d!==f;case"source":return d&&!f;case"target":return!d&&f;default:return!1}});return{nodes:s,edges:l}},this.renderFocusElements=()=>{const{element:n,graph:i}=this.context;if(!this.isLensOn)return;const a=this.lens.getCenter(),{nodes:s,edges:o}=this.getFocusElements(a),l=new Set,u=c=>{const h=Re(c);l.add(h);const d=n.getElement(h);if(!d)return;const f=this.shapes.get(h)||d.cloneNode();f.setPosition(d.getPosition()),f.id=d.id,this.shapes.has(h)?Object.entries(d.attributes).forEach(([x,A])=>{f.style[x]!==A&&(f.style[x]=A)}):(this.canvas.appendChild(f),this.shapes.set(h,f));const v=i.getElementType(h),p=this.getElementStyle(v,c);f.update(p)};s.forEach(u),o.forEach(u),this.shapes.forEach((c,h)=>{l.has(h)||(c.destroy(),this.shapes.delete(h))})},this.scaleRByWheel=n=>{var i;this.options.preventDefault&&n.preventDefault();const{clientX:a,clientY:s,deltaX:o,deltaY:l}=n,{graph:u,canvas:c}=this.context,h=u.getCanvasByClient([a,s]),d=(i=this.lens)===null||i===void 0?void 0:i.getCenter();if(!this.isLensOn||Hr(h,d)>this.r)return;const{maxR:f,minR:v}=this.options,p=o+l>0?1/(1-Sx):1-Sx,x=Math.min(...c.getSize())/2;this.r=Math.max(v||0,Math.min(f||x,this.r*p)),this.renderLens(d),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=n=>{var i;const a=Bi(n.canvas),s=(i=this.lens)===null||i===void 0?void 0:i.getCenter();!this.isLensOn||Hr(a,s)>this.r||(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=Bi(n.canvas);this.renderLens(i),this.renderFocusElements()},this.onDragEnd=()=>{this.isLensDragging=!1},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}getElementStyle(e,t){const n=e==="node"?this.options.nodeStyle:this.options.edgeStyle;return typeof n=="function"?n(t):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i}=this.options,a=t.getCanvas().getLayer();["click","drag"].includes(n)&&a.addEventListener(Ue.CLICK,this.onEdgeFilter),n==="pointermove"?a.addEventListener(Ue.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.addEventListener(Ue.DRAG_START,this.onDragStart),a.addEventListener(Ue.DRAG,this.onDrag),a.addEventListener(Ue.DRAG_END,this.onDragEnd)),i==="wheel"&&((e=this.graphDom)===null||e===void 0||e.addEventListener(Ue.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i}=this.options,a=t.getCanvas().getLayer();["click","drag"].includes(n)&&a.removeEventListener(Ue.CLICK,this.onEdgeFilter),n==="pointermove"?a.removeEventListener(Ue.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.removeEventListener(Ue.DRAG_START,this.onDragStart),a.removeEventListener(Ue.DRAG,this.onDrag),a.removeEventListener(Ue.DRAG_END,this.onDragEnd)),i==="wheel"&&((e=this.graphDom)===null||e===void 0||e.removeEventListener(Ue.WHEEL,this.scaleRByWheel))}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach((e,t)=>{e.destroy(),this.shapes.delete(t)}),super.destroy()}}Cf.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const gP={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},_x=.05,Mx=.1;class Pf extends zi{constructor(e,t){super(e,Object.assign({},Pf.defaultOptions,t)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=Bi(n.canvas);this.onMagnify(i)},this.onMagnify=n=>{n.some(isNaN)||(this.renderLens(n),this.renderFocusElements())},this.renderLens=n=>{const i=Object.assign({},gP,this.options.style);this.isLensOn||(this.lens=new bl({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,bs(n),{size:this.r*2,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(i)},this.getDPercent=()=>{const{minD:n,maxD:i}=this.options;return`${Math.round((this.d-n)/(i-n)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:n}=this.context,i=this.lens.getCenter(),a=(this.d+1)*this.r,s=new Map,o=new Map;n.getNodeData().forEach(u=>{const c=Fi(u),h=Hr(c,i);if(h>this.r)return;const d=a*h/(this.d*h+this.r),[f,v]=c,[p,x]=i,A=(f-p)/h,N=(v-x)/h,I=[p+d*A,x+d*N],K=Re(u),W=this.getNodeStyle(u),z=(0,El.Z)(n.getElementRenderStyle(K),Object.keys(W));s.set(K,Object.assign(Object.assign({},bs(I)),W)),o.set(K,Object.assign(Object.assign({},bs(c)),z))}),this.updateStyle(s,o)},this.getNodeStyle=n=>{const{nodeStyle:i}=this.options;return typeof i=="function"?i(n):i},this.updateStyle=(n,i)=>{const{graph:a,element:s}=this.context,{enter:o,exit:l,keep:u}=Lo(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(n.keys()),d=>d),c=new Set,h=(d,f)=>{const v=s.getElement(d);v==null||v.update(f),a.getRelatedEdgesData(d).forEach(p=>{c.add(Re(p))})};[...o,...u].forEach(d=>{h(d,n.get(d))}),l.forEach(d=>{h(d,this.prevOriginStyleMap.get(d)),this.prevOriginStyleMap.delete(d)}),c.forEach(d=>{const f=s.getElement(d);f==null||f.update({})}),this.prevMagnifiedStyleMap=n,i.forEach((d,f)=>{this.prevOriginStyleMap.has(f)||this.prevOriginStyleMap.set(f,d)})},this.isWheelValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const{clientX:i,clientY:a}=n,s=this.context.graph.getCanvasByClient([i,a]),o=this.lens.getCenter();return!(Hr(s,o)>this.r)},this.scaleR=n=>{const{maxR:i,minR:a}=this.options,s=n?1/(1-_x):1-_x,o=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(a||0,Math.min(i||o,this.r*s))},this.scaleD=n=>{const{maxD:i,minD:a}=this.options,s=n?this.d+Mx:this.d-Mx;this.d=Math.max(a,Math.min(i,s))},this.scaleRByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleR(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleD(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.isDragValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const i=Bi(n.canvas),a=this.lens.getCenter();return!(Hr(i,a)>this.r)},this.isLensDragging=!1,this.onDragStart=n=>{this.isDragValid(n)&&(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=Bi(n.canvas);this.onMagnify(i)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleR(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleD(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=t.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.addEventListener(Ue.CLICK,this.onCreateFisheye),n==="pointermove"&&s.addEventListener(Ue.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.addEventListener(Ue.DRAG_START,this.onDragStart),s.addEventListener(Ue.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.addEventListener(Ue.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(e=this.graphDom)===null||e===void 0||e.addEventListener(Ue.WHEEL,o,{passive:!1})}}unbindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=t.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.removeEventListener(Ue.CLICK,this.onCreateFisheye),n==="pointermove"&&s.removeEventListener(Ue.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.removeEventListener(Ue.DRAG_START,this.onDragStart),s.removeEventListener(Ue.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.removeEventListener(Ue.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(e=this.graphDom)===null||e===void 0||e.removeEventListener(Ue.WHEEL,o)}}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){var e;this.unbindEvents(),this.isLensOn&&((e=this.lens)===null||e===void 0||e.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}Pf.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Nf extends zi{constructor(e,t){super(e,Object.assign({},Nf.defaultOptions,t)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var n,i,a,s;const o=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(o),o?(i=(n=this.options).onEnter)===null||i===void 0||i.call(n):(s=(a=this.options).onExit)===null||s===void 0||s.call(a)},this.shortcut=new lu(e.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML=`
|
|
|
:not(:root):fullscreen::backdrop {
|
|
|
background: transparent;
|
|
|
}
|
|
|
`}bindEvents(){this.unbindEvents(),this.shortcut.unbindAll();const{request:e=[],exit:t=[]}=this.options.trigger;this.shortcut.bind(e,this.request),this.shortcut.bind(t,this.exit),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(i=>{document.addEventListener(i,this.onFullscreenChange,!1)})}unbindEvents(){this.shortcut.unbindAll(),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(t=>{document.removeEventListener(t,this.onFullscreenChange,!1)})}setGraphSize(e=!0){var t,n;let i,a;e?(i=((t=globalThis.screen)===null||t===void 0?void 0:t.width)||0,a=((n=globalThis.screen)===null||n===void 0?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,a]=this.graphSize,this.context.graph.setSize(i,a),this.context.graph.render()}request(){document.fullscreenElement||!pP()||this.$el.requestFullscreen().catch(e=>{da.warn(`Error attempting to enable full-screen: ${e.message} (${e.name})`)})}exit(){document.fullscreenElement&&document.exitFullscreen()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.exit(),this.style.remove(),super.destroy()}}Nf.defaultOptions={trigger:{},autoFit:!0};function pP(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class Rf extends zi{constructor(e,t){super(e,Object.assign({},Rf.defaultOptions,t)),this.$element=bu("grid-line",!0),this.offset=[0,0],this.onTransform=i=>{if(!this.options.follow)return;const{data:{translate:a}}=i;a&&this.updateOffset(a)},this.context.canvas.getContainer().prepend(this.$element),this.updateStyle(),this.bindEvents()}update(e){super.update(e),this.updateStyle()}bindEvents(){const{graph:e}=this.context;e.on(sn.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{size:e,stroke:t,lineWidth:n,border:i,borderLineWidth:a,borderStroke:s,borderStyle:o}=this.options;Object.assign(this.$element.style,{border:i?`${a}px ${o} ${s}`:"none",backgroundImage:`linear-gradient(${t} ${n}px, transparent ${n}px), linear-gradient(90deg, ${t} ${n}px, transparent ${n}px)`,backgroundSize:`${e}px ${e}px`})}updateOffset(e){this.offset=tM(Qn(this.offset,e),this.options.size),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}destroy(){this.context.graph.off(sn.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}Rf.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};var e0=g(90494);function n0(r){const e={Added:new Map,Updated:new Map,Removed:new Map};return r.forEach(t=>{const{type:n,value:i}=t,a=Re(i);if(n==="NodeAdded"||n==="EdgeAdded"||n==="ComboAdded")e.Added.set(a,t);else if(n==="NodeUpdated"||n==="EdgeUpdated"||n==="ComboUpdated")if(e.Added.has(a))e.Added.set(a,{type:n.replace("Updated","Added"),value:i});else if(e.Updated.has(a)){const{original:s}=e.Updated.get(a);e.Updated.set(a,{type:n,value:i,original:s})}else e.Removed.has(a)||e.Updated.set(a,t);else(n==="NodeRemoved"||n==="EdgeRemoved"||n==="ComboRemoved")&&(e.Added.has(a)?e.Added.delete(a):(e.Updated.has(a)&&e.Updated.delete(a),e.Removed.set(a,t)))}),[...Array.from(e.Added.values()),...Array.from(e.Updated.values()),...Array.from(e.Removed.values())]}function kx(r){const{NodeAdded:e=[],NodeUpdated:t=[],NodeRemoved:n=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:l=[],ComboRemoved:u=[]}=(0,xd.Z)(r,c=>c.type);return{add:{nodes:e,edges:i,combos:o},update:{nodes:t,edges:a,combos:l},remove:{nodes:n,edges:s,combos:u}}}function Tx(r,e){for(const t in r)(0,ie.Z)(r[t])&&!Array.isArray(r[t])&&r[t]!==null?(e[t]||(e[t]={}),Tx(r[t],e[t])):e[t]===void 0&&(e[t]=vc(t))}function mP(r,e=!1,t){const n={animation:e,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=kx(n0(r));return["nodes","edges","combos"].forEach(o=>{a[o]&&a[o].forEach(l=>{var u,c;const h=Object.assign({},l.value);let d=Object.assign({},l.original);if(t){const f=t.graph.getElementType(Re(l.original)),v=f==="edge"?"stroke":"fill",p=t.element.getElementComputedStyle(f,l.original);d=Object.assign(Object.assign({},l.original),{style:Object.assign({[v]:p[v]},l.original.style)})}Tx(h,d),(u=n.current.update)[o]||(u[o]=[]),n.current.update[o].push(h),(c=n.original.update)[o]||(c[o]=[]),n.original.update[o].push(d)}),i[o]&&i[o].forEach(l=>{var u,c;const h=Object.assign({},l.value);(u=n.current.add)[o]||(u[o]=[]),n.current.add[o].push(h),(c=n.original.remove)[o]||(c[o]=[]),n.original.remove[o].push(h)}),s[o]&&s[o].forEach(l=>{var u,c;const h=Object.assign({},l.value);(u=n.current.remove)[o]||(u[o]=[]),n.current.remove[o].push(h),(c=n.original.add)[o]||(c[o]=[]),n.original.add[o].push(h)})}),n}class Lf extends zi{constructor(e,t){super(e,Object.assign({},Lf.defaultOptions,t)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(i,a=!0)=>{var s,o,l;this.freezed=!0,(o=(s=this.options).executeCommand)===null||o===void 0||o.call(s,i);const u=a?i.original:i.current;this.context.graph.addData(u.add),this.context.graph.updateData(u.update),this.context.graph.removeData(Ly(u.remove,!1)),(l=this.context.element)===null||l===void 0||l.draw({silence:!0,animation:i.animation}),this.freezed=!1},this.addCommand=i=>{var a;if(!this.freezed){if(i.type===sn.AFTER_DRAW){const{dataChanges:s=[],animation:o=!0}=i.data;if(!((a=this.context.batch)===null||a===void 0)&&a.isBatching){if(!this.batchChanges)return;this.batchChanges.push(s),this.batchAnimation&&(this.batchAnimation=o);return}this.batchChanges=[s],this.batchAnimation=o}this.undoStackPush(mP(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(Co.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=i=>{const{initiate:a}=i.data;this.batchAnimation=!1,a?this.batchChanges=[]:this.undoStack.pop()||(this.batchChanges=null)},this.emitter=new e0.Z;const{graph:n}=this.context;n.on(sn.AFTER_DRAW,this.addCommand),n.on(sn.BATCH_START,this.initBatchCommand),n.on(sn.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var e,t,n,i;const a=this.undoStack.pop();if(a){if(this.executeCommand(a),((t=(e=this.options).beforeAddCommand)===null||t===void 0?void 0:t.call(e,a,!1))===!1)return;this.redoStack.push(a),(i=(n=this.options).afterAddCommand)===null||i===void 0||i.call(n,a,!1),this.notify(Co.UNDO,a)}return this}redo(){const e=this.redoStack.pop();return e&&(this.executeCommand(e,!1),this.undoStackPush(e),this.notify(Co.REDO,e)),this}undoAndCancel(){const e=this.undoStack.pop();return e&&(this.executeCommand(e,!1),this.redoStack=[],this.notify(Co.CANCEL,e)),this}undoStackPush(e){var t,n,i,a;const{stackSize:s}=this.options;s!==0&&this.undoStack.length>=s&&this.undoStack.shift(),((n=(t=this.options).beforeAddCommand)===null||n===void 0?void 0:n.call(t,e,!0))!==!1&&(this.undoStack.push(e),(a=(i=this.options).afterAddCommand)===null||a===void 0||a.call(i,e,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(Co.CLEAR,null)}notify(e,t){this.emitter.emit(e,{cmd:t}),this.emitter.emit(Co.CHANGE,{cmd:t})}on(e,t){this.emitter.on(e,t)}destroy(){const{graph:e}=this.context;e.off(sn.AFTER_DRAW,this.addCommand),e.off(sn.BATCH_START,this.initBatchCommand),e.off(sn.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Lf.defaultOptions={stackSize:0};var yP=g(1344),bP=g.n(yP);function xP(r,e,t){if(r.length===1)return EP(r[0],e,t);if(r.length===2)return wP(r,e,t);switch(t){case"smooth":return _P(r,e);case"sharp":return MP(r,e);case"rounded":default:return SP(r,e)}}const EP=(r,e,t)=>{if(t==="sharp")return[["M",r[0]-e,r[1]-e],["L",r[0]+e,r[1]-e],["L",r[0]+e,r[1]+e],["L",r[0]-e,r[1]+e],["Z"]];const n=[e,e,0,0,0];return[["M",r[0],r[1]-e],["A",...n,r[0],r[1]+e],["A",...n,r[0],r[1]-e]]},wP=(r,e,t)=>{const n=[e,e,0,0,0],i=t==="sharp"?Qn(r[0],Do(uo(Fr(r[0],r[1])),e)):r[0],a=t==="sharp"?Qn(r[1],Do(uo(Fr(r[1],r[0])),e)):r[1],s=Do(uo(Md(Fr(i,a),!1)),e),o=Do(s,-1),l=Qn(i,s),u=Qn(a,s),c=Qn(a,o),h=Qn(i,o);return t==="sharp"?[["M",l[0],l[1]],["L",u[0],u[1]],["L",c[0],c[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",u[0],u[1]],["A",...n,c[0],c[1]],["L",h[0],h[1]],["A",...n,l[0],l[1]]]},SP=(r,e)=>{const t=Yy(r).map((o,l)=>{const u=(l-2+r.length)%r.length,c=(l-1+r.length)%r.length,h=(l+1)%r.length,d=r[u],f=r[c],v=r[h],p=Fr(d,f),x=Fr(f,o),A=Fr(o,v),N=(j,Z)=>$g(j,Z,!0)<Math.PI,I=N(p,x),K=N(x,A),W=j=>Do(uo(Md(j,!1)),e),z=W(x);return[{p:pl(I?Qn(f,W(p)):Qn(f,z)),concave:I&&f},{p:pl(K?Qn(o,W(A)):Qn(o,z)),concave:K&&o}]}),n=[e,e,0,0,0],i=t.findIndex((o,l)=>!t[(l-1+t.length)%t.length][0].concave&&!t[(l-1+t.length)%t.length][1].concave&&!o[0].concave&&!o[0].concave&&!o[1].concave),a=t.slice(i).concat(t.slice(0,i));let s=[];return a.flatMap((o,l)=>{const u=[],c=a[t.length-1];return l===0&&u.push(["M",...c[1].p]),o[0].concave?s.push(o[0].p,o[1].p):u.push(["A",...n,...o[0].p]),o[1].concave?s.unshift(o[1].p):u.push(["L",...o[1].p]),s.length===3&&(u.pop(),u.push(["C",...s.flat()]),s=[]),u})},_P=(r,e)=>{const t=Yy(r).map((n,i)=>{const a=r[(i+1)%r.length];return{p:n,v:uo(Fr(a,n))}});return t.forEach((n,i)=>{const a=i>0?i-1:r.length-1,s=t[a].v,o=uo(Qn(s,Do(n.v,$g(s,n.v,!0)<Math.PI?1:-1)));n.p=Qn(n.p,Do(o,e))}),a1(t.map(n=>n.p))},MP=(r,e)=>{const n=r.map((a,s)=>{const o=r[s===0?r.length-1:s-1],l=yc(Do(uo(Md(Fr(o,a),!1)),e));return[Qn(o,l),Qn(a,l)]}).flat();return n.map((a,s)=>{if(s%2===0)return null;const o=[n[(s-1)%n.length],n[s%n.length]],l=[n[(s+1)%n.length],n[(s+2)%n.length]];return Qg(o,l,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};var kP=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Df extends zi{constructor(e,t){super(e,Object.assign({},Df.defaultOptions,t)),this.hullMemberIds=[],this.drawHull=()=>{if(!this.shape)this.shape=new _c({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);else{const n=!(0,pi.Z)(this.optionsCache,this.options);this.shape.update(this.getHullStyle(n))}this.optionsCache=Object.assign({},this.options)},this.updateHullPath=n=>{this.shape&&this.options.members.includes(Re(n.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(n=!1)=>{const{graph:i}=this.context,a=this.getMember();if(a.length===0)return"";const s=a.map(u=>i.getNodeData(u)),o=bP()(s.map(Fi),this.options.concavity).slice(1).reverse(),l=o.flatMap(u=>s.filter(c=>(0,pi.Z)(Fi(c),u)).map(Re));return(0,pi.Z)(l,this.hullMemberIds)&&!n?this.path:(this.hullMemberIds=l,this.path=xP(o,this.getPadding(),this.options.corner),this.path)},this.bindEvents()}bindEvents(){this.context.graph.on(sn.AFTER_RENDER,this.drawHull),this.context.graph.on(sn.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(e){const t=this.options,{members:n,padding:i,corner:a}=t,s=kP(t,["members","padding","corner"]);return Object.assign(Object.assign({},s),{d:this.getHullPath(e)})}getPadding(){const{graph:e}=this.context;return this.hullMemberIds.reduce((n,i)=>{const{halfExtents:a}=e.getElementRenderBounds(i),s=Math.max(a[0],a[1]);return Math.max(n,s)},0)+this.options.padding}addMember(e){const t=Array.isArray(e)?e:[e];this.options.members=[...new Set([...this.options.members,...t])],this.shape.update({d:this.getHullPath()})}removeMember(e){const t=Array.isArray(e)?e:[e];this.options.members=this.options.members.filter(n=>!t.includes(n)),t.some(n=>this.hullMemberIds.includes(n))&&this.shape.update({d:this.getHullPath()})}updateMember(e){this.options.members=(0,At.Z)(e)?e(this.options.members):e,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.context.graph.off(sn.AFTER_DRAW,this.drawHull),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}Df.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};var it=g(97582);function lr(r,e,t){return(e=sy(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ox(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function di(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ox(Object(t),!0).forEach(function(n){lr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ox(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function TP(r,e){for(;!{}.hasOwnProperty.call(r,e)&&(r=iu(r))!==null;);return r}function r0(){return r0=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(r,e,t){var n=TP(r,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?r:t):i.value}},r0.apply(null,arguments)}function Ax(r,e,t,n){var i=r0(iu(1&n?r.prototype:r),e,t);return 2&n&&typeof i=="function"?function(a){return i.apply(t,a)}:i}function i0(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function Cx(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function Fc(){}var Bc=.7,If=1/Bc,Eu="\\s*([+-]?\\d+)\\s*",zc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",OP=/^#([0-9a-f]{3,8})$/,AP=new RegExp(`^rgb\\(${Eu},${Eu},${Eu}\\)$`),CP=new RegExp(`^rgb\\(${Xs},${Xs},${Xs}\\)$`),PP=new RegExp(`^rgba\\(${Eu},${Eu},${Eu},${zc}\\)$`),NP=new RegExp(`^rgba\\(${Xs},${Xs},${Xs},${zc}\\)$`),RP=new RegExp(`^hsl\\(${zc},${Xs},${Xs}\\)$`),LP=new RegExp(`^hsla\\(${zc},${Xs},${Xs},${zc}\\)$`),Px={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};i0(Fc,Ff,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:Nx,formatHex:Nx,formatHex8:DP,formatHsl:IP,formatRgb:Rx,toString:Rx});function Nx(){return this.rgb().formatHex()}function DP(){return this.rgb().formatHex8()}function IP(){return Bx(this).formatHsl()}function Rx(){return this.rgb().formatRgb()}function Ff(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=OP.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?Lx(e):t===3?new va(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Bf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Bf(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=AP.exec(r))?new va(e[1],e[2],e[3],1):(e=CP.exec(r))?new va(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=PP.exec(r))?Bf(e[1],e[2],e[3],e[4]):(e=NP.exec(r))?Bf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=RP.exec(r))?Fx(e[1],e[2]/100,e[3]/100,1):(e=LP.exec(r))?Fx(e[1],e[2]/100,e[3]/100,e[4]):Px.hasOwnProperty(r)?Lx(Px[r]):r==="transparent"?new va(NaN,NaN,NaN,0):null}function Lx(r){return new va(r>>16&255,r>>8&255,r&255,1)}function Bf(r,e,t,n){return n<=0&&(r=e=t=NaN),new va(r,e,t,n)}function FP(r){return r instanceof Fc||(r=Ff(r)),r?(r=r.rgb(),new va(r.r,r.g,r.b,r.opacity)):new va}function BP(r,e,t,n){return arguments.length===1?FP(r):new va(r,e,t,n==null?1:n)}function va(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}i0(va,BP,Cx(Fc,{brighter(r){return r=r==null?If:Math.pow(If,r),new va(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Bc:Math.pow(Bc,r),new va(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new va(kl(this.r),kl(this.g),kl(this.b),zf(this.opacity))},displayable(){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:Dx,formatHex:Dx,formatHex8:zP,formatRgb:Ix,toString:Ix}));function Dx(){return`#${Tl(this.r)}${Tl(this.g)}${Tl(this.b)}`}function zP(){return`#${Tl(this.r)}${Tl(this.g)}${Tl(this.b)}${Tl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ix(){const r=zf(this.opacity);return`${r===1?"rgb(":"rgba("}${kl(this.r)}, ${kl(this.g)}, ${kl(this.b)}${r===1?")":`, ${r})`}`}function zf(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function kl(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Tl(r){return r=kl(r),(r<16?"0":"")+r.toString(16)}function Fx(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ws(r,e,t,n)}function Bx(r){if(r instanceof ws)return new ws(r.h,r.s,r.l,r.opacity);if(r instanceof Fc||(r=Ff(r)),!r)return new ws;if(r instanceof ws)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(t-n)/o+(t<n)*6:t===a?s=(n-e)/o+2:s=(e-t)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new ws(s,o,l,r.opacity)}function jP(r,e,t,n){return arguments.length===1?Bx(r):new ws(r,e,t,n==null?1:n)}function ws(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}i0(ws,jP,Cx(Fc,{brighter(r){return r=r==null?If:Math.pow(If,r),new ws(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Bc:Math.pow(Bc,r),new ws(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new va(a0(r>=240?r-240:r+120,i,n),a0(r,i,n),a0(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new ws(zx(this.h),jf(this.s),jf(this.l),zf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=zf(this.opacity);return`${r===1?"hsl(":"hsla("}${zx(this.h)}, ${jf(this.s)*100}%, ${jf(this.l)*100}%${r===1?")":`, ${r})`}`}}));function zx(r){return r=(r||0)%360,r<0?r+360:r}function jf(r){return Math.max(0,Math.min(1,r||0))}function a0(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}function wu(r,e){var t=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Fg(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function GP(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n]}return t}function Ol(r,e){if(r==null)return{};var t,n,i=GP(r,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(n=0;n<a.length;n++)t=a[n],e.includes(t)||{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}var WP=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof g.g!="undefined"?g.g:typeof self!="undefined"?self:{},jx={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(WP,function(){function t(W,z,j,Z,vt){n(W,z,j||0,Z||W.length-1,vt||a)}function n(W,z,j,Z,vt){for(;Z>j;){if(Z-j>600){var Tt=Z-j+1,zt=z-j+1,Qt=Math.log(Tt),ae=.5*Math.exp(2*Qt/3),fe=.5*Math.sqrt(Qt*ae*(Tt-ae)/Tt)*(zt-Tt/2<0?-1:1),ce=Math.max(j,Math.floor(z-zt*ae/Tt+fe)),ct=Math.min(Z,Math.floor(z+(Tt-zt)*ae/Tt+fe));n(W,z,ce,ct,vt)}var $=W[z],Q=j,It=Z;for(i(W,j,z),vt(W[Z],$)>0&&i(W,j,Z);Q<It;){for(i(W,Q,It),Q++,It--;vt(W[Q],$)<0;)Q++;for(;vt(W[It],$)>0;)It--}vt(W[j],$)===0?i(W,j,It):(It++,i(W,It,Z)),It<=z&&(j=It+1),z<=It&&(Z=It-1)}}function i(W,z,j){var Z=W[z];W[z]=W[j],W[j]=Z}function a(W,z){return W<z?-1:W>z?1:0}var s=function(z){z===void 0&&(z=9),this._maxEntries=Math.max(4,z),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(z){var j=this.data,Z=[];if(!N(z,j))return Z;for(var vt=this.toBBox,Tt=[];j;){for(var zt=0;zt<j.children.length;zt++){var Qt=j.children[zt],ae=j.leaf?vt(Qt):Qt;N(z,ae)&&(j.leaf?Z.push(Qt):A(z,ae)?this._all(Qt,Z):Tt.push(Qt))}j=Tt.pop()}return Z},s.prototype.collides=function(z){var j=this.data;if(!N(z,j))return!1;for(var Z=[];j;){for(var vt=0;vt<j.children.length;vt++){var Tt=j.children[vt],zt=j.leaf?this.toBBox(Tt):Tt;if(N(z,zt)){if(j.leaf||A(z,zt))return!0;Z.push(Tt)}}j=Z.pop()}return!1},s.prototype.load=function(z){if(!(z&&z.length))return this;if(z.length<this._minEntries){for(var j=0;j<z.length;j++)this.insert(z[j]);return this}var Z=this._build(z.slice(),0,z.length-1,0);if(!this.data.children.length)this.data=Z;else if(this.data.height===Z.height)this._splitRoot(this.data,Z);else{if(this.data.height<Z.height){var vt=this.data;this.data=Z,Z=vt}this._insert(Z,this.data.height-Z.height-1,!0)}return this},s.prototype.insert=function(z){return z&&this._insert(z,this.data.height-1),this},s.prototype.clear=function(){return this.data=I([]),this},s.prototype.remove=function(z,j){if(!z)return this;for(var Z=this.data,vt=this.toBBox(z),Tt=[],zt=[],Qt,ae,fe;Z||Tt.length;){if(Z||(Z=Tt.pop(),ae=Tt[Tt.length-1],Qt=zt.pop(),fe=!0),Z.leaf){var ce=o(z,Z.children,j);if(ce!==-1)return Z.children.splice(ce,1),Tt.push(Z),this._condense(Tt),this}!fe&&!Z.leaf&&A(Z,vt)?(Tt.push(Z),zt.push(Qt),Qt=0,ae=Z,Z=Z.children[0]):ae?(Qt++,Z=ae.children[Qt],fe=!1):Z=null}return this},s.prototype.toBBox=function(z){return z},s.prototype.compareMinX=function(z,j){return z.minX-j.minX},s.prototype.compareMinY=function(z,j){return z.minY-j.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(z){return this.data=z,this},s.prototype._all=function(z,j){for(var Z=[];z;)z.leaf?j.push.apply(j,z.children):Z.push.apply(Z,z.children),z=Z.pop();return j},s.prototype._build=function(z,j,Z,vt){var Tt=Z-j+1,zt=this._maxEntries,Qt;if(Tt<=zt)return Qt=I(z.slice(j,Z+1)),l(Qt,this.toBBox),Qt;vt||(vt=Math.ceil(Math.log(Tt)/Math.log(zt)),zt=Math.ceil(Tt/Math.pow(zt,vt-1))),Qt=I([]),Qt.leaf=!1,Qt.height=vt;var ae=Math.ceil(Tt/zt),fe=ae*Math.ceil(Math.sqrt(zt));K(z,j,Z,fe,this.compareMinX);for(var ce=j;ce<=Z;ce+=fe){var ct=Math.min(ce+fe-1,Z);K(z,ce,ct,ae,this.compareMinY);for(var $=ce;$<=ct;$+=ae){var Q=Math.min($+ae-1,ct);Qt.children.push(this._build(z,$,Q,vt-1))}}return l(Qt,this.toBBox),Qt},s.prototype._chooseSubtree=function(z,j,Z,vt){for(;vt.push(j),!(j.leaf||vt.length-1===Z);){for(var Tt=1/0,zt=1/0,Qt=void 0,ae=0;ae<j.children.length;ae++){var fe=j.children[ae],ce=f(fe),ct=p(z,fe)-ce;ct<zt?(zt=ct,Tt=ce<Tt?ce:Tt,Qt=fe):ct===zt&&ce<Tt&&(Tt=ce,Qt=fe)}j=Qt||j.children[0]}return j},s.prototype._insert=function(z,j,Z){var vt=Z?z:this.toBBox(z),Tt=[],zt=this._chooseSubtree(vt,this.data,j,Tt);for(zt.children.push(z),c(zt,vt);j>=0&&Tt[j].children.length>this._maxEntries;)this._split(Tt,j),j--;this._adjustParentBBoxes(vt,Tt,j)},s.prototype._split=function(z,j){var Z=z[j],vt=Z.children.length,Tt=this._minEntries;this._chooseSplitAxis(Z,Tt,vt);var zt=this._chooseSplitIndex(Z,Tt,vt),Qt=I(Z.children.splice(zt,Z.children.length-zt));Qt.height=Z.height,Qt.leaf=Z.leaf,l(Z,this.toBBox),l(Qt,this.toBBox),j?z[j-1].children.push(Qt):this._splitRoot(Z,Qt)},s.prototype._splitRoot=function(z,j){this.data=I([z,j]),this.data.height=z.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(z,j,Z){for(var vt,Tt=1/0,zt=1/0,Qt=j;Qt<=Z-j;Qt++){var ae=u(z,0,Qt,this.toBBox),fe=u(z,Qt,Z,this.toBBox),ce=x(ae,fe),ct=f(ae)+f(fe);ce<Tt?(Tt=ce,vt=Qt,zt=ct<zt?ct:zt):ce===Tt&&ct<zt&&(zt=ct,vt=Qt)}return vt||Z-j},s.prototype._chooseSplitAxis=function(z,j,Z){var vt=z.leaf?this.compareMinX:h,Tt=z.leaf?this.compareMinY:d,zt=this._allDistMargin(z,j,Z,vt),Qt=this._allDistMargin(z,j,Z,Tt);zt<Qt&&z.children.sort(vt)},s.prototype._allDistMargin=function(z,j,Z,vt){z.children.sort(vt);for(var Tt=this.toBBox,zt=u(z,0,j,Tt),Qt=u(z,Z-j,Z,Tt),ae=v(zt)+v(Qt),fe=j;fe<Z-j;fe++){var ce=z.children[fe];c(zt,z.leaf?Tt(ce):ce),ae+=v(zt)}for(var ct=Z-j-1;ct>=j;ct--){var $=z.children[ct];c(Qt,z.leaf?Tt($):$),ae+=v(Qt)}return ae},s.prototype._adjustParentBBoxes=function(z,j,Z){for(var vt=Z;vt>=0;vt--)c(j[vt],z)},s.prototype._condense=function(z){for(var j=z.length-1,Z=void 0;j>=0;j--)z[j].children.length===0?j>0?(Z=z[j-1].children,Z.splice(Z.indexOf(z[j]),1)):this.clear():l(z[j],this.toBBox)};function o(W,z,j){if(!j)return z.indexOf(W);for(var Z=0;Z<z.length;Z++)if(j(W,z[Z]))return Z;return-1}function l(W,z){u(W,0,W.children.length,z,W)}function u(W,z,j,Z,vt){vt||(vt=I(null)),vt.minX=1/0,vt.minY=1/0,vt.maxX=-1/0,vt.maxY=-1/0;for(var Tt=z;Tt<j;Tt++){var zt=W.children[Tt];c(vt,W.leaf?Z(zt):zt)}return vt}function c(W,z){return W.minX=Math.min(W.minX,z.minX),W.minY=Math.min(W.minY,z.minY),W.maxX=Math.max(W.maxX,z.maxX),W.maxY=Math.max(W.maxY,z.maxY),W}function h(W,z){return W.minX-z.minX}function d(W,z){return W.minY-z.minY}function f(W){return(W.maxX-W.minX)*(W.maxY-W.minY)}function v(W){return W.maxX-W.minX+(W.maxY-W.minY)}function p(W,z){return(Math.max(z.maxX,W.maxX)-Math.min(z.minX,W.minX))*(Math.max(z.maxY,W.maxY)-Math.min(z.minY,W.minY))}function x(W,z){var j=Math.max(W.minX,z.minX),Z=Math.max(W.minY,z.minY),vt=Math.min(W.maxX,z.maxX),Tt=Math.min(W.maxY,z.maxY);return Math.max(0,vt-j)*Math.max(0,Tt-Z)}function A(W,z){return W.minX<=z.minX&&W.minY<=z.minY&&z.maxX<=W.maxX&&z.maxY<=W.maxY}function N(W,z){return z.minX<=W.maxX&&z.minY<=W.maxY&&z.maxX>=W.minX&&z.maxY>=W.minY}function I(W){return{children:W,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(W,z,j,Z,vt){for(var Tt=[z,j];Tt.length;)if(j=Tt.pop(),z=Tt.pop(),!(j-z<=Z)){var zt=z+Math.ceil((j-z)/Z/2)*Z;t(W,zt,z,j,vt),Tt.push(z,zt,zt,j)}}return s})})(jx);var tF=jx.exports,On=function(r){return r.GROUP="g",r.FRAGMENT="fragment",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",r}({}),s0=function(r){return r[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",r}({}),eF=null,nF=null,o0=et.IH,Su=et.JG,UP=et.Fp,ZP=et.VV,Gx=et.bA,l0=et.lu,ga=function(){function r(){rn(this,r),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return an(r,[{key:"update",value:function(t,n){Su(this.center,t),Su(this.halfExtents,n),l0(this.min,this.center,this.halfExtents),o0(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,n){o0(this.center,n,t),Gx(this.center,this.center,.5),l0(this.halfExtents,n,t),Gx(this.halfExtents,this.halfExtents,.5),Su(this.min,t),Su(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!r.isEmpty(t)){if(r.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,i=n[0],a=n[1],s=n[2],o=this.halfExtents,l=o[0],u=o[1],c=o[2],h=i-l,d=i+l,f=a-u,v=a+u,p=s-c,x=s+c,A=t.center,N=A[0],I=A[1],K=A[2],W=t.halfExtents,z=W[0],j=W[1],Z=W[2],vt=N-z,Tt=N+z,zt=I-j,Qt=I+j,ae=K-Z,fe=K+Z;vt<h&&(h=vt),Tt>d&&(d=Tt),zt<f&&(f=zt),Qt>v&&(v=Qt),ae<p&&(p=ae),fe>x&&(x=fe),n[0]=(h+d)*.5,n[1]=(f+v)*.5,n[2]=(p+x)*.5,o[0]=(d-h)*.5,o[1]=(v-f)*.5,o[2]=(x-p)*.5,this.min[0]=h,this.min[1]=f,this.min[2]=p,this.max[0]=d,this.max[1]=v,this.max[2]=x}}},{key:"setFromTransformedAABB",value:function(t,n){var i=this.center,a=this.halfExtents,s=t.center,o=t.halfExtents,l=n[0],u=n[4],c=n[8],h=n[1],d=n[5],f=n[9],v=n[2],p=n[6],x=n[10],A=Math.abs(l),N=Math.abs(u),I=Math.abs(c),K=Math.abs(h),W=Math.abs(d),z=Math.abs(f),j=Math.abs(v),Z=Math.abs(p),vt=Math.abs(x);i[0]=n[12]+l*s[0]+u*s[1]+c*s[2],i[1]=n[13]+h*s[0]+d*s[1]+f*s[2],i[2]=n[14]+v*s[0]+p*s[1]+x*s[2],a[0]=A*o[0]+N*o[1]+I*o[2],a[1]=K*o[0]+W*o[1]+z*o[2],a[2]=j*o[0]+Z*o[1]+vt*o[2],l0(this.min,i,a),o0(this.max,i,a)}},{key:"intersects",value:function(t){var n=this.getMax(),i=this.getMin(),a=t.getMax(),s=t.getMin();return i[0]<=a[0]&&n[0]>=s[0]&&i[1]<=a[1]&&n[1]>=s[1]&&i[2]<=a[2]&&n[2]>=s[2]}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var n=new r,i=UP([0,0,0],this.getMin(),t.getMin()),a=ZP([0,0,0],this.getMax(),t.getMax());return n.setMinMax(i,a),n}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?Su([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?Su([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0}}])}(),VP=function(){function r(e,t){rn(this,r),this.distance=e||0,this.normal=t||et.al(0,1,0),this.updatePNVertexFlag()}return an(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return et.AK(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/et.Zh(this.normal);et.bA(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,n,i){var a=this.distanceToPoint(t),s=this.distanceToPoint(n),o=a/(a-s),l=o>=0&&o<=1;return l&&i&&et.t7(i,t,n,o),l}}])}(),rF=function(r){return r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",r}({}),YP=function(){function r(e){if(rn(this,r),this.planes=[],e)this.planes=e;else for(var t=0;t<6;t++)this.planes.push(new VP)}return an(r,[{key:"extractFromVPMatrix",value:function(t){var n=Mr(t,16),i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],h=n[7],d=n[8],f=n[9],v=n[10],p=n[11],x=n[12],A=n[13],N=n[14],I=n[15];et.t8(this.planes[0].normal,o-i,h-l,p-d),this.planes[0].distance=I-x,et.t8(this.planes[1].normal,o+i,h+l,p+d),this.planes[1].distance=I+x,et.t8(this.planes[2].normal,o+a,h+u,p+f),this.planes[2].distance=I+A,et.t8(this.planes[3].normal,o-a,h-u,p-f),this.planes[3].distance=I-A,et.t8(this.planes[4].normal,o-s,h-c,p-v),this.planes[4].distance=I-N,et.t8(this.planes[5].normal,o+s,h+c,p+v),this.planes[5].distance=I+N,this.planes.forEach(function(K){K.normalize(),K.updatePNVertexFlag()})}}])}(),rs=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;rn(this,r),this.x=0,this.y=0,this.x=e,this.y=t}return an(r,[{key:"clone",value:function(){return new r(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),_u=function(){function r(e,t,n,i){rn(this,r),this.x=e,this.y=t,this.width=n,this.height=i,this.left=e,this.right=e+n,this.top=t,this.bottom=t+i}return an(r,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(t){return new r(t.x,t.y,t.width,t.height)}},{key:"applyTransform",value:function(t,n){var i=ge.al(t.x,t.y,0,1),a=ge.al(t.x+t.width,t.y,0,1),s=ge.al(t.x,t.y+t.height,0,1),o=ge.al(t.x+t.width,t.y+t.height,0,1),l=ge.Ue(),u=ge.Ue(),c=ge.Ue(),h=ge.Ue();ge.fF(l,i,n),ge.fF(u,a,n),ge.fF(c,s,n),ge.fF(h,o,n);var d=Math.min(l[0],u[0],c[0],h[0]),f=Math.min(l[1],u[1],c[1],h[1]),v=Math.max(l[0],u[0],c[0],h[0]),p=Math.max(l[1],u[1],c[1],h[1]);return r.fromRect({x:d,y:f,width:v-d,height:p-f})}}])}(),Br="Method not implemented.",iF="Use document.documentElement instead.",HP="Cannot append a destroyed element.";function Mu(r){return r===void 0?0:r>360||r<-360?r%360:r}var u0=et.Ue();function ia(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(r)&&r.length===3?n?et.d9(r):et.JG(u0,r):(0,bt.Z)(r)?n?et.al(r,e,t):et.t8(u0,r,e,t):n?et.al(r[0],r[1]||e,r[2]||t):et.t8(u0,r[0],r[1]||e,r[2]||t)}var XP=Math.PI/180;function Cr(r){return r*XP}var KP=180/Math.PI;function is(r){return r*KP}var $P=.9;function aF(r){return r%=400,r<0&&(r+=400),r*$P}function sF(r){return r/360}function QP(r){return 360*r}var Gf=Math.PI/2;function JP(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t*t,o=n*n,l=i*i,u=a*a,c=s+o+l+u,h=t*a-n*i;return h>.499995*c?(r[0]=Gf,r[1]=2*Math.atan2(n,t),r[2]=0):h<-.499995*c?(r[0]=-Gf,r[1]=2*Math.atan2(n,t),r[2]=0):(r[0]=Math.asin(2*(t*i-a*n)),r[1]=Math.atan2(2*(t*a+n*i),1-2*(l+u)),r[2]=Math.atan2(2*(t*n+i*a),1-2*(o+l))),r}function qP(r,e){var t,n,i=yt.getScaling(et.Ue(),e),a=Mr(i,3),s=a[0],o=a[1],l=a[2],u=Math.asin(-e[2]/s);return u<Gf?u>-Gf?(t=Math.atan2(e[6]/o,e[10]/l),n=Math.atan2(e[1]/s,e[0]/s)):(n=0,t=-Math.atan2(e[4]/o,e[5]/o)):(n=0,t=Math.atan2(e[4]/o,e[5]/o)),r[0]=t,r[1]=u,r[2]=n,r}function c0(r,e){return e.length===16?qP(r,e):JP(r,e)}function tN(r,e,t,n,i){var a=Math.cos(r),s=Math.sin(r);return te.al(n*a,i*s,0,-n*s,i*a,0,e,t,1)}function eN(r,e,t,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=2*a,u=t-e,c=n-i,h=l/u,d=l/c,f=(t+e)/u,v=(n+i)/c,p,x,A=s-a,N=s*a;return o?(p=-s/A,x=-N/A):(p=-(s+a)/A,x=-2*N/A),r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=d,r[6]=0,r[7]=0,r[8]=f,r[9]=v,r[10]=p,r[11]=-1,r[12]=0,r[13]=0,r[14]=x,r[15]=0,r}function Wx(r){var e=r[0],t=r[1],n=r[3],i=r[4],a=Math.sqrt(e*e+t*t),s=Math.sqrt(n*n+i*i),o=e*i-t*n;if(o<0&&(e<i?a=-a:s=-s),a){var l=1/a;e*=l,t*=l}if(s){var u=1/s;n*=u,i*=u}var c=Math.atan2(t,e),h=is(c);return[r[6],r[7],a,s,h]}var Ks=yt.create(),Ss=yt.create(),jc=ge.Ue(),Hn=[et.Ue(),et.Ue(),et.Ue()],Ux=et.Ue();function nN(r,e,t,n,i,a){if(!rN(Ks,r)||(yt.copy(Ss,Ks),Ss[3]=0,Ss[7]=0,Ss[11]=0,Ss[15]=1,Math.abs(yt.determinant(Ss))<1e-8))return!1;var s=Ks[3],o=Ks[7],l=Ks[11],u=Ks[12],c=Ks[13],h=Ks[14],d=Ks[15];if(s!==0||o!==0||l!==0){jc[0]=s,jc[1]=o,jc[2]=l,jc[3]=d;var f=yt.invert(Ss,Ss);if(!f)return!1;yt.transpose(Ss,Ss),ge.fF(i,jc,Ss)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=u,e[1]=c,e[2]=h,iN(Hn,Ks),t[0]=et.kE(Hn[0]),et.Fv(Hn[0],Hn[0]),n[0]=et.AK(Hn[0],Hn[1]),h0(Hn[1],Hn[1],Hn[0],1,-n[0]),t[1]=et.kE(Hn[1]),et.Fv(Hn[1],Hn[1]),n[0]/=t[1],n[1]=et.AK(Hn[0],Hn[2]),h0(Hn[2],Hn[2],Hn[0],1,-n[1]),n[2]=et.AK(Hn[1],Hn[2]),h0(Hn[2],Hn[2],Hn[1],1,-n[2]),t[2]=et.kE(Hn[2]),et.Fv(Hn[2],Hn[2]),n[1]/=t[2],n[2]/=t[2],et.kC(Ux,Hn[1],Hn[2]),et.AK(Hn[0],Ux)<0)for(var v=0;v<3;v++)t[v]*=-1,Hn[v][0]*=-1,Hn[v][1]*=-1,Hn[v][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Hn[0][0]-Hn[1][1]-Hn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Hn[0][0]+Hn[1][1]-Hn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Hn[0][0]-Hn[1][1]+Hn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Hn[0][0]+Hn[1][1]+Hn[2][2],0)),Hn[2][1]>Hn[1][2]&&(a[0]=-a[0]),Hn[0][2]>Hn[2][0]&&(a[1]=-a[1]),Hn[1][0]>Hn[0][1]&&(a[2]=-a[2]),!0}function rN(r,e){var t=e[15];if(t===0)return!1;for(var n=1/t,i=0;i<16;i++)r[i]=e[i]*n;return!0}function iN(r,e){r[0][0]=e[0],r[0][1]=e[1],r[0][2]=e[2],r[1][0]=e[4],r[1][1]=e[5],r[1][2]=e[6],r[2][0]=e[8],r[2][1]=e[9],r[2][2]=e[10]}function h0(r,e,t,n,i){r[0]=e[0]*n+t[0]*i,r[1]=e[1]*n+t[1]*i,r[2]=e[2]*n+t[2]*i}var zr=function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r}({}),Zx=function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r}({}),_s=function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r}({}),aN={UPDATED:"updated"},Vx=2e-4,Yx=function(){function r(){rn(this,r),this.clipSpaceNearZ=s0.NEGATIVE_ONE,this.eventEmitter=new Ee.Z,this.matrix=yt.create(),this.right=et.al(1,0,0),this.up=et.al(0,1,0),this.forward=et.al(0,0,1),this.position=et.al(0,0,1),this.focalPoint=et.al(0,0,0),this.distanceVector=et.al(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=yt.create(),this.projectionMatrixInverse=yt.create(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=zr.EXPLORING,this.trackingMode=Zx.DEFAULT,this.projectionMode=_s.PERSPECTIVE,this.frustum=new YP,this.orthoMatrix=yt.create()}return an(r,[{key:"isOrtho",value:function(){return this.projectionMode===_s.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,n){return this.type=t,this.type===zr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===zr.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==zr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return yt.invert(yt.create(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,n){var i=yt.fromTranslation(yt.create(),[t,n,0]);this.jitteredProjectionMatrix=yt.multiply(yt.create(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===_s.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===_s.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,n,i,a,s,o){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===_s.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===_s.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===_s.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===_s.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,n){var i=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(t),this.rotate(0,0,o);var l=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),u=l.x,c=l.y,h=et.al(u-a,c-s,0),d=et.AK(h,this.right)/et.kE(this.right),f=et.AK(h,this.up)/et.kE(this.up),v=this.getPosition(),p=Mr(v,2),x=p[0],A=p[1],N=this.getFocalPoint(),I=Mr(N,2),K=I[0],W=I[1];return this.setPosition(x-d,A-f),this.setFocalPoint(K-d,W-f),this}},{key:"setPerspective",value:function(t,n,i,a){var s;this.projectionMode=_s.PERSPECTIVE,this.fov=i,this.near=t,this.far=n,this.aspect=a;var o=this.near*Math.tan(Cr(.5*this.fov))/this.zoom,l=2*o,u=this.aspect*l,c=-.5*u;if((s=this.view)!==null&&s!==void 0&&s.enabled){var h=this.view.fullWidth,d=this.view.fullHeight;c+=this.view.offsetX*u/h,o-=this.view.offsetY*l/d,u*=this.view.width/h,l*=this.view.height/d}return eN(this.projectionMatrix,c,c+u,o-l,o,t,this.far,this.clipSpaceNearZ===s0.ZERO),yt.invert(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,n,i,a,s,o){var l;this.projectionMode=_s.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=i,this.bottom=a,this.near=s,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,f=h-u,v=h+u,p=d+c,x=d-c;if((l=this.view)!==null&&l!==void 0&&l.enabled){var A=(this.rright-this.left)/this.view.fullWidth/this.zoom,N=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f+=A*this.view.offsetX,v=f+A*this.view.width,p-=N*this.view.offsetY,x=p-N*this.view.height}return this.clipSpaceNearZ===s0.NEGATIVE_ONE?yt.ortho(this.projectionMatrix,f,v,p,x,s,o):yt.orthoZO(this.projectionMatrix,f,v,p,x,s,o),yt.invert(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=ia(t,n,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=et.al(0,1,0);if(this.focalPoint=ia(t,n,i),this.trackingMode===Zx.CINEMATIC){var s=et.$X(et.Ue(),this.focalPoint,this.position);t=s[0],n=s[1],i=s[2];var o=et.kE(s),l=is(Math.asin(n/o)),u=90+is(Math.atan2(i,t)),c=yt.create();yt.rotateY(c,c,Cr(u)),yt.rotateX(c,c,Cr(l)),a=et.fF(et.Ue(),[0,1,0],c)}return yt.invert(this.matrix,yt.lookAt(yt.create(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Vx&&(this.distance=Vx),this.dollyingStep=this.distance/100;var n=et.Ue();t=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=t*i[0]+a[0],n[1]=t*i[1]+a[1],n[2]=t*i[2]+a[2],this._setPosition(n),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Mu(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Mu(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Mu(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Xt.yY(Xt.Ue(),[0,0,1],Cr(this.roll));yt.identity(this.matrix);var n=Xt.yY(Xt.Ue(),[1,0,0],Cr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.elevation)),i=Xt.yY(Xt.Ue(),[0,1,0],Cr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.azimuth)),a=Xt.Jp(Xt.Ue(),i,n);a=Xt.Jp(Xt.Ue(),a,t);var s=yt.fromQuat(yt.create(),a);this.type===zr.ORBITING||this.type===zr.EXPLORING?(yt.translate(this.matrix,this.matrix,this.focalPoint),yt.multiply(this.matrix,this.matrix,s),yt.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===zr.TRACKING&&(yt.translate(this.matrix,this.matrix,this.position),yt.multiply(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(t,n,i){this.position=ia(t,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){et.JG(this.right,ia(ge.fF(ge.Ue(),[1,0,0,0],this.matrix))),et.JG(this.up,ia(ge.fF(ge.Ue(),[0,1,0,0],this.matrix))),et.JG(this.forward,ia(ge.fF(ge.Ue(),[0,0,1,0],this.matrix))),et.Fv(this.right,this.right),et.Fv(this.up,this.up),et.Fv(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=et.kE(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===zr.TRACKING?(this.elevation=is(Math.asin(n/a)),this.azimuth=is(Math.atan2(-t,-i))):this.rotateWorld?(this.elevation=is(Math.asin(n/a)),this.azimuth=is(Math.atan2(-t,-i))):(this.elevation=-is(Math.asin(n/a)),this.azimuth=-is(Math.atan2(-t,-i)))}},{key:"_getPosition",value:function(){et.JG(this.position,ia(ge.fF(ge.Ue(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){et.kK(this.distanceVector,[0,0,-this.distance],te.xO(te.Ue(),this.matrix)),et.IH(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=et.$X(et.Ue(),this.focalPoint,this.position),this.distance=et.kE(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===_s.ORTHOGRAPHIC){var t=this.position,n=Xt.yY(Xt.Ue(),[0,0,1],-this.roll*Math.PI/180);yt.fromRotationTranslationScaleOrigin(this.orthoMatrix,n,et.al((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),et.al(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),n=yt.multiply(yt.create(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(aN.UPDATED)}}},{key:"rotate",value:function(t,n,i){throw new Error(Br)}},{key:"pan",value:function(t,n){throw new Error(Br)}},{key:"dolly",value:function(t){throw new Error(Br)}},{key:"createLandmark",value:function(t,n){throw new Error(Br)}},{key:"gotoLandmark",value:function(t,n){throw new Error(Br)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Br)}}])}(),sN=function(r){return r[r.Standard=0]="Standard",r}({}),d0=function(r){return r[r.ADDED=0]="ADDED",r[r.REMOVED=1]="REMOVED",r[r.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",r}({}),Hx={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _u(0,0,0,0)},un=function(r){return r.COORDINATE="<coordinate>",r.COLOR="<color>",r.PAINT="<paint>",r.NUMBER="<number>",r.ANGLE="<angle>",r.OPACITY_VALUE="<opacity-value>",r.SHADOW_BLUR="<shadow-blur>",r.LENGTH="<length>",r.PERCENTAGE="<percentage>",r.LENGTH_PERCENTAGE="<length> | <percentage>",r.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",r.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",r.LIST_OF_POINTS="<list-of-points>",r.PATH="<path>",r.FILTER="<filter>",r.Z_INDEX="<z-index>",r.OFFSET_DISTANCE="<offset-distance>",r.DEFINED_PATH="<defined-path>",r.MARKER="<marker>",r.TRANSFORM="<transform>",r.TRANSFORM_ORIGIN="<transform-origin>",r.TEXT="<text>",r.TEXT_TRANSFORM="<text-transform>",r}({});function aa(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=e?e.apply(this,a):a[0],l=t.cache;if(l.has(o))return l.get(o);var u=r.apply(this,a);return t.cache=l.set(o,u)||l,u};return t.cache=new(aa.Cache||Map),t}aa.Cache=Map;var cn=function(r){return r[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",r}({}),Ms=function(r){return r[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",r}({}),oN=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),lN=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),uN=[{name:"em",unit_type:cn.kEms},{name:"px",unit_type:cn.kPixels},{name:"deg",unit_type:cn.kDegrees},{name:"rad",unit_type:cn.kRadians},{name:"grad",unit_type:cn.kGradians},{name:"ms",unit_type:cn.kMilliseconds},{name:"s",unit_type:cn.kSeconds},{name:"rem",unit_type:cn.kRems},{name:"turn",unit_type:cn.kTurns}],ku=function(r){return r[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",r}({}),cN=function(e){return uN.find(function(t){return t.name===e}).unit_type},hN=function(e){return e?e==="number"?cn.kNumber:e==="percent"||e==="%"?cn.kPercentage:cN(e):cn.kUnknown},dN=function(e){switch(e){case cn.kNumber:case cn.kInteger:return Ms.kUNumber;case cn.kPercentage:return Ms.kUPercent;case cn.kPixels:return Ms.kULength;case cn.kMilliseconds:case cn.kSeconds:return Ms.kUTime;case cn.kDegrees:case cn.kRadians:case cn.kGradians:case cn.kTurns:return Ms.kUAngle;default:return Ms.kUOther}},fN=function(e){switch(e){case Ms.kUNumber:return cn.kNumber;case Ms.kULength:return cn.kPixels;case Ms.kUPercent:return cn.kPercentage;case Ms.kUTime:return cn.kSeconds;case Ms.kUAngle:return cn.kDegrees;default:return cn.kUnknown}},Xx=function(e){var t=1;switch(e){case cn.kPixels:case cn.kDegrees:case cn.kSeconds:break;case cn.kMilliseconds:t=.001;break;case cn.kRadians:t=180/Math.PI;break;case cn.kGradians:t=.9;break;case cn.kTurns:t=360;break}return t},f0=function(e){switch(e){case cn.kNumber:case cn.kInteger:return"";case cn.kPercentage:return"%";case cn.kEms:return"em";case cn.kRems:return"rem";case cn.kPixels:return"px";case cn.kDegrees:return"deg";case cn.kRadians:return"rad";case cn.kGradians:return"grad";case cn.kMilliseconds:return"ms";case cn.kSeconds:return"s";case cn.kTurns:return"turn"}return""},Wf=function(){function r(){rn(this,r)}return an(r,[{key:"toString",value:function(){return this.buildCSSText(oN.kNo,lN.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=ku.kUnitType&&this.getType()<=ku.kClampType}}],[{key:"isAngle",value:function(t){return t===cn.kDegrees||t===cn.kRadians||t===cn.kGradians||t===cn.kTurns}},{key:"isLength",value:function(t){return t>=cn.kEms&&t<cn.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===cn.kPercentage||t===cn.kEms||t===cn.kRems}},{key:"isTime",value:function(t){return t===cn.kSeconds||t===cn.kMilliseconds}}])}(),vN=function(r){function e(t){var n;return rn(this,e),n=dr(this,e),n.colorSpace=t,n}return fr(e,r),an(e,[{key:"getType",value:function(){return ku.kColorType}},{key:"to",value:function(n){return this}}])}(Wf),Uf=function(r){return r[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",r}({}),Zf=function(r){function e(t,n){var i;return rn(this,e),i=dr(this,e),i.type=t,i.value=n,i}return fr(e,r),an(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(n,i,a){return a}},{key:"getType",value:function(){return ku.kColorType}}])}(Wf),as=function(r){function e(t){var n;return rn(this,e),n=dr(this,e),n.value=t,n}return fr(e,r),an(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return ku.kKeywordType}},{key:"buildCSSText",value:function(n,i,a){return a+this.value}}])}(Wf),gN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";return Number.isFinite(e)?n="NaN":e>0?n="infinity":n="-infinity",n+=t},v0=function(e){return fN(dN(e))},Pr=function(r){function e(t){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cn.kNumber;rn(this,e),n=dr(this,e);var a;return typeof i=="string"?a=hN(i):a=i,n.unit=a,n.value=t,n}return fr(e,r),an(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(n){var i=n;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return ku.kUnitType}},{key:"convertTo",value:function(n){if(this.unit===n)return new e(this.value,this.unit);var i=v0(this.unit);if(i!==v0(n)||i===cn.kUnknown)return null;var a=Xx(this.unit)/Xx(n);return new e(this.value*a,n)}},{key:"buildCSSText",value:function(n,i,a){var s;switch(this.unit){case cn.kUnknown:break;case cn.kInteger:s=Number(this.value).toFixed(0);break;case cn.kNumber:case cn.kPercentage:case cn.kEms:case cn.kRems:case cn.kPixels:case cn.kDegrees:case cn.kRadians:case cn.kGradians:case cn.kMilliseconds:case cn.kSeconds:case cn.kTurns:{var o=-999999,l=999999,u=this.value,c=f0(this.unit);if(u<o||u>l){var h=f0(this.unit);!Number.isFinite(u)||Number.isNaN(u)?s=gN(u,h):s=u+(h||"")}else s="".concat(u).concat(c)}}return a+=s,a}}])}(Wf),ks=new Pr(0,"px");new Pr(1,"px");var Al=new Pr(0,"deg"),g0=function(r){function e(t,n,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return rn(this,e),a=dr(this,e,["rgb"]),a.r=t,a.g=n,a.b=i,a.alpha=s,a.isNone=o,a}return fr(e,r),an(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(n,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(vN),Kx=new as("unset"),pN=new as("initial"),mN=new as("inherit"),p0={"":Kx,unset:Kx,initial:pN,inherit:mN},yN=function(e){return p0[e]||(p0[e]=new as(e)),p0[e]},$x=new g0(0,0,0,0,!0),Qx=new g0(0,0,0,0),bN=aa(function(r,e,t,n){return new g0(r,e,t,n)},function(r,e,t,n){return"rgba(".concat(r,",").concat(e,",").concat(t,",").concat(n,")")}),Jr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cn.kNumber;return new Pr(e,t)};new Pr(50,"%");function xN(r){var e=r.type,t=r.value;return e==="hex"?"#".concat(t):e==="literal"?t:e==="rgb"?"rgb(".concat(t.join(","),")"):"rgba(".concat(t.join(","),")")}var EN=function(){var r={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function t($){throw new Error("".concat(e,": ").concat($))}function n(){var $=i();return e.length>0&&t("Invalid input not EOF"),$}function i(){return I(a)}function a(){return s("linear-gradient",r.linearGradient,l)||s("repeating-linear-gradient",r.repeatingLinearGradient,l)||s("radial-gradient",r.radialGradient,h)||s("repeating-radial-gradient",r.repeatingRadialGradient,h)||s("conic-gradient",r.conicGradient,h)}function s($,Q,It){return o(Q,function(ue){var le=It();return le&&(ce(r.comma)||t("Missing comma before color stops")),{type:$,orientation:le,colorStops:I(K)}})}function o($,Q){var It=ce($);if(It){ce(r.startCall)||t("Missing (");var ue=Q(It);return ce(r.endCall)||t("Missing )"),ue}}function l(){return u()||c()}function u(){return fe("directional",r.sideOrCorner,1)}function c(){return fe("angular",r.angleValue,1)}function h(){var $,Q=d(),It;return Q&&($=[],$.push(Q),It=e,ce(r.comma)&&(Q=d(),Q?$.push(Q):e=It)),$}function d(){var $=f()||v();if($)$.at=x();else{var Q=p();if(Q){$=Q;var It=x();It&&($.at=It)}else{var ue=A();ue&&($={type:"default-radial",at:ue})}}return $}function f(){var $=fe("shape",/^(circle)/i,0);return $&&($.style=ae()||p()),$}function v(){var $=fe("shape",/^(ellipse)/i,0);return $&&($.style=zt()||p()),$}function p(){return fe("extent-keyword",r.extentKeywords,1)}function x(){if(fe("position",/^at/,0)){var $=A();return $||t("Missing positioning value"),$}}function A(){var $=N();if($.x||$.y)return{type:"position",value:$}}function N(){return{x:zt(),y:zt()}}function I($){var Q=$(),It=[];if(Q)for(It.push(Q);ce(r.comma);)Q=$(),Q?It.push(Q):t("One extra comma");return It}function K(){var $=W();return $||t("Expected color definition"),$.length=zt(),$}function W(){return j()||vt()||Z()||z()}function z(){return fe("literal",r.literalColor,0)}function j(){return fe("hex",r.hexColor,1)}function Z(){return o(r.rgbColor,function(){return{type:"rgb",value:I(Tt)}})}function vt(){return o(r.rgbaColor,function(){return{type:"rgba",value:I(Tt)}})}function Tt(){return ce(r.number)[1]}function zt(){return fe("%",r.percentageValue,1)||Qt()||ae()}function Qt(){return fe("position-keyword",r.positionKeywords,1)}function ae(){return fe("px",r.pixelValue,1)||fe("em",r.emValue,1)}function fe($,Q,It){var ue=ce(Q);if(ue)return{type:$,value:ue[It]}}function ce($){var Q=/^[\n\r\t\s]+/.exec(e);Q&&ct(Q[0].length);var It=$.exec(e);return It&&ct(It[0].length),It}function ct($){e=e.substring($)}return function($){return e=$,n()}}();function oF(r,e,t,n){var i=Cr(n.value),a=0,s=0,o=a+e/2,l=s+t/2,u=Math.abs(e*Math.cos(i))+Math.abs(t*Math.sin(i)),c=r[0]+o-Math.cos(i)*u/2,h=r[1]+l-Math.sin(i)*u/2,d=r[0]+o+Math.cos(i)*u/2,f=r[1]+l+Math.sin(i)*u/2;return{x1:c,y1:h,x2:d,y2:f}}function lF(r,e,t,n,i,a){var s=n.value,o=i.value;n.unit===cn.kPercentage&&(s=n.value/100*e),i.unit===cn.kPercentage&&(o=i.value/100*t);var l=Math.max(distanceSquareRoot([0,0],[s,o]),distanceSquareRoot([0,t],[s,o]),distanceSquareRoot([e,t],[s,o]),distanceSquareRoot([e,0],[s,o]));return a&&(a instanceof Pr?l=a.value:a instanceof as&&(a.value==="closest-side"?l=Math.min(s,e-s,o,t-o):a.value==="farthest-side"?l=Math.max(s,e-s,o,t-o):a.value==="closest-corner"&&(l=Math.min(distanceSquareRoot([0,0],[s,o]),distanceSquareRoot([0,t],[s,o]),distanceSquareRoot([e,t],[s,o]),distanceSquareRoot([e,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:l}}var wN=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,SN=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,_N=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Jx=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function MN(r){var e,t=r.length;if(r[t-1].length=(e=r[t-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},t>1){var n;r[0].length=(n=r[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"}}for(var i=0,a=Number(r[0].length.value),s=1;s<t;s++){var o,l=(o=r[s].length)===null||o===void 0?void 0:o.value;if(!(0,be.Z)(l)&&!(0,be.Z)(a)){for(var u=1;u<s-i;u++)r[i+u].length={type:"%",value:"".concat(a+(Number(l)-a)*u/(s-i))};i=s,a=Number(l)}}}var kN={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},TN=aa(function(r){var e;return r.type==="angular"?e=Number(r.value):e=kN[r.value]||0,Jr(e,"deg")}),ON=aa(function(r){var e=50,t=50,n="%",i="%";if((r==null?void 0:r.type)==="position"){var a=r.value,s=a.x,o=a.y;(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?e=0:s.value==="center"?e=50:s.value==="right"?e=100:s.value==="top"?t=0:s.value==="bottom"&&(t=100)),(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?e=0:o.value==="center"?t=50:o.value==="right"?e=100:o.value==="top"?t=0:o.value==="bottom"&&(t=100)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(n=s==null?void 0:s.type,e=Number(s.value)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(i=o==null?void 0:o.type,t=Number(o.value))}return{cx:Jr(e,n),cy:Jr(t,i)}}),AN=aa(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var e=EN(r);return e.map(function(o){var l=o.type,u=o.orientation,c=o.colorStops;MN(c);var h=c.map(function(I){return{offset:Jr(Number(I.length.value),"%"),color:xN(I)}});if(l==="linear-gradient")return new Zf(Uf.LinearGradient,{angle:u?TN(u):Al,steps:h});if(l==="radial-gradient"&&(u||(u=[{type:"shape",value:"circle"}]),u[0].type==="shape"&&u[0].value==="circle")){var d=ON(u[0].at),f=d.cx,v=d.cy,p;if(u[0].style){var x=u[0].style,A=x.type,N=x.value;A==="extent-keyword"?p=yN(N):p=Jr(N,A)}return new Zf(Uf.RadialGradient,{cx:f,cy:v,size:p,steps:h})}})}var t=r[0];if(r[1]==="("||r[2]==="("){if(t==="l"){var n=wN.exec(r);if(n){var i,a=((i=n[2].match(Jx))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new Zf(Uf.LinearGradient,{angle:Jr(parseFloat(n[1]),"deg"),steps:a.map(function(o){var l=Mr(o,2),u=l[0],c=l[1];return{offset:Jr(Number(u)*100,"%"),color:c}})})]}}else if(t==="r"){var s=CN(r);if(s)if((0,Gt.Z)(s))r=s;else return[new Zf(Uf.RadialGradient,s)]}else if(t==="p")return PN(r)}});function CN(r){var e=SN.exec(r);if(e){var t,n=((t=e[4].match(Jx))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:Jr(50,"%"),cy:Jr(50,"%"),steps:n.map(function(i){var a=Mr(i,2),s=a[0],o=a[1];return{offset:Jr(Number(s)*100,"%"),color:o}})}}return null}function PN(r){var e=_N.exec(r);if(e){var t=e[1],n=e[2];switch(t){case"a":t="repeat";break;case"x":t="repeat-x";break;case"y":t="repeat-y";break;case"n":t="no-repeat";break;default:t="no-repeat"}return{image:n,repetition:t}}return null}function uF(r){return!!r.type&&!!r.value}function NN(r){return r&&!!r.image}function qx(r){return r&&!(0,be.Z)(r.r)&&!(0,be.Z)(r.g)&&!(0,be.Z)(r.b)}var Gc=aa(function(r){if(NN(r))return di({repetition:"repeat"},r);if((0,be.Z)(r)&&(r=""),r==="transparent")return Qx;if(r==="currentColor")r="black";else if(r==="none")return $x;var e=AN(r);if(e)return e;var t=Ff(r),n=[0,0,0,0];return t!==null&&(n[0]=t.r||0,n[1]=t.g||0,n[2]=t.b||0,n[3]=t.opacity),bN.apply(void 0,n)});function RN(r,e){if(!(!qx(r)||!qx(e)))return[[Number(r.r),Number(r.g),Number(r.b),Number(r.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var n=t.slice();if(n[3])for(var i=0;i<3;i++)n[i]=Math.round((0,Kt.Z)(n[i],0,255));return n[3]=(0,Kt.Z)(n[3],0,1),"rgba(".concat(n.join(","),")")}]}function Wc(r,e){if((0,be.Z)(e))return Jr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(r)>=0)return Jr(Number(e),"px");if("deg".search(r)>=0)return Jr(Number(e),"deg")}var t=[];e=e.replace(r,function(i){return t.push(i),"U".concat(i)});var n="U(".concat(r.source,")");return t.map(function(i){return Jr(Number(e.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(n,"g"),"*0")),i)})[0]}var tE=function(e){return Wc(new RegExp("px","g"),e)},LN=aa(tE),DN=function(e){return Wc(new RegExp("%","g"),e)};aa(DN);var eE=function(e){return(0,bt.Z)(e)||isFinite(Number(e))?Jr(Number(e)||0,"px"):Wc(new RegExp("px|%|em|rem","g"),e)},m0=aa(eE),nE=function(e){return Wc(new RegExp("deg|rad|grad|turn","g"),e)},IN=aa(nE);function FN(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=r.value||0,o=e.value||0,l=v0(r.unit),u=r.convertTo(l),c=e.convertTo(l);return u&&c?(s=u.value,o=c.value,a=f0(r.unit)):(Pr.isLength(r.unit)||Pr.isLength(e.unit))&&(s=Ra(r,i,t),o=Ra(e,i,t),a="px"),[s,o,function(h){return n&&(h=Math.max(h,0)),h+a}]}function pa(r){var e=0;return r.unit===cn.kDegrees?e=r.value:r.unit===cn.kRadians?e=is(Number(r.value)):r.unit===cn.kTurns?e=QP(Number(r.value)):r.value&&(e=r.value),e}function rE(r,e){var t;return Array.isArray(r)?t=r.map(function(n){return Number(n)}):(0,Gt.Z)(r)?t=r.split(" ").map(function(n){return Number(n)}):(0,bt.Z)(r)&&(t=[r]),e===2?t.length===1?[t[0],t[0]]:[t[0],t[1]]:t.length===1?[t[0],t[0],t[0],t[0]]:t.length===2?[t[0],t[1],t[0],t[1]]:t.length===3?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]]}function Ra(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r.unit===cn.kPixels)return Number(r.value);if(r.unit===cn.kPercentage&&t){var i=t.nodeName===On.GROUP?t.getLocalBounds():t.getGeometryBounds();return(n?i.min[e]:0)+r.value/100*i.halfExtents[e]*2}return 0}var BN=function(e){return Wc(/deg|rad|grad|turn|px|%/g,e)},zN=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function jN(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(r=r.toLowerCase().trim(),r==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,t=[],n,i=0;n=e.exec(r);){if(n.index!==i)return[];if(i=n.index+n[0].length,zN.indexOf(n[1])>-1&&t.push({name:n[1],params:n[2].split(" ").map(function(a){return BN(a)||Gc(a)})}),e.lastIndex===r.length)return t}return[]}function iE(r){return r.toString()}var aE=function(e){return typeof e=="number"?Jr(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Jr(Number(e)):Jr(0)},y0=aa(aE);aa(function(r){return(0,Gt.Z)(r)?r.split(" ").map(y0):r.map(y0)});function b0(r,e){return[r,e,iE]}function x0(r,e){return function(t,n){return[t,n,function(i){return iE((0,Kt.Z)(i,r,e))}]}}function sE(r,e){if(r.length===e.length)return[r,e,function(t){return t}]}function oE(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=(0,we.D)(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function GN(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=(0,U.hE)(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function WN(r){for(var e=0;e<r.length;e++){var t=r[e-1],n=r[e],i=n[0];if(i==="M"&&t){var a=t[0],s=[n[1],n[2]],o=void 0;a==="L"||a==="M"?o=[t[1],t[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[t[t.length-2],t[t.length-1]]),o&&Vf(s,o)&&(r.splice(e,1),e--)}}}function UN(r){for(var e=!1,t=r.length,n=0;n<t;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function ZN(r){for(var e=[],t=[],n=[],i=0;i<r.length;i++){var a=r[i],s=a[0];s==="M"?(n.length&&(t.push(n),n=[]),n.push([a[1],a[2]])):s==="Z"?n.length&&(e.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&t.push(n),{polygons:e,polylines:t}}function Vf(r,e){return r[0]===e[0]&&r[1]===e[1]}function VN(r,e){for(var t=[],n=[],i=[],a=0;a<r.length;a++){var s=r[a],o=s.currentPoint,l=s.params,u=s.prePoint,c=void 0;switch(s.command){case"Q":c=(0,U.x4)(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":c=(0,U.l5)(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;c=(0,U.vp)(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:t.push(o[0]),n.push(o[1]);break}c&&(s.box=c,t.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)),e&&(s.command==="L"||s.command==="M")&&s.prePoint&&s.nextPoint&&i.push(s)}t=t.filter(function(K){return!Number.isNaN(K)&&K!==1/0&&K!==-1/0}),n=n.filter(function(K){return!Number.isNaN(K)&&K!==1/0&&K!==-1/0});var d=(0,Bt.Z)(t),f=(0,Bt.Z)(n),v=(0,oe.Z)(t),p=(0,oe.Z)(n);if(i.length===0)return{x:d,y:f,width:v-d,height:p-f};for(var x=0;x<i.length;x++){var A=i[x],N=A.currentPoint,I=void 0;N[0]===d?(I=Yf(A,e),d-=I.xExtra):N[0]===v&&(I=Yf(A,e),v+=I.xExtra),N[1]===f?(I=Yf(A,e),f-=I.yExtra):N[1]===p&&(I=Yf(A,e),p+=I.yExtra)}return{x:d,y:f,width:v-d,height:p-f}}function Yf(r,e){var t=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2),l=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!l||Math.sin(l)===0||(0,ht.Z)(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),c=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));u=u>Math.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c;var h={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return h}function lE(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}var uE=function(e,t){var n=e.x*t.x+e.y*t.y,i=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),a=e.x*t.y-e.y*t.x<0?-1:1,s=a*Math.acos(n/i);return s},cE=function(e,t,n,i,a,s,o,l){t=Math.abs(t),n=Math.abs(n),i=(0,ut.Z)(i,360);var u=Cr(i);if(e.x===o.x&&e.y===o.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(e.x-o.x)/2,h=(e.y-o.y)/2,d={x:Math.cos(u)*c+Math.sin(u)*h,y:-Math.sin(u)*c+Math.cos(u)*h},f=Math.pow(d.x,2)/Math.pow(t,2)+Math.pow(d.y,2)/Math.pow(n,2);f>1&&(t*=Math.sqrt(f),n*=Math.sqrt(f));var v=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(d.y,2)-Math.pow(n,2)*Math.pow(d.x,2),p=Math.pow(t,2)*Math.pow(d.y,2)+Math.pow(n,2)*Math.pow(d.x,2),x=v/p;x=x<0?0:x;var A=(a!==s?1:-1)*Math.sqrt(x),N={x:A*(t*d.y/n),y:A*(-(n*d.x)/t)},I={x:Math.cos(u)*N.x-Math.sin(u)*N.y+(e.x+o.x)/2,y:Math.sin(u)*N.x+Math.cos(u)*N.y+(e.y+o.y)/2},K={x:(d.x-N.x)/t,y:(d.y-N.y)/n},W=uE({x:1,y:0},K),z={x:(-d.x-N.x)/t,y:(-d.y-N.y)/n},j=uE(K,z);!s&&j>0?j-=2*Math.PI:s&&j<0&&(j+=2*Math.PI),j%=2*Math.PI;var Z=W+j*l,vt=t*Math.cos(Z),Tt=n*Math.sin(Z),zt={x:Math.cos(u)*vt-Math.sin(u)*Tt+I.x,y:Math.sin(u)*vt+Math.cos(u)*Tt+I.y,ellipticalArcStartAngle:W,ellipticalArcEndAngle:W+j,ellipticalArcAngle:Z,ellipticalArcCenter:I,resultantRx:t,resultantRy:n};return zt};function YN(r){for(var e=[],t=null,n=null,i=null,a=0,s=r.length,o=0;o<s;o++){var l=r[o];n=r[o+1];var u=l[0],c={command:u,prePoint:t,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(u){case"M":i=[l[1],l[2]],a=o;break;case"A":var h=HN(t,l);c.arcParams=h;break}if(u==="Z")t=i,n=r[a+1];else{var d=l.length;t=[l[d-2],l[d-1]]}n&&n[0]==="Z"&&(n=r[a],e[a]&&(e[a].prePoint=t)),c.currentPoint=t,e[a]&&Vf(t,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var f=n?[n[n.length-2],n[n.length-1]]:null;c.nextPoint=f;var v=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[v[0]-t[0],v[1]-t[1]],c.endTangent=[t[0]-v[0],t[1]-v[1]];else if(u==="Q"){var p=[l[1],l[2]];c.startTangent=[v[0]-p[0],v[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]}else if(u==="T"){var x=e[o-1],A=lE(x.currentPoint,v);x.command==="Q"?(c.command="Q",c.startTangent=[v[0]-A[0],v[1]-A[1]],c.endTangent=[t[0]-A[0],t[1]-A[1]]):(c.command="TL",c.startTangent=[v[0]-t[0],v[1]-t[1]],c.endTangent=[t[0]-v[0],t[1]-v[1]])}else if(u==="C"){var N=[l[1],l[2]],I=[l[3],l[4]];c.startTangent=[v[0]-N[0],v[1]-N[1]],c.endTangent=[t[0]-I[0],t[1]-I[1]],c.startTangent[0]===0&&c.startTangent[1]===0&&(c.startTangent=[N[0]-I[0],N[1]-I[1]]),c.endTangent[0]===0&&c.endTangent[1]===0&&(c.endTangent=[I[0]-N[0],I[1]-N[1]])}else if(u==="S"){var K=e[o-1],W=lE(K.currentPoint,v),z=[l[1],l[2]];K.command==="C"?(c.command="C",c.startTangent=[v[0]-W[0],v[1]-W[1]],c.endTangent=[t[0]-z[0],t[1]-z[1]]):(c.command="SQ",c.startTangent=[v[0]-z[0],v[1]-z[1]],c.endTangent=[t[0]-z[0],t[1]-z[1]])}else if(u==="A"){var j=hE(c,0),Z=j.x,vt=j.y,Tt=hE(c,1,!1),zt=Tt.x,Qt=Tt.y;c.startTangent=[Z,vt],c.endTangent=[zt,Qt]}e.push(c)}return e}function hE(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=r.arcParams,i=n.rx,a=i===void 0?0:i,s=n.ry,o=s===void 0?0:s,l=n.xRotation,u=n.arcFlag,c=n.sweepFlag,h=cE({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!u,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},e),d=cE({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!u,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},t?e+.005:e-.005),f=d.x-h.x,v=d.y-h.y,p=Math.sqrt(f*f+v*v);return{x:-f/p,y:-v/p}}function Hf(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function E0(r,e){return Hf(r)*Hf(e)?(r[0]*e[0]+r[1]*e[1])/(Hf(r)*Hf(e)):1}function dE(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(E0(r,e))}function HN(r,e){var t=e[1],n=e[2],i=(0,ut.Z)(Cr(e[3]),Math.PI*2),a=e[4],s=e[5],o=r[0],l=r[1],u=e[6],c=e[7],h=Math.cos(i)*(o-u)/2+Math.sin(i)*(l-c)/2,d=-1*Math.sin(i)*(o-u)/2+Math.cos(i)*(l-c)/2,f=h*h/(t*t)+d*d/(n*n);f>1&&(t*=Math.sqrt(f),n*=Math.sqrt(f));var v=t*t*(d*d)+n*n*(h*h),p=v?Math.sqrt((t*t*(n*n)-v)/v):1;a===s&&(p*=-1),isNaN(p)&&(p=0);var x=n?p*t*d/n:0,A=t?p*-n*h/t:0,N=(o+u)/2+Math.cos(i)*x-Math.sin(i)*A,I=(l+c)/2+Math.sin(i)*x+Math.cos(i)*A,K=[(h-x)/t,(d-A)/n],W=[(-1*h-x)/t,(-1*d-A)/n],z=dE([1,0],K),j=dE(K,W);return E0(K,W)<=-1&&(j=Math.PI),E0(K,W)>=1&&(j=0),s===0&&j>0&&(j-=2*Math.PI),s===1&&j<0&&(j+=2*Math.PI),{cx:N,cy:I,rx:Vf(r,[u,c])?0:t,ry:Vf(r,[u,c])?0:n,startAngle:z,endAngle:z+j,xRotation:i,arcFlag:a,sweepFlag:s}}function XN(r,e,t){return r.reduce(function(n,i){var a="";if(i[0]==="M"||i[0]==="L"){var s=vec3.fromValues(i[1],i[2],0);t&&vec3.transformMat4(s,s,t),a="".concat(i[0]).concat(s[0],",").concat(s[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var o=vec3.fromValues(i[1],i[2],0),l=vec3.fromValues(i[3],i[4],0),u=vec3.fromValues(i[5],i[6],0);t&&(vec3.transformMat4(o,o,t),vec3.transformMat4(l,l,t),vec3.transformMat4(u,u,t)),a="".concat(i[0]).concat(o[0],",").concat(o[1],",").concat(l[0],",").concat(l[1],",").concat(u[0],",").concat(u[1])}else if(i[0]==="A"){var c=vec3.fromValues(i[6],i[7],0);t&&vec3.transformMat4(c,c,t),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(c[0],",").concat(c[1])}else if(i[0]==="Q"){var h=vec3.fromValues(i[1],i[2],0),d=vec3.fromValues(i[3],i[4],0);t&&(vec3.transformMat4(h,h,t),vec3.transformMat4(d,d,t)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return n+=a},"")}function KN(r,e,t,n){return[["M",r,e],["L",t,n]]}function fE(r,e,t,n){var i=(-1+Math.sqrt(2))/3*4,a=r*i,s=e*i,o=t-r,l=t+r,u=n-e,c=n+e;return[["M",o,n],["C",o,n-s,t-a,u,t,u],["C",t+a,u,l,n-s,l,n],["C",l,n+s,t+a,c,t,c],["C",t-a,c,o,n+s,o,n],["Z"]]}function $N(r,e){var t=r.map(function(n,i){return[i===0?"M":"L",n[0],n[1]]});return e&&t.push(["Z"]),t}function QN(r,e,t,n,i){if(i){var a=_slicedToArray(i,4),s=a[0],o=a[1],l=a[2],u=a[3],c=r>0?1:-1,h=e>0?1:-1,d=c+h!==0?1:0;return[["M",c*s+t,n],["L",r-c*o+t,n],o?["A",o,o,0,0,d,r+t,h*o+n]:null,["L",r+t,e-h*l+n],l?["A",l,l,0,0,d,r+t-c*l,e+n]:null,["L",t+c*u,e+n],u?["A",u,u,0,0,d,t,e+n-h*u]:null,["L",t,h*s+n],s?["A",s,s,0,0,d,c*s+t,n]:null,["Z"]].filter(function(f){return f})}return[["M",t,n],["L",t+r,n],["L",t+r,n+e],["L",t,n+e],["Z"]]}function cF(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.getLocalTransform(),t=[];switch(r.nodeName){case On.LINE:var n=r.parsedStyle,i=n.x1,a=i===void 0?0:i,s=n.y1,o=s===void 0?0:s,l=n.x2,u=l===void 0?0:l,c=n.y2,h=c===void 0?0:c;t=KN(a,o,u,h);break;case On.CIRCLE:{var d=r.parsedStyle,f=d.r,v=f===void 0?0:f,p=d.cx,x=p===void 0?0:p,A=d.cy,N=A===void 0?0:A;t=fE(v,v,x,N);break}case On.ELLIPSE:{var I=r.parsedStyle,K=I.rx,W=K===void 0?0:K,z=I.ry,j=z===void 0?0:z,Z=I.cx,vt=Z===void 0?0:Z,Tt=I.cy,zt=Tt===void 0?0:Tt;t=fE(W,j,vt,zt);break}case On.POLYLINE:case On.POLYGON:var Qt=r.parsedStyle.points;t=$N(Qt.points,r.nodeName===On.POLYGON);break;case On.RECT:var ae=r.parsedStyle,fe=ae.width,ce=fe===void 0?0:fe,ct=ae.height,$=ct===void 0?0:ct,Q=ae.x,It=Q===void 0?0:Q,ue=ae.y,le=ue===void 0?0:ue,Fe=ae.radius,Qe=Fe&&Fe.some(function(tn){return tn!==0});t=QN(ce,$,It,le,Qe&&Fe.map(function(tn){return clamp(tn,0,Math.min(Math.abs(ce)/2,Math.abs($)/2))}));break;case On.PATH:var He=r.parsedStyle.d.absolutePath;t=_toConsumableArray(He);break}if(t.length)return XN(t,r,e)}function hF(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=r.map(function(s,o){var l=s[0],u=r[o+1],c=o===0&&(e!==0||t!==0),h=(o===r.length-1||u&&(u[0]==="M"||u[0]==="Z"))&&n!==0&&i!==0,d=c?[e,t]:[0,0],f=_slicedToArray(d,2),v=f[0],p=f[1],x=h?[n,i]:[0,0],A=_slicedToArray(x,2),N=A[0],I=A[1];switch(l){case"M":return"M ".concat(s[1]+v,",").concat(s[2]+p);case"L":return"L ".concat(s[1]+N,",").concat(s[2]+I);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+N," ").concat(s[4]+I);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+N," ").concat(s[6]+I);case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]+N," ").concat(s[7]+I);case"Z":return"Z";default:return null}}).filter(function(s){return s!==null}).join(" ");return~a.indexOf("NaN")?"":a}var vE=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=(0,Vt.A)(e)}catch(f){t=(0,Vt.A)(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}WN(t);var n=UN(t),i=ZN(t),a=i.polygons,s=i.polylines,o=YN(t),l=VN(o,0),u=l.x,c=l.y,h=l.width,d=l.height;return{absolutePath:t,hasArc:n,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(h)?h:0,height:Number.isFinite(d)?d:0}}},JN=aa(vE);function gE(r){return(0,Gt.Z)(r)?JN(r):vE(r)}function qN(r,e,t){var n=r.curve,i=e.curve;(!n||n.length===0)&&(n=(0,ve.Y)(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=(0,ve.Y)(e.absolutePath,!1),e.curve=i);var a=[n,i];n.length!==i.length&&(a=(0,kt.x)(n,i));var s=(0,ee.b)(a[0])!==(0,ee.b)(a[1])?(0,me.G)(a[0]):(0,Nt.U)(a[0]);return[s,(0,Zt.g)(a[1],s),function(o){return o}]}function tR(r,e){var t;return(0,Gt.Z)(r)?t=r.split(" ").map(function(n){var i=n.split(","),a=Mr(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):t=r,{points:t,totalLength:0,segments:[]}}function eR(r,e){return[r.points,e.points,function(t){return t}]}var li=null,Tu=/\s*(\w+)\(([^)]*)\)/g;function ma(r){return function(e){var t=0;return r.map(function(n){return n===li?e[t++]:n})}}function Cl(r){return r}var Uc={matrix:["NNNNNN",[li,li,0,0,li,li,0,0,0,0,1,0,li,li,0,1],Cl],matrix3d:["NNNNNNNNNNNNNNNN",Cl],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ma([li,li,new Pr(1)]),Cl],scaleX:["N",ma([li,new Pr(1),new Pr(1)]),ma([li,new Pr(1)])],scaleY:["N",ma([new Pr(1),li,new Pr(1)]),ma([new Pr(1),li])],scaleZ:["N",ma([new Pr(1),new Pr(1),li])],scale3d:["NNN",Cl],skew:["Aa",null,Cl],skewX:["A",null,ma([li,Al])],skewY:["A",null,ma([Al,li])],translate:["Tt",ma([li,li,ks]),Cl],translateX:["T",ma([li,ks,ks]),ma([li,ks])],translateY:["T",ma([ks,li,ks]),ma([ks,li])],translateZ:["L",ma([ks,ks,li])],translate3d:["TTL",Cl]};function pE(r){for(var e=[],t=r.length,n=0;n<t;n++){var i=r[n],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=Uc[a];if(!o)return[];var l=s.map(function(u){return Jr(u)});e.push({t:a,d:l})}return e}function nR(r){if(Array.isArray(r))return pE(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(Tu.lastIndex=0;t=Tu.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=Uc[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],u=0;u<o.length;u++){var c=s[u],h=o[u],d=void 0;if(c?d={A:function(v){return v.trim()==="0"?Al:IN(v)},N:y0,T:m0,L:LN}[h.toUpperCase()](c):d={a:Al,n:l[0],t:ks}[h],d===void 0)return[];l.push(d)}if(e.push({t:i,d:l}),Tu.lastIndex===r.length)return e}return[]}function rR(r){if(Array.isArray(r))return pE(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(Tu.lastIndex=0;t=Tu.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=Uc[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],u=0;u<o.length;u++){var c=s[u],h=o[u],d=void 0;if(c?d={A:function(v){return v.trim()==="0"?Al:nE(v)},N:aE,T:eE,L:tE}[h.toUpperCase()](c):d={a:Al,n:l[0],t:ks}[h],d===void 0)return[];l.push(d)}if(e.push({t:i,d:l}),Tu.lastIndex===r.length)return e}return[]}function iR(r){var e,t,n,i;switch(r.t){case"rotateX":return i=Cr(pa(r.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Cr(pa(r.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Cr(pa(r.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=r.d[0].value,t=r.d[1].value,n=r.d[2].value,i=Cr(pa(r.d[3]));var a=e*e+t*t+n*n;if(a===0)e=1,t=0,n=0;else if(a!==1){var s=Math.sqrt(a);e/=s,t/=s,n/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),u=o*o;return[1-2*(t*t+n*n)*u,2*(e*t*u+n*l),2*(e*n*u-t*l),0,2*(e*t*u-n*l),1-2*(e*e+n*n)*u,2*(t*n*u+e*l),0,2*(e*n*u+t*l),2*(t*n*u-e*l),1-2*(e*e+t*t)*u,0,0,0,0,1];case"scale":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[r.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,r.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,r.d[0].value,0,0,0,0,1];case"scale3d":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,r.d[2].value,0,0,0,0,1];case"skew":var c=Cr(pa(r.d[0])),h=Cr(pa(r.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Cr(pa(r.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Cr(pa(r.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return e=Ra(r.d[0],0,null)||0,t=Ra(r.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,0,1];case"translateX":return e=Ra(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,0,0,1];case"translateY":return t=Ra(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,t,0,1];case"translateZ":return n=Ra(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n,1];case"translate3d":return e=Ra(r.d[0],0,null)||0,t=Ra(r.d[1],0,null)||0,n=Ra(r.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1];case"perspective":var d=Ra(r.d[0],0,null)||0,f=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,f,0,0,0,1];case"matrix":return[r.d[0].value,r.d[1].value,0,0,r.d[2].value,r.d[3].value,0,0,0,0,1,0,r.d[4].value,r.d[5].value,0,1];case"matrix3d":return r.d.map(function(v){return v.value})}}function aR(r,e){return[r[0]*e[0]+r[4]*e[1]+r[8]*e[2]+r[12]*e[3],r[1]*e[0]+r[5]*e[1]+r[9]*e[2]+r[13]*e[3],r[2]*e[0]+r[6]*e[1]+r[10]*e[2]+r[14]*e[3],r[3]*e[0]+r[7]*e[1]+r[11]*e[2]+r[15]*e[3],r[0]*e[4]+r[4]*e[5]+r[8]*e[6]+r[12]*e[7],r[1]*e[4]+r[5]*e[5]+r[9]*e[6]+r[13]*e[7],r[2]*e[4]+r[6]*e[5]+r[10]*e[6]+r[14]*e[7],r[3]*e[4]+r[7]*e[5]+r[11]*e[6]+r[15]*e[7],r[0]*e[8]+r[4]*e[9]+r[8]*e[10]+r[12]*e[11],r[1]*e[8]+r[5]*e[9]+r[9]*e[10]+r[13]*e[11],r[2]*e[8]+r[6]*e[9]+r[10]*e[10]+r[14]*e[11],r[3]*e[8]+r[7]*e[9]+r[11]*e[10]+r[15]*e[11],r[0]*e[12]+r[4]*e[13]+r[8]*e[14]+r[12]*e[15],r[1]*e[12]+r[5]*e[13]+r[9]*e[14]+r[13]*e[15],r[2]*e[12]+r[6]*e[13]+r[10]*e[14]+r[14]*e[15],r[3]*e[12]+r[7]*e[13]+r[11]*e[14]+r[15]*e[15]]}function sR(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(iR).reduce(aR)}function mE(r){var e=[0,0,0],t=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return nN(sR(r),e,t,n,i,a),[[e,t,n,a,i]]}var oR=function(){function r(n,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var l=0;l<4;l++)a[s][o]+=i[s][l]*n[l][o];return a}function e(n){return n[0][2]===0&&n[0][3]===0&&n[1][2]===0&&n[1][3]===0&&n[2][0]===0&&n[2][1]===0&&n[2][2]===1&&n[2][3]===0&&n[3][2]===0&&n[3][3]===1}function t(n,i,a,s,o){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=0;u<4;u++)l[u][3]=o[u];for(var c=0;c<3;c++)for(var h=0;h<3;h++)l[3][c]+=n[h]*l[h][c];var d=s[0],f=s[1],v=s[2],p=s[3],x=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];x[0][0]=1-2*(f*f+v*v),x[0][1]=2*(d*f-v*p),x[0][2]=2*(d*v+f*p),x[1][0]=2*(d*f+v*p),x[1][1]=1-2*(d*d+v*v),x[1][2]=2*(f*v-d*p),x[2][0]=2*(d*v-f*p),x[2][1]=2*(f*v+d*p),x[2][2]=1-2*(d*d+f*f),l=r(l,x);var A=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(A[2][1]=a[2],l=r(l,A)),a[1]&&(A[2][1]=0,A[2][0]=a[0],l=r(l,A)),a[0]&&(A[2][0]=0,A[1][0]=a[0],l=r(l,A));for(var N=0;N<3;N++)for(var I=0;I<3;I++)l[N][I]*=i[N];return e(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return t}();function lR(r){return r.toFixed(6).replace(".000000","")}function w0(r,e){var t,n;return r.decompositionPair!==e&&(r.decompositionPair=e,t=mE(r)),e.decompositionPair!==r&&(e.decompositionPair=r,n=mE(e)),t[0]===null||n[0]===null?[[!1],[!0],function(i){return i?e[0].d:r[0].d}]:(t[0].push(0),n[0].push(1),[t,n,function(i){var a=cR(t[0][3],n[0][3],i[5]),s=oR(i[0],i[1],i[2],a,i[4]),o=s.map(lR).join(",");return o}])}function uR(r,e){for(var t=0,n=0;n<r.length;n++)t+=r[n]*e[n];return t}function cR(r,e,t){var n=uR(r,e);n=(0,Kt.Z)(n,-1,1);var i=[];if(n===1)i=r;else for(var a=Math.acos(n),s=Math.sin(t*a)*1/Math.sqrt(1-n*n),o=0;o<4;o++)i.push(r[o]*(Math.cos(t*a)-n*s)+e[o]*s);return i}function S0(r){return r.replace(/[XY]/,"")}function _0(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var hR=function(e,t){return e==="perspective"&&t==="perspective"||(e==="matrix"||e==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function dR(r,e,t){var n=!1;if(!r.length||!e.length){r.length||(n=!0,r=e,e=[]);for(var i=function(){var zt=r[a],Qt=zt.t,ae=zt.d,fe=Qt.substring(0,5)==="scale"?1:0;e.push({t:Qt,d:ae.map(function(ce){return typeof ce=="number"?Jr(fe):Jr(fe,ce.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],l=[];if(r.length!==e.length){var u=w0(r,e);s=[u[0]],o=[u[1]],l=[["matrix",[u[2]]]]}else for(var c=0;c<r.length;c++){var h=r[c].t,d=e[c].t,f=r[c].d,v=e[c].d,p=Uc[h],x=Uc[d],A=void 0;if(hR(h,d)){var N=w0([r[c]],[e[c]]);s.push(N[0]),o.push(N[1]),l.push(["matrix",[N[2]]]);continue}else if(h===d)A=h;else if(p[2]&&x[2]&&S0(h)===S0(d))A=S0(h),f=p[2](f),v=x[2](v);else if(p[1]&&x[1]&&_0(h)===_0(d))A=_0(h),f=p[1](f),v=x[1](v);else{var I=w0(r,e);s=[I[0]],o=[I[1]],l=[["matrix",[I[2]]]];break}for(var K=[],W=[],z=[],j=0;j<f.length;j++){var Z=FN(f[j],v[j],t,!1,j);K[j]=Z[0],W[j]=Z[1],z.push(Z[2])}s.push(K),o.push(W),l.push([A,z])}if(n){var vt=s;s=o,o=vt}return[s,o,function(Tt){return Tt.map(function(zt,Qt){var ae=zt.map(function(fe,ce){return l[Qt][1][ce](fe)}).join(",");return l[Qt][0]==="matrix"&&ae.split(",").length===16&&(l[Qt][0]="matrix3d"),l[Qt][0]==="matrix3d"&&ae.split(",").length===6&&(l[Qt][0]="matrix"),"".concat(l[Qt][0],"(").concat(ae,")")}).join(" ")}]}var fR=aa(function(r){if((0,Gt.Z)(r)){if(r==="text-anchor")return[Jr(0,"px"),Jr(0,"px")];var e=r.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[m0(yE(e[0])),m0(yE(e[1]))]}return[Jr(r[0]||0,"px"),Jr(r[1]||0,"px")]});function yE(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var bE=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:un.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:un.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:un.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:un.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:un.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:un.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:un.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:un.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:un.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:un.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:un.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:un.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:un.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:un.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:un.FILTER},{n:"clipPath",syntax:un.DEFINED_PATH},{n:"textPath",syntax:un.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:un.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:un.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:un.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:un.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:un.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:un.COORDINATE},{n:"y1",int:!0,l:!0,syntax:un.COORDINATE},{n:"z1",int:!0,l:!0,syntax:un.COORDINATE},{n:"x2",int:!0,l:!0,syntax:un.COORDINATE},{n:"y2",int:!0,l:!0,syntax:un.COORDINATE},{n:"z2",int:!0,l:!0,syntax:un.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:un.PATH,p:50},{n:"points",int:!0,l:!0,syntax:un.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:un.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:un.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:un.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:un.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:un.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:un.NUMBER,d:function(e){return e===On.PATH||e===On.POLYGON||e===On.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:un.MARKER},{n:"markerEnd",syntax:un.MARKER},{n:"markerMid",syntax:un.MARKER},{n:"markerStartOffset",syntax:un.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:un.LENGTH,l:!0,int:!0,d:"0"}],vR=new Set(bE.filter(function(r){return!!r.l}).map(function(r){return r.n})),xE={},gR=function(){function r(e){var t=this;rn(this,r),this.runtime=e,bE.forEach(function(n){t.registerMetadata(n)})}return an(r,[{key:"registerMetadata",value:function(t){[t.n].concat(ea(t.a||[])).forEach(function(n){xE[n]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,n);var a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;Object.assign(t.parsedStyle,n);var o=!!i.forceUpdateGeometry;if(!o){for(var l in n)if(vR.has(l)){o=!0;break}}n.fill&&(t.parsedStyle.fill=Gc(n.fill)),n.stroke&&(t.parsedStyle.stroke=Gc(n.stroke)),n.shadowColor&&(t.parsedStyle.shadowColor=Gc(n.shadowColor)),n.filter&&(t.parsedStyle.filter=jN(n.filter)),(0,be.Z)(n.radius)||(t.parsedStyle.radius=rE(n.radius,4)),(0,be.Z)(n.lineDash)||(t.parsedStyle.lineDash=rE(n.lineDash,2)),n.points&&(t.parsedStyle.points=tR(n.points)),n.d===""&&(t.parsedStyle.d=di({},Hx)),n.d&&(t.parsedStyle.d=gE(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[un.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},t,null),(0,Yt.Z)(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[un.DEFINED_PATH].calculator("clipPath",a,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[un.DEFINED_PATH].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.transform&&(t.parsedStyle.transform=nR(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=fR(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[un.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[un.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[un.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),(0,be.Z)(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[un.Z_INDEX].postProcessor(t),(0,be.Z)(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[un.OFFSET_DISTANCE].postProcessor(t),n.transform&&this.runtime.CSSPropertySyntaxFactory[un.TRANSFORM].postProcessor(t),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[un.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var n=t.nodeName,i=this.runtime.geometryUpdaterFactory[n];if(i){var a=t.geometry;a.contentBounds||(a.contentBounds=new ga),a.renderBounds||(a.renderBounds=new ga);var s=t.parsedStyle,o=i.update(s,t),l=o.cx,u=l===void 0?0:l,c=o.cy,h=c===void 0?0:c,d=o.cz,f=d===void 0?0:d,v=o.hwidth,p=v===void 0?0:v,x=o.hheight,A=x===void 0?0:x,N=o.hdepth,I=N===void 0?0:N,K=[Math.abs(p),Math.abs(A),I],W=s.stroke,z=s.lineWidth,j=z===void 0?1:z,Z=s.increasedLineWidthForHitTesting,vt=Z===void 0?0:Z,Tt=s.shadowType,zt=Tt===void 0?"outer":Tt,Qt=s.shadowColor,ae=s.filter,fe=ae===void 0?[]:ae,ce=s.transformOrigin,ct=[u,h,f];a.contentBounds.update(ct,K);var $=n===On.POLYLINE||n===On.POLYGON||n===On.PATH?Math.SQRT2:.5,Q=W&&!W.isNone;if(Q){var It=((j||0)+(vt||0))*$;K[0]+=It,K[1]+=It}if(a.renderBounds.update(ct,K),Qt&&zt&&zt!=="inner"){var ue=a.renderBounds,le=ue.min,Fe=ue.max,Qe=s.shadowBlur,He=s.shadowOffsetX,tn=s.shadowOffsetY,vn=Qe||0,_n=He||0,kr=tn||0,Rr=le[0]-vn+_n,Ps=Fe[0]+vn+_n,Fl=le[1]-vn+kr,ja=Fe[1]+vn+kr;le[0]=Math.min(le[0],Rr),Fe[0]=Math.max(Fe[0],Ps),le[1]=Math.min(le[1],Fl),Fe[1]=Math.max(Fe[1],ja),a.renderBounds.setMinMax(le,Fe)}fe.forEach(function(ch){var hh=ch.name,Eo=ch.params;if(hh==="blur"){var dh=Eo[0].value;a.renderBounds.update(a.renderBounds.center,et.IH(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[dh,dh,0]))}else if(hh==="drop-shadow"){var fh=Eo[0].value,vh=Eo[1].value,wo=Eo[2].value,gh=a.renderBounds,oa=gh.min,la=gh.max,wm=oa[0]-wo+fh,Sm=la[0]+wo+fh,_m=oa[1]-wo+vh,Mm=la[1]+wo+vh;oa[0]=Math.min(oa[0],wm),la[0]=Math.max(la[0],Sm),oa[1]=Math.min(oa[1],_m),la[1]=Math.max(la[1],Mm),a.renderBounds.setMinMax(oa,la)}}),t.geometry.dirty=!1;var xo=p<0,Em=A<0,lh=(xo?-1:1)*(ce?Ra(ce[0],0,t,!0):0),uh=(Em?-1:1)*(ce?Ra(ce[1],1,t,!0):0);(lh||uh)&&t.setOrigin(lh,uh)}}},{key:"updateSizeAttenuation",value:function(t,n){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/n,t.nodeName===On.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/n)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===On.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}(),pR=function(){function r(){rn(this,r),this.mixer=b0}return an(r,[{key:"calculator",value:function(t,n,i,a){return pa(i)}}])}(),mR=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i,a,s){return i instanceof as&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(t,n,i,a),t==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtifyToRoot(o)}),i}}])}(),yR=function(){function r(){rn(this,r),this.parser=Gc,this.mixer=RN}return an(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof as?i.value==="none"?$x:Qx:i}}])}(),bR=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i){return i instanceof as?[]:i}}])}();function EE(r){var e=r.parsedStyle,t=e.fontSize;return(0,be.Z)(t)?null:t}var M0=function(){function r(){rn(this,r),this.mixer=b0}return an(r,[{key:"calculator",value:function(t,n,i,a,s){if((0,bt.Z)(i))return i;if(Pr.isRelativeUnit(i.unit)){if(i.unit===cn.kPercentage)return 0;if(i.unit===cn.kEms){if(a.parentNode){var o=EE(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===cn.kRems){var l;if(a!=null&&(l=a.ownerDocument)!==null&&l!==void 0&&l.documentElement){var u=EE(a.ownerDocument.documentElement);if(u)return u*=i.value,u}return 0}}else return i.value}}])}(),xR=function(){function r(){rn(this,r),this.mixer=sE}return an(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])}(),ER=function(){function r(){rn(this,r),this.mixer=sE}return an(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])}(),wR=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i,a){var s;i instanceof as&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),SR=function(){function r(){rn(this,r),this.mixer=b0}return an(r,[{key:"calculator",value:function(t,n,i){return i.value}}])}(),_R=function(){function r(){rn(this,r),this.mixer=x0(0,1)}return an(r,[{key:"calculator",value:function(t,n,i){return i.value}},{key:"postProcessor",value:function(t){var n=t.parsedStyle,i=n.offsetPath,a=n.offsetDistance;if(i){var s=i.nodeName;if(s===On.LINE||s===On.PATH||s===On.POLYLINE){var o=i.getPoint(a);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),MR=function(){function r(){rn(this,r),this.mixer=x0(0,1)}return an(r,[{key:"calculator",value:function(t,n,i){return i.value}}])}(),kR=function(){function r(){rn(this,r),this.parser=gE,this.mixer=qN}return an(r,[{key:"calculator",value:function(t,n,i){return i instanceof as&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _u(0,0,0,0)}:i}}])}(),TR=an(function r(){rn(this,r),this.mixer=eR}),OR=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.mixer=x0(0,1/0),t}return fr(e,r),an(e)}(M0),AR=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof as?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),CR=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])}(),dF=function(e){return Object.fromEntries(Object.entries(e).filter(function(t){var n=_slicedToArray(t,2),i=n[1];return i!==void 0}))},k0=new WeakMap;function fF(r,e,t){if(r){var n=typeof r=="string"?document.getElementById(r):r;k0.has(n)&&k0.get(n).destroy(t),k0.set(n,e)}}var wE=typeof window!="undefined"&&typeof window.document!="undefined";function vF(r){return!!r.getAttribute}function gF(r,e){for(var t=0,n=r.length;t<n;){var i=t+n>>>1;PR(r[i],e)<0?t=i+1:n=i}return t}function PR(r,e){var t=Number(r.parsedStyle.zIndex||0),n=Number(e.parsedStyle.zIndex||0);if(t===n){var i=r.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(r)-a.indexOf(e)}}return t-n}function NR(r){var e=r;do{var t,n=(t=e.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(n)return e;e=e.parentElement}while(e!==null);return null}var SE="px";function pF(r,e,t){wE&&r.style&&(r.style.width=e+SE,r.style.height=t+SE)}function _E(r,e){if(wE)return document.defaultView.getComputedStyle(r,null).getPropertyValue(e)}function mF(r){var e=_E(r,"width");return e==="auto"?r.offsetWidth:parseFloat(e)}function yF(r){var e=_E(r,"height");return e==="auto"?r.offsetHeight:parseFloat(e)}var RR=1,LR={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},DR=typeof performance=="object"&&performance.now?performance:Date;function T0(r){return r.nodeName===On.FRAGMENT?!0:r.getRootNode().nodeName===On.FRAGMENT}function bF(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=!1,i=!1,a=!!e&&!e.isNone,s=!!t&&!t.isNone;return r==="visiblepainted"||r==="painted"||r==="auto"?(n=a,i=s):r==="visiblefill"||r==="fill"?n=!0:r==="visiblestroke"||r==="stroke"?i=!0:(r==="visible"||r==="all")&&(n=!0,i=!0),[n,i]}var IR=1,FR=function(){return IR++},$s=typeof self=="object"&&self.self===self?self:typeof g.g=="object"&&g.g.global===g.g?g.g:{},BR=Date.now(),zR=function(){return $s.performance&&typeof $s.performance.now=="function"?$s.performance.now():Date.now()-BR},Zc={},ME=Date.now(),jR=function(e){if(typeof e!="function")throw new TypeError("".concat(e," is not a function"));var t=Date.now(),n=t-ME,i=n>16?0:16-n,a=FR();return Zc[a]=e,Object.keys(Zc).length>1||setTimeout(function(){ME=t;var s=Zc;Zc={},Object.keys(s).forEach(function(o){return s[o](zR())})},i),a},GR=function(e){delete Zc[e]},WR=["","webkit","moz","ms","o"],kE=function(e){return typeof e!="string"?jR:e===""?$s.requestAnimationFrame:$s["".concat(e,"RequestAnimationFrame")]},UR=function(e){return typeof e!="string"?GR:e===""?$s.cancelAnimationFrame:$s["".concat(e,"CancelAnimationFrame")]||$s["".concat(e,"CancelRequestAnimationFrame")]},ZR=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n+=1}},TE=ZR(WR,function(r){return!!kE(r)}),OE=kE(TE),VR=UR(TE);$s.requestAnimationFrame=OE,$s.cancelAnimationFrame=VR;var xF=null,EF=null,wF=null,SF=null,YR=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],HR=/([\"\'])[^\'\"]+\1/;function XR(r){for(var e=r.fontSize,t=e===void 0?16:e,n=r.fontFamily,i=n===void 0?"sans-serif":n,a=r.fontStyle,s=a===void 0?"normal":a,o=r.fontVariant,l=o===void 0?"normal":o,u=r.fontWeight,c=u===void 0?"normal":u,h=(0,bt.Z)(t)&&"".concat(t,"px")||"16px",d=i.split(","),f=d.length-1;f>=0;f--){var v=d[f].trim();!HR.test(v)&&YR.indexOf(v)<0&&(v='"'.concat(v,'"')),d[f]=v}return"".concat(s," ").concat(l," ").concat(c," ").concat(h," ").concat(d.join(","))}function O0(r,e,t){return yt.identity(r),r[4]=Math.tan(e),r[1]=Math.tan(t),r}var yi=yt.create(),KR=yt.create(),$R={scale:function(e){yt.fromScaling(yi,[e[0].value,e[1].value,1])},scaleX:function(e){yt.fromScaling(yi,[e[0].value,1,1])},scaleY:function(e){yt.fromScaling(yi,[1,e[0].value,1])},scaleZ:function(e){yt.fromScaling(yi,[1,1,e[0].value])},scale3d:function(e){yt.fromScaling(yi,[e[0].value,e[1].value,e[2].value])},translate:function(e){yt.fromTranslation(yi,[e[0].value,e[1].value,0])},translateX:function(e){yt.fromTranslation(yi,[e[0].value,0,0])},translateY:function(e){yt.fromTranslation(yi,[0,e[0].value,0])},translateZ:function(e){yt.fromTranslation(yi,[0,0,e[0].value])},translate3d:function(e){yt.fromTranslation(yi,[e[0].value,e[1].value,e[2].value])},rotate:function(e){yt.fromZRotation(yi,Cr(pa(e[0])))},rotateX:function(e){yt.fromXRotation(yi,Cr(pa(e[0])))},rotateY:function(e){yt.fromYRotation(yi,Cr(pa(e[0])))},rotateZ:function(e){yt.fromZRotation(yi,Cr(pa(e[0])))},rotate3d:function(e){yt.fromRotation(yi,Cr(pa(e[3])),[e[0].value,e[1].value,e[2].value])},skew:function(e){O0(yi,Cr(e[0].value),Cr(e[1].value))},skewX:function(e){O0(yi,Cr(e[0].value),0)},skewY:function(e){O0(yi,0,Cr(e[0].value))},matrix:function(e){yt.set(yi,e[0].value,e[1].value,0,0,e[2].value,e[3].value,0,0,0,0,1,0,e[4].value,e[5].value,0,1)},matrix3d:function(e){yt.set.apply(yt,[yi].concat(ea(e.map(function(t){return t.value}))))}},QR=et.al(1,1,1),JR=et.Ue(),AE={translate:function(e,t){on.sceneGraphService.setLocalScale(e,QR,!1),on.sceneGraphService.setLocalEulerAngles(e,JR,void 0,void 0,!1),on.sceneGraphService.setLocalPosition(e,[t[0].value,t[1].value,0],!1),on.sceneGraphService.dirtifyLocal(e,e.transformable)}};function qR(r,e){if(r.length){if(r.length===1&&AE[r[0].t]){AE[r[0].t](e,r[0].d);return}for(var t=yt.identity(KR),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=$R[a];o&&(o(s),yt.mul(t,t,yi))}e.setLocalTransform(t)}else e.resetLocalTransform();return e.getLocalTransform()}var t3=function(){function r(){rn(this,r),this.parser=rR,this.mixer=dR}return an(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof as?[]:i}},{key:"postProcessor",value:function(t){qR(t.parsedStyle.transform,t)}}])}(),e3=function(){function r(){rn(this,r)}return an(r,[{key:"postProcessor",value:function(t){var n=t.parsedStyle.transformOrigin;n[0].unit===cn.kPixels&&n[1].unit===cn.kPixels?t.setOrigin(n[0].value,n[1].value):t.getGeometryBounds()}}])}(),n3=function(){function r(){rn(this,r)}return an(r,[{key:"calculator",value:function(t,n,i,a){return i.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var n=t.parentNode,i=n.renderable,a=n.sortable;i&&(i.dirty=!0),a&&(a.dirty=!0,a.dirtyReason=d0.Z_INDEX_CHANGED)}}}])}(),r3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,l=t.r,u=l===void 0?0:l;return{cx:a,cy:o,hwidth:u,hheight:u}}}])}(),i3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,l=t.rx,u=l===void 0?0:l,c=t.ry,h=c===void 0?0:c;return{cx:a,cy:o,hwidth:u,hheight:h}}}])}(),a3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t){var n=t.x1,i=t.y1,a=t.x2,s=t.y2,o=Math.min(n,a),l=Math.max(n,a),u=Math.min(i,s),c=Math.max(i,s),h=l-o,d=c-u,f=h/2,v=d/2;return{cx:o+f,cy:u+v,hwidth:f,hheight:v}}}])}(),s3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t){var n=t.d,i=n.rect,a=i.x,s=i.y,o=i.width,l=i.height,u=o/2,c=l/2;return{cx:a+u,cy:s+c,hwidth:u,hheight:c}}}])}(),o3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t){if(t.points&&(0,S.Z)(t.points.points)){var n=t.points.points,i=Math.min.apply(Math,ea(n.map(function(d){return d[0]}))),a=Math.max.apply(Math,ea(n.map(function(d){return d[0]}))),s=Math.min.apply(Math,ea(n.map(function(d){return d[1]}))),o=Math.max.apply(Math,ea(n.map(function(d){return d[1]}))),l=a-i,u=o-s,c=l/2,h=u/2;return{cx:i+c,cy:s+h,hwidth:c,hheight:h}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),l3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,l=t.src,u=t.width,c=u===void 0?0:u,h=t.height,d=h===void 0?0:h,f=c,v=d;return l&&!(0,Gt.Z)(l)&&(f||(f=l.width,t.width=f),v||(v=l.height,t.height=v)),{cx:a+f/2,cy:o+v/2,hwidth:f/2,hheight:v/2}}}])}(),u3=function(){function r(e){rn(this,r),this.globalRuntime=e}return an(r,[{key:"isReadyToMeasure",value:function(t,n){var i=t.text;return i}},{key:"update",value:function(t,n){var i,a=t.text,s=t.textAlign,o=s===void 0?"start":s,l=t.lineWidth,u=l===void 0?1:l,c=t.textBaseline,h=c===void 0?"alphabetic":c,d=t.dx,f=d===void 0?0:d,v=t.dy,p=v===void 0?0:v,x=t.x,A=x===void 0?0:x,N=t.y,I=N===void 0?0:N;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var K=(n==null||(i=n.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},W=K.offscreenCanvas,z=this.globalRuntime.textService.measureText(a,t,W);t.metrics=z;var j=z.width,Z=z.height,vt=j/2,Tt=Z/2,zt=A+vt;o==="center"||o==="middle"?zt+=u/2-vt:(o==="right"||o==="end")&&(zt+=u-vt*2);var Qt=I-Tt;return h==="middle"?Qt+=Tt:h==="top"||h==="hanging"?Qt+=Tt*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&(Qt+=0),f&&(zt+=f),p&&(Qt+=p),{cx:zt,cy:Qt,hwidth:vt,hheight:Tt}}}])}(),c3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t,n){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),h3=function(){function r(){rn(this,r)}return an(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,l=t.width,u=l===void 0?0:l,c=t.height,h=c===void 0?0:c;return{cx:a+u/2,cy:o+h/2,hwidth:u/2,hheight:h/2}}}])}();function _F(r){return!!r.type}var Xf=function(){function r(e){rn(this,r),this.eventPhase=r.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new rs,this.page=new rs,this.canvas=new rs,this.viewport=new rs,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return an(r,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Br)}}])}(),CE=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.client=new rs,t.movement=new rs,t.offset=new rs,t.global=new rs,t.screen=new rs,t}return fr(e,r),an(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)}},{key:"initMouseEvent",value:function(){throw new Error(Br)}}])}(Xf),d3=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.width=0,t.height=0,t.isPrimary=!1,t}return fr(e,r),an(e,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(CE),f3=function(r){function e(){return rn(this,e),dr(this,e,arguments)}return fr(e,r),an(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(CE),La=function(r){function e(t,n){var i;return rn(this,e),i=dr(this,e,[null]),i.type=t,i.detail=n,Object.assign(i,n),i}return fr(e,r),an(e)}(Xf),PE=new WeakMap,v3=function(){function r(){rn(this,r),this.emitter=new Ee.Z}return an(r,[{key:"on",value:function(t,n,i){return this.addEventListener(t,n,i),this}},{key:"addEventListener",value:function(t,n,i){var a=!1,s=!1;if((0,Y.Z)(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var l=i.once;s=l===void 0?!1:l}a&&(t+="capture"),n=(0,At.Z)(n)?n:n.handleEvent;var u=(0,At.Z)(n)?void 0:n;return s?this.emitter.once(t,n,u):this.emitter.on(t,n,u),this}},{key:"off",value:function(t,n,i){return t?this.removeEventListener(t,n,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;(t=this.emitter)===null||t===void 0||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,n,i){var a;if(!this.emitter)return this;var s=(0,Y.Z)(i)?i:i==null?void 0:i.capture;s&&(t+="capture"),n=(0,At.Z)(n)?n:(a=n)===null||a===void 0?void 0:a.handleEvent;var o=(0,At.Z)(n)?void 0:n;return this.emitter.off(t,n,o),this}},{key:"emit",value:function(t,n){this.dispatchEvent(new La(t,n))}},{key:"dispatchEvent",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=PE.get(this);if(!i){var a;this.document?i=this:this.defaultView?i=this.defaultView:i=(a=this.ownerDocument)===null||a===void 0?void 0:a.defaultView,i&&PE.set(this,i)}if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Pl=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return fr(e,r),an(e,[{key:"textContent",get:function(){var n="";this.nodeName===On.TEXT&&(n+=this.style.text);var i=wu(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===On.TEXT?n+=s.nodeValue:n+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return n},set:function(n){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===On.TEXT&&(this.style.text="".concat(n))}},{key:"getRootNode",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(n){throw new Error(Br)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(Br)}},{key:"lookupPrefix",value:function(n){throw new Error(Br)}},{key:"normalize",value:function(){throw new Error(Br)}},{key:"isEqualNode",value:function(n){return this===n}},{key:"isSameNode",value:function(n){return this.isEqualNode(n)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(n){if(n===this)return 0;for(var i=n,a=this,s=[i],o=[a];(l=i.parentNode)!==null&&l!==void 0?l:a.parentNode;){var l;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var u=s.length>o.length?s:o,c=u===s?o:s;if(u[u.length-c.length]===c[0])return u===s?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var h=u.length-c.length,d=c.length-1;d>=0;d--){var f=c[d],v=u[h+d];if(v!==f){var p=f.parentNode.childNodes;return p.indexOf(f)<p.indexOf(v)?c===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:u===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(n){return this.contains(n)}},{key:"contains",value:function(n){for(var i=n;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(n){for(var i=this;n>0&&i;)i=i.parentNode,n--;return i}},{key:"forEach",value:function(n){for(var i=[this];i.length>0;){var a=i.pop(),s=n(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(n){return!!n.childNodes}}])}(v3);Pl.DOCUMENT_POSITION_DISCONNECTED=1,Pl.DOCUMENT_POSITION_PRECEDING=2,Pl.DOCUMENT_POSITION_FOLLOWING=4,Pl.DOCUMENT_POSITION_CONTAINS=8,Pl.DOCUMENT_POSITION_CONTAINED_BY=16,Pl.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var MF=2048,kF=null,g3=function(){function r(){rn(this,r)}return an(r,[{key:"getOrCreateCanvas",value:function(t,n){if(this.canvas)return this.canvas;if(t||on.offscreenCanvas)this.canvas=t||on.offscreenCanvas,this.context=this.canvas.getContext("2d",di({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",di({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",di({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),TF=function(r){return r[r.CAMERA_CHANGED=0]="CAMERA_CHANGED",r[r.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",r[r.NONE=2]="NONE",r}({}),OF=null,p3=/\[\s*(.*)=(.*)\s*\]/,m3=function(){function r(){rn(this,r)}return an(r,[{key:"selectOne",value:function(t,n){var i=this;if(t.startsWith("."))return n.find(function(l){return((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(l){return l.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.find(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):null}return n.find(function(l){return n!==l&&l.nodeName===t})}},{key:"selectAll",value:function(t,n){var i=this;if(t.startsWith("."))return n.findAll(function(l){return n!==l&&((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(l){return n!==l&&l.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.findAll(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):[]}return n.findAll(function(l){return n!==l&&l.nodeName===t})}},{key:"is",value:function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,s=i.value;return a==="name"?n.name===s:this.attributeToString(n,a)===s}return n.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var n=t.match(p3),i="",a="";return n&&n.length>2&&(i=n[1].replace(/"/g,""),a=n[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(t,n){if(!t.getAttribute)return"";var i=t.getAttribute(n);return(0,be.Z)(i)?"":i.toString?i.toString():""}}])}(),fi=function(r){return r.REPARENT="reparent",r.DESTROY="destroy",r.ATTR_MODIFIED="DOMAttrModified",r.INSERTED="DOMNodeInserted",r.REMOVED="removed",r.MOUNTED="DOMNodeInsertedIntoDocument",r.UNMOUNTED="DOMNodeRemovedFromDocument",r.BOUNDS_CHANGED="bounds-changed",r.CULLED="culled",r}({}),Qs=function(r){function e(t,n,i,a,s,o,l,u){var c;return rn(this,e),c=dr(this,e,[null]),c.relatedNode=n,c.prevValue=i,c.newValue=a,c.attrName=s,c.attrChange=o,c.prevParsedValue=l,c.newParsedValue=u,c.type=t,c}return fr(e,r),an(e)}(Xf);Qs.ADDITION=2,Qs.MODIFICATION=1,Qs.REMOVAL=3;function NE(r){var e=r.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var y3=new Qs(fi.REPARENT,null,"","","",0,"",""),b3=rt.Ue(),Kf=et.Ue(),x3=et.al(1,1,1),E3=yt.create(),w3=rt.Ue(),Yo=et.Ue(),Ou=yt.create(),Ho=Xt.Ue(),S3=et.Ue(),_3=Xt.Ue(),M3=et.Ue(),Vc=et.Ue(),Nl=et.Ue(),$f=yt.create(),RE=Xt.Ue(),LE=Xt.Ue(),Qf=Xt.Ue(),A0={affectChildren:!0},k3=function(){function r(e){rn(this,r),this.pendingEvents=new Map,this.boundsChangedEvent=new La(fi.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}return an(r,[{key:"matches",value:function(t,n){return this.runtime.sceneGraphSelector.is(t,n)}},{key:"querySelector",value:function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)}},{key:"querySelectorAll",value:function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)}},{key:"attach",value:function(t,n,i){var a,s=!1;t.parentNode&&(s=t.parentNode!==n,this.detach(t));var o=t.nodeName===On.FRAGMENT,l=T0(n);t.parentNode=n;var u=o?t.childNodes:[t];(0,bt.Z)(i)?u.forEach(function(f){n.childNodes.splice(i,0,f),f.parentNode=n}):u.forEach(function(f){n.childNodes.push(f),f.parentNode=n});var c=n,h=c.sortable;if((h!=null&&(a=h.sorted)!==null&&a!==void 0&&a.length||t.parsedStyle.zIndex)&&(h.dirtyChildren.indexOf(t)===-1&&h.dirtyChildren.push(t),h.dirty=!0,h.dirtyReason=d0.ADDED),!l){if(o)this.dirtifyFragment(t);else{var d=t.transformable;d&&this.dirtifyWorld(t,d)}s&&t.dispatchEvent(y3)}}},{key:"detach",value:function(t){if(t.parentNode){var n,i,a=t.transformable,s=t.parentNode,o=s.sortable;(o!=null&&(n=o.sorted)!==null&&n!==void 0&&n.length||(i=t.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=d0.REMOVED);var l=t.parentNode.childNodes.indexOf(t);l>-1&&t.parentNode.childNodes.splice(l,1),a&&this.dirtifyWorld(t,a),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=[n,i,a]);var s=t.transformable;if(!(n[0]===s.origin[0]&&n[1]===s.origin[1]&&n[2]===s.origin[2])){var o=s.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtifyLocal(t,s)}}},{key:"rotate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.rotateLocal(t,n);else{var o=Ho;Xt.Su(o,n[0],n[1],n[2]);var l=this.getRotation(t),u=this.getRotation(t.parentNode);Xt.JG(Qf,u),Xt.U_(Qf,Qf),Xt.Jp(o,Qf,o),Xt.Jp(s.localRotation,o,l),Xt.Fv(s.localRotation,s.localRotation),this.dirtifyLocal(t,s)}}},{key:"rotateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;Xt.Su(LE,n[0],n[1],n[2]),Xt.dC(s.localRotation,s.localRotation,LE),this.dirtifyLocal(t,s)}},{key:"setEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.setLocalEulerAngles(t,n);else{Xt.Su(s.localRotation,n[0],n[1],n[2]);var o=this.getRotation(t.parentNode);Xt.JG(RE,Xt.U_(Ho,o)),Xt.dC(s.localRotation,s.localRotation,RE),this.dirtifyLocal(t,s)}}},{key:"setLocalEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof n=="number"&&(n=et.al(n,i,a));var o=t.transformable;Xt.Su(o.localRotation,n[0],n[1],n[2]),s&&this.dirtifyLocal(t,o)}},{key:"translateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.al(n,i,a));var s=t.transformable;et.fS(n,Kf)||(et.VC(n,n,s.localRotation),et.IH(s.localPosition,s.localPosition,n),this.dirtifyLocal(t,s))}},{key:"setPosition",value:function(t,n){var i,a=t.transformable;if(Nl[0]=n[0],Nl[1]=n[1],Nl[2]=(i=n[2])!==null&&i!==void 0?i:0,!et.fS(this.getPosition(t),Nl)){if(et.JG(a.position,Nl),t.parentNode===null||!t.parentNode.transformable)et.JG(a.localPosition,Nl);else{var s=t.parentNode.transformable;yt.copy($f,s.worldTransform),yt.invert($f,$f),et.fF(a.localPosition,Nl,$f)}this.dirtifyLocal(t,a)}}},{key:"setLocalPosition",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;Vc[0]=n[0],Vc[1]=n[1],Vc[2]=(i=n[2])!==null&&i!==void 0?i:0,!et.fS(s.localPosition,Vc)&&(et.JG(s.localPosition,Vc),a&&this.dirtifyLocal(t,s))}},{key:"scaleLocal",value:function(t,n){var i,a=t.transformable;et.Jp(a.localScale,a.localScale,et.t8(Yo,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:1)),this.dirtifyLocal(t,a)}},{key:"setLocalScale",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;et.t8(Yo,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:s.localScale[2]),!et.fS(Yo,s.localScale)&&(et.JG(s.localScale,Yo),a&&this.dirtifyLocal(t,s))}},{key:"translate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=et.t8(Yo,n,i,a)),!et.fS(n,Kf)&&(et.IH(Yo,this.getPosition(t),n),this.setPosition(t,Yo))}},{key:"setRotation",value:function(t,n,i,a,s){var o=t.transformable;if(typeof n=="number"&&(n=Xt.al(n,i,a,s)),t.parentNode===null||!t.parentNode.transformable)this.setLocalRotation(t,n);else{var l=this.getRotation(t.parentNode);Xt.JG(Ho,l),Xt.U_(Ho,Ho),Xt.Jp(o.localRotation,Ho,n),Xt.Fv(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}}},{key:"setLocalRotation",value:function(t,n,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof n=="number"&&(n=Xt.t8(Ho,n,i,a,s));var l=t.transformable;Xt.JG(l.localRotation,n),o&&this.dirtifyLocal(t,l)}},{key:"setLocalSkew",value:function(t,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof n=="number"&&(n=rt.t8(w3,n,i));var s=t.transformable;rt.JG(s.localSkew,n),a&&this.dirtifyLocal(t,s)}},{key:"dirtifyLocal",value:function(t,n){T0(t)||n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))}},{key:"dirtifyWorld",value:function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var n=t.transformable;n&&(n.frozen=!1,n.dirtyFlag=!0,n.localDirtyFlag=!0);var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0);for(var a=t.childNodes.length,s=0;s<a;s++)this.dirtifyFragment(t.childNodes[s]);t.nodeName===On.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,n=new Set,i=function(s,o){!s.isConnected||n.has(s)||s.nodeName===On.FRAGMENT||(t.boundsChangedEvent.detail=o,t.boundsChangedEvent.target=s,s.isMutationObserved?s.dispatchEvent(t.boundsChangedEvent):s.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(s))};this.pendingEvents.forEach(function(a,s){s.nodeName!==On.FRAGMENT&&(A0.affectChildren=a,a?s.forEach(function(o){i(o,A0)}):i(s,A0))}),n.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t;for(i.renderable&&(i.renderable.dirty=!0);i;)NE(i),i=i.parentNode;n&&t.forEach(function(a){NE(a)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"updateDisplayObjectDependency",value:function(t,n,i,a){if(n&&n!==i){var s=this.displayObjectDependencyMap.get(n);if(s&&s[t]){var o=s[t].indexOf(a);s[t].splice(o,1)}}if(i){var l=this.displayObjectDependencyMap.get(i);l||(this.displayObjectDependencyMap.set(i,{}),l=this.displayObjectDependencyMap.get(i)),l[t]||(l[t]=[]),l[t].push(a)}}},{key:"informDependentDisplayObjects",value:function(t){var n=this,i=this.displayObjectDependencyMap.get(t);i&&Object.keys(i).forEach(function(a){i[a].forEach(function(s){n.dirtifyToRoot(s,!0),s.dispatchEvent(new Qs(fi.ATTR_MODIFIED,s,n,n,a,Qs.MODIFICATION,n,n)),s.isCustomElement&&s.isConnected&&s.attributeChangedCallback&&s.attributeChangedCallback(a,n,n)})})}},{key:"getPosition",value:function(t){var n=t.transformable;return yt.getTranslation(n.position,this.getWorldTransform(t,n))}},{key:"getRotation",value:function(t){var n=t.transformable;return yt.getRotation(n.rotation,this.getWorldTransform(t,n))}},{key:"getScale",value:function(t){var n=t.transformable;return yt.getScaling(n.scaling,this.getWorldTransform(t,n))}},{key:"getWorldTransform",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.transformable;return!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){var n=t.localSkew[0]!==0||t.localSkew[1]!==0;if(n){yt.fromRotationTranslationScaleOrigin(t.localTransform,t.localRotation,t.localPosition,et.al(1,1,1),t.origin),(t.localSkew[0]!==0||t.localSkew[1]!==0)&&(yt.identity(Ou),Ou[4]=Math.tan(t.localSkew[0]),Ou[1]=Math.tan(t.localSkew[1]),yt.multiply(t.localTransform,t.localTransform,Ou));var i=yt.fromRotationTranslationScaleOrigin(Ou,Xt.t8(Ho,0,0,0,1),et.t8(Yo,1,1,1),t.localScale,t.origin);yt.multiply(t.localTransform,t.localTransform,i)}else{var a=t.localTransform,s=t.localPosition,o=t.localRotation,l=t.localScale,u=t.origin,c=s[0]!==0||s[1]!==0||s[2]!==0,h=o[3]!==1||o[0]!==0||o[1]!==0||o[2]!==0,d=l[0]!==1||l[1]!==1||l[2]!==1,f=u[0]!==0||u[1]!==0||u[2]!==0;!h&&!d&&!f?c?yt.fromTranslation(a,s):yt.identity(a):yt.fromRotationTranslationScaleOrigin(a,o,s,l,u)}}},{key:"getLocalTransform",value:function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform}},{key:"setLocalTransform",value:function(t,n){var i=yt.getTranslation(S3,n),a=yt.getRotation(_3,n),s=yt.getScaling(M3,n);this.setLocalScale(t,s,!1),this.setLocalPosition(t,i,!1),this.setLocalRotation(t,a,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,x3,!1),this.setLocalPosition(t,Kf,!1),this.setLocalEulerAngles(t,Kf,void 0,void 0,!1),this.setLocalSkew(t,b3,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(t,n);if(!ga.isEmpty(a)){var s=i||new ga;return s.setFromTransformedAABB(a,this.getWorldTransform(t)),s}return null}},{key:"getGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t,a=i.geometry;a.dirty&&on.styleValueRegistry.updateGeometry(t);var s=n?a.renderBounds:a.contentBounds||null;return s||new ga}},{key:"getBounds",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,l=this.getTransformedGeometryBounds(t,i,o),u=t.childNodes;if(u.forEach(function(d){var f=n.getBounds(d,i);f&&(l?l.add(f):(l=o||new ga,l.update(f.center,f.halfExtents)))}),l||(l=new ga),i){var c=NR(t);if(c){var h=c.parsedStyle.clipPath.getBounds(i);l?h&&(l=h.intersection(l)):l.update(h.center,h.halfExtents)}}return i?(s.renderBounds=l,s.renderBoundsDirty=!1):(s.bounds=l,s.boundsDirty=!1),l}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var n=E3;t.parentNode.transformable&&(n=yt.invert(Ou,this.getWorldTransform(t.parentNode)));var i=this.getBounds(t);if(!ga.isEmpty(i)){var a=new ga;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var n,i,a=this.getGeometryBounds(t);ga.isEmpty(a)||(i=new ga,i.setFromTransformedAABB(a,this.getWorldTransform(t)));var s=(n=t.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0?void 0:n.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),l=Mr(o,2),u=l[0],c=l[1],h=i.getMax(),d=Mr(h,2),f=d[0],v=d[1];return new _u(u+((s==null?void 0:s.left)||0),c+((s==null?void 0:s.top)||0),f-u,v-c)}return new _u((s==null?void 0:s.left)||0,(s==null?void 0:s.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,n){var i=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(o){var l=o.transformable;l.dirtyFlag||i.dirtifyWorldInternal(o,l)});var a=t,s=a.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var i=t.childNodes,a=0;a<i.length;a++)this.syncHierarchy(i[a])}}},{key:"sync",value:function(t,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var i=t.parentNode,a=i&&i.transformable;i===null||!a?yt.copy(n.worldTransform,n.localTransform):yt.multiply(n.worldTransform,a.worldTransform,n.localTransform),n.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var n=t.parentNode;n;){var i=n.transformable;i&&(i.frozen=!1),n=n.parentNode}}}])}(),Rl={MetricsString:"|\xC9q\xC5",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},DE=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,T3=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,O3=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,A3=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,C3=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,P3=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,N3=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,R3=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,L3=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,D3=new RegExp("".concat(T3.source,"|").concat(A3.source,"|").concat(P3.source,"|").concat(R3.source)),I3=new RegExp("".concat(O3.source,"|").concat(C3.source,"|").concat(N3.source,"|").concat(L3.source)),F3=function(){function r(e){var t=this;rn(this,r),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(n,i){return t.isBreakingSpace(i)?!1:!!(n&&(I3.exec(i)||D3.exec(n)))},this.trimByKinsokuShorui=function(n){var i=ea(n),a=i[i.length-2];if(!a)return n;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=e}return an(r,[{key:"measureFont",value:function(t,n){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});s.font=t;var o=Rl.MetricsString+Rl.BaselineSymbol,l=Math.ceil(s.measureText(o).width),u=Math.ceil(s.measureText(Rl.BaselineSymbol).width),c=Rl.HeightMultiplier*u;u=u*Rl.BaselineMultiplier|0,a.width=l,a.height=c,s.fillStyle="#f00",s.fillRect(0,0,l,c),s.font=t,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,u);var h=s.getImageData(0,0,l||1,c||1).data,d=h.length,f=l*4,v=0,p=0,x=!1;for(v=0;v<u;++v){for(var A=0;A<f;A+=4)if(h[p+A]!==255){x=!0;break}if(!x)p+=f;else break}for(i.ascent=u-v,p=d-f,x=!1,v=c;v>u;--v){for(var N=0;N<f;N+=4)if(h[p+N]!==255){x=!0;break}if(!x)p-=f;else break}return i.descent=v-u,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[t]=i,i}},{key:"measureText",value:function(t,n,i){var a=n.fontSize,s=a===void 0?16:a,o=n.wordWrap,l=o===void 0?!1:o,u=n.lineHeight,c=n.lineWidth,h=c===void 0?1:c,d=n.textBaseline,f=d===void 0?"alphabetic":d,v=n.textAlign,p=v===void 0?"start":v,x=n.letterSpacing,A=x===void 0?0:x,N=n.textPath;n.textPathSide,n.textPathStartOffset;var I=n.leading,K=I===void 0?0:I,W=XR(n),z=this.measureFont(W,i);z.fontSize===0&&(z.fontSize=s,z.ascent=s);var j=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);j.font=W,n.isOverflowing=!1;var Z=l?this.wordWrap(t,n,i):t,vt=Z.split(/(?:\r\n|\r|\n)/),Tt=new Array(vt.length),zt=0;if(N){N.getTotalLength();for(var Qt=0;Qt<vt.length;Qt++)j.measureText(vt[Qt]).width+(vt[Qt].length-1)*A}else{for(var ae=0;ae<vt.length;ae++){var fe=j.measureText(vt[ae]).width+(vt[ae].length-1)*A;Tt[ae]=fe,zt=Math.max(zt,fe)}var ce=zt+h,ct=u||z.fontSize+h,$=Math.max(ct,z.fontSize+h)+(vt.length-1)*(ct+K);ct+=K;var Q=0;return f==="middle"?Q=-$/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?Q=-$:(f==="top"||f==="hanging")&&(Q=0),{font:W,width:ce,height:$,lines:vt,lineWidths:Tt,lineHeight:ct,maxLineWidth:zt,fontProperties:z,lineMetrics:Tt.map(function(It,ue){var le=0;return p==="center"||p==="middle"?le-=It/2:(p==="right"||p==="end")&&(le-=It),new _u(le-h/2,Q+ue*ct,It+h,ct)})}}}},{key:"setGraphemeOnPath",value:function(){}},{key:"wordWrap",value:function(t,n,i){var a=this,s=n.wordWrapWidth,o=s===void 0?0:s,l=n.letterSpacing,u=l===void 0?0:l,c=n.maxLines,h=c===void 0?1/0:c,d=n.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),v=o+u,p="";d==="ellipsis"?p="...":d&&d!=="clip"&&(p=d);for(var x=[],A=0,N=0,I={},K=function(Q){return a.getFromCache(Q,u,I,f)},W=Array.from(p).reduce(function($,Q){return $+K(Q)},0),z=Array.from(t),j=0;j<z.length;j++){var Z=z[j],vt=t[j-1],Tt=t[j+1],zt=K(Z);if(this.isNewline(Z)){if(A++,A>=h){n.isOverflowing=!0;break}N=0,x[A]="";continue}if(N>0&&N+zt>v){if(A+1>=h){if(n.isOverflowing=!0,W>0&&W<=v){for(var Qt=x[A].length,ae=0,fe=Qt,ce=0;ce<Qt;ce++){var ct=K(x[A][ce]);if(ae+ct+W>v){fe=ce;break}ae+=ct}x[A]=(x[A]||"").slice(0,fe)+p}break}if(A++,N=0,x[A]="",this.isBreakingSpace(Z))continue;this.canBreakInLastChar(Z)||(x=this.trimToBreakable(x),N=this.sumTextWidthByCache(x[A]||"",I)),this.shouldBreakByKinsokuShorui(Z,Tt)&&(x=this.trimByKinsokuShorui(x),N+=K(vt||""))}N+=zt,x[A]=(x[A]||"")+Z}return x.join(`
|
|
|
`)}},{key:"isBreakingSpace",value:function(t){return typeof t!="string"?!1:Rl.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return typeof t!="string"?!1:Rl.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var n=ea(t),i=n[n.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return n;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),l=a+1,u=a+(o?0:1);return n[n.length-1]+=i.slice(l,i.length),n[n.length-2]=i.slice(0,u),n}},{key:"canBreakInLastChar",value:function(t){return!(t&&DE.test(t))}},{key:"sumTextWidthByCache",value:function(t,n){return t.split("").reduce(function(i,a){if(!n[a])throw Error("cannot count the word without cache");return i+n[a]},0)}},{key:"findBreakableIndex",value:function(t){for(var n=t.length-1;n>=0;n--)if(!DE.test(t[n]))return n;return-1}},{key:"getFromCache",value:function(t,n,i,a){var s=i[t];if(typeof s!="number"){var o=t.length*n;s=a.measureText(t).width+o,i[t]=s}return s}}])}(),on={},B3=function(r){var e=new l3,t=new o3;return r={},lr(lr(lr(lr(lr(lr(lr(lr(lr(lr(r,On.CIRCLE,new r3),On.ELLIPSE,new i3),On.RECT,e),On.IMAGE,e),On.GROUP,new c3),On.LINE,new a3),On.TEXT,new u3(on)),On.POLYLINE,t),On.POLYGON,t),On.PATH,new s3),lr(lr(r,On.HTML,new h3),On.MESH,null)}(),z3=function(r){var e=new yR,t=new M0;return r={},lr(lr(lr(lr(lr(lr(lr(lr(lr(lr(r,un.PERCENTAGE,null),un.NUMBER,new SR),un.ANGLE,new pR),un.DEFINED_PATH,new mR),un.PAINT,e),un.COLOR,e),un.FILTER,new bR),un.LENGTH,t),un.LENGTH_PERCENTAGE,t),un.LENGTH_PERCENTAGE_12,new xR),lr(lr(lr(lr(lr(lr(lr(lr(lr(lr(r,un.LENGTH_PERCENTAGE_14,new ER),un.COORDINATE,new M0),un.OFFSET_DISTANCE,new _R),un.OPACITY_VALUE,new MR),un.PATH,new kR),un.LIST_OF_POINTS,new TR),un.SHADOW_BLUR,new OR),un.TEXT,new AR),un.TEXT_TRANSFORM,new CR),un.TRANSFORM,new t3),lr(lr(lr(r,un.TRANSFORM_ORIGIN,new e3),un.Z_INDEX,new n3),un.MARKER,new wR)}(),j3=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof g.g!="undefined"?g.g:{}};on.CameraContribution=Yx,on.AnimationTimeline=null,on.EasingFunction=null,on.offscreenCanvasCreator=new g3,on.sceneGraphSelector=new m3,on.sceneGraphService=new k3(on),on.textService=new F3(on),on.geometryUpdaterFactory=B3,on.CSSPropertySyntaxFactory=z3,on.styleValueRegistry=new gR(on),on.layoutRegistry=null,on.globalThis=j3(),on.enableStyleSyntax=!0,on.enableSizeAttenuation=!1;var IE=0;function AF(){IE=0}var FE=new Qs(fi.INSERTED,null,"","","",0,"",""),BE=new Qs(fi.REMOVED,null,"","","",0,"",""),G3=new La(fi.DESTROY),W3=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.entity=IE++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:sN.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return fr(e,r),an(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(n){return n!==""})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null}},{key:"cloneNode",value:function(n){throw new Error(Br)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error(HP);return on.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!T0(this)&&n.nodeName===On.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(FE.relatedNode=this,n.dispatchEvent(FE)),n}},{key:"insertBefore",value:function(n,i){if(!i)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(n):this.appendChild(n,a)}return n}},{key:"replaceChild",value:function(n,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(n,a),i}},{key:"removeChild",value:function(n){var i;return BE.relatedNode=this,n.dispatchEvent(BE),(i=n.ownerDocument)!==null&&i!==void 0&&i.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),on.sceneGraphService.detach(n),n}},{key:"removeChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(n){return on.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return on.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return on.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return on.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return on.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return on.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return on.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(on.sceneGraphService.matches(n,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(n){var i=this,a=null;return this.forEach(function(s){return s!==i&&n(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(n){var i=this,a=[];return this.forEach(function(s){s!==i&&n(s)&&a.push(s)}),a}},{key:"after",value:function(){var n=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(l,u){var c;return(c=n.parentNode)===null||c===void 0?void 0:c.appendChild(l,i+u+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var n,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var l=s[0],u=s.slice(1);this.parentNode.appendChild(l,i),(n=l).after.apply(n,ea(u))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return n.appendChild(o)})}},{key:"prepend",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,l){return n.appendChild(o,l)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.dispatchEvent(G3),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return on.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return on.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return on.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return on.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return on.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(n){if(typeof n!="symbol"){var i=this.attributes[n];return i}}},{key:"hasAttribute",value:function(n){return this.getAttributeNames().includes(n)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(n){this.setAttribute(n,null),delete this.attributes[n]}},{key:"setAttribute",value:function(n,i,a,s){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(Br)}},{key:"getAttributeNode",value:function(n){throw new Error(Br)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(Br)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(Br)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(Br)}},{key:"removeAttributeNode",value:function(n){throw new Error(Br)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(Br)}},{key:"setAttributeNode",value:function(n){throw new Error(Br)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(Br)}},{key:"toggleAttribute",value:function(n,i){throw new Error(Br)}}])}(Pl);function Xr(r){return!!(r!=null&&r.nodeName)}var U3=on.globalThis.Proxy?on.globalThis.Proxy:function(){},go=new Qs(fi.ATTR_MODIFIED,null,null,null,null,Qs.MODIFICATION,null,null),Yc=et.Ue(),Z3=Xt.Ue(),Da=function(r){function e(t){var n;return rn(this,e),n=dr(this,e),n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||On.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),on.enableStyleSyntax&&(n.style=new U3({setProperty:function(a,s){n.setAttribute(a,s)},getPropertyValue:function(a){return n.getAttribute(a)},removeProperty:function(a){n.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:n.getAttribute(s)},set:function(a,s,o){return n.setAttribute(s,o),!0}})),n}return fr(e,r),an(e,[{key:"destroy",value:function(){Ax(e,"destroy",this,3)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=di({},this.attributes);for(var s in a){var o=a[s];Xr(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var l=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:a});return l.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(u){if(!u.style.isMarker){var c=u.cloneNode(n);l.appendChild(c)}}),l}},{key:"initAttributes",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};on.styleValueRegistry.processProperties(this,n,i),this.renderable.dirty=!0}},{key:"setAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;(0,Yt.Z)(i)||(a||i!==this.attributes[n])&&(this.internalSetAttribute(n,i,{memoize:s}),Ax(e,"setAttribute",this,3)([n,i]))}},{key:"internalSetAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.renderable,o=this.attributes[n],l=this.parsedStyle[n];on.styleValueRegistry.processProperties(this,lr({},n,i),a),s.dirty=!0;var u=this.parsedStyle[n];if(this.isConnected&&(go.relatedNode=this,go.prevValue=o,go.newValue=i,go.attrName=n,go.prevParsedValue=l,go.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(go):(go.target=this,this.ownerDocument.defaultView.dispatchEvent(go,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement){var c,h;(c=(h=this).attributeChangedCallback)===null||c===void 0||c.call(h,n,o,i,l,u)}}},{key:"getBBox",value:function(){var n=this.getBounds(),i=n.getMin(),a=Mr(i,2),s=a[0],o=a[1],l=n.getMax(),u=Mr(l,2),c=u[0],h=u[1];return new _u(s,o,c-s,h-o)}},{key:"setOrigin",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return on.sceneGraphService.setOrigin(this,ia(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return on.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return on.sceneGraphService.setPosition(this,ia(n,i,a,!1)),this}},{key:"setLocalPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return on.sceneGraphService.setLocalPosition(this,ia(n,i,a,!1)),this}},{key:"translate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return on.sceneGraphService.translate(this,ia(n,i,a,!1)),this}},{key:"translateLocal",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return on.sceneGraphService.translateLocal(this,ia(n,i,a,!1)),this}},{key:"getPosition",value:function(){return on.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return on.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(n,i,a){return this.scaleLocal(n,i,a)}},{key:"scaleLocal",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=ia(n,i,a,!1)),on.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=ia(n,i,a,!1)),on.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return on.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return on.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=c0(Yc,on.sceneGraphService.getWorldTransform(this)),i=Mr(n,3),a=i[2];return is(a)}},{key:"getLocalEulerAngles",value:function(){var n=c0(Yc,on.sceneGraphService.getLocalRotation(this)),i=Mr(n,3),a=i[2];return is(a)}},{key:"setEulerAngles",value:function(n){return on.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return on.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return(0,be.Z)(i)&&(0,be.Z)(a)?on.sceneGraphService.rotateLocal(this,0,0,n):on.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return(0,be.Z)(i)&&(0,be.Z)(a)?on.sceneGraphService.rotate(this,0,0,n):on.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return on.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return on.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return on.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return on.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return on.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return on.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return on.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return on.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return on.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){on.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(n,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,n,i):null}},{key:"isVisible",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"}},{key:"isInteractive",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,ea(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,ea(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],l=a[1];return o?(0,ie.Z)(o)?(Object.keys(o).forEach(function(u){n.setAttribute(u,o[u])}),this):a.length===2?(this.setAttribute(o,l),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(n){var i=n||this.getWorldTransform(),a=yt.getTranslation(Yc,i),s=Mr(a,2),o=s[0],l=s[1],u=yt.getScaling(Yc,i),c=Mr(u,2),h=c[0],d=c[1],f=yt.getRotation(Z3,i),v=c0(Yc,f),p=Mr(v,3),x=p[0],A=p[2];return tN(x||A,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=Wx(n),a=Mr(i,5),s=a[0],o=a[1],l=a[2],u=a[3],c=a[4];this.setEulerAngles(c).setPosition(s,o).setLocalScale(l,u)}},{key:"setLocalMatrix",value:function(n){var i=Wx(n),a=Mr(i,5),s=a[0],o=a[1],l=a[2],u=a[3],c=a[4];this.setLocalEulerAngles(c).setLocalPosition(s,o).setLocalScale(l,u)}},{key:"show",value:function(){this.forEach(function(n){n.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(n){n.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(n){return this.children[n]||null}},{key:"add",value:function(n,i){return this.appendChild(n,i)}},{key:"set",value:function(n,i){this.config[n]=i}},{key:"get",value:function(n){return this.config[n]}},{key:"moveTo",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"move",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"setZIndex",value:function(n){return this.style.zIndex=n,this}}])}(W3),C0=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),dr(this,e,[di({type:On.CIRCLE},t)])}return fr(e,r),an(e)}(Da),V3=["style"],Y3=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Ol(n,V3);return rn(this,e),t=dr(this,e,[di({style:i},a)]),t.isCustomElement=!0,t}return fr(e,r),an(e)}(Da),H3=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),dr(this,e,[di({type:On.ELLIPSE},t)])}return fr(e,r),an(e)}(Da),CF=null,Ia=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),dr(this,e,[di({type:On.GROUP},t)])}return fr(e,r),an(e)}(Da),X3=["style"],K3=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Ol(n,X3);return rn(this,e),t=dr(this,e,[di({type:On.HTML,style:i},a)]),t.cullable.enable=!1,t}return fr(e,r),an(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var n=yt.invert(yt.create(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!ga.isEmpty(i)){var a=new ga;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])}(Da),$3=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),dr(this,e,[di({type:On.IMAGE},t)])}return fr(e,r),an(e)}(Da),Q3=["style"],zE=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Ol(n,Q3);rn(this,e),t=dr(this,e,[di({type:On.LINE,style:di({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),t.markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd;return o&&Xr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&Xr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return fr(e,r),an(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Xr(s)&&(this.markerStartAngle=0,s.remove()),o&&Xr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&Xr(s)&&(this.markerEndAngle=0,s.remove()),o&&Xr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=i.x1,c=i.x2,h=i.y1,d=i.y2,f=n?a:s;if(!(!f||!Xr(f))){var v=0,p,x,A,N,I,K;n?(A=u,N=h,p=c-u,x=d-h,I=o||0,K=this.markerStartAngle):(A=c,N=d,p=u-c,x=h-d,I=l||0,K=this.markerEndAngle),v=Math.atan2(x,p),f.setLocalEulerAngles(v*180/Math.PI+K),f.setLocalPosition(A+Math.cos(v)*I,N+Math.sin(v)*I)}}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,l=a.x2,u=a.y2,c=(0,U.U4)(s,o,l,u,n),h=c.x,d=c.y,f=et.fF(et.Ue(),et.al(h,d,0),i?this.getWorldTransform():this.getLocalTransform());return new rs(f[0],f[1])}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var n=this.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;return(0,U.Xk)(i,a,s,o)}}])}(Da),J3=["style"],P0=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Ol(n,J3);rn(this,e),t=dr(this,e,[di({type:On.PATH,style:i,initialParsedStyle:{miterLimit:4,d:di({},Hx)}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd,u=s.markerMid;return o&&Xr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),u&&Xr(u)&&t.placeMarkerMid(u),l&&Xr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return fr(e,r),an(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Xr(s)&&(this.markerStartAngle=0,s.remove()),o&&Xr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Xr(s)&&(this.markerEndAngle=0,s.remove()),o&&Xr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=n?a:s;if(!(!u||!Xr(u))){var c=0,h,d,f,v,p,x;if(n){var A=this.getStartTangent(),N=Mr(A,2),I=N[0],K=N[1];f=K[0],v=K[1],h=I[0]-K[0],d=I[1]-K[1],p=o||0,x=this.markerStartAngle}else{var W=this.getEndTangent(),z=Mr(W,2),j=z[0],Z=z[1];f=Z[0],v=Z[1],h=j[0]-Z[0],d=j[1]-Z[1],p=l||0,x=this.markerEndAngle}c=Math.atan2(d,h),u.setLocalEulerAngles(c*180/Math.PI+x),u.setLocalPosition(f+Math.cos(c)*p,v+Math.sin(c)*p)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(c){c.remove()}),n&&Xr(n))for(var a=1;a<i.length-1;a++){var s=Mr(i[a].currentPoint,2),o=s[0],l=s[1],u=a===1?n:n.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,l)}}},{key:"getTotalLength",value:function(){return oE(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=(0,$t.r)(a,n),o=s.x,l=s.y,u=et.fF(et.Ue(),et.al(o,l,0),i?this.getWorldTransform():this.getLocalTransform());return new rs(u[0],u[1])}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(n*oE(this),i)}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.d.segments,i=[];if(n.length>1){var a=n[0].currentPoint,s=n[1].currentPoint,o=n[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.d.segments,i=n.length,a=[];if(i>1){var s=n[i-2].currentPoint,o=n[i-1].currentPoint,l=n[i-1].endTangent;a=[],l?(a.push([o[0]-l[0],o[1]-l[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])}(Da),q3=["style"],jE=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Ol(n,q3);rn(this,e),t=dr(this,e,[di({type:On.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,l=s.markerEnd,u=s.markerMid;return o&&Xr(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),u&&Xr(u)&&t.placeMarkerMid(u),l&&Xr(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return fr(e,r),an(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Xr(s)&&(this.markerStartAngle=0,s.remove()),o&&Xr(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Xr(s)&&(this.markerEndAngle=0,s.remove()),o&&Xr(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,u=i.points,c=u||{},h=c.points,d=n?a:s;if(!(!d||!Xr(d)||!h)){var f=0,v,p,x,A,N,I;if(x=h[0][0],A=h[0][1],n)v=h[1][0]-h[0][0],p=h[1][1]-h[0][1],N=o||0,I=this.markerStartAngle;else{var K=h.length;this.parsedStyle.isClosed?(v=h[K-1][0]-h[0][0],p=h[K-1][1]-h[0][1]):(x=h[K-1][0],A=h[K-1][1],v=h[K-2][0]-h[K-1][0],p=h[K-2][1]-h[K-1][1]),N=l||0,I=this.markerEndAngle}f=Math.atan2(p,v),d.setLocalEulerAngles(f*180/Math.PI+I),d.setLocalPosition(x+Math.cos(f)*N,A+Math.sin(f)*N)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(h){h.remove()}),this.markerMidList=[],n&&Xr(n)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var l=s[o][0],u=s[o][1],c=o===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(l,u)}}}])}(Da),tL=["style"],eL=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=Ol(t,tL);return rn(this,e),dr(this,e,[di({type:On.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return fr(e,r),an(e,[{key:"getTotalLength",value:function(){return GN(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,l,u,c=this.getTotalLength();a.forEach(function(A,N){a[N+1]&&(l=[0,0],l[0]=o/c,u=(0,U.Xk)(A[0],A[1],a[N+1][0],a[N+1][1]),o+=u,l[1]=o/c,s.push(l))}),this.parsedStyle.points.segments=s}var h=0,d=0;this.parsedStyle.points.segments.forEach(function(A,N){n>=A[0]&&n<=A[1]&&(h=(n-A[0])/(A[1]-A[0]),d=N)});var f=(0,U.U4)(a[d][0],a[d][1],a[d+1][0],a[d+1][1],h),v=f.x,p=f.y,x=et.fF(et.Ue(),et.al(v,p,0),i?this.getWorldTransform():this.getLocalTransform());return new rs(x[0],x[1])}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.points.points,i=[];return i.push([n[1][0],n[1][1]]),i.push([n[0][0],n[0][1]]),i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.points.points,i=n.length-1,a=[];return a.push([n[i-1][0],n[i-1][1]]),a.push([n[i][0],n[i][1]]),a}}])}(jE),Au=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),dr(this,e,[di({type:On.RECT},t)])}return fr(e,r),an(e)}(Da),nL=["style"],rL=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=Ol(t,nL);return rn(this,e),dr(this,e,[di({type:On.TEXT,style:di({fill:"black"},n)},i)])}return fr(e,r),an(e,[{key:"getComputedTextLength",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Da),PF=null,NF={number:function(e){return new Pr(e)},percent:function(e){return new Pr(e,"%")},px:function(e){return new Pr(e,"px")},em:function(e){return new Pr(e,"em")},rem:function(e){return new Pr(e,"rem")},deg:function(e){return new Pr(e,"deg")},grad:function(e){return new Pr(e,"grad")},rad:function(e){return new Pr(e,"rad")},turn:function(e){return new Pr(e,"turn")},s:function(e){return new Pr(e,"s")},ms:function(e){return new Pr(e,"ms")},registerProperty:function(e){var t=e.name,n=e.inherits,i=e.interpolable,a=e.initialValue,s=e.syntax;on.styleValueRegistry.registerMetadata({n:t,inh:n,int:i,d:a,syntax:s})},registerLayout:function(e,t){on.layoutRegistry.registerLayout(e,t)}},RF=null,iL=function(){function r(e){rn(this,r),this.strategies=e}return an(r,[{key:"apply",value:function(t){var n=t.camera,i=t.renderingService,a=t.renderingContext,s=this.strategies;i.hooks.cull.tap(r.tag,function(o){if(o){var l=o.cullable;return s.length===0?l.visible=a.unculledEntities.indexOf(o.entity)>-1:l.visible=s.every(function(u){return u.isVisible(n,o)}),!o.isCulled()&&o.isVisible()?o:(o.dispatchEvent(new La(fi.CULLED)),null)}return o}),i.hooks.afterRender.tap(r.tag,function(o){o.cullable.visibilityPlaneMask=-1})}}])}();iL.tag="Culling";var aL=function(){function r(){var e=this;rn(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new d3(null),this.rootWheelEvent=new f3(null),this.onPointerMove=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView;if(!(i.supportsTouchEvents&&t.pointerType==="touch")){var a=e.normalizeToPointerEvent(t,i),s=wu(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=e.bootstrapEvent(e.rootPointerEvent,l,i,t);e.context.eventService.mapEvent(u)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView,a=e.normalizeToPointerEvent(t,i),s=wu(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=e.bootstrapEvent(e.rootPointerEvent,l,i,t);e.context.eventService.mapEvent(u)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}}return an(r,[{key:"apply",value:function(t){var n=this;this.context=t;var i=t.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=n.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),l=o.picked;return l[0]||null}),i.hooks.pointerWheel.tap(r.tag,function(s){var o=n.normalizeWheelEvent(s);n.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.normalizeToPointerEvent(s,a);if(n.autoPreventDefault&&o[0].isNormalized){var l=s.cancelable||!("cancelable"in s);l&&s.preventDefault()}var u=wu(o),c;try{for(u.s();!(c=u.n()).done;){var h=c.value,d=n.bootstrapEvent(n.rootPointerEvent,h,a,s);n.context.eventService.mapEvent(d)}}catch(f){u.e(f)}finally{u.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.context.contextService.getDomElement(),l=n.context.eventService.isNativeEventFromCanvas(o,s),u=l?"":"outside",c=n.normalizeToPointerEvent(s,a),h=wu(c),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=n.bootstrapEvent(n.rootPointerEvent,f,a,s);v.type+=u,n.context.eventService.mapEvent(v)}}catch(p){h.e(p)}finally{h.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(r.tag,this.onPointerMove),i.hooks.pointerOver.tap(r.tag,this.onPointerMove),i.hooks.pointerOut.tap(r.tag,this.onPointerMove),i.hooks.click.tap(r.tag,this.onClick),i.hooks.pointerCancel.tap(r.tag,function(s){var o=n.normalizeToPointerEvent(s,a),l=wu(o),u;try{for(l.s();!(u=l.n()).done;){var c=u.value,h=n.bootstrapEvent(n.rootPointerEvent,c,a,s);n.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,n,i,a){t.view=i,t.originalEvent=null,t.nativeEvent=a,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var s=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=s.x,l=s.y;t.viewport.x=o,t.viewport.y=l;var u=this.context.eventService.viewport2Canvas(t.viewport),c=u.x,h=u.y;return t.canvas.x=c,t.canvas.y=h,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=a.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=LR[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var n=this.rootWheelEvent;this.transferMouseData(n,t),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ;var i=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),a=i.x,s=i.y;n.viewport.x=a,n.viewport.y=s;var o=this.context.eventService.viewport2Canvas(n.viewport),l=o.x,u=o.y;return n.canvas.x=l,n.canvas.y=u,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=t,n.type=t.type,n}},{key:"transferMouseData",value:function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=DR.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,n){var i=[];if(n.isTouchEvent(t))for(var a=0;a<t.changedTouches.length;a++){var s=t.changedTouches[a];(0,Yt.Z)(s.button)&&(s.button=0),(0,Yt.Z)(s.buttons)&&(s.buttons=1),(0,Yt.Z)(s.isPrimary)&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),(0,Yt.Z)(s.width)&&(s.width=s.radiusX||1),(0,Yt.Z)(s.height)&&(s.height=s.radiusY||1),(0,Yt.Z)(s.tiltX)&&(s.tiltX=0),(0,Yt.Z)(s.tiltY)&&(s.tiltY=0),(0,Yt.Z)(s.pointerType)&&(s.pointerType="touch"),(0,Yt.Z)(s.pointerId)&&(s.pointerId=s.identifier||0),(0,Yt.Z)(s.pressure)&&(s.pressure=s.force||.5),(0,Yt.Z)(s.twist)&&(s.twist=0),(0,Yt.Z)(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=t.type,i.push(s)}else if(n.isMouseEvent(t)){var o=t;(0,Yt.Z)(o.isPrimary)&&(o.isPrimary=!0),(0,Yt.Z)(o.width)&&(o.width=1),(0,Yt.Z)(o.height)&&(o.height=1),(0,Yt.Z)(o.tiltX)&&(o.tiltX=0),(0,Yt.Z)(o.tiltY)&&(o.tiltY=0),(0,Yt.Z)(o.pointerType)&&(o.pointerType="mouse"),(0,Yt.Z)(o.pointerId)&&(o.pointerId=RR),(0,Yt.Z)(o.pressure)&&(o.pressure=.5),(0,Yt.Z)(o.twist)&&(o.twist=0),(0,Yt.Z)(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(t);return i}}])}();aL.tag="Event";var LF=[On.CIRCLE,On.ELLIPSE,On.IMAGE,On.RECT,On.LINE,On.POLYLINE,On.POLYGON,On.TEXT,On.PATH,On.HTML],DF=null,sL=function(){function r(){rn(this,r),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return an(r,[{key:"apply",value:function(t){var n=this,i,a=t.renderingService,s=t.renderingContext,o=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=o;var u=function(p){var x=p.target;x.renderable.dirty=!0,a.dirtify()},c=function(p){n.syncTasks.set(p.target,p.detail.affectChildren),a.dirtify()},h=function(p){var x=p.target;on.enableSizeAttenuation&&on.styleValueRegistry.updateSizeAttenuation(x,l.getCamera().getZoom())},d=function(p){var x=p.target,A=x.rBushNode;A.aabb&&n.rBush.remove(A.aabb),n.syncTasks.delete(x),on.sceneGraphService.dirtifyToRoot(x),a.dirtify()};a.hooks.init.tap(r.tag,function(){l.addEventListener(fi.MOUNTED,h),l.addEventListener(fi.UNMOUNTED,d),l.addEventListener(fi.ATTR_MODIFIED,u),l.addEventListener(fi.BOUNDS_CHANGED,c)}),a.hooks.destroy.tap(r.tag,function(){l.removeEventListener(fi.MOUNTED,h),l.removeEventListener(fi.UNMOUNTED,d),l.removeEventListener(fi.ATTR_MODIFIED,u),l.removeEventListener(fi.BOUNDS_CHANGED,c),n.syncTasks.clear()});var f=(i=on.globalThis.requestIdleCallback)!==null&&i!==void 0?i:OE.bind(on.globalThis);a.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering?(n.isFirstTimeRendering=!1,n.syncing=!0,f(function(){n.syncRTree(!0),n.isFirstTimeRenderingFinished=!0})):n.syncRTree()})}},{key:"syncNode",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.isConnected){var i=t.rBushNode;i.aabb&&this.rBush.remove(i.aabb);var a=t.getRenderBounds();if(a){var s=t.renderable;n&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new ga),s.dirtyRenderBounds.update(a.center,a.halfExtents));var o=a.getMin(),l=Mr(o,2),u=l[0],c=l[1],h=a.getMax(),d=Mr(h,2),f=d[0],v=d[1];i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=u,i.aabb.minY=c,i.aabb.maxX=f,i.aabb.maxY=v}if(i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY))return i.aabb}}},{key:"syncRTree",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!n&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var i=[],a=new Set,s=function(l){if(!a.has(l)&&l.renderable){var u=t.syncNode(l,n);u&&(i.push(u),a.add(l))}};this.syncTasks.forEach(function(o,l){o&&l.forEach(s);for(var u=l;u;)s(u),u=u.parentElement}),this.rBush.load(i),i.length=0,this.syncing=!1}}}])}();sL.tag="Prepare";function IF(r){return!!r.document}var N0=function(r){return r.READY="ready",r.BEFORE_RENDER="beforerender",r.RERENDER="rerender",r.AFTER_RENDER="afterrender",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.RESIZE="resize",r.DIRTY_RECTANGLE="dirtyrectangle",r.RENDERER_CHANGED="rendererchanged",r}({}),FF=500,BF=.1,zF=1e3,jF=new La(fi.MOUNTED),GF=new La(fi.UNMOUNTED),WF=new La(N0.BEFORE_RENDER),UF=new La(N0.RERENDER),ZF=new La(N0.AFTER_RENDER),VF=null;var oL=function(r){function e(){var t;rn(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=dr(this,e,[].concat(i)),t.landmarks=[],t}return fr(e,r),an(e,[{key:"rotate",value:function(n,i,a){if(this.relElevation=Mu(i),this.relAzimuth=Mu(n),this.relRoll=Mu(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===zr.EXPLORING){var s=Xt.yY(Xt.Ue(),[1,0,0],Cr((this.rotateWorld?1:-1)*this.relElevation)),o=Xt.yY(Xt.Ue(),[0,1,0],Cr((this.rotateWorld?1:-1)*this.relAzimuth)),l=Xt.yY(Xt.Ue(),[0,0,1],Cr(this.relRoll)),u=Xt.Jp(Xt.Ue(),o,s);u=Xt.Jp(Xt.Ue(),u,l);var c=yt.fromQuat(yt.create(),u);yt.translate(this.matrix,this.matrix,[0,0,-this.distance]),yt.multiply(this.matrix,this.matrix,c),yt.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=ia(n,i,0),s=et.d9(this.position);return et.IH(s,s,et.bA(et.Ue(),this.right,a[0])),et.IH(s,s,et.bA(et.Ue(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(n){var i=this.forward,a=et.d9(this.position),s=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getDistance():this.type===zr.TRACKING&&et.IH(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(n){var i,a,s,o,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=l.position,c=u===void 0?this.position:u,h=l.focalPoint,d=h===void 0?this.focalPoint:h,f=l.roll,v=l.zoom,p=new on.CameraContribution;p.setType(this.type,void 0),p.setPosition(c[0],(i=c[1])!==null&&i!==void 0?i:this.position[1],(a=c[2])!==null&&a!==void 0?a:this.position[2]),p.setFocalPoint(d[0],(s=d[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),p.setRoll(f!=null?f:this.roll),p.setZoom(v!=null?v:this.zoom);var x={name:n,matrix:yt.clone(p.getWorldTransform()),right:et.d9(p.right),up:et.d9(p.up),forward:et.d9(p.forward),position:et.d9(p.getPosition()),focalPoint:et.d9(p.getFocalPoint()),distanceVector:et.d9(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(x),x}},{key:"gotoLandmark",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(0,Gt.Z)(n)?this.landmarks.find(function(zt){return zt.name===n}):n;if(s){var o=(0,bt.Z)(a)?{duration:a}:a,l=o.easing,u=l===void 0?"linear":l,c=o.duration,h=c===void 0?100:c,d=o.easingFunction,f=d===void 0?void 0:d,v=o.onfinish,p=v===void 0?void 0:v,x=o.onframe,A=x===void 0?void 0:x,N=.01;this.cancelLandmarkAnimation();var I=s.position,K=s.focalPoint,W=s.zoom,z=s.roll,j=f||on.EasingFunction(u),Z,vt=function(){i.setFocalPoint(K),i.setPosition(I),i.setRoll(z),i.setZoom(W),i.computeMatrix(),i.triggerUpdate(),p==null||p()};if(h===0)return vt();var Tt=function(Qt){Z===void 0&&(Z=Qt);var ae=Qt-Z;if(ae>=h){vt();return}var fe=j(ae/h),ce=et.Ue(),ct=et.Ue(),$=1,Q=0;et.t7(ce,i.focalPoint,K,fe),et.t7(ct,i.position,I,fe),Q=i.roll*(1-fe)+z*fe,$=i.zoom*(1-fe)+W*fe,i.setFocalPoint(ce),i.setPosition(ct),i.setRoll(Q),i.setZoom($);var It=et.TK(ce,K)+et.TK(ct,I);if(It<=N&&W===void 0&&z===void 0)return vt();i.computeMatrix(),i.triggerUpdate(),ae<h&&(A==null||A(fe),i.landmarkAnimationID=i.canvas.requestAnimationFrame(Tt))};this.canvas.requestAnimationFrame(Tt)}}}])}(Yx);on.CameraContribution=oL;var GE=null,YF=0,WE=new WeakMap,HF=null,XF=null,Jf,po;function KF(r,e){return Jf=new GE(r,e)}function $F(r){return po||(po=GE.copy(Jf),po.oldValue=r,po)}function QF(){Jf=po=void 0}function lL(r){return r===po||r===Jf}function JF(r,e){return r===e?r:po&&lL(r)?po:null}function uL(r){r.nodes.forEach(function(e){var t=WE.get(e);t&&t.forEach(function(n){n.observer===r&&n.removeTransientObservers()})})}function qF(r,e){for(var t=r;t;t=t.parentNode){var n=WE.get(t);if(n)for(var i=0;i<n.length;i++){var a=n[i],s=a.options;if(!(t!==r&&!s.subtree)){var o=e(s);o&&a.enqueue(o)}}}}var R0=!1,L0=null;function tB(r){L0.push(r),R0||(R0=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(D0):D0())}function D0(){R0=!1;var r=L0;L0=[],r.sort(function(t,n){return t.uid-n.uid});var e=!1;r.forEach(function(t){var n=t.takeRecords();uL(t),n.length&&(t.callback(n,t),e=!0)}),e&&D0()}var I0=function(r){function e(t,n,i,a){var s;return rn(this,e),s=dr(this,e,[t]),s.currentTime=i,s.timelineTime=a,s.target=n,s.type="finish",s.bubbles=!1,s.currentTarget=n,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return fr(e,r),an(e)}(Xf),cL=0,hL=function(){function r(e,t){var n;rn(this,r),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=t,this.id="".concat(cL++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((n=this.effect)===null||n===void 0?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return an(r,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,i){t.resolveReadyPromise=function(){n(t)},t.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,i){t.resolveFinishedPromise=function(){n(t)},t.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var n;this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-t/this.playbackRate}this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(t!==null){if(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=t,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==t&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):t==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==t&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():t==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new I0(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)}},{key:"tick",value:function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(Br)}},{key:"addEventListener",value:function(t,n,i){throw new Error(Br)}},{key:"removeEventListener",value:function(t,n,i){throw new Error(Br)}},{key:"dispatchEvent",value:function(t){throw new Error(Br)}},{key:"commitStyles",value:function(){throw new Error(Br)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var t;this._inEffect=!!((t=this.effect)!==null&&t!==void 0&&t.update(-1))}else{var n;this._inEffect=!!((n=this.effect)!==null&&n!==void 0&&n.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new I0(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new I0(null,this,this.currentTime,t);this.onframe(a)}this._finishedFlag=!1}}}])}(),dL=4,fL=.001,vL=1e-7,gL=10,Hc=11,qf=1/(Hc-1),pL=typeof Float32Array=="function",UE=function(e,t){return 1-3*t+3*e},ZE=function(e,t){return 3*t-6*e},VE=function(e){return 3*e},tv=function(e,t,n){return((UE(t,n)*e+ZE(t,n))*e+VE(t))*e},YE=function(e,t,n){return 3*UE(t,n)*e*e+2*ZE(t,n)*e+VE(t)},mL=function(e,t,n,i,a){var s,o,l=0;do o=t+(n-t)/2,s=tv(o,i,a)-e,s>0?n=o:t=o;while(Math.abs(s)>vL&&++l<gL);return o},yL=function(e,t,n,i){for(var a=0;a<dL;++a){var s=YE(t,n,i);if(s===0)return t;var o=tv(t,n,i)-e;t-=o/s}return t},F0=function(e,t,n,i){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return function(l){return l};for(var a=pL?new Float32Array(Hc):new Array(Hc),s=0;s<Hc;++s)a[s]=tv(s*qf,e,n);var o=function(u){for(var c=0,h=1,d=Hc-1;h!==d&&a[h]<=u;++h)c+=qf;--h;var f=(u-a[h])/(a[h+1]-a[h]),v=c+f*qf,p=YE(v,e,n);return p>=fL?yL(u,v,e,n):p===0?v:mL(u,c,c+qf,e,n)};return function(l){return l===0||l===1?l:tv(o(l),t,i)}},bL=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},ev=function(e){return Math.pow(e,2)},nv=function(e){return Math.pow(e,3)},rv=function(e){return Math.pow(e,4)},iv=function(e){return Math.pow(e,5)},av=function(e){return Math.pow(e,6)},sv=function(e){return 1-Math.cos(e*Math.PI/2)},ov=function(e){return 1-Math.sqrt(1-e*e)},lv=function(e){return e*e*(3*e-2)},uv=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},cv=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=Mr(t,2),i=n[0],a=i===void 0?1:i,s=n[1],o=s===void 0?.5:s,l=(0,Kt.Z)(Number(a),1,10),u=(0,Kt.Z)(Number(o),.1,2);return e===0||e===1?e:-l*Math.pow(2,10*(e-1))*Math.sin((e-1-u/(Math.PI*2)*Math.asin(1/l))*(Math.PI*2)/u)},Xc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=Mr(t,4),a=i[0],s=a===void 0?1:a,o=i[1],l=o===void 0?100:o,u=i[2],c=u===void 0?10:u,h=i[3],d=h===void 0?0:h;s=(0,Kt.Z)(s,.1,1e3),l=(0,Kt.Z)(l,.1,1e3),c=(0,Kt.Z)(c,.1,1e3),d=(0,Kt.Z)(d,.1,1e3);var f=Math.sqrt(l/s),v=c/(2*Math.sqrt(l*s)),p=v<1?f*Math.sqrt(1-v*v):0,x=1,A=v<1?(v*f+-d)/p:-d+f,N=n?n*e/1e3:e;return v<1?N=Math.exp(-N*v*f)*(x*Math.cos(p*N)+A*Math.sin(p*N)):N=(x+A*N)*Math.exp(-N*f),e===0||e===1?e:1-N},B0=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=t,i=Mr(n,2),a=i[0],s=a===void 0?10:a,o=i[1],l=o==="start"?Math.ceil:Math.floor;return l((0,Kt.Z)(e,0,1)*s)/s},HE=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=Mr(t,4),i=n[0],a=n[1],s=n[2],o=n[3];return F0(i,a,s,o)(e)},hv=F0(.42,0,1,1),ss=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-e(1-t,n,i)}},os=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?e(t*2,n,i)/2:1-e(t*-2+2,n,i)/2}},ls=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?(1-e(1-t*2,n,i))/2:(e(t*2-1,n,i)+1)/2}},XE={steps:B0,"step-start":function(e){return B0(e,[1,"start"])},"step-end":function(e){return B0(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":HE,ease:function(e){return HE(e,[.25,.1,.25,1])},in:hv,out:ss(hv),"in-out":os(hv),"out-in":ls(hv),"in-quad":ev,"out-quad":ss(ev),"in-out-quad":os(ev),"out-in-quad":ls(ev),"in-cubic":nv,"out-cubic":ss(nv),"in-out-cubic":os(nv),"out-in-cubic":ls(nv),"in-quart":rv,"out-quart":ss(rv),"in-out-quart":os(rv),"out-in-quart":ls(rv),"in-quint":iv,"out-quint":ss(iv),"in-out-quint":os(iv),"out-in-quint":ls(iv),"in-expo":av,"out-expo":ss(av),"in-out-expo":os(av),"out-in-expo":ls(av),"in-sine":sv,"out-sine":ss(sv),"in-out-sine":os(sv),"out-in-sine":ls(sv),"in-circ":ov,"out-circ":ss(ov),"in-out-circ":os(ov),"out-in-circ":ls(ov),"in-back":lv,"out-back":ss(lv),"in-out-back":os(lv),"out-in-back":ls(lv),"in-bounce":uv,"out-bounce":ss(uv),"in-out-bounce":os(uv),"out-in-bounce":ls(uv),"in-elastic":cv,"out-elastic":ss(cv),"in-out-elastic":os(cv),"out-in-elastic":ls(cv),spring:Xc,"spring-in":Xc,"spring-out":ss(Xc),"spring-in-out":os(Xc),"spring-out-in":ls(Xc)},xL=function(e){return bL(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},EL=function(e){return XE[xL(e)]||XE.linear},wL=function(e){return e},SL=1,_L=.5,KE=0;function $E(r,e){return function(t){if(t>=1)return 1;var n=1/r;return t+=e*n,t-t%n}}var dv="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",ML=new RegExp("cubic-bezier\\(".concat(dv,",").concat(dv,",").concat(dv,",").concat(dv,"\\)")),kL=/steps\(\s*(\d+)\s*\)/,TL=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function z0(r){var e=ML.exec(r);if(e)return F0.apply(void 0,ea(e.slice(1).map(Number)));var t=kL.exec(r);if(t)return $E(Number(t[1]),KE);var n=TL.exec(r);return n?$E(Number(n[1]),{start:SL,middle:_L,end:KE}[n[2]]):EL(r)}function OL(r){return Math.abs(AL(r)/(r.playbackRate||1))}function AL(r){var e;return r.duration===0||r.iterations===0?0:(r.duration==="auto"?0:Number(r.duration))*((e=r.iterations)!==null&&e!==void 0?e:1)}var QE=0,j0=1,fv=2,JE=3;function CL(r,e,t){if(e===null)return QE;var n=t.endTime;return e<Math.min(t.delay,n)?j0:e>=Math.min(t.delay+r+t.endDelay,n)?fv:JE}function PL(r,e,t,n,i){switch(n){case j0:return e==="backwards"||e==="both"?0:null;case JE:return t-i;case fv:return e==="forwards"||e==="both"?r:null;case QE:return null}}function NL(r,e,t,n,i){var a=i;return r===0?e!==j0&&(a+=t):a+=n/r,a}function RL(r,e,t,n,i,a){var s=r===1/0?e%1:r%1;return s===0&&t===fv&&n!==0&&(i!==0||a===0)&&(s=1),s}function LL(r,e,t,n){return r===fv&&e===1/0?1/0:t===1?Math.floor(n)-1:Math.floor(n)}function DL(r,e,t){var n=r;if(r!=="normal"&&r!=="reverse"){var i=e;r==="alternate-reverse"&&(i+=1),n="normal",i!==1/0&&i%2!==0&&(n="reverse")}return n==="normal"?t:1-t}function IL(r,e,t){var n=CL(r,e,t),i=PL(r,t.fill,e,n,t.delay);if(i===null)return null;var a=t.duration==="auto"?0:t.duration,s=NL(a,n,t.iterations,i,t.iterationStart),o=RL(s,t.iterationStart,n,t.iterations,i,a),l=LL(n,t.iterations,o,s),u=DL(t.direction,l,o);return t.currentIteration=l,t.progress=u,t.easingFunction(u)}function FL(r,e,t){var n=BL(r,e),i=zL(n,t);return function(a,s){if(s!==null)i.filter(function(l){return s>=l.applyFrom&&s<l.applyTo}).forEach(function(l){var u=s-l.startOffset,c=l.endOffset-l.startOffset,h=c===0?0:u/c;a.setAttribute(l.property,l.interpolation(h),!1,!1)});else for(var o in n)qE(o)&&a.setAttribute(o,null)}}function qE(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function BL(r,e){for(var t={},n=0;n<r.length;n++)for(var i in r[n])if(qE(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:z0(r[n].easing)||e.easingFunction,value:r[n][i]};t[i]=t[i]||[],t[i].push(a)}return t}function zL(r,e){var t=[];for(var n in r)for(var i=r[n],a=0;a<i.length-1;a++){var s=a,o=a+1,l=i[s].computedOffset,u=i[o].computedOffset,c=l,h=u;a===0&&(c=-1/0,u===0&&(o=s)),a===i.length-2&&(h=1/0,l===1&&(s=o)),t.push({applyFrom:c,applyTo:h,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:n,interpolation:jL(n,i[s].value,i[o].value,e)})}return t.sort(function(d,f){return d.startOffset-f.startOffset}),t}var tw=function(e,t,n){return function(i){var a=ew(e,t,i);return(0,bt.Z)(a)?a:n(a)}};function jL(r,e,t,n){var i=xE[r];if(i&&i.syntax&&i.int){var a=on.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(e,n):e,l=s?s(t,n):t,u=a.mixer(o,l,n);if(u){var c=tw.apply(void 0,ea(u));return function(h){return h===0?e:h===1?t:c(h)}}}}return tw(!1,!0,function(h){return h?t:e})}function ew(r,e,t){if(typeof r=="number"&&typeof e=="number")return r*(1-t)+e*t;if(typeof r=="boolean"&&typeof e=="boolean"||typeof r=="string"&&typeof e=="string")return t<.5?r:e;if(Array.isArray(r)&&Array.isArray(e)){for(var n=r.length,i=e.length,a=Math.max(n,i),s=[],o=0;o<a;o++)s.push(ew(r[o<n?o:n-1],e[o<i?o:i-1],t));return s}throw new Error("Mismatched interpolation arguments ".concat(r,":").concat(e))}var GL=function(){function r(){rn(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=wL,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return an(r,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=z0(t),this._easing=t}}])}();function WL(r){var e=[];for(var t in r)if(!(t in["easing","offset","composite"])){var n=r[t];Array.isArray(n)||(n=[n]);for(var i=n.length,a=0;a<i;a++){if(!e[a]){var s={};"offset"in r&&(s.offset=Number(r.offset)),"easing"in r&&(s.easing=r.easing),"composite"in r&&(s.composite=r.composite),e[a]=s}n[a]!==void 0&&n[a]!==null&&(e[a][t]=n[a])}}return e.sort(function(o,l){return(o.computedOffset||0)-(l.computedOffset||0)}),e}function nw(r,e){if(r===null)return[];Array.isArray(r)||(r=WL(r));for(var t=r.map(function(l){var u={};e!=null&&e.composite&&(u.composite="auto");for(var c in l){var h=l[c];if(c==="offset"){if(h!==null){if(h=Number(h),!isFinite(h))throw new Error("Keyframe offsets must be numbers.");if(h<0||h>1)throw new Error("Keyframe offsets must be between 0 and 1.");u.computedOffset=h}}else if(c==="composite"&&["replace","add","accumulate","auto"].indexOf(h)===-1)throw new Error("".concat(h," compositing is not supported"));u[c]=h}return u.offset===void 0&&(u.offset=null),u.easing===void 0&&(u.easing=(e==null?void 0:e.easing)||"linear"),u.composite===void 0&&(u.composite="auto"),u}),n=!0,i=-1/0,a=0;a<t.length;a++){var s=t[a].offset;if((0,be.Z)(s))n=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}t=t.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function o(){var l,u=t,c=u.length;if(t[c-1].computedOffset=Number((l=t[c-1].offset)!==null&&l!==void 0?l:1),c>1){var h;t[0].computedOffset=Number((h=t[0].offset)!==null&&h!==void 0?h:0)}for(var d=0,f=Number(t[0].computedOffset),v=1;v<c;v++){var p=t[v].computedOffset;if(!(0,be.Z)(p)&&!(0,be.Z)(f)){for(var x=1;x<v-d;x++)t[d+x].computedOffset=f+(Number(p)-f)*x/(v-d);d=v,f=Number(p)}}}return n||o(),t}var UL="backwards|forwards|both|none".split("|"),ZL="reverse|alternate|alternate-reverse".split("|");function VL(r,e){var t=new GL;return e&&(t.fill="both",t.duration="auto"),typeof r=="number"&&!isNaN(r)?t.duration=r:r!==void 0&&Object.keys(r).forEach(function(n){if(r[n]!==void 0&&r[n]!==null&&r[n]!=="auto"){if((typeof t[n]=="number"||n==="duration")&&(typeof r[n]!="number"||isNaN(r[n]))||n==="fill"&&UL.indexOf(r[n])===-1||n==="direction"&&ZL.indexOf(r[n])===-1)return;t[n]=r[n]}}),t}function YL(r,e){var t;return r=HL((t=r)!==null&&t!==void 0?t:{duration:"auto"}),VL(r,e)}function HL(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var XL=function(){function r(e,t,n){var i=this;rn(this,r),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=YL(n,!1),this.timing.effect=this,this.timing.activeDuration=OL(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=nw(t,this.timing),this.interpolations=FL(this.normalizedKeyframes,this.timing,this.target);var a=on.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,l){return l==="duration"?o.duration==="auto"?0:o.duration:l==="fill"?o.fill==="auto"?"none":o.fill:l==="localTime"?i.animation&&i.animation.currentTime||null:l==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:l==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[l]},set:function(){return!0}}):this.timing}return an(r,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return t===null?!1:(this.timeFraction=IL(this.timing.activeDuration,t,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=nw(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var n=this;Object.keys(t||{}).forEach(function(i){n.timing[i]=t[i]})}}])}();function rw(r,e){return Number(r.id)-Number(e.id)}var KL=function(){function r(e){var t=this;rn(this,r),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(n){t.currentTime=n,t.discardAnimations(),t.animations.length===0?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(n){var i=t.rafCallbacks;t.rafCallbacks=[],n<Number(t.currentTime)&&(n=Number(t.currentTime)),t.animations.sort(rw),t.animations=t.tick(n,!0,t.animations)[0],i.forEach(function(a){a[1](n)}),t.applyPendingEffects()},this.document=e}return an(r,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,n,i){var a=new XL(t,n,i),s=new hL(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(t){var n=this;if(!this.inTick){t.markTarget();var i=t.targetAnimations();i.sort(rw);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=n.animations.indexOf(s);o!==-1&&n.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){t==null||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return t.playState!=="finished"&&t.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,t]),n}},{key:"requestAnimationFrame",value:function(t){var n=this;return this.rAF(function(i){n.updateAnimationsPromises(),t(i),n.updateAnimationsPromises()})}},{key:"tick",value:function(t,n,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var l=[],u=[],c=[],h=[];return i.forEach(function(d){d.tick(t,n),d._inEffect?(u.push(d.effect),d.markTarget()):(l.push(d.effect),d.unmarkTarget()),d._needsTick&&(a.ticking=!0);var f=d._inEffect||d._needsTick;d._inTimeline=f,f?c.push(d):h.push(d)}),(s=this.pendingEffects).push.apply(s,l),(o=this.pendingEffects).push.apply(o,u),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,h]}}])}();on.EasingFunction=z0,on.AnimationTimeline=KL;function iw(r,e){e(r),r.children&&r.children.forEach(function(t){t&&iw(t,e)})}function Kc(r){vv(r,!0)}function Ts(r){vv(r,!1)}function vv(r,e){var t=e?"visible":"hidden";iw(r,function(n){n.attr("visibility",t)})}var aw=g(83845),$L=5,sw=function(r,e,t,n){t===void 0&&(t=0),n===void 0&&(n=$L),Object.entries(e).forEach(function(i){var a=(0,it.CR)(i,2),s=a[0],o=a[1],l=r;Object.prototype.hasOwnProperty.call(e,s)&&(o?(0,aw.Z)(o)?((0,aw.Z)(r[s])||(l[s]={}),t<n?sw(r[s],o,t+1,n):l[s]=e[s]):(0,S.Z)(o)?(l[s]=[],l[s]=l[s].concat(o)):l[s]=o:l[s]=o)})},Oi=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)sw(r,e[n]);return r},QL=function(r){(0,it.ZT)(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,(0,it.ev)([],(0,it.CR)(t),!1))||this;return i.isMutationObserved=!0,i.addEventListener(fi.INSERTED,function(){Ts(i)}),i}return e}(Ia);function ow(r){var e=r.appendChild(new QL({class:"offscreen"}));return Ts(e),e}function JL(r){for(var e=r;e;){if(e.className==="offscreen")return!0;e=e.parent}return!1}function qL(){vv(this,this.attributes.visibility!=="hidden")}var vi=function(r){(0,it.ZT)(e,r);function e(t,n){n===void 0&&(n={});var i=r.call(this,Oi({},{style:n},t))||this;return i.initialized=!1,i._defaultOptions=n,i}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=ow(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;(t=this._offscreen)===null||t===void 0||t.destroy()},e.prototype.attributeChangedCallback=function(t){t==="visibility"&&qL.call(this)},e.prototype.update=function(t,n){var i;return this.attr(Oi({},this.attributes,t||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,n)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,n){},e.prototype.getSubShapeStyle=function(t){var n=t.x,i=t.y,a=t.transform,s=t.transformOrigin,o=t.class,l=t.className,u=t.zIndex,c=(0,it._T)(t,["x","y","transform","transformOrigin","class","className","zIndex"]);return c},e}(Y3);function G0(r){return r.toString().charAt(0).toUpperCase()+r.toString().slice(1)}function tD(r){return r.toString().charAt(0).toLowerCase()+r.toString().slice(1)}function eD(r,e){return"".concat(e).concat(G0(r))}function lw(r,e,t){var n;t===void 0&&(t=!0);var i=e||((n=r.match(/^([a-z][a-z0-9]+)/))===null||n===void 0?void 0:n[0])||"",a=r.replace(new RegExp("^(".concat(i,")")),"");return t?tD(a):a}function nD(r,e){Object.entries(e).forEach(function(t){var n=(0,it.CR)(t,2),i=n[0],a=n[1];(0,it.ev)([r],(0,it.CR)(r.querySelectorAll(i)),!1).filter(function(s){return s.matches(i)}).forEach(function(s){if(s){var o=s;o.style.cssText+=Object.entries(a).reduce(function(l,u){return"".concat(l).concat(u.join(":"),";")},"")}})})}var gv=function(r,e){if(!(r!=null&&r.startsWith(e)))return!1;var t=r[e.length];return t>="A"&&t<="Z"};function $n(r,e,t){t===void 0&&(t=!1);var n={};return Object.entries(r).forEach(function(i){var a=(0,it.CR)(i,2),s=a[0],o=a[1];if(!(s==="className"||s==="class")){if(gv(s,"show")&&gv(lw(s,"show"),e)!==t)s===eD(e,"show")?n[s]=o:n[s.replace(new RegExp(G0(e)),"")]=o;else if(!gv(s,"show")&&gv(s,e)!==t){var l=lw(s,e);l==="filter"&&typeof o=="function"||(n[l]=o)}}}),n}function Cu(r,e){return Object.entries(r).reduce(function(t,n){var i=(0,it.CR)(n,2),a=i[0],s=i[1];return a.startsWith("show")?t["show".concat(e).concat(a.slice(4))]=s:t["".concat(e).concat(G0(a))]=s,t},{})}function mo(r,e){e===void 0&&(e=["x","y","class","className"]);var t=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],n={},i={};return Object.entries(r).forEach(function(a){var s=(0,it.CR)(a,2),o=s[0],l=s[1];e.includes(o)||(t.indexOf(o)!==-1?i[o]=l:n[o]=l)}),[n,i]}var W0=function(r){(0,it.ZT)(e,r);function e(t){t===void 0&&(t={});var n=t.style,i=(0,it._T)(t,["style"]);return r.call(this,(0,it.pi)({style:(0,it.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},i))||this}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=ow(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;(t=this._offscreen)===null||t===void 0||t.destroy()},e}(rL);function rD(r,e){var t=new Map;return r.forEach(function(n){var i=e(n);t.has(i)||t.set(i,[]),t.get(i).push(n)}),t}function iD(r){throw new Error(r)}var aD=function(){function r(i,a,s,o,l,u,c){i===void 0&&(i=null),a===void 0&&(a=null),s===void 0&&(s=null),o===void 0&&(o=null),l===void 0&&(l=[null,null,null,null,null]),u===void 0&&(u=[]),c===void 0&&(c=[]),e.add(this),this._elements=Array.from(i),this._data=a,this._parent=s,this._document=o,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=u,this._facetElements=c}r.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new t(a,null,this._elements[0],this._document)},r.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new t(this._elements,null,this._parent,this._document,void 0,void 0,a)},r.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new t([a],null,a,this._document)},r.prototype.append=function(i){var a=this,s=typeof i=="function"?i:function(){return a.createElement(i)},o=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var u=this._data[l],c=(0,it.CR)(Array.isArray(u)?u:[u,null],2),h=c[0],d=c[1],f=s(h,l);f.__data__=h,d!==null&&(f.__fromElements__=d),this._parent.appendChild(f),o.push(f)}return new t(o,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var v=this._elements[l],h=v.__data__,f=s(h,l);v.appendChild(f),o.push(f)}return new t(o,null,o[0],this._document)},r.prototype.maybeAppend=function(i,a){var s=(0,it.Q_)(this,e,"m",n).call(this,i[0]==="#"?i:"#".concat(i),a);return s.attr("id",i),s},r.prototype.maybeAppendByClassName=function(i,a){var s=i.toString(),o=(0,it.Q_)(this,e,"m",n).call(this,s[0]==="."?s:".".concat(s),a);return o.attr("className",s),o},r.prototype.maybeAppendByName=function(i,a){var s=(0,it.Q_)(this,e,"m",n).call(this,'[name="'.concat(i,'"]'),a);return s.attr("name",i),s},r.prototype.data=function(i,a,s){var o,l;a===void 0&&(a=function(Tt){return Tt}),s===void 0&&(s=function(){return null});for(var u=[],c=[],h=new Set(this._elements),d=[],f=new Set,v=new Map(this._elements.map(function(Tt,zt){return[a(Tt.__data__,zt),Tt]})),p=new Map(this._facetElements.map(function(Tt,zt){return[a(Tt.__data__,zt),Tt]})),x=rD(this._elements,function(Tt){return s(Tt.__data__)}),A=0;A<i.length;A++){var N=i[A],I=a(N,A),K=s(N,A);if(v.has(I)){var W=v.get(I);W.__data__=N,W.__facet__=!1,c.push(W),h.delete(W),v.delete(I)}else if(p.has(I)){var W=p.get(I);W.__data__=N,W.__facet__=!0,c.push(W),p.delete(I)}else if(x.has(I)){var z=x.get(I);d.push([N,z]);try{for(var j=(o=void 0,(0,it.XA)(z)),Z=j.next();!Z.done;Z=j.next()){var W=Z.value;h.delete(W)}}catch(Tt){o={error:Tt}}finally{try{Z&&!Z.done&&(l=j.return)&&l.call(j)}finally{if(o)throw o.error}}x.delete(I)}else if(v.has(K)){var W=v.get(K);W.__toData__?W.__toData__.push(N):W.__toData__=[N],f.add(W),h.delete(W)}else u.push(N)}var vt=[new t([],u,this._parent,this._document),new t(c,null,this._parent,this._document),new t(h,null,this._parent,this._document),new t([],d,this._parent,this._document),new t(f,null,this._parent,this._document)];return new t(this._elements,null,this._parent,this._document,vt)},r.prototype.merge=function(i){var a=(0,it.ev)((0,it.ev)([],(0,it.CR)(this._elements),!1),(0,it.CR)(i._elements),!1),s=(0,it.ev)((0,it.ev)([],(0,it.CR)(this._transitions),!1),(0,it.CR)(i._transitions),!1);return new t(a,null,this._parent,this._document,void 0,s)},r.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=t.registry[i];return a?new a:iD("Unknown node type: ".concat(i))},r.prototype.join=function(i,a,s,o,l){i===void 0&&(i=function(v){return v}),a===void 0&&(a=function(v){return v}),s===void 0&&(s=function(v){return v.remove()}),o===void 0&&(o=function(v){return v}),l===void 0&&(l=function(v){return v.remove()});var u=i(this._enter),c=a(this._update),h=s(this._exit),d=o(this._merge),f=l(this._split);return c.merge(u).merge(h).merge(d).merge(f)},r.prototype.remove=function(){for(var i=function(o){var l=a._elements[o],u=a._transitions[o];u?u.then(function(){return l.remove()}):l.remove()},a=this,s=0;s<this._elements.length;s++)i(s);return new t([],null,this._parent,this._document,void 0,this._transitions)},r.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var s=this._elements[a],o=s.__data__;i.call(s,o,a)}return this},r.prototype.attr=function(i,a){var s=typeof a!="function"?function(){return a}:a;return this.each(function(o,l){a!==void 0&&(this[i]=s.call(this,o,l))})},r.prototype.style=function(i,a,s){s===void 0&&(s=!0);var o=typeof a!="function"||!s?function(){return a}:a;return this.each(function(l,u){a!==void 0&&(this.style[i]=o.call(this,l,u))})},r.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(s,o){var l=this;Object.entries(i).forEach(function(u){var c=(0,it.CR)(u,2),h=c[0],d=c[1],f=typeof d!="function"||!a?function(){return d}:d;d!==void 0&&l.attr(h,f.call(l,s,o))})})},r.prototype.update=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.transition=function(i){var a=this._transitions;return this.each(function(s,o){a[o]=i.call(this,s,o)})},r.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},r.prototype.call=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return i.call.apply(i,(0,it.ev)([this._parent,this],(0,it.CR)(a),!1)),this},r.prototype.node=function(){return this._elements[0]},r.prototype.nodes=function(){return this._elements},r.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},r.prototype.parent=function(){return this._parent};var e,t,n;return t=r,e=new WeakSet,n=function(a,s){var o=this._elements[0],l=o.querySelector(a);if(l)return new t([l],null,this._parent,this._document);var u=typeof s=="string"?this.createElement(s):s();return o.appendChild(u),new t([u],null,this._parent,this._document)},r.registry={g:Ia,rect:Au,circle:C0,path:P0,text:W0,ellipse:H3,image:$3,line:zE,polygon:jE,polyline:eL,html:K3},r}();function Sn(r){return new aD([r],null,r,r.ownerDocument)}function sD(r,e,t){return r.querySelector(e)?Sn(r).select(e):Sn(r).append(t)}var Hi=function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=e,this.y=t,this.width=n,this.height=i}return Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),r.fromRect=function(e){return new r(e.x,e.y,e.width,e.height)},r.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},r.prototype.isPointIn=function(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom},r}();function eB(r){var e=r.getRenderBounds(),t=__read(e.min,2),n=t[0],i=t[1],a=__read(e.max,2),s=a[0],o=a[1],l=s-n,u=o-i;return new Hi(n,i,l,u)}var Os=function(r,e){var t=function(i){return"".concat(e,"-").concat(i)},n=Object.fromEntries(Object.entries(r).map(function(i){var a=(0,it.CR)(i,2),s=a[0],o=a[1],l=t(o);return[s,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(n,{prefix:t}),n};function ji(r){if((0,bt.Z)(r))return[r,r,r,r];if((0,S.Z)(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function Fa(r,e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),r?t(e):(n&&i(e),null)}var uw=Os({text:"text"},"title");function pv(r){return/\S+-\S+/g.test(r)?r.split("-").map(function(e){return e[0]}):r.length>2?[r[0]]:r.split("")}function oD(r,e){var t=r.attributes,n=t.position,i=t.spacing,a=t.inset,s=t.text,o=r.getBBox(),l=e.getBBox(),u=pv(n),c=(0,it.CR)(ji(s?i:0),4),h=c[0],d=c[1],f=c[2],v=c[3],p=(0,it.CR)(ji(a),4),x=p[0],A=p[1],N=p[2],I=p[3],K=(0,it.CR)([v+d,h+f],2),W=K[0],z=K[1],j=(0,it.CR)([I+A,x+N],2),Z=j[0],vt=j[1];if(u[0]==="l")return new Hi(o.x,o.y,l.width+o.width+W+Z,Math.max(l.height+vt,o.height));if(u[0]==="t")return new Hi(o.x,o.y,Math.max(l.width+Z,o.width),l.height+o.height+z+vt);var Tt=(0,it.CR)([e.attributes.width||l.width,e.attributes.height||l.height],2),zt=Tt[0],Qt=Tt[1];return new Hi(l.x,l.y,zt+o.width+W+Z,Qt+o.height+z+vt)}function lD(r,e){var t=Object.entries(e).reduce(function(n,i){var a=(0,it.CR)(i,2),s=a[0],o=a[1],l=r.node().attr(s);return l||(n[s]=o),n},{});r.styles(t)}function uD(r){var e,t,n,i,a=r,s=a.width,o=a.height,l=a.position,u=(0,it.CR)([+s/2,+o/2],2),c=u[0],h=u[1],d=(0,it.CR)([+c,+h,"center","middle"],4),f=d[0],v=d[1],p=d[2],x=d[3],A=pv(l);return A.includes("l")&&(e=(0,it.CR)([0,"start"],2),f=e[0],p=e[1]),A.includes("r")&&(t=(0,it.CR)([+s,"end"],2),f=t[0],p=t[1]),A.includes("t")&&(n=(0,it.CR)([0,"top"],2),v=n[0],x=n[1]),A.includes("b")&&(i=(0,it.CR)([+o,"bottom"],2),v=i[0],x=i[1]),{x:f,y:v,textAlign:p,textBaseline:x}}var cD=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return e.prototype.getAvailableSpace=function(){var t=this,n=this.attributes,i=n.width,a=n.height,s=n.position,o=n.spacing,l=n.inset,u=t.querySelector(uw.text.class);if(!u)return new Hi(0,0,+i,+a);var c=u.getBBox(),h=c.width,d=c.height,f=(0,it.CR)(ji(o),4),v=f[0],p=f[1],x=f[2],A=f[3],N=(0,it.CR)([0,0,+i,+a],4),I=N[0],K=N[1],W=N[2],z=N[3],j=pv(s);if(j.includes("i"))return new Hi(I,K,W,z);j.forEach(function(ct,$){var Q,It,ue,le;ct==="t"&&(Q=(0,it.CR)($===0?[d+x,+a-d-x]:[0,+a],2),K=Q[0],z=Q[1]),ct==="r"&&(It=(0,it.CR)([+i-h-A],1),W=It[0]),ct==="b"&&(ue=(0,it.CR)([+a-d-v],1),z=ue[0]),ct==="l"&&(le=(0,it.CR)($===0?[h+p,+i-h-p]:[0,+i],2),I=le[0],W=le[1])});var Z=(0,it.CR)(ji(l),4),vt=Z[0],Tt=Z[1],zt=Z[2],Qt=Z[3],ae=(0,it.CR)([Qt+Tt,vt+zt],2),fe=ae[0],ce=ae[1];return new Hi(I+Qt,K+vt,W-fe,z-ce)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Hi(0,0,0,0)},e.prototype.render=function(t,n){var i=this,a=t.width,s=t.height,o=t.position,l=t.spacing,u=(0,it._T)(t,["width","height","position","spacing"]),c=(0,it.CR)(mo(u),1),h=c[0],d=uD(t),f=d.x,v=d.y,p=d.textAlign,x=d.textBaseline;Fa(!!u.text,Sn(n),function(A){i.title=A.maybeAppendByClassName(uw.text,"text").styles(h).call(lD,{x:f,y:v,textAlign:p,textBaseline:x}).node()})},e}(vi),U0=g(13279);function us(r,e){return(0,At.Z)(r)?r.apply(void 0,(0,it.ev)([],(0,it.CR)(e),!1)):r}function hD(r,e){return r.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{})}function dD(r){return typeof r=="boolean"?!1:"enter"in r&&"update"in r&&"exit"in r}function cw(r){if(!r)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],t=Object.fromEntries(Object.entries(r).filter(function(n){var i=(0,it.CR)(n,1),a=i[0];return!e.includes(a)}));return Object.fromEntries(e.map(function(n){return dD(r)?r[n]===!1?[n,!1]:[n,(0,it.pi)((0,it.pi)({},r[n]),t)]:[n,t]}))}function Pu(r,e){r?r.finished.then(e):e()}function fD(r,e){r.length===0?e():Promise.all(r.map(function(t){return t==null?void 0:t.finished})).then(e)}function hw(r,e){"update"in r?r.update(e):r.attr(e)}function dw(r,e,t){if(e.length===0)return null;if(!t){var n=e.slice(-1)[0];return hw(r,{style:n}),null}return r.animate(e,t)}function vD(r,e){return!(r.nodeName!=="text"||e.nodeName!=="text"||r.attributes.text!==e.attributes.text)}function gD(r,e,t,n){if(n===void 0&&(n="destroy"),vD(r,e))return r.remove(),[null];var i=function(){n==="destroy"?r.destroy():n==="hide"&&Ts(r),e.isVisible()&&Kc(e)};if(!t)return i(),[null];var a=t.duration,s=a===void 0?0:a,o=t.delay,l=o===void 0?0:o,u=Math.ceil(+s/2),c=+s/4,h=(0,it.CR)(r.getGeometryBounds().center,2),d=h[0],f=h[1],v=(0,it.CR)(e.getGeometryBounds().center,2),p=v[0],x=v[1],A=(0,it.CR)([(d+p)/2-d,(f+x)/2-f],2),N=A[0],I=A[1],K=r.style.opacity,W=K===void 0?1:K,z=e.style.opacity,j=z===void 0?1:z,Z=r.style.transform||"",vt=e.style.transform||"",Tt=r.animate([{opacity:W,transform:"translate(0, 0) ".concat(Z)},{opacity:0,transform:"translate(".concat(N,", ").concat(I,") ").concat(Z)}],(0,it.pi)((0,it.pi)({fill:"both"},t),{duration:l+u+c})),zt=e.animate([{opacity:0,transform:"translate(".concat(-N,", ").concat(-I,") ").concat(vt),offset:.01},{opacity:j,transform:"translate(0, 0) ".concat(vt)}],(0,it.pi)((0,it.pi)({fill:"both"},t),{duration:u+c,delay:l+u-c}));return Pu(zt,i),[Tt,zt]}function As(r,e,t){var n={},i={};return Object.entries(e).forEach(function(a){var s=(0,it.CR)(a,2),o=s[0],l=s[1];if(!(0,be.Z)(l)){var u=r.style[o]||r.parsedStyle[o]||0;u!==l&&(n[o]=u,i[o]=l)}}),t?dw(r,[n,i],(0,it.pi)({fill:"both"},t)):(hw(r,i),null)}function pD(r){var e;return((e=r[0])===null||e===void 0?void 0:e.map(function(t,n){return r.map(function(i){return i[n]})}))||[]}function Z0(r,e,t){t===void 0&&(t=!1);var n=r.getBBox(),i=n.width,a=n.height,s=e/Math.max(i,a);return t&&(r.style.transform="scale(".concat(s,")")),s}var fw=function(r,e,t){return[["M",r-t,e],["A",t,t,0,1,0,r+t,e],["A",t,t,0,1,0,r-t,e],["Z"]]},mD=fw,yD=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},bD=function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},xD=function(r,e,t){var n=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["Z"]]},ED=function(r,e,t){var n=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]},wD=function(r,e,t){var n=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+n,e-t/2],["L",r+n,e+t/2],["L",r,e+t],["L",r-n,e+t/2],["L",r-n,e-t/2],["Z"]]},SD=function(r,e,t){var n=t-1.5;return[["M",r-t,e-n],["L",r+t,e+n],["L",r+t,e-n],["L",r-t,e+n],["Z"]]},vw=function(r,e,t){return[["M",r,e+t],["L",r,e-t]]},_D=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},MD=function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},kD=function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},TD=function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},gw=function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},OD=gw,AD=function(r,e,t){return[["M",r-t,e],["A",t/2,t/2,0,1,1,r,e],["A",t/2,t/2,0,1,0,r+t,e]]},CD=function(r,e,t){return[["M",r-t-1,e-2.5],["L",r,e-2.5],["L",r,e+2.5],["L",r+t+1,e+2.5]]},PD=function(r,e,t){return[["M",r-t-1,e+2.5],["L",r,e+2.5],["L",r,e-2.5],["L",r+t+1,e-2.5]]},ND=function(r,e,t){return[["M",r-(t+1),e+2.5],["L",r-t/2,e+2.5],["L",r-t/2,e-2.5],["L",r+t/2,e-2.5],["L",r+t/2,e+2.5],["L",r+t+1,e+2.5]]};function RD(r,e){return[["M",r-5,e+2.5],["L",r-5,e],["L",r,e],["L",r,e-3],["L",r,e+3],["L",r+6.5,e+3]]}var LD=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e],["L",r-t,e+t],["Z"]]},cs=Os({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),DD=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,t,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:LD(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Ia({class:cs.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Ia({class:cs.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return(0,Kt.Z)(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,n=(0,it.CR)(pD(t.map(function(h){var d=h.getBBox(),f=d.width,v=d.height;return[f,v]})).map(function(h){return Math.max.apply(Math,(0,it.ev)([],(0,it.CR)(h),!1))}),2),i=n[0],a=n[1],s=this.attributes,o=s.pageWidth,l=o===void 0?i:o,u=s.pageHeight,c=u===void 0?a:u;return{pageWidth:l,pageHeight:c}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=r.prototype.getBBox.call(this),n=t.x,i=t.y,a=this.controllerShape,s=this.pageShape,o=s.pageWidth,l=s.pageHeight;return new Hi(n,i,o+a.width,l)},e.prototype.goTo=function(t){var n=this,i=this.attributes.animate,a=this,s=a.currPage,o=a.playState,l=a.playWindow,u=a.pageViews;if(o!=="idle"||t<0||u.length<=0||t>=u.length)return null;u[s].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=(0,it.CR)(this.getFollowingPageDiff(t),2),h=c[0],d=c[1];this.playState="running";var f=dw(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-h,", ").concat(-d,")")}],i);return Pu(f,function(){n.innerCurrPage=t,n.playState="idle",n.setVisiblePages([t]),n.updatePageInfo()}),f},e.prototype.prev=function(){var t=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!t&&i<=0)return null;var a=t?(i-1+n)%n:(0,Kt.Z)(i-1,0,n);return this.goTo(a)},e.prototype.next=function(){var t=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!t&&i>=n-1)return null;var a=t?(i+1)%n:(0,Kt.Z)(i+1,0,n);return this.goTo(a)},e.prototype.renderClipPath=function(t){var n=this.pageShape,i=n.pageWidth,a=n.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=t.maybeAppendByClassName(cs.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(n,i){t.includes(i)?Kc(n):Ts(n)})},e.prototype.adjustControllerLayout=function(){var t=this,n=t.prevBtnGroup,i=t.nextBtnGroup,a=t.pageInfoGroup,s=this.attributes,o=s.orientation,l=s.controllerPadding,u=a.getBBox(),c=u.width,h=u.height,d=(0,it.CR)(o==="horizontal"?[-180,0]:[-90,90],2),f=d[0],v=d[1];n.setLocalEulerAngles(f),i.setLocalEulerAngles(v);var p=n.getBBox(),x=p.width,A=p.height,N=i.getBBox(),I=N.width,K=N.height,W=Math.max(x,c,I),z=o==="horizontal"?{offset:[[0,0],[x/2+l,0],[x+c+l*2,0]],textAlign:"start"}:{offset:[[W/2,-A-l],[W/2,0],[W/2,K+l]],textAlign:"center"},j=(0,it.CR)(z.offset,3),Z=(0,it.CR)(j[0],2),vt=Z[0],Tt=Z[1],zt=(0,it.CR)(j[1],2),Qt=zt[0],ae=zt[1],fe=(0,it.CR)(j[2],2),ce=fe[0],ct=fe[1],$=z.textAlign,Q=a.querySelector("text");Q&&(Q.style.textAlign=$),n.setLocalPosition(vt,Tt),a.setLocalPosition(Qt,ae),i.setLocalPosition(ce,ct)},e.prototype.updatePageInfo=function(){var t,n=this,i=n.currPage,a=n.pageViews,s=n.attributes.formatter;a.length<2||((t=this.pageInfoGroup.querySelector(cs.pageInfo.class))===null||t===void 0||t.attr("text",s(i+1,a.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var n=this.currPage;if(n===t)return[0,0];var i=this.attributes.orientation,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=t<n?-1:1;return i==="horizontal"?[l*s,0]:[0,l*o]},e.prototype.prepareFollowingPage=function(t){var n=this,i=n.currPage,a=n.pageViews;if(this.setVisiblePages([t,i]),t!==i){var s=(0,it.CR)(this.getFollowingPageDiff(t),2),o=s[0],l=s[1];a[t].setLocalPosition(o,l)}},e.prototype.renderController=function(t){var n=this,i=this.attributes.controllerSpacing,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=this.pageViews.length>=2,u=t.maybeAppendByClassName(cs.controller,"g");if(vv(u.node(),l),!!l){var c=$n(this.attributes,"button"),h=$n(this.attributes,"pageNum"),d=(0,it.CR)(mo(c),2),f=d[0],v=d[1],p=f.size,x=(0,it._T)(f,["size"]),A=!u.select(cs.prevBtnGroup.class).node(),N=u.maybeAppendByClassName(cs.prevBtnGroup,"g").styles(v);this.prevBtnGroup=N.node();var I=N.maybeAppendByClassName(cs.prevBtn,"path"),K=u.maybeAppendByClassName(cs.nextBtnGroup,"g").styles(v);this.nextBtnGroup=K.node();var W=K.maybeAppendByClassName(cs.nextBtn,"path");[I,W].forEach(function(j){j.styles((0,it.pi)((0,it.pi)({},x),{transformOrigin:"center"})),Z0(j.node(),p,!0)});var z=u.maybeAppendByClassName(cs.pageInfoGroup,"g");this.pageInfoGroup=z.node(),z.maybeAppendByClassName(cs.pageInfo,"text").styles(h),this.updatePageInfo(),u.node().setLocalPosition(s+i,o/2),A&&(this.prevBtnGroup.addEventListener("click",function(){n.prev()}),this.nextBtnGroup.addEventListener("click",function(){n.next()}))}},e.prototype.render=function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s;this.attr("transform","translate(".concat(a,", ").concat(o,")"));var l=Sn(n);this.renderClipPath(l),this.renderController(l),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,n=(0,Rc.Z)(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(fi.INSERTED,n),this.playWindow.addEventListener(fi.REMOVED,n)},e}(vi);function ID(r){var e="default";if((0,ie.Z)(r)&&r instanceof Image)e="image";else if((0,At.Z)(r))e="symbol";else if((0,Gt.Z)(r)){var t=new RegExp("data:(image|text)");r.match(t)?e="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(r)?e="url":e="symbol"}return e}function FD(r){var e=ID(r);return["base64","url","image"].includes(e)?"image":r&&e==="symbol"?"path":null}var jr=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,l=this.getSubShapeStyle(t),u=l.symbol,c=l.size,h=c===void 0?16:c,d=(0,it._T)(l,["symbol","size"]),f=FD(u);Fa(!!f,Sn(n),function(v){v.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call(function(p){if(f==="image"){var x=h*2;p.styles({img:u,width:x,height:x,x:a-h,y:o-h})}else{var x=h/2,A=(0,At.Z)(u)?u:e.getSymbol(u);p.styles((0,it.pi)({d:A==null?void 0:A(a,o,x)},d))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(vi);jr.registerSymbol("cross",_D),jr.registerSymbol("hyphen",TD),jr.registerSymbol("line",vw),jr.registerSymbol("plus",kD),jr.registerSymbol("tick",MD),jr.registerSymbol("circle",fw),jr.registerSymbol("point",mD),jr.registerSymbol("bowtie",SD),jr.registerSymbol("hexagon",wD),jr.registerSymbol("square",yD),jr.registerSymbol("diamond",bD),jr.registerSymbol("triangle",xD),jr.registerSymbol("triangle-down",ED),jr.registerSymbol("line",vw),jr.registerSymbol("dot",gw),jr.registerSymbol("dash",OD),jr.registerSymbol("smooth",AD),jr.registerSymbol("hv",CD),jr.registerSymbol("vh",PD),jr.registerSymbol("hvh",ND),jr.registerSymbol("vhv",RD);function nB(r,e,t){var n=Math.round((r-t)/e);return t+n*e}function BD(r,e,t){var n=1.4,i=n*t;return[["M",r-t,e-i],["L",r+t,e-i],["L",r+t,e+i],["L",r-t,e+i],["Z"]]}var pw=1.4,mw=.4;function zD(r,e,t){var n=t,i=n*pw,a=n/2,s=n/6,o=r+i*mw;return[["M",r,e],["L",o,e+a],["L",r+i,e+a],["L",r+i,e-a],["L",o,e-a],["Z"],["M",o,e+s],["L",r+i-2,e+s],["M",o,e-s],["L",r+i-2,e-s]]}function jD(r,e,t){var n=t,i=n*pw,a=n/2,s=n/6,o=e+i*mw;return[["M",r,e],["L",r-a,o],["L",r-a,e+i],["L",r+a,e+i],["L",r+a,o],["Z"],["M",r-s,o],["L",r-s,e+i-2],["M",r+s,o],["L",r+s,e+i-2]]}jr.registerSymbol("hiddenHandle",BD),jr.registerSymbol("verticalHandle",zD),jr.registerSymbol("horizontalHandle",jD);var rB=function(r,e,t){return r===void 0&&(r="horizontal"),r==="horizontal"?e:t};function iB(r,e,t,n){var i;n===void 0&&(n=4);var a=__read(r,2),s=a[0],o=a[1],l=__read(e,2),u=l[0],c=l[1],h=__read(t,2),d=h[0],f=h[1],v=__read([u,c],2),p=v[0],x=v[1],A=x-p;return p>x&&(i=__read([x,p],2),p=i[0],x=i[1]),A>o-s?[s,o]:p<s?d===s&&f===x?[s,x]:[s,A+s]:x>o?f===o&&d===p?[p,o]:[o-A,o]:[p,x]}function V0(r,e,t){return r===void 0&&(r="horizontal"),r==="horizontal"?e:t}function aB(r){var e=r&&r.getRenderBounds();if(!e)return{width:0,height:0};var t=e.getMax(),n=e.getMin();return{width:t[0]-n[0],height:t[1]-n[1]}}function yw(r){var e=r.getLocalBounds(),t=e.min,n=e.max,i=(0,it.CR)([t,n],2),a=(0,it.CR)(i[0],2),s=a[0],o=a[1],l=(0,it.CR)(i[1],2),u=l[0],c=l[1];return{x:s,y:o,width:u-s,height:c-o,left:s,bottom:c,top:o,right:u}}function sB(r,e){var t=select(r).append("text").node();return t.attr(__assign(__assign({},e),{visibility:"hidden"})),t}function GD(r,e){var t=(0,it.CR)(r,2),n=t[0],i=t[1],a=(0,it.CR)(e,2),s=a[0],o=a[1];return n!==s&&i===o}function oB(r,e){var t=__read(r,2),n=t[0],i=t[1],a=__read(e,2),s=a[0],o=a[1];return n===s&&i!==o}function WD(r,e){var t,n,i=e.attributes;try{for(var a=(0,it.XA)(Object.entries(i)),s=a.next();!s.done;s=a.next()){var o=(0,it.CR)(s.value,2),l=o[0],u=o[1];l!=="id"&&l!=="className"&&r.attr(l,u)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}function yo(r){return typeof r=="function"?r():(0,Gt.Z)(r)||(0,bt.Z)(r)?new W0({style:{text:String(r)}}):r}var mv,Y0;function lB(r){Y0=r}var UD=(0,Jp.Z)(function(r,e){var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,s=e.fontVariant;return Y0?Y0(r,t):(mv||(mv=on.offscreenCanvasCreator.getOrCreateContext(void 0)),mv.font=[a,s,i,"".concat(t,"px"),n].join(" "),mv.measureText(r).width)},function(r,e){return[r,Object.values(e||bw(r)).join()].join("")},4096),bw=function(r){var e=r.style.fontFamily||"sans-serif",t=r.style.fontWeight||"normal",n=r.style.fontStyle||"normal",i=r.style.fontVariant,a=r.style.fontSize;return a=typeof a=="object"?a.value:a,{fontSize:a,fontFamily:e,fontWeight:t,fontStyle:n,fontVariant:i}};function xw(r){return r.nodeName==="text"?r:r.nodeName==="g"&&r.children.length===1&&r.children[0].nodeName==="text"?r.children[0]:null}function Ew(r,e){var t=xw(r);t&&t.attr(e)}function H0(r,e,t){t===void 0&&(t="..."),Ew(r,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:t})}var Ba=Os({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");function ZD(r){var e=r.querySelector(Ba.marker.class);return e?e.style:{}}var VD=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,{span:[1,1],marker:function(){return new C0({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return t?typeof t=="string"||typeof t=="number"?t!=="":typeof t=="function"?!0:t.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,n=this.valueGroup,i=this.attributes.markerSize,a=t.node().getBBox(),s=a.width,o=a.height,l=n.node().getBBox(),u=l.width,c=l.height;return{markerWidth:i,labelWidth:s,valueWidth:u,height:Math.max(i,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var n=(0,it.CR)(ji(t),2),i=n[0],a=n[1],s=this.showValue?a:0,o=i+s;return[i/o,s/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,n=this.attributes,i=n.markerSize,a=n.width,s=this.actualSpace,o=s.markerWidth,l=s.height,u=this.actualSpace,c=u.labelWidth,h=u.valueWidth,d=(0,it.CR)(this.spacing,2),f=d[0],v=d[1];if(a){var p=a-i-f-v,x=(0,it.CR)(this.span,2),A=x[0],N=x[1];t=(0,it.CR)([A*p,N*p],2),c=t[0],h=t[1]}var I=o+c+h+f+v;return{width:I,height:l,markerWidth:o,labelWidth:c,valueWidth:h}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var n=(0,it.CR)(ji(t),2),i=n[0],a=n[1];return this.showValue?[i,a]:[i,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,n=t.markerWidth,i=t.labelWidth,a=t.valueWidth,s=t.width,o=t.height,l=(0,it.CR)(this.spacing,2),u=l[0],c=l[1];return{height:o,width:s,markerWidth:n,labelWidth:i,valueWidth:a,position:[n/2,n+u,n+i+u+c]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=ZD(this.markerGroup.node()),n=this.attributes,i=n.markerSize,a=n.markerStrokeWidth,s=a===void 0?t.strokeWidth:a,o=n.markerLineWidth,l=o===void 0?t.lineWidth:o,u=n.markerStroke,c=u===void 0?t.stroke:u,h=+(s||l||(c?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),f=d.width,v=d.height;return(1-h/Math.max(f,v))*i},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var n=this,i=this.attributes.marker,a=$n(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Ba.markerGroup,"g").style("zIndex",0),Fa(!!i,this.markerGroup,function(){var s,o=n.markerGroup.node(),l=(s=o.childNodes)===null||s===void 0?void 0:s[0],u=typeof i=="string"?new jr({style:{symbol:i},className:Ba.marker.name}):i();l?u.nodeName===l.nodeName?l instanceof jr?l.update((0,it.pi)((0,it.pi)({},a),{symbol:i})):(WD(l,u),Sn(l).styles(a)):(l.remove(),Sn(u).attr("className",Ba.marker.name).styles(a),o.appendChild(u)):(u instanceof jr||Sn(u).attr("className",Ba.marker.name).styles(a),o.appendChild(u)),n.markerGroup.node().scale(1/n.markerGroup.node().getScale()[0]);var c=Z0(n.markerGroup.node(),n.scaleSize,!0);n.markerGroup.node().style._transform="scale(".concat(c,")")})},e.prototype.renderLabel=function(t){var n=$n(this.attributes,"label"),i=n.text,a=(0,it._T)(n,["text"]);this.labelGroup=t.maybeAppendByClassName(Ba.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Ba.label,function(){return yo(i)}).styles(a)},e.prototype.renderValue=function(t){var n=this,i=$n(this.attributes,"value"),a=i.text,s=(0,it._T)(i,["text"]);this.valueGroup=t.maybeAppendByClassName(Ba.valueGroup,"g").style("zIndex",0),Fa(this.showValue,this.valueGroup,function(){n.valueGroup.maybeAppendByClassName(Ba.value,function(){return yo(a)}).styles(s)})},e.prototype.renderBackground=function(t){var n=this.shape,i=n.width,a=n.height,s=$n(this.attributes,"background");this.background=t.maybeAppendByClassName(Ba.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Ba.background,"rect").styles((0,it.pi)({width:i,height:a},s))},e.prototype.adjustLayout=function(){var t=this.layout,n=t.labelWidth,i=t.valueWidth,a=t.height,s=(0,it.CR)(t.position,3),o=s[0],l=s[1],u=s[2],c=a/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(l,", ").concat(c,")")}),H0(this.labelGroup.select(Ba.label.class).node(),Math.ceil(n)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(u,", ").concat(c,")")}),H0(this.valueGroup.select(Ba.value.class).node(),Math.ceil(i)))},e.prototype.render=function(t,n){var i=Sn(n),a=t.x,s=a===void 0?0:a,o=t.y,l=o===void 0?0:o;i.styles({transform:"translate(".concat(s,", ").concat(l,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.adjustLayout()},e}(vi),Ll=Os({page:"item-page",navigator:"navigator",item:"item"},"items"),ww=function(r,e,t){return t===void 0&&(t=!0),r?e(r):t},YD=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:U0.Z,mouseenter:U0.Z,mouseleave:U0.Z})||this;return n.navigatorShape=[0,0],n}return Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,n=t.gridRow,i=t.gridCol,a=t.data;if(!n&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return n&&i?[n,i]:n?[n,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,n=t.data,i=t.layout,a=$n(this.attributes,"item"),s=n.map(function(o,l){var u=o.id,c=u===void 0?l:u,h=o.label,d=o.value;return{id:"".concat(c),index:l,style:(0,it.pi)({layout:i,labelText:h,valueText:d},Object.fromEntries(Object.entries(a).map(function(f){var v=(0,it.CR)(f,2),p=v[0],x=v[1];return[p,us(x,[o,l,n])]})))}});return s},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,n=this.attributes,i=n.orientation,a=n.width,s=n.rowPadding,o=n.colPadding,l=(0,it.CR)(this.navigatorShape,1),u=l[0],c=(0,it.CR)(this.grid,2),h=c[0],d=c[1],f=d*h,v=0;return this.pageViews.children.map(function(p,x){var A,N,I=Math.floor(x/f),K=x%f,W=t.ifHorizontal(d,h),z=[Math.floor(K/W),K%W];i==="vertical"&&z.reverse();var j=(0,it.CR)(z,2),Z=j[0],vt=j[1],Tt=(a-u-(d-1)*o)/d,zt=p.getBBox().height,Qt=(0,it.CR)([0,0],2),ae=Qt[0],fe=Qt[1];return i==="horizontal"?(A=(0,it.CR)([v,Z*(zt+s)],2),ae=A[0],fe=A[1],v=vt===d-1?0:v+Tt+o):(N=(0,it.CR)([vt*(Tt+o),v],2),ae=N[0],fe=N[1],v=Z===h-1?0:v+zt+s),{page:I,index:x,row:Z,col:vt,pageIndex:K,width:Tt,height:zt,x:ae,y:fe}})},e.prototype.getFlexLayout=function(){var t=this.attributes,n=t.width,i=t.height,a=t.rowPadding,s=t.colPadding,o=(0,it.CR)(this.navigatorShape,1),l=o[0],u=(0,it.CR)(this.grid,2),c=u[0],h=u[1],d=(0,it.CR)([n-l,i],2),f=d[0],v=d[1],p=(0,it.CR)([0,0,0,0,0,0,0,0],8),x=p[0],A=p[1],N=p[2],I=p[3],K=p[4],W=p[5],z=p[6],j=p[7];return this.pageViews.children.map(function(Z,vt){var Tt,zt,Qt,ae,fe=Z.getBBox(),ce=fe.width,ct=fe.height,$=z===0?0:s,Q=z+$+ce;if(Q<=f&&ww(K,function(ue){return ue<h}))return Tt=(0,it.CR)([z+$,j,Q],3),x=Tt[0],A=Tt[1],z=Tt[2],{width:ce,height:ct,x,y:A,page:N,index:vt,pageIndex:I++,row:W,col:K++};zt=(0,it.CR)([W+1,0,0,j+ct+a],4),W=zt[0],K=zt[1],z=zt[2],j=zt[3];var It=j+ct;return It<=v&&ww(W,function(ue){return ue<c})?(Qt=(0,it.CR)([z,j,ce],3),x=Qt[0],A=Qt[1],z=Qt[2],{width:ce,height:ct,x,y:A,page:N,index:vt,pageIndex:I++,row:W,col:K++}):(ae=(0,it.CR)([0,0,ce,0,N+1,0,0,0],8),x=ae[0],A=ae[1],z=ae[2],j=ae[3],N=ae[4],I=ae[5],W=ae[6],K=ae[7],{width:ce,height:ct,x,y:A,page:N,index:vt,pageIndex:I++,row:W,col:K++})})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,n=t.call(this);return n.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):n},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,n){var i=this.attributes.orientation;return V0(i,t,n)},e.prototype.flattenPage=function(t){t.querySelectorAll(Ll.item.class).forEach(function(n){t.appendChild(n)}),t.querySelectorAll(Ll.page.class).forEach(function(n){var i=t.removeChild(n);i.destroy()})},e.prototype.renderItems=function(t){var n=this.attributes,i=n.click,a=n.mouseenter,s=n.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);Sn(t).selectAll(Ll.item.class).data(this.renderData,function(l){return l.id}).join(function(l){return l.append(function(u){var c=u.style;return new VD({style:c})}).attr("className",Ll.item.name).on("click",function(){i==null||i(this),o("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){s==null||s(this),o("itemMouseleave",{item:this})})},function(l){return l.each(function(u){var c=u.style;this.update(c)})},function(l){return l.remove()})},e.prototype.relayoutNavigator=function(){var t,n=this.attributes,i=n.layout,a=n.width,s=((t=this.pageViews.children[0])===null||t===void 0?void 0:t.getBBox().height)||0,o=(0,it.CR)(this.navigatorShape,2),l=o[0],u=o[1];this.navigator.update(i==="grid"?{pageWidth:a-l,pageHeight:s-u}:{})},e.prototype.adjustLayout=function(){var t=this,n=Object.entries(hD(this.itemsLayout,"page")).map(function(a){var s=(0,it.CR)(a,2),o=s[0],l=s[1];return{page:o,layouts:l}}),i=(0,it.ev)([],(0,it.CR)(this.navigator.getContainer().children),!1);n.forEach(function(a){var s=a.layouts,o=t.pageViews.appendChild(new Ia({className:Ll.page.name}));s.forEach(function(l){var u=l.x,c=l.y,h=l.index,d=l.width,f=l.height,v=i[h];o.appendChild(v),(0,Ec.Z)(v,"__layout__",l),v.update({x:u,y:c,width:d,height:f})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var n=this.attributes.orientation,i=$n(this.attributes,"nav"),a=Oi({orientation:n},i),s=this;return t.selectAll(Ll.navigator.class).data(["nav"]).join(function(o){return o.append(function(){return new DD({style:a})}).attr("className",Ll.navigator.name).each(function(){s.navigator=this})},function(o){return o.each(function(){this.update(a)})},function(o){return o.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,n){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(Sn(n));this.renderItems(a.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,n){var i=new La(t,{detail:n});this.dispatchEvent(i)},e}(vi),$c=Os({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Sw={showLabel:!0,formatter:function(r){return r.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},uB=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,Sw)||this}return e.prototype.render=function(t,n){var i=Sn(n).maybeAppendByClassName($c.markerGroup,"g");this.renderMarker(i);var a=Sn(n).maybeAppendByClassName($c.labelGroup,"g");this.renderLabel(a)},e.prototype.renderMarker=function(t){var n=this,i=this.attributes,a=i.orientation,s=i.markerSymbol,o=s===void 0?V0(a,"horizontalHandle","verticalHandle"):s;Fa(!!o,t,function(l){var u=$n(n.attributes,"marker"),c=(0,it.pi)({symbol:o},u);n.marker=l.maybeAppendByClassName($c.marker,function(){return new jr({style:c})}).update(c)})},e.prototype.renderLabel=function(t){var n=this,i=this.attributes,a=i.showLabel,s=i.orientation,o=i.spacing,l=o===void 0?0:o,u=i.formatter;Fa(a,t,function(c){var h,d=$n(n.attributes,"label"),f=d.text,v=(0,it._T)(d,["text"]),p=((h=c.select($c.marker.class))===null||h===void 0?void 0:h.node().getBBox())||{},x=p.width,A=x===void 0?0:x,N=p.height,I=N===void 0?0:N,K=(0,it.CR)(V0(s,[0,I+l,"center","top"],[A+l,0,"start","middle"]),4),W=K[0],z=K[1],j=K[2],Z=K[3];c.maybeAppendByClassName($c.label,"text").styles((0,it.pi)((0,it.pi)({},v),{x:W,y:z,text:u(f).toString(),textAlign:j,textBaseline:Z}))})},e}(vi),_w={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},HD=Oi({},_w,{}),cB=Oi({},_w,Cu(Sw,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),hB=.01,dB=.5,Qc=Os({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),XD=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,HD)||this}return e.prototype.renderTitle=function(t,n,i){var a=this.attributes,s=a.showTitle,o=a.titleText,l=$n(this.attributes,"title"),u=(0,it.CR)(mo(l),2),c=u[0],h=u[1];this.titleGroup=t.maybeAppendByClassName(Qc.titleGroup,"g").styles(h);var d=(0,it.pi)((0,it.pi)({width:n,height:i},c),{text:s?o:""});this.title=this.titleGroup.maybeAppendByClassName(Qc.title,function(){return new cD({style:d})}).update(d)},e.prototype.renderItems=function(t,n){var i=n.x,a=n.y,s=n.width,o=n.height,l=$n(this.attributes,"title",!0),u=(0,it.CR)(mo(l),2),c=u[0],h=u[1],d=(0,it.pi)((0,it.pi)({},c),{width:s,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Qc.itemsGroup,"g").styles((0,it.pi)((0,it.pi)({},h),{transform:"translate(".concat(i,", ").concat(a,")")}));var f=this;this.itemsGroup.selectAll(Qc.items.class).data(["items"]).join(function(v){return v.append(function(){return new YD({style:d})}).attr("className",Qc.items.name).each(function(){f.items=Sn(this)})},function(v){return v.update(d)},function(v){return v.remove()})},e.prototype.adjustLayout=function(){var t=this.attributes.showTitle;if(t){var n=this.title.node().getAvailableSpace(),i=n.x,a=n.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,n=t.showTitle,i=t.width,a=t.height;return n?this.title.node().getAvailableSpace():new Hi(0,0,i,a)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t,n,i=(t=this.title)===null||t===void 0?void 0:t.node(),a=(n=this.items)===null||n===void 0?void 0:n.node();return!i||!a?r.prototype.getBBox.call(this):oD(i,a)},e.prototype.render=function(t,n){var i=this.attributes,a=i.width,s=i.height,o=i.x,l=o===void 0?0:o,u=i.y,c=u===void 0?0:u,h=Sn(n);n.style.transform="translate(".concat(l,", ").concat(c,")"),this.renderTitle(h,a,s),this.renderItems(h,this.availableSpace),this.adjustLayout()},e}(vi);function X0(r){const{width:e,height:t,renderer:n,containerStyle:i}=r,a=KD(r),[s,o]=$D(r);Object.assign(a.style,Object.assign({position:"absolute",left:s+"px",top:o+"px",width:e+"px",height:t+"px"},i));const l=new Pg({width:e,height:t,container:a,renderer:n||new Kd});return[a,l]}function KD(r){var e;const{container:t,className:n,graphCanvas:i}=r;if(t)return typeof t=="string"?document.getElementById(t):t;const a=bu(n,!1);return(e=i.getContainer())===null||e===void 0||e.appendChild(a),a}function $D(r){const{width:e,height:t,placement:n,graphCanvas:i}=r,[a,s]=i.getSize(),[o,l]=jy(n);return[o*(a-e),l*(s-t)]}var QD=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class yv extends zi{constructor(e,t){super(e,Object.assign({},yv.defaultOptions,t)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:n}=this.context;n.on(sn.AFTER_DRAW,this.createElement)},this.changeState=(n,i)=>{const{graph:a}=this.context,{typePrefix:s}=this,o=(0,na.Z)(n,[s,"id"]),l=(0,na.Z)(n,[s,"style","labelText"]),[u]=o.split("__"),c=this.fieldMap[u].get(l)||[];a.setElementState(Object.fromEntries(c==null?void 0:c.map(h=>[h,i])))},this.click=n=>{if(this.options.trigger==="hover")return;const i=(0,na.Z)(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(n,[])):(this.selectedItems.push(i),this.changeState(n,"selected"))},this.mouseleave=n=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(n,[]))},this.mouseenter=n=>{if(this.options.trigger==="click")return;const i=(0,na.Z)(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(n,"active"))},this.setFieldMap=(n,i,a)=>{if(!n)return;const s=this.fieldMap[a];if(s)if(!s.has(n))s.set(n,[i]);else{const o=s.get(n);o&&(o.push(i),s.set(n,o))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(n,i)=>{if(!n)return[];const{model:a,element:s}=this.context,{nodes:o,edges:l,combos:u}=a.getData(),c={},h=x=>(0,At.Z)(n)?n(x):n,d={node:"circle",edge:"line",combo:"rect"},f={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},v=(x,A)=>s==null?void 0:s.getElementComputedStyle(x,A),p=(x,A)=>{x.forEach(N=>{const{id:I}=N,K=(0,na.Z)(N,["data",h(N)]),W=(s==null?void 0:s.getElementType(A,N))||"circle",z=v(A,N),j=(A==="edge"?z==null?void 0:z.stroke:z==null?void 0:z.fill)||"#1783ff";I&&K&&K.replace(/\s+/g,"")&&(this.setFieldMap(K,I,A),c[K]||(c[K]={id:`${A}__${I}`,label:K,marker:f[W]||d[A],elementType:A,lineWidth:1,stroke:j,fill:j}))})};switch(i){case"node":p(o,"node");break;case"edge":p(l,"edge");break;case"combo":p(u,"combo");break;default:return[]}return Object.values(c)},this.createElement=()=>{if(this.draw){this.updateElement();return}const n=this.options,{width:i,height:a,nodeField:s,edgeField:o,comboField:l,trigger:u,position:c,container:h,containerStyle:d,className:f}=n,v=QD(n,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),p=this.getMarkerData(s,"node"),x=this.getMarkerData(o,"edge"),A=this.getMarkerData(l,"combo"),N=[...p,...A,...x],I=Object.assign({width:i,height:a,data:N,itemMarkerLineWidth:({lineWidth:z})=>z,itemMarker:({marker:z})=>z,itemMarkerStroke:({stroke:z})=>z,itemMarkerFill:({fill:z})=>z,gridCol:p.length},v,this.getEvents()),K=new XD({className:"legend",style:I});this.category=K,this.upsertCanvas().appendChild(K),this.draw=!0},this.bindEvents()}update(e){super.update(e),this.clear(),this.createElement()}clear(){var e,t;(e=this.canvas)===null||e===void 0||e.destroy(),(t=this.container)===null||t===void 0||t.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:e})=>!this.selectedItems.length||this.selectedItems.includes(e)?1:.5,itemLabelOpacity:({id:e})=>!this.selectedItems.length||this.selectedItems.includes(e)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const e=this.context.canvas,[t,n]=e.getSize(),{width:i=t,height:a=n,position:s,container:o,containerStyle:l,className:u}=this.options,[c,h]=X0({width:i,height:a,graphCanvas:e,container:o,containerStyle:l,placement:s,className:"legend"});return this.container=c,u&&c.classList.add(u),this.canvas=h,this.canvas}destroy(){this.clear(),this.context.graph.off(sn.AFTER_DRAW,this.createElement),super.destroy()}}yv.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class bv extends zi{constructor(e,t){super(e,Object.assign({},bv.defaultOptions,t)),this.onDraw=n=>{var i;!((i=n==null?void 0:n.data)===null||i===void 0)&&i.render||this.onRender()},this.shapes=new Map,this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=n=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(n.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=n=>{if(!this.mask||!this.isMaskDragging)return;const{size:[i,a]}=this.options,{movementX:s,movementY:o}=n,{left:l,top:u,width:c,height:h}=this.mask.style,[,,d,f]=this.maskBBox;let v=parseInt(l)+s,p=parseInt(u)+o,x=parseInt(c),A=parseInt(h);v<0&&(v=0),p<0&&(p=0),v+x>i&&(v=Ko(i-x,0)),p+A>a&&(p=Ko(a-A,0)),x<d&&(s>0?(v=Ko(v-s,0),x=Xo(x+s,i)):s<0&&(x=Xo(x-s,i))),A<f&&(o>0?(p=Ko(p-o,0),A=Xo(A+o,a)):o<0&&(A=Xo(A-o,a))),Object.assign(this.mask.style,{left:v+"px",top:p+"px",width:x+"px",height:A+"px"});const N=parseInt(l)-v,I=parseInt(u)-p;if(N===0&&I===0)return;const K=this.context.canvas.getCamera().getZoom(),W=this.canvas.getCamera().getZoom(),z=K/W;this.context.graph.translateBy([N*z,I*z],!1)},this.onMaskDragEnd=n=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(n.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=(0,Ny.Z)(()=>{this.isMaskDragging||(this.updateMask(),this.setCamera())},32,{leading:!0}),this.setOnRender(),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),"delay"in e&&this.setOnRender(),this.bindEvents()}setOnRender(){this.onRender=(0,Rc.Z)(()=>{this.renderMinimap(),this.renderMask()},this.options.delay,!0)}bindEvents(){const{graph:e}=this.context;e.on(sn.AFTER_DRAW,this.onDraw),e.on(sn.AFTER_RENDER,this.onRender),e.on(sn.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:e}=this.context;e.off(sn.AFTER_DRAW,this.onDraw),e.off(sn.AFTER_RENDER,this.onRender),e.off(sn.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const e=this.getElements(),t=this.initCanvas();this.setShapes(t,e)}getElements(){const{filter:e}=this.options,{model:t}=this.context,n=t.getData();if(!e)return n;const{nodes:i,edges:a,combos:s}=n;return{nodes:i.filter(o=>e(Re(o),"node")),edges:a.filter(o=>e(Re(o),"edge")),combos:s.filter(o=>e(Re(o),"combo"))}}setShapes(e,t){const{nodes:n,edges:i,combos:a}=t,{shape:s}=this.options,{element:o}=this.context;if(s==="key"){const u=new Set,c=h=>{const d=Re(h);u.add(d);const f=o.getElement(d);if(!f)return;const v=f.getShape("key"),p=this.shapes.get(d)||v.cloneNode();p.setPosition(v.getPosition()),f.style.zIndex&&(p.style.zIndex=f.style.zIndex),p.id=f.id,this.shapes.has(d)?Object.entries(v.attributes).forEach(([x,A])=>{p.style[x]!==A&&(p.style[x]=A)}):(e.appendChild(p),this.shapes.set(d,p))};i.forEach(c),a.forEach(c),n.forEach(c),this.shapes.forEach((h,d)=>{u.has(d)||(e.removeChild(h),this.shapes.delete(d))});return}const l=(u,c)=>{const d=o.getElement(u).getPosition();return c.setPosition(d),c};e.removeChildren(),i.forEach(u=>e.appendChild(s(Re(u),"edge"))),a.forEach(u=>{e.appendChild(l(Re(u),s(Re(u),"combo")))}),n.forEach(u=>{e.appendChild(l(Re(u),s(Re(u),"node")))})}initCanvas(){const{renderer:e,size:[t,n]}=this.options;if(this.canvas){const{width:i,height:a}=this.canvas.getConfig();(t!==i||n!==a)&&this.canvas.resize(t,n),e&&this.canvas.setRenderer(e)}else{const{className:i,position:a,container:s,containerStyle:o}=this.options,[l,u]=X0({renderer:e,width:t,height:n,placement:a,className:"minimap",container:s,containerStyle:o,graphCanvas:this.context.canvas});i&&l.classList.add(i),this.container=l,this.canvas=u}return this.setCamera(),this.canvas}createLandmark(e,t,n){const i=`${e.join(",")}-${t.join(",")}-${n}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const s=this.canvas.getCamera().createLandmark(i,{position:e,focalPoint:t,zoom:n});return this.landmarkMap.set(i,s),s}setCamera(){var e;const{canvas:t}=this.context,n=(e=this.canvas)===null||e===void 0?void 0:e.getCamera();if(!n)return;const{size:[i,a],padding:s}=this.options,[o,l,u,c]=Ws(s),{min:h,max:d,center:f}=t.getBounds("elements"),v=d[0]-h[0],p=d[1]-h[1],x=i-c-l,A=a-o-u,N=x/v,I=A/p,K=Math.min(N,I),W=this.createLandmark(f,f,K);n.gotoLandmark(W,0)}get maskBBox(){const{canvas:e}=this.context,t=e.getSize(),n=e.getCanvasByViewport([0,0]),i=e.getCanvasByViewport(t),a=this.canvas.canvas2Viewport(bs(n)),s=this.canvas.canvas2Viewport(bs(i)),o=s.x-a.x,l=s.y-a.y;return[a.x,a.y,o,l]}calculateMaskBBox(){const{size:[e,t]}=this.options;let[n,i,a,s]=this.maskBBox;return n<0&&(a=Xo(a+n,e),n=0),i<0&&(s=Xo(s+i,t),i=0),n+a>e&&(a=Ko(e-n,0)),i+s>t&&(s=Ko(t-i,0)),[Xo(n,e),Xo(i,t),Ko(a,0),Ko(s,0)]}renderMask(){const{maskStyle:e}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart)),this.container.appendChild(this.mask),Object.assign(this.mask.style,Object.assign(Object.assign({},e),{cursor:"move",position:"absolute",pointerEvents:"auto"})),this.updateMask()}updateMask(){if(!this.mask)return;const[e,t,n,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:t+"px",left:e+"px",width:n+"px",height:i+"px"})}destroy(){var e;this.unbindEvents(),this.canvas.destroy(),(e=this.mask)===null||e===void 0||e.remove(),super.destroy()}}bv.defaultOptions={size:[240,160],shape:"key",padding:10,position:"right-bottom",maskStyle:{border:"1px solid #ddd",background:"rgba(0, 0, 0, 0.1)"},containerStyle:{border:"1px solid #ddd",background:"#fff"},delay:128};const Xo=(r,e)=>Math.min(r,e),Ko=(r,e)=>Math.max(r,e);var K0=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};const $0={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class xv extends zi{constructor(e,t){super(e,Object.assign({},xv.defaultOptions,t)),this.initSnapline=()=>{const n=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=n.appendChild(new cc({style:Object.assign(Object.assign({},$0),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=n.appendChild(new cc({style:Object.assign(Object.assign({},$0),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(n,i,a)=>K0(this,void 0,void 0,function*(){const{verticalX:s,horizontalY:o}=a,{tolerance:l}=this.options,{min:[u,c],max:[h,d],center:[f,v]}=i;let p=0,x=0;s!==null&&(Xi(h,s)<l&&(p=s-h),Xi(u,s)<l&&(p=s-u),Xi(f,s)<l&&(p=s-f),p!==0&&(this.isVerticalSticking=!0)),o!==null&&(Xi(d,o)<l&&(x=o-d),Xi(c,o)<l&&(x=o-c),Xi(v,o)<l&&(x=o-v),x!==0&&(this.isHorizontalSticking=!0)),(p!==0||x!==0)&&(yield this.context.graph.translateElementBy({[n]:[p,x]},!1))}),this.enableSnap=n=>{const{target:i}=n,a=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[s,o]=this.getDelta(n);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(s)<=a&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,-o]},!1),!1;if(this.isHorizontalSticking&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[0,-o]},!1),!1;if(this.isVerticalSticking&&Math.abs(s)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout(()=>{this.enableStick=!0},200)}return this.enableStick},this.calcSnaplineMetadata=(n,i)=>{const{tolerance:a,shape:s}=this.options,{min:[o,l],max:[u,c],center:[h,d]}=i;let f=null,v=null,p=null,x=null,A=null,N=null;return this.getNodes().some(I=>{if((0,pi.Z)(n.id,I.id))return!1;const K=Mw(I,s).getRenderBounds(),{min:[W,z],max:[j,Z],center:[vt,Tt]}=K;return f===null&&(Xi(vt,h)<a?f=vt:Xi(W,o)<a||Xi(W,u)<a?f=W:(Xi(j,u)<a||Xi(j,o)<a)&&(f=j),f!==null&&(v=Math.min(z,l),p=Math.max(Z,c))),x===null&&(Xi(Tt,d)<a?x=Tt:Xi(z,l)<a||Xi(z,c)<a?x=z:(Xi(Z,c)<a||Xi(Z,l)<a)&&(x=Z),x!==null&&(A=Math.min(W,o),N=Math.max(j,u))),f!==null&&x!==null}),{verticalX:f,verticalMinY:v,verticalMaxY:p,horizontalY:x,horizontalMinX:A,horizontalMaxX:N}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=n=>K0(this,void 0,void 0,function*(){const{target:i}=n;if(this.options.autoSnap&&!this.enableSnap(n))return;const a=Mw(i,this.options.shape).getRenderBounds(),s=this.calcSnaplineMetadata(i,a);this.hideSnapline(),(s.verticalX!==null||s.horizontalY!==null)&&this.updateSnapline(s),this.options.autoSnap&&(yield this.autoSnapToLine(i.id,a,s))}),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var e;const{filter:t}=this.options,i=(((e=this.context.element)===null||e===void 0?void 0:e.getNodes())||[]).filter(a=>{var s;return qT(a)&&((s=this.context.viewport)===null||s===void 0?void 0:s.isInViewport(a.getRenderBounds()))});return t?i.filter(a=>t(a)):i}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(e){const{lineWidth:t}=this.options[`${e}LineStyle`];return+(t||$0.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(e){const{verticalX:t,verticalMinY:n,verticalMaxY:i,horizontalY:a,horizontalMinX:s,horizontalMaxX:o}=e,[l,u]=this.context.canvas.getSize(),{offset:c}=this.options;a!==null?Object.assign(this.horizontalLine.style,{x1:c===1/0?0:s-c,y1:a,x2:c===1/0?l:o+c,y2:a,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",t!==null?Object.assign(this.verticalLine.style,{x1:t,y1:c===1/0?0:n-c,x2:t,y2:c===1/0?u:i+c,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(e){const t=this.context.graph.getZoom();return ys([e.dx,e.dy],t)}bindEvents(){return K0(this,void 0,void 0,function*(){const{graph:e}=this.context;e.on(ts.DRAG_START,this.onDragStart),e.on(ts.DRAG,this.onDrag),e.on(ts.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:e}=this.context;e.off(ts.DRAG_START,this.onDragStart),e.off(ts.DRAG,this.onDrag),e.off(ts.DRAG_END,this.onDragEnd)}destroyElements(){var e,t;(e=this.horizontalLine)===null||e===void 0||e.destroy(),(t=this.verticalLine)===null||t===void 0||t.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}xv.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const Xi=(r,e)=>Math.abs(r-e),Mw=(r,e)=>typeof e=="function"?e(r):r.getShape(e);var kw=null,JD=null;function Ev(r){return r instanceof Date?r:new Date(r)}function qD(r){for(var e=__read(r,2),t=e[0],n=e[1],i=kw.indexOf(t),a=kw.indexOf(n),s="",o=i;o<=a;o+=1)if(s+=JD[o],o<a){var l="-";o===2?l=" ":o>2&&(l=":"),s+=l}return s}function sa(r,e){var t={YYYY:r.getFullYear(),MM:r.getMonth()+1,DD:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds()},n=e;return Object.keys(t).forEach(function(i){var a=t[i];n=n.replace(i,i==="YYYY"?"".concat(a):"".concat(a).padStart(2,"0"))}),n}function fB(r,e){return Ev(r).getTime()-Ev(e).getTime()}function vB(r,e){var t=__read([Ev(r),Ev(e)],2),n=t[0],i=t[1];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function gB(r,e){var t=new Date(r),n={year:function(i){i.setMonth(0),i.setHours(0,0,0,0)},month:function(i){i.setDate(1),i.setHours(0,0,0,0)},day:function(i){return i.setHours(0,0,0,0)},hour:function(i){return i.setMinutes(0,0,0)},minute:function(i){return i.setSeconds(0,0)},second:function(i){return i.setMilliseconds(0)}};return n[e](t),sa(t,qD(["year",e]))}function tI(r,e){if(r.length<=e)return r;for(var t=Math.floor(r.length/e),n=[],i=0;i<r.length;i+=t)n.push(r[i]);return n}var Q0={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new P0({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]},pB=(0,Ta.Z)({},Q0,{style:{type:"arc"}}),mB=(0,Ta.Z)({},Q0,{style:{}}),Nr=Os({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis");function bo(r,e){return[r[0]*e,r[1]*e]}function Jc(r,e){return[r[0]+e[0],r[1]+e[1]]}function J0(r,e){return[r[0]-e[0],r[1]-e[1]]}function Dl(r,e){return[Math.min(r[0],e[0]),Math.min(r[1],e[1])]}function Il(r,e){return[Math.max(r[0],e[0]),Math.max(r[1],e[1])]}function qc(r,e){return Math.sqrt(Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2))}function Tw(r){if(r[0]===0&&r[1]===0)return[0,0];var e=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2));return[r[0]/e,r[1]/e]}function yB(r,e,t){var n=__read(r,2),i=n[0],a=n[1],s=__read(e,2),o=s[0],l=s[1],u=i-o,c=a-l,h=Math.sin(t),d=Math.cos(t);return[u*d-c*h+o,u*h+c*d+l]}function eI(r,e){return e?[r[1],-r[0]]:[-r[1],r[0]]}function Nu(r){return r*Math.PI/180}function Ow(r){return Number((r*180/Math.PI).toPrecision(5))}function wv(r,e){return r.style.opacity||(r.style.opacity=1),As(r,{opacity:0},e)}var nI=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function rI(r){return nI.includes(r)}function Aw(r){var e={};for(var t in r)rI(t)&&(e[t]=r[t]);return e}var Ru=Os({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Cw(r){return r.reduce(function(e,t,n){return e.push((0,it.ev)([n===0?"M":"L"],(0,it.CR)(t),!1)),e},[])}function iI(r,e,t){var n=e.connect,i=n===void 0?"line":n,a=e.center;if(i==="line")return Cw(r);if(!a)return[];var s=qc(r[0],a),o=t?0:1;return r.reduce(function(l,u,c){return c===0?l.push((0,it.ev)(["M"],(0,it.CR)(u),!1)):l.push((0,it.ev)(["A",s,s,0,0,o],(0,it.CR)(u),!1)),l},[])}function q0(r,e,t){return e.type==="surround"?iI(r,e,t):Cw(r)}function aI(r,e,t){var n=t.type,i=t.connect,a=t.center,s=t.closed,o=s?[["Z"]]:[],l=(0,it.CR)([q0(r,t),q0(e.slice().reverse(),t,!0)],2),u=l[0],c=l[1],h=(0,it.CR)([r[0],e.slice(-1)[0]],2),d=h[0],f=h[1],v=function(N,I){return[u,N,c,I,o].flat()};if(i==="line"||n==="surround")return v([(0,it.ev)(["L"],(0,it.CR)(f),!1)],[(0,it.ev)(["L"],(0,it.CR)(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=(0,it.CR)([qc(f,a),qc(d,a)],2),x=p[0],A=p[1];return v([(0,it.ev)(["A",x,x,0,0,1],(0,it.CR)(f),!1),(0,it.ev)(["L"],(0,it.CR)(f),!1)],[(0,it.ev)(["A",A,A,0,0,0],(0,it.CR)(d),!1),(0,it.ev)(["L"],(0,it.CR)(d),!1)])}function sI(r,e,t,n){var i=t.animate,a=t.isBillboard,s=e.map(function(o,l){return{id:o.id||"grid-line-".concat(l),d:q0(o.points,t)}});return r.selectAll(Ru.line.class).data(s,function(o){return o.id}).join(function(o){return o.append("path").each(function(l,u){var c=us(Aw((0,it.pi)({d:l.d},n)),[l,u,s]);this.attr((0,it.pi)({class:Ru.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},c))})},function(o){return o.transition(function(l,u){var c=us(Aw((0,it.pi)({d:l.d},n)),[l,u,s]);return As(this,c,i.update)})},function(o){return o.transition(function(){var l=this,u=wv(this,i.exit);return Pu(u,function(){return l.remove()}),u})}).transitions()}function oI(r,e,t){var n=t.animate,i=t.connect,a=t.areaFill;if(e.length<2||!a||!i)return[];for(var s=Array.isArray(a)?a:[a,"transparent"],o=function(v){return s[v%s.length]},l=[],u=0;u<e.length-1;u++){var c=(0,it.CR)([e[u].points,e[u+1].points],2),h=c[0],d=c[1],f=aI(h,d,t);l.push({d:f,fill:o(u)})}return r.selectAll(Ru.region.class).data(l,function(v,p){return p}).join(function(v){return v.append("path").each(function(p,x){var A=us(p,[p,x,l]);this.attr(A)}).attr("className",Ru.region.name)},function(v){return v.transition(function(p,x){var A=us(p,[p,x,l]);return As(this,A,n.update)})},function(v){return v.transition(function(){var p=this,x=wv(this,n.exit);return Pu(x,function(){return p.remove()}),x})}).transitions()}function lI(r){var e=r.data,t=e===void 0?[]:e,n=r.closed;return n?t.map(function(i){var a=i.points,s=(0,it.CR)(a,1),o=s[0];return(0,it.pi)((0,it.pi)({},i),{points:(0,it.ev)((0,it.ev)([],(0,it.CR)(a),!1),[o],!1)})}):t}var uI=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){var i=t.type,a=t.center,s=t.areaFill,o=t.closed,l=(0,it._T)(t,["type","center","areaFill","closed"]),u=lI(t),c=Sn(n).maybeAppendByClassName(Ru.lineGroup,"g"),h=Sn(n).maybeAppendByClassName(Ru.regionGroup,"g"),d=sI(c,u,t,l),f=oI(h,u,t);return(0,it.ev)((0,it.ev)([],(0,it.CR)(d),!1),(0,it.CR)(f),!1)},e}(vi),cI=function(r,e){return function(t){return r*(1-t)+e*t}};function hI(r,e){var t=e?e.length:0,n=r?Math.min(t,r.length):0;return function(i){var a=new Array(n),s=new Array(t),o=0;for(o=0;o<n;++o)a[o]=tm(r[o],e[o]);for(;o<t;++o)s[o]=e[o];for(o=0;o<n;++o)s[o]=a[o](i);return s}}function dI(r,e){r===void 0&&(r={}),e===void 0&&(e={});var t={},n={};return Object.entries(e).forEach(function(i){var a=(0,it.CR)(i,2),s=a[0],o=a[1];s in r?t[s]=tm(r[s],o):n[s]=o}),function(i){return Object.entries(t).forEach(function(a){var s=(0,it.CR)(a,2),o=s[0],l=s[1];return n[o]=l(i)}),n}}function tm(r,e){return typeof r=="number"&&typeof e=="number"?cI(r,e):Array.isArray(r)&&Array.isArray(e)?hI(r,e):typeof r=="object"&&typeof e=="object"?dI(r,e):function(t){return r}}function fI(r,e,t,n){if(!n)return r.attr("__keyframe_data__",t),null;var i=n.duration,a=i===void 0?0:i,s=tm(e,t),o=Math.ceil(+a/16),l=new Array(o).fill(0).map(function(u,c,h){return{__keyframe_data__:s(c/(h.length-1))}});return r.animate(l,(0,it.pi)({fill:"both"},n))}function Pw(r,e){var t={},n=Array.isArray(e)?e:[e];for(var i in r)n.includes(i)||(t[i]=r[i]);return t}function Nw(r,e){return Object.fromEntries(Object.entries(r).map(function(t){var n=(0,it.CR)(t,2),i=n[0],a=n[1];return[i,us(a,e)]}))}function bB(r){if(r.type==="linear"){var e=r.startPos,t=r.endPos;return __spreadArray(__spreadArray([],__read(e),!1),__read(t),!1)}var n=r.startAngle,i=r.endAngle,a=r.center,s=r.radius;return __spreadArray(__spreadArray([n,i],__read(a),!1),[s],!1)}function em(r,e){return e&&(0,At.Z)(e)?r.filter(e):r}function Rw(r,e){var t=e.startAngle,n=e.endAngle;return(n-t)*r+t}function Sv(r,e){if(e.type==="linear"){var t=(0,it.CR)(e.startPos,2),n=t[0],i=t[1],a=(0,it.CR)(e.endPos,2),s=a[0],o=a[1],l=(0,it.CR)([s-n,o-i],2),u=l[0],c=l[1];return Tw([u,c])}var h=Nu(Rw(r,e));return[-Math.sin(h),Math.cos(h)]}function nm(r,e,t){var n=Sv(r,t);return eI(n,e!=="positive")}function th(r,e){return nm(r,e.labelDirection,e)}function vI(r,e){var t=(0,it.CR)(e.startPos,2),n=t[0],i=t[1],a=(0,it.CR)(e.endPos,2),s=a[0],o=a[1],l=(0,it.CR)([s-n,o-i],2),u=l[0],c=l[1];return[n+u*r,i+c*r]}function gI(r,e){var t=e.radius,n=(0,it.CR)(e.center,2),i=n[0],a=n[1],s=Nu(Rw(r,e));return[i+t*Math.cos(s),a+t*Math.sin(s)]}function _v(r,e){return e.type==="linear"?vI(r,e):gI(r,e)}function Lw(r){return Sv(0,r)[1]===0}function Dw(r){return Sv(0,r)[0]===0}function Iw(r,e){return e-r===360}function Fw(r,e,t,n,i){var a=e-r,s=(0,it.CR)([i,i],2),o=s[0],l=s[1],u=(0,it.CR)([Nu(r),Nu(e)],2),c=u[0],h=u[1],d=function(Tt){return[t+i*Math.cos(Tt),n+i*Math.sin(Tt)]},f=(0,it.CR)(d(c),2),v=f[0],p=f[1],x=(0,it.CR)(d(h),2),A=x[0],N=x[1];if(Iw(r,e)){var I=(h+c)/2,K=(0,it.CR)(d(I),2),W=K[0],z=K[1];return[["M",v,p],["A",o,l,0,1,0,W,z],["A",o,l,0,1,0,A,N]]}var j=a>180?1:0,Z=r>e?0:1,vt=!1;return vt?"M".concat(t,",").concat(n,",L").concat(v,",").concat(p,",A").concat(o,",").concat(l,",0,").concat(j,",").concat(Z,",").concat(A,",").concat(N,",L").concat(t,",").concat(n):"M".concat(v,",").concat(p,",A").concat(o,",").concat(l,",0,").concat(j,",").concat(Z,",").concat(A,",").concat(N)}function pI(r){var e=r.attributes,t=e.startAngle,n=e.endAngle,i=e.center,a=e.radius;return(0,it.ev)((0,it.ev)([t,n],(0,it.CR)(i),!1),[a],!1)}function mI(r,e,t,n){var i=e.startAngle,a=e.endAngle,s=e.center,o=e.radius;return r.selectAll(Nr.line.class).data([{d:Fw.apply(void 0,(0,it.ev)((0,it.ev)([i,a],(0,it.CR)(s),!1),[o],!1))}],function(l,u){return u}).join(function(l){return l.append("path").attr("className",Nr.line.name).styles(e).styles({d:function(u){return u.d}})},function(l){return l.transition(function(){var u=this,c=fI(this,pI(this),(0,it.ev)((0,it.ev)([i,a],(0,it.CR)(s),!1),[o],!1),n.update);if(c){var h=function(){var d=(0,na.Z)(u.attributes,"__keyframe_data__");u.style.d=Fw.apply(void 0,(0,it.ev)([],(0,it.CR)(d),!1))};c.onframe=h,c.onfinish=h}return c}).styles(e)},function(l){return l.remove()}).styles(t).transitions()}function yI(r,e){var t=e.truncRange,n=e.truncShape,i=e.lineExtension}function bI(r,e,t){t===void 0&&(t=[0,0]);var n=(0,it.CR)([r,e,t],3),i=(0,it.CR)(n[0],2),a=i[0],s=i[1],o=(0,it.CR)(n[1],2),l=o[0],u=o[1],c=(0,it.CR)(n[2],2),h=c[0],d=c[1],f=(0,it.CR)([l-a,u-s],2),v=f[0],p=f[1],x=Math.sqrt(Math.pow(v,2)+Math.pow(p,2)),A=(0,it.CR)([-h/x,d/x],2),N=A[0],I=A[1];return[N*v,N*p,I*v,I*p]}function Bw(r){var e=(0,it.CR)(r,2),t=(0,it.CR)(e[0],2),n=t[0],i=t[1],a=(0,it.CR)(e[1],2),s=a[0],o=a[1];return{x1:n,y1:i,x2:s,y2:o}}function xI(r,e,t,n){var i=e.showTrunc,a=e.startPos,s=e.endPos,o=e.truncRange,l=e.lineExtension,u=(0,it.CR)([a,s],2),c=(0,it.CR)(u[0],2),h=c[0],d=c[1],f=(0,it.CR)(u[1],2),v=f[0],p=f[1],x=(0,it.CR)(l?bI(a,s,l):new Array(4).fill(0),4),A=x[0],N=x[1],I=x[2],K=x[3],W=function(Q){return r.selectAll(Nr.line.class).data(Q,function(It,ue){return ue}).join(function(It){return It.append("line").attr("className",function(ue){return"".concat(Nr.line.name," ").concat(ue.className)}).styles(t).transition(function(ue){return As(this,Bw(ue.line),!1)})},function(It){return It.styles(t).transition(function(ue){var le=ue.line;return As(this,Bw(le),n.update)})},function(It){return It.remove()}).transitions()};if(!i||!o)return W([{line:[[h+A,d+N],[v+I,p+K]],className:Nr.line.name}]);var z=(0,it.CR)(o,2),j=z[0],Z=z[1],vt=v-h,Tt=p-d,zt=(0,it.CR)([h+vt*j,d+Tt*j],2),Qt=zt[0],ae=zt[1],fe=(0,it.CR)([h+vt*Z,d+Tt*Z],2),ce=fe[0],ct=fe[1],$=W([{line:[[h+A,d+N],[Qt,ae]],className:Nr.lineFirst.name},{line:[[ce,ct],[v+I,p+K]],className:Nr.lineSecond.name}]);return yI(r,e),$}function EI(r,e,t,n){var i=t.showArrow,a=t.showTrunc,s=t.lineArrow,o=t.lineArrowOffset,l=t.lineArrowSize,u;if(e==="arc"?u=r.select(Nr.line.class):a?u=r.select(Nr.lineSecond.class):u=r.select(Nr.line.class),!i||!s||t.type==="arc"&&Iw(t.startAngle,t.endAngle)){var c=u.node();c&&(c.style.markerEnd=void 0);return}var h=yo(s);h.attr(n),Z0(h,l,!0),u.style("markerEnd",h).style("markerEndOffset",-o)}function wI(r,e,t){var n=e.type,i,a=$n(e,"line");return n==="linear"?i=xI(r,e,Pw(a,"arrow"),t):i=mI(r,e,Pw(a,"arrow"),t),EI(r,n,e,a),i}function SI(r,e){return nm(r,e.gridDirection,e)}function zw(r){var e=r.type,t=r.gridCenter;return e==="linear"?t:t||r.center}function _I(r,e){var t=e.gridLength;return r.map(function(n,i){var a=n.value,s=(0,it.CR)(_v(a,e),2),o=s[0],l=s[1],u=(0,it.CR)(bo(SI(a,e),t),2),c=u[0],h=u[1];return{id:i,points:[[o,l],[o+c,l+h]]}})}function MI(r,e){var t=e.gridControlAngles,n=zw(e);if(!n)throw new Error("grid center is not provide");if(r.length<2)throw new Error("Invalid grid data");if(!t||t.length===0)throw new Error("Invalid gridControlAngles");var i=(0,it.CR)(n,2),a=i[0],s=i[1];return r.map(function(o,l){var u=o.value,c=(0,it.CR)(_v(u,e),2),h=c[0],d=c[1],f=(0,it.CR)([h-a,d-s],2),v=f[0],p=f[1],x=[];return t.forEach(function(A){var N=Nu(A),I=(0,it.CR)([Math.cos(N),Math.sin(N)],2),K=I[0],W=I[1],z=v*K-p*W+a,j=v*W+p*K+s;x.push([z,j])}),{points:x,id:l}})}function kI(r,e,t,n){var i=$n(t,"grid"),a=i.type,s=i.areaFill,o=zw(t),l=em(e,t.gridFilter),u=a==="segment"?_I(l,t):MI(l,t),c=(0,it.pi)((0,it.pi)({},i),{center:o,areaFill:(0,At.Z)(s)?l.map(function(h,d){return us(s,[h,d,l])}):s,animate:n,data:u});return r.selectAll(Nr.grid.class).data([1]).join(function(h){return h.append(function(){return new uI({style:c})}).attr("className",Nr.grid.name)},function(h){return h.transition(function(){return this.update(c)})},function(h){return h.remove()}).transitions()}function Gi(r,e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=!1),n&&r===e||i&&r===t?!0:r>e&&r<t}function TI(r,e,t,n){t===void 0&&(t=2),n===void 0&&(n="top"),Ew(r,{wordWrap:!0,wordWrapWidth:e,maxLines:t,textBaseline:n})}function OI(r,e,t){var n=r.getBBox(),i=n.width,a=n.height,s=(0,it.CR)([e,t].map(function(u,c){var h;return u.includes("%")?parseFloat(((h=u.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||h===void 0?void 0:h[0])||"0")/100*(c===0?i:a):u}),2),o=s[0],l=s[1];return[o,l]}function jw(r,e){if(e)try{var t=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,n=e.replace(t,function(i,a,s){return"translate(".concat(OI(r,a,s),")")});r.attr("transform",n)}catch(i){}}var Gw=function(r){return r!==void 0&&r!=null&&!Number.isNaN(r)},rm=function(){function r(e,t,n,i){this.set(e,t,n,i)}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),r.prototype.rotatedPoints=function(e,t,n){var i=this,a=i.x1,s=i.y1,o=i.x2,l=i.y2,u=Math.cos(e),c=Math.sin(e),h=t-t*u+n*c,d=n-t*c-n*u,f=[[u*a-c*l+h,c*a+u*l+d],[u*o-c*l+h,c*o+u*l+d],[u*a-c*s+h,c*a+u*s+d],[u*o-c*s+h,c*o+u*s+d]];return f},r.prototype.set=function(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},r.prototype.defined=function(e){return this[e]!==Number.MAX_VALUE&&this[e]!==-Number.MAX_VALUE},r}();function Mv(r,e){var t=r.getEulerAngles()||0;r.setEulerAngles(0);var n=r.getBounds(),i=(0,it.CR)(n.min,2),a=i[0],s=i[1],o=(0,it.CR)(n.max,2),l=o[0],u=o[1],c=r.getBBox(),h=c.width,d=c.height,f=d,v=0,p=0,x=a,A=s,N=xw(r);if(N){f-=1.5;var I=N.style.textAlign,K=N.style.textBaseline;I==="center"?x=(a+l)/2:(I==="right"||I==="end")&&(x=l),K==="middle"?A=(s+u)/2:K==="bottom"&&(A=u)}var W=(0,it.CR)(ji(e),4),z=W[0],j=z===void 0?0:z,Z=W[1],vt=Z===void 0?0:Z,Tt=W[2],zt=Tt===void 0?j:Tt,Qt=W[3],ae=Qt===void 0?vt:Qt,fe=new rm((v+=a)-ae,(p+=s)-j,v+h+vt,p+f+zt);return r.setEulerAngles(t),fe.rotatedPoints(Nu(t),x,A)}function eh(r,e){return e[0]<=Math.max(r[0][0],r[1][0])&&e[0]<=Math.min(r[0][0],r[1][0])&&e[1]<=Math.max(r[0][1],r[1][1])&&e[1]<=Math.min(r[0][1],r[1][1])}function nh(r,e,t){var n=(e[1]-r[1])*(t[0]-e[0])-(e[0]-r[0])*(t[1]-e[1]);return n===0?0:n<0?2:1}function AI(r,e){var t=nh(r[0],r[1],e[0]),n=nh(r[0],r[1],e[1]),i=nh(e[0],e[1],r[0]),a=nh(e[0],e[1],r[1]);return!!(t!==n&&i!==a||t===0&&eh(r,e[0])||n===0&&eh(r,e[1])||i===0&&eh(e,r[0])||a===0&&eh(e,r[1]))}function CI(r,e){var t=r.length;if(t<3)return!1;var n=[e,[9999,e[1]]],i=0,a=0;do{var s=[r[a],r[(a+1)%t]];if(AI(s,n)){if(nh(s[0],e,s[1])===0)return eh(s,e);i++}a=(a+1)%t}while(a!==0);return!!(i&1)}function PI(r,e){return e.every(function(t){return CI(r,t)})}function NI(r,e,t){var n=r.x1,i=r.x2,a=r.y1,s=r.y2,o=[[n,a],[i,a],[i,s],[n,s]],l=Mv(e,t);return PI(o,l)}function Ww(r,e){var t=(0,it.CR)(r,4),n=t[0],i=t[1],a=t[2],s=t[3],o=(0,it.CR)(e,4),l=o[0],u=o[1],c=o[2],h=o[3],d=a-n,f=s-i,v=c-l,p=h-u,x=d*p-v*f;if(x===0)return!1;var A=x>0,N=n-l,I=i-u,K=d*I-f*N;if(K<0===A)return!1;var W=v*I-p*N;return!(W<0===A||K>x===A||W>x===A)}function Uw(r,e){var t=[[r[0],r[1],r[2],r[3]],[r[2],r[3],r[4],r[5]],[r[4],r[5],r[6],r[7]],[r[6],r[7],r[0],r[1]]];return t.some(function(n){return Ww(e,n)})}var xB={lineToLine:Ww,intersectBoxLine:Uw,getBounds:Mv};function RI(r,e,t){var n,i,a=Mv(r,t).flat(1),s=Mv(e,t).flat(1),o=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=(0,it.XA)(o),u=l.next();!u.done;u=l.next()){var c=u.value;if(Uw(s,c))return!0}}catch(h){n={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return!1}function LI(r,e){var t=r.type,n=r.labelDirection,i=r.crossSize;if(!i)return!1;if(t==="arc"){var a=r.center,s=r.radius,o=(0,it.CR)(a,2),l=o[0],u=o[1],c=n==="negative"?0:i,h=-s-c,d=s+c,f=(0,it.CR)(ji(e),4),v=f[0],p=f[1],x=f[2],A=f[3];return new rm(l+h-A,u+h-v,l+d+p,u+d+x)}var N=(0,it.CR)(r.startPos,2),I=N[0],K=N[1],W=(0,it.CR)(r.endPos,2),z=W[0],j=W[1],Z=(0,it.CR)(Dw(r)?[-e,0,e,0]:[0,e,0,-e],4),vt=Z[0],Tt=Z[1],zt=Z[2],Qt=Z[3],ae=th(0,r),fe=bo(ae,i),ce=new rm(I,K,z,j);return ce.x1+=Qt,ce.y1+=vt,ce.x2+=Tt+fe[0],ce.y2+=zt+fe[1],ce}function kv(r,e,t){var n,i,a=e.crossPadding,s=new Set,o=null,l=LI(e,a),u=function(v){return l?NI(l,v):!0},c=function(v,p){return!v||!v.firstChild?!0:!RI(v.firstChild,p.firstChild,ji(t))};try{for(var h=(0,it.XA)(r),d=h.next();!d.done;d=h.next()){var f=d.value;u(f)?!o||c(o,f)?o=f:(s.add(o),s.add(f)):s.add(f)}}catch(v){n={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return Array.from(s)}function im(r,e){return e===void 0&&(e={}),(0,be.Z)(r)?0:typeof r=="number"?r:Math.floor(UD(r,e))}function DI(r,e,t,n){if(!(r.length<=1)){var i=e.suffix,a=i===void 0?"...":i,s=e.minLength,o=e.maxLength,l=o===void 0?1/0:o,u=e.step,c=u===void 0?" ":u,h=e.margin,d=h===void 0?[0,0,0,0]:h,f=bw(n.getTextShape(r[0])),v=im(c,f),p=s?im(s,f):v,x=im(l,f);((0,be.Z)(x)||x===1/0)&&(x=Math.max.apply(null,r.map(function(fe){return fe.getBBox().width})));for(var A=r.slice(),N=(0,it.CR)(d,4),I=N[0],K=I===void 0?0:I,W=N[1],z=W===void 0?0:W,j=N[2],Z=j===void 0?K:j,vt=N[3],Tt=vt===void 0?z:vt,zt=function(fe){if(A.forEach(function(ce){n.ellipsis(n.getTextShape(ce),fe,a)}),A=kv(r,t,d),A.length<1)return{value:void 0}},Qt=x;Qt>p+v;Qt-=v){var ae=zt(Qt);if(typeof ae=="object")return ae.value}}}var II={parity:function(r,e){var t=e.seq,n=t===void 0?2:t;return r.filter(function(i,a){return a%n?(Ts(i),!1):!0})}},FI=function(r){return r.filter(Gw)};function BI(r,e,t,n){var i=r.length,a=e.keepHeader,s=e.keepTail;if(!(i<=1||i===2&&a&&s)){var o=II.parity,l=function(I){return I.forEach(n.show),I},u=2,c=r.slice(),h=r.slice(),d=Math.min.apply(Math,(0,it.ev)([1],(0,it.CR)(r.map(function(I){return I.getBBox().width})),!1));if(t.type==="linear"&&(Lw(t)||Dw(t))){var f=yw(r[0]).left,v=yw(r[i-1]).right,p=Math.abs(v-f)||1;u=Math.max(Math.floor(i*d/p),u)}var x,A;for(a&&(x=c.splice(0,1)[0]),s&&(A=c.splice(-1,1)[0],c.reverse()),l(c);u<r.length&&kv(FI(A?(0,it.ev)((0,it.ev)([A],(0,it.CR)(h),!1),[x],!1):(0,it.ev)([x],(0,it.CR)(h),!1)),t,e==null?void 0:e.margin).length;){if(A&&!x&&u%2===0){var N=c.splice(0,1);N.forEach(n.hide)}else if(A&&x){var N=c.splice(0,1);N.forEach(n.hide)}h=o(l(c),{seq:u}),u++}}}function zI(r,e,t,n){var i,a,s=e.optionalAngles,o=s===void 0?[0,45,90]:s,l=e.margin,u=e.recoverWhenFailed,c=u===void 0?!0:u,h=r.map(function(A){return A.getLocalEulerAngles()}),d=function(){return kv(r,t,l).length<1},f=function(A){return r.forEach(function(N,I){var K=Array.isArray(A)?A[I]:A;n.rotate(N,+K)})};try{for(var v=(0,it.XA)(o),p=v.next();!p.done;p=v.next()){var x=p.value;if(f(x),d())return}}catch(A){i={error:A}}finally{try{p&&!p.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}c&&f(h)}function jI(r){var e=r.type,t=r.labelDirection;return e==="linear"&&Lw(r)?t==="negative"?"bottom":"top":"middle"}function GI(r,e,t,n){var i=e.wordWrapWidth,a=i===void 0?50:i,s=e.maxLines,o=s===void 0?3:s,l=e.recoverWhenFailed,u=l===void 0?!0:l,c=e.margin,h=c===void 0?[0,0,0,0]:c,d=r.map(function(N){return N.attr("maxLines")||1}),f=Math.min.apply(Math,(0,it.ev)([],(0,it.CR)(d),!1)),v=function(){return kv(r,t,h).length<1},p=jI(t),x=function(N){return r.forEach(function(I,K){var W=Array.isArray(N)?N[K]:N;n.wrap(I,a,W,p)})};if(!(f>o)){for(var A=f;A<=o;A++)if(x(A),v())return;u&&x(d)}}var WI=new Map([["hide",BI],["rotate",zI],["ellipsis",DI],["wrap",GI]]);function UI(r,e,t){return e.labelOverlap.length<1?!1:t==="hide"?!JL(r[0]):t==="rotate"?!r.some(function(n){var i;return!!(!((i=n.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):t==="ellipsis"||t==="wrap"?r.filter(function(n){return n.querySelector("text")}).length>1:!0}function ZI(r,e,t){var n=e.labelOverlap,i=n===void 0?[]:n;i.length&&i.forEach(function(a){var s=a.type,o=WI.get(s);UI(r,e,s)&&(o==null||o(r,a,e,t))})}function VI(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=function(n){return n==="positive"?-1:1};return r.reduce(function(n,i){return n*t(i)},1)}function Zw(r){for(var e=r;e<0;)e+=360;return Math.round(e%360)}function am(r,e){var t=(0,it.CR)(r,2),n=t[0],i=t[1],a=(0,it.CR)(e,2),s=a[0],o=a[1],l=(0,it.CR)([n*s+i*o,n*o-i*s],2),u=l[0],c=l[1];return Math.atan2(c,u)}function YI(r){var e=(r+360)%180;return Gi(e,-90,90)||(e+=180),e}function HI(r,e,t){var n,i=t.labelAlign,a=(n=e.style.transform)===null||n===void 0?void 0:n.includes("rotate");if(a)return e.getLocalEulerAngles();var s=0,o=th(r.value,t),l=Sv(r.value,t);return i==="horizontal"?0:(i==="perpendicular"?s=am([1,0],o):s=am([l[0]<0?-1:1,0],l),YI(Ow(s)))}function Vw(r,e,t){var n=t.type,i=t.labelAlign,a=th(r,t),s=Zw(e),o=Zw(Ow(am([1,0],a))),l="center",u="middle";return n==="linear"?[90,270].includes(o)&&s===0?(l="center",u=a[1]===1?"top":"bottom"):!(o%180)&&[90,270].includes(s)?l="center":o===0?(Gi(s,0,90,!1,!0)||Gi(s,0,90)||Gi(s,270,360))&&(l="start"):o===90?Gi(s,0,90,!1,!0)?l="start":(Gi(s,90,180)||Gi(s,270,360))&&(l="end"):o===270?Gi(s,0,90,!1,!0)?l="end":(Gi(s,90,180)||Gi(s,270,360))&&(l="start"):o===180&&(s===90?l="start":(Gi(s,0,90)||Gi(s,270,360))&&(l="end")):i==="parallel"?Gi(o,0,180,!0)?u="top":u="bottom":i==="horizontal"?Gi(o,90,270,!1)?l="end":(Gi(o,270,360,!1)||Gi(o,0,90))&&(l="start"):i==="perpendicular"&&(Gi(o,90,270)?l="end":l="start"),{textAlign:l,textBaseline:u}}function XI(r,e,t){e.setLocalEulerAngles(r);var n=e.__data__.value,i=Vw(n,r,t),a=e.querySelector(Nr.labelItem.class);a&&Hw(a,i)}function Yw(r,e,t){var n=t.showTick,i=t.tickLength,a=t.tickDirection,s=t.labelDirection,o=t.labelSpacing,l=e.indexOf(r),u=us(o,[r,l,e]),c=(0,it.CR)([th(r.value,t),VI(s,a)],2),h=c[0],d=c[1],f=d===1?us(n?i:0,[r,l,e]):0,v=(0,it.CR)(Jc(bo(h,u+f),_v(r.value,t)),2),p=v[0],x=v[1];return{x:p,y:x}}function KI(r,e,t,n){var i=n.labelFormatter,a=(0,At.Z)(i)?function(){return yo(us(i,[r,e,t,th(r.value,n)]))}:function(){return yo(r.label||"")};return a}function Hw(r,e){r.nodeName==="text"&&r.attr(e)}function Xw(r){ZI(this.node().childNodes,r,{hide:Ts,show:Kc,rotate:function(e,t){XI(+t,e,r)},ellipsis:function(e,t,n){e&&H0(e,t||1/0,n)},wrap:function(e,t,n){e&&TI(e,t,n)},getTextShape:function(e){return e.querySelector("text")}})}function Kw(r,e,t,n,i){var a=t.indexOf(e),s=Sn(r).append(KI(e,a,t,i)).attr("className",Nr.labelItem.name).node(),o=(0,it.CR)(mo(Nw(n,[e,a,t])),2),l=o[0],u=o[1],c=u.transform,h=(0,it._T)(u,["transform"]);jw(s,c);var d=HI(e,s,i);return s.getLocalEulerAngles()||s.setLocalEulerAngles(d),Hw(s,(0,it.pi)((0,it.pi)({},Vw(e.value,d,i)),l)),r.attr(h),s}function $I(r,e,t,n){var i=em(e,t.labelFilter),a=$n(t,"label");return r.selectAll(Nr.label.class).data(i,function(s,o){return o}).join(function(s){return s.append("g").attr("className",Nr.label.name).transition(function(o){Kw(this,o,e,a,t);var l=Yw(o,e,t),u=l.x,c=l.y;return this.style.transform="translate(".concat(u,", ").concat(c,")"),null}).call(function(){Xw.call(r,t)})},function(s){return s.transition(function(o){var l=this.querySelector(Nr.labelItem.class),u=Kw(this,o,e,a,t),c=gD(l,u,n.update),h=Yw(o,e,t),d=h.x,f=h.y,v=As(this,{transform:"translate(".concat(d,", ").concat(f,")")},n.update);return(0,it.ev)((0,it.ev)([],(0,it.CR)(c),!1),[v],!1)}).call(function(o){var l=(0,na.Z)(o,"_transitions").flat().filter(Gw);fD(l,function(){Xw.call(r,t)})})},function(s){return s.transition(function(){var o=this,l=wv(this.childNodes[0],n.exit);return Pu(l,function(){return Sn(o).remove()}),l})}).transitions()}function $w(r,e){return nm(r,e.tickDirection,e)}function QI(r,e){var t=(0,it.CR)(r,2),n=t[0],i=t[1];return[[0,0],[n*e,i*e]]}function JI(r,e,t,n,i){var a=i.tickLength,s=(0,it.CR)(QI(n,us(a,[r,e,t])),2),o=(0,it.CR)(s[0],2),l=o[0],u=o[1],c=(0,it.CR)(s[1],2),h=c[0],d=c[1];return{x1:l,x2:h,y1:u,y2:d}}function qI(r,e,t,n,i){var a=i.tickFormatter,s=$w(e.value,i),o="line";return(0,At.Z)(a)&&(o=function(){return us(a,[e,t,n,s])}),r.append(o).attr("className",Nr.tickItem.name)}function t6(r,e,t,n,i,a,s){var o=$w(r.value,a),l=JI(r,e,t,o,a),u=l.x1,c=l.x2,h=l.y1,d=l.y2,f=(0,it.CR)(mo(Nw(s,[r,e,t,o])),2),v=f[0],p=f[1];n.node().nodeName==="line"&&n.styles((0,it.pi)({x1:u,x2:c,y1:h,y2:d},v)),i.attr(p),n.styles(v)}function Qw(r,e,t,n,i,a){var s=qI(Sn(this),r,e,t,n);t6(r,e,t,s,this,n,i);var o=(0,it.CR)(_v(r.value,n),2),l=o[0],u=o[1];return As(this,{transform:"translate(".concat(l,", ").concat(u,")")},a)}function e6(r,e,t,n){var i=em(e,t.tickFilter),a=$n(t,"tick");return r.selectAll(Nr.tick.class).data(i,function(s){return s.id||s.label}).join(function(s){return s.append("g").attr("className",Nr.tick.name).transition(function(o,l){return Qw.call(this,o,l,i,t,a,!1)})},function(s){return s.transition(function(o,l){return this.removeChildren(),Qw.call(this,o,l,i,t,a,n.update)})},function(s){return s.transition(function(){var o=this,l=wv(this.childNodes[0],n.exit);return Pu(l,function(){return o.remove()}),l})}).transitions()}function n6(r,e,t){var n=t.titlePosition,i=n===void 0?"lb":n,a=t.titleSpacing,s=pv(i),o=r.node().getLocalBounds(),l=(0,it.CR)(o.min,2),u=l[0],c=l[1],h=(0,it.CR)(o.halfExtents,2),d=h[0],f=h[1],v=(0,it.CR)(e.node().getLocalBounds().halfExtents,2),p=v[0],x=v[1],A=(0,it.CR)([u+d,c+f],2),N=A[0],I=A[1],K=(0,it.CR)(ji(a),4),W=K[0],z=K[1],j=K[2],Z=K[3];if(["start","end"].includes(i)&&t.type==="linear"){var vt=t.startPos,Tt=t.endPos,zt=(0,it.CR)(i==="start"?[vt,Tt]:[Tt,vt],2),Qt=zt[0],ae=zt[1],fe=Tw([-ae[0]+Qt[0],-ae[1]+Qt[1]]),ce=(0,it.CR)(bo(fe,W),2),ct=ce[0],$=ce[1];return{x:Qt[0]+ct,y:Qt[1]+$}}return s.includes("t")&&(I-=f+x+W),s.includes("r")&&(N+=d+p+z),s.includes("l")&&(N-=d+p+Z),s.includes("b")&&(I+=f+x+j),{x:N,y:I}}function r6(r,e,t){var n=r.getGeometryBounds().halfExtents,i=n[1]*2;if(e==="vertical"){if(t==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(t==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function Jw(r,e,t,n,i){var a=$n(n,"title"),s=(0,it.CR)(mo(a),2),o=s[0],l=s[1],u=l.transform,c=l.transformOrigin,h=(0,it._T)(l,["transform","transformOrigin"]);e.styles(h);var d=u||r6(r.node(),o.direction,o.position);r.styles((0,it.pi)((0,it.pi)({},o),{transformOrigin:c})),jw(r.node(),d);var f=n6(Sn(t._offscreen||t.querySelector(Nr.mainGroup.class)),e,n),v=f.x,p=f.y,x=As(e.node(),{transform:"translate(".concat(v,", ").concat(p,")")},i);return x}function i6(r,e,t,n){var i=t.titleText;return r.selectAll(Nr.title.class).data([{title:i}].filter(function(a){return!!a.title}),function(a,s){return a.title}).join(function(a){return a.append(function(){return yo(i)}).attr("className",Nr.title.name).transition(function(){return Jw(Sn(this),r,e,t,n.enter)})},function(a){return a.transition(function(){return Jw(Sn(this),r,e,t,n.update)})},function(a){return a.remove()}).transitions()}function qw(r,e,t,n){var i=r.showLine,a=r.showTick,s=r.showLabel,o=e.maybeAppendByClassName(Nr.lineGroup,"g"),l=Fa(i,o,function(f){return wI(f,r,n)})||[],u=e.maybeAppendByClassName(Nr.tickGroup,"g"),c=Fa(a,u,function(f){return e6(f,t,r,n)})||[],h=e.maybeAppendByClassName(Nr.labelGroup,"g"),d=Fa(s,h,function(f){return $I(f,t,r,n)})||[];return(0,it.ev)((0,it.ev)((0,it.ev)([],(0,it.CR)(l),!1),(0,it.CR)(c),!1),(0,it.CR)(d),!1).filter(function(f){return!!f})}var a6=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,Q0)||this}return e.prototype.render=function(t,n,i){var a=this,s=t.titleText,o=t.data,l=t.animate,u=t.showTitle,c=t.showGrid,h=t.dataThreshold,d=t.truncRange,f=tI(o,h).filter(function(W){var z=W.value;return!(d&&z>d[0]&&z<d[1])}),v=cw(i===void 0?l:i),p=Sn(n).maybeAppendByClassName(Nr.gridGroup,"g"),x=Fa(c,p,function(W){return kI(W,f,t,v)})||[],A=Sn(n).maybeAppendByClassName(Nr.mainGroup,"g");s&&(!this.initialized&&v.enter||this.initialized&&v.update)&&qw(t,Sn(this.offscreenGroup),f,cw(!1));var N=qw(t,Sn(A.node()),f,v),I=Sn(n).maybeAppendByClassName(Nr.titleGroup,"g"),K=Fa(u,I,function(W){return i6(W,a,t,v)})||[];return(0,it.ev)((0,it.ev)((0,it.ev)([],(0,it.CR)(x),!1),(0,it.CR)(N),!1),(0,it.CR)(K),!1).flat().filter(function(W){return!!W})},e}(vi);function t2(r){var e=r.canvas,t=r.touches,n=r.offsetX,i=r.offsetY;if(e){var a=e.x,s=e.y;return[a,s]}if(t){var o=t[0],l=o.clientX,u=o.clientY;return[l,u]}return n&&i?[n,i]:[0,0]}function sm(r,e){return+r.toPrecision(e)}function EB(r){return r.toLocaleString()}function wB(r){return r.toExponential()}function SB(r,e){return e===void 0&&(e=0),Math.abs(r)<1e3?String(r):"".concat(sm(r/1e3,e).toLocaleString(),"K")}var _B=function(r,e,t){return r<0&&Number.isFinite(r)?e:t},MB=function(r,e,t){return r>0&&Number.isFinite(r)?e:t},kB=function(r,e){return r*e},TB=function(r,e){return r/2+(e||0)/2},om=g(53715),s6=g(15278),o6=function(r){(0,it.ZT)(e,r);function e(t){var n=this,i=t.style,a=(0,it._T)(t,["style"]);return n=r.call(this,(0,Ta.Z)({},{type:"column"},(0,it.pi)({style:i},a)))||this,n.columnsGroup=new Ia({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return e.prototype.render=function(){var t=this.attributes,n=t.columns,i=t.x,a=t.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(a,")"),Sn(this.columnsGroup).selectAll(".column").data(n.flat()).join(function(s){return s.append("rect").attr("className","column").each(function(o){this.attr(o)})},function(s){return s.each(function(o){this.attr(o)})},function(s){return s.remove()})},e.prototype.update=function(t){this.attr(Oi({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Da),l6=function(r){(0,it.ZT)(e,r);function e(t){var n=this,i=t.style,a=(0,it._T)(t,["style"]);return n=r.call(this,(0,Ta.Z)({},{type:"lines"},(0,it.pi)({style:i},a)))||this,n.linesGroup=n.appendChild(new Ia),n.areasGroup=n.appendChild(new Ia),n.render(),n}return e.prototype.render=function(){var t=this.attributes,n=t.lines,i=t.areas,a=t.x,s=t.y;this.style.transform="translate(".concat(a,", ").concat(s,")"),n&&this.renderLines(n),i&&this.renderAreas(i)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Oi({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Sn(this.linesGroup).selectAll(".line").data(t).join(function(n){return n.append("path").attr("className","line").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.attr(i)})},function(n){return n.remove()})},e.prototype.renderAreas=function(t){Sn(this.linesGroup).selectAll(".area").data(t).join(function(n){return n.append("path").attr("className","area").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.style(i)})},function(n){return n.remove()})},e}(Da);function u6(r,e,t,n){var i,a=[],s=!!n,o,l,u=[1/0,1/0],c=[-1/0,-1/0],h,d,f;if(s){i=(0,it.CR)(n,2),u=i[0],c=i[1];for(var v=0,p=r.length;v<p;v+=1){var x=r[v];u=Dl(u,x),c=Il(c,x)}}for(var v=0,A=r.length;v<A;v+=1){var x=r[v];if(v===0&&!t)f=x;else if(v===A-1&&!t)d=x,a.push(f),a.push(d);else{var N=[v?v-1:A-1,v-1][t?0:1];o=r[N],l=r[t?(v+1)%A:v+1];var I=[0,0];I=J0(l,o),I=bo(I,e);var K=qc(x,o),W=qc(x,l),z=K+W;z!==0&&(K/=z,W/=z);var j=bo(I,-K),Z=bo(I,W);d=Jc(x,j),h=Jc(x,Z),h=Dl(h,Il(l,x)),h=Il(h,Dl(l,x)),j=J0(h,x),j=bo(j,-K/W),d=Jc(x,j),d=Dl(d,Il(o,x)),d=Il(d,Dl(o,x)),Z=J0(x,d),Z=bo(Z,W/K),h=Jc(x,Z),s&&(d=Il(d,u),d=Dl(d,c),h=Il(h,u),h=Dl(h,c)),a.push(f),a.push(d),f=h}}return t&&a.push(a.shift()),a}function c6(r,e,t){var n;e===void 0&&(e=!1),t===void 0&&(t=[[0,0],[1,1]]);for(var i=!!e,a=[],s=0,o=r.length;s<o;s+=2)a.push([r[s],r[s+1]]);for(var l=u6(a,.4,i,t),u=a.length,c=[],h,d,f,s=0;s<u-1;s+=1)h=l[s*2],d=l[s*2+1],f=a[s+1],c.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]]);return i&&(h=l[u],d=l[u+1],n=(0,it.CR)(a,1),f=n[0],c.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]])),c}function h6(r,e){var t,n=e.x,i=e.y,a=(0,it.CR)(i.getOptions().range||[0,0],2),s=a[0],o=a[1];return o>s&&(t=(0,it.CR)([s,o],2),o=t[0],s=t[1]),r.map(function(l){var u=l.map(function(c,h){return[n.map(h),(0,Kt.Z)(i.map(c),o,s)]});return u})}function rh(r,e){e===void 0&&(e=!1);var t=e?r.length-1:0,n=r.map(function(i,a){return(0,it.ev)([a===t?"M":"L"],(0,it.CR)(i),!1)});return e?n.reverse():n}function Tv(r,e){if(e===void 0&&(e=!1),r.length<=2)return rh(r);for(var t=[],n=r.length,i=0;i<n;i+=1){var a=e?r[n-i-1]:r[i];(0,pi.Z)(a,t.slice(-2))||t.push.apply(t,(0,it.ev)([],(0,it.CR)(a),!1))}var s=c6(t,!1);return e?s.unshift((0,it.ev)(["M"],(0,it.CR)(r[n-1]),!1)):s.unshift((0,it.ev)(["M"],(0,it.CR)(r[0]),!1)),s}function lm(r,e,t){var n=(0,su.Z)(r);return n.push(["L",e,t],["L",0,t],["Z"]),n}function d6(r,e,t,n){return r.map(function(i){return lm(e?Tv(i):rh(i),t,n)})}function f6(r,e,t){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=rh(a),o=void 0;if(i===0)o=lm(s,e,t);else{var l=r[i-1],u=rh(l,!0);u[0][0]="L",o=(0,it.ev)((0,it.ev)((0,it.ev)([],(0,it.CR)(s),!1),(0,it.CR)(u),!1),[["Z"]],!1)}n.push(o)}return n}function v6(r,e,t){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=Tv(a),o=void 0;if(i===0)o=lm(s,e,t);else{var l=r[i-1],u=Tv(l,!0),c=a[0];u[0][0]="L",o=(0,it.ev)((0,it.ev)((0,it.ev)([],(0,it.CR)(s),!1),(0,it.CR)(u),!1),[(0,it.ev)(["M"],(0,it.CR)(c),!1),["Z"]],!1)}n.push(o)}return n}var g6=g(89372),p6=g(93442);function e2(r){return r.length===0?[0,0]:[(0,Bt.Z)((0,g6.Z)(r,function(e){return(0,Bt.Z)(e)||0})),(0,oe.Z)((0,p6.Z)(r,function(e){return(0,oe.Z)(e)||0}))]}function n2(r){for(var e=(0,su.Z)(r),t=e[0].length,n=(0,it.CR)([Array(t).fill(0),Array(t).fill(0)],2),i=n[0],a=n[1],s=0;s<e.length;s+=1)for(var o=e[s],l=0;l<t;l+=1)o[l]>=0?(o[l]+=i[l],i[l]=o[l]):(o[l]+=a[l],a[l]=o[l]);return e}var m6=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||(t==null?void 0:t.length)===0)return[[]];var n=(0,su.Z)(t);return(0,bt.Z)(n[0])?[n]:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?n2(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,n=(0,it.CR)(t.getOptions().domain||[0,0],2),i=n[0],a=n[1];return a<0?t.map(a):t.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes,n=t.width,i=t.height;return{width:n,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,n=this.attributes,i=n.type,a=n.isStack,s=n.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var o=$n(this.attributes,"area"),l=$n(this.attributes,"line"),u=this.containerShape.width,c=this.data;if(c[0].length===0)return{lines:[],areas:[]};var h=this.scales,d=h.x,f=h.y,v=h6(c,{type:"line",x:d,y:f}),p=[];if(o){var x=this.baseline;a?p=s?v6(v,u,x):f6(v,u,x):p=d6(v,s,u,x)}return{lines:v.map(function(A,N){return(0,it.pi)({stroke:t.getColor(N),d:s?Tv(A):rh(A)},l)}),areas:p.map(function(A,N){return(0,it.pi)({d:A,fill:t.getColor(N)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,n=$n(this.attributes,"column"),i=this.attributes,a=i.isStack,s=i.type,o=i.scale;if(s!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,u=this.rawData;if(!u)return{columns:[]};a&&(u=n2(u));var c=this.createScales(u),h=c.x,d=c.y,f=(0,it.CR)(e2(u),2),v=f[0],p=f[1],x=new om.b({domain:[0,p-(v>0?0:v)],range:[0,l*o]}),A=h.getBandWidth(),N=this.rawData;return{columns:u.map(function(I,K){return I.map(function(W,z){var j=A/u.length,Z=function(){return{x:h.map(z)+j*K,y:W>=0?d.map(W):d.map(0),width:j,height:x.map(Math.abs(W))}},vt=function(){return{x:h.map(z),y:d.map(W),width:A,height:x.map(N[K][z])}};return(0,it.pi)((0,it.pi)({fill:t.getColor(K)},n),a?vt():Z())})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,n){sD(n,".container","rect").attr("className","container").node();var i=t.type,a=t.x,s=t.y,o="spark".concat(i),l=(0,it.pi)({x:a,y:s},i==="line"?this.linesStyle:this.columnsStyle);Sn(n).selectAll(".spark").data([i]).join(function(u){return u.append(function(c){return c==="line"?new l6({className:o,style:l}):new o6({className:o,style:l})}).attr("className","spark ".concat(o))},function(u){return u.update(l)},function(u){return u.remove()})},e.prototype.getColor=function(t){var n=this.attributes.color;return(0,S.Z)(n)?n[t%n.length]:(0,At.Z)(n)?n.call(null,t):n},e.prototype.createScales=function(t){var n,i,a=this.attributes,s=a.type,o=a.scale,l=a.range,u=l===void 0?[]:l,c=a.spacing,h=this.containerShape,d=h.width,f=h.height,v=(0,it.CR)(e2(t),2),p=v[0],x=v[1],A=new om.b({domain:[(n=u[0])!==null&&n!==void 0?n:p,(i=u[1])!==null&&i!==void 0?i:x],range:[f,f*(1-o)]});return s==="line"?{type:s,x:new om.b({domain:[0,t[0].length-1],range:[0,d]}),y:A}:{type:s,x:new s6.t({domain:t[0].map(function(N,I){return I}),range:[0,d],paddingInner:c,paddingOuter:c/2,align:.5}),y:A}},e.tag="sparkline",e}(vi),r2={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},i2={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},a2={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Js=Os({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),$o=Os({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),y6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){var i=t.x,a=t.y,s=t.size,o=s===void 0?10:s,l=t.radius,u=l===void 0?o/4:l,c=t.orientation,h=(0,it._T)(t,["x","y","size","radius","orientation"]),d=o,f=d*2.4,v=Sn(n).maybeAppendByClassName($o.iconRect,"rect").styles((0,it.pi)((0,it.pi)({},h),{width:d,height:f,radius:u,x:i-d/2,y:a-f/2,transformOrigin:"center"})),p=i+1/3*d-d/2,x=i+2/3*d-d/2,A=a+1/4*f-f/2,N=a+3/4*f-f/2;v.maybeAppendByClassName("".concat($o.iconLine,"-1"),"line").styles((0,it.pi)({x1:p,x2:p,y1:A,y2:N},h)),v.maybeAppendByClassName("".concat($o.iconLine,"-2"),"line").styles((0,it.pi)({x1:x,x2:x,y1:A,y2:N},h)),c==="vertical"&&(v.node().style.transform="rotate(90)")},e}(vi),b6=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,t,a2)||this}return e.prototype.renderLabel=function(t){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,l=$n(this.attributes,"label"),u=l.x,c=u===void 0?0:u,h=l.y,d=h===void 0?0:h,f=l.transform,v=l.transformOrigin,p=(0,it._T)(l,["x","y","transform","transformOrigin"]),x=(0,it.CR)(mo(p,[]),2),A=x[0],N=x[1],I=Sn(t).maybeAppendByClassName($o.labelGroup,"g").styles(N),K=(0,it.pi)((0,it.pi)({},i2),A),W=K.text,z=(0,it._T)(K,["text"]);Fa(!!o,I,function(j){n.label=j.maybeAppendByClassName($o.label,"text").styles((0,it.pi)((0,it.pi)({},z),{x:a+c,y:s+d,transform:f,transformOrigin:v,text:"".concat(W)})),n.label.on("mousedown",function(Z){Z.stopPropagation()}),n.label.on("touchstart",function(Z){Z.stopPropagation()})})},e.prototype.renderIcon=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.orientation,o=n.type,l=(0,it.pi)((0,it.pi)({x:i,y:a,orientation:s},r2),$n(this.attributes,"icon")),u=this.attributes.iconShape,c=u===void 0?function(){return new y6({style:l})}:u,h=Sn(t).maybeAppendByClassName($o.iconGroup,"g");h.selectAll($o.icon.class).data([c]).join(function(d){return d.append(typeof c=="string"?c:function(){return c(o)}).attr("className",$o.icon.name)},function(d){return d.update(l)},function(d){return d.remove()})},e.prototype.render=function(t,n){this.renderIcon(n),this.renderLabel(n)},e}(vi),x6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,t,(0,it.pi)((0,it.pi)((0,it.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Cu(a2,"handle")),Cu(r2,"handleIcon")),Cu(i2,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(i){return function(a){a.stopPropagation(),n.target=i,n.prevPos=n.getOrientVal(t2(a));var s=n.availableSpace,o=s.x,l=s.y,u=n.getBBox(),c=u.x,h=u.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([o,l])-n.getOrientVal([+c,+h])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(i){var a=n.attributes,s=a.slidable,o=a.brushable,l=a.type;i.stopPropagation();var u=n.getOrientVal(t2(i)),c=u-n.prevPos;if(c){var h=n.getRatio(c);switch(n.target){case"start":s&&n.setValuesOffset(h);break;case"end":s&&n.setValuesOffset(0,h);break;case"selection":s&&n.setValuesOffset(h,h);break;case"track":if(!o)return;n.selectionWidth+=h,l==="range"?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0);break;default:break}n.prevPos=u}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(i){var a=n.attributes,s=a.onChange,o=a.type,l=o==="range"?i:i[1],u=o==="range"?n.getValues():n.getValues()[1],c=new La("valuechange",{detail:{oldValue:l,value:u}});n.dispatchEvent(c),s==null||s(u)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){var t=this.attributes.orientation;if(t!=="horizontal")return null;var n=$n(this.attributes,"sparkline");return(0,it.pi)((0,it.pi)({zIndex:0},this.availableSpace),n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,n=t.trackLength,i=t.trackSize,a=(0,it.CR)(this.getOrientVal([[n,i],[i,n]]),2),s=a[0],o=a[1];return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,n=t.x,i=t.y,a=t.padding,s=(0,it.CR)(ji(a),4),o=s[0],l=s[1],u=s[2],c=s[3],h=this.shape,d=h.width,f=h.height;return{x:c,y:o,width:d-(c+l),height:f-(o+u)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,n){t===void 0&&(t=[0,0]),n===void 0&&(n=!1),this.attributes.values=t;var i=n===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},e.prototype.updateSelectionArea=function(t){var n=this.calcSelectionArea();this.foregroundGroup.selectAll(Js.selection.class).each(function(i,a){As(this,n[a],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&As(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&As(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,n){t===void 0&&(t=[0,0]),n===void 0&&(n=!1);var i=this.values,a=this.clampValues(t);this.attributes.values=a,this.setValues(a),n&&this.onValueChange(i)},e.prototype.renderTrack=function(t){var n=this.attributes,i=n.x,a=n.y,s=$n(this.attributes,"track");this.trackShape=Sn(t).maybeAppendByClassName(Js.track,"rect").styles((0,it.pi)((0,it.pi)({x:i,y:a},this.shape),s))},e.prototype.renderBrushArea=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.brushable;this.brushArea=Sn(t).maybeAppendByClassName(Js.brushArea,"rect").styles((0,it.pi)({x:i,y:a,fill:"transparent",cursor:s?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.orientation,l=Sn(t).maybeAppendByClassName(Js.sparklineGroup,"g");Fa(o==="horizontal",l,function(u){var c=(0,it.pi)((0,it.pi)({},n.sparklineStyle),{x:a,y:s});u.maybeAppendByClassName(Js.sparkline,function(){return new m6({style:c})}).update(c)})},e.prototype.renderHandles=function(){var t=this,n,i=this.attributes,a=i.showHandle,s=i.type,o=s==="range"?["start","end"]:["end"],l=a?o:[],u=this;(n=this.foregroundGroup)===null||n===void 0||n.selectAll(Js.handle.class).data(l.map(function(c){return{type:c}}),function(c){return c.type}).join(function(c){return c.append(function(h){var d=h.type;return new b6({style:t.getHandleStyle(d)})}).each(function(h){var d=h.type;this.attr("class","".concat(Js.handle.name," ").concat(d,"-handle"));var f="".concat(d,"Handle");u[f]=this,this.addEventListener("pointerdown",u.onDragStart(d))})},function(c){return c.each(function(h){var d=h.type;this.update(u.getHandleStyle(d))})},function(c){return c.each(function(h){var d=h.type,f="".concat(d,"Handle");u[f]=void 0}).remove()})},e.prototype.renderSelection=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.type,o=n.selectionType;this.foregroundGroup=Sn(t).maybeAppendByClassName(Js.foreground,"g");var l=$n(this.attributes,"selection"),u=function(h){return h.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles((0,it.pi)((0,it.pi)({},l),{transform:"translate(".concat(i,", ").concat(a,")")}))},c=this;this.foregroundGroup.selectAll(Js.selection.class).data(s==="value"?[]:this.calcSelectionArea().map(function(h,d){return{style:(0,it.pi)({},h),index:d,show:o==="select"?d===1:d!==1}}),function(h){return h.index}).join(function(h){return h.append("rect").attr("className",Js.selection.name).call(u).each(function(d,f){var v=this;f===1?(c.selectionShape=Sn(this),this.on("pointerdown",function(p){v.attr("cursor","grabbing"),c.onDragStart("selection")(p)}),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){v.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){v.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){v.attr("cursor","pointer")})):this.on("pointerdown",c.onDragStart("track"))})},function(h){return h.call(u)},function(h){return h.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,n){this.renderTrack(n),this.renderSparkline(n),this.renderBrushArea(n),this.renderSelection(n)},e.prototype.clampValues=function(t,n){var i;n===void 0&&(n=4);var a=(0,it.CR)(this.range,2),s=a[0],o=a[1],l=(0,it.CR)(this.getValues().map(function(x){return sm(x,n)}),2),u=l[0],c=l[1],h=Array.isArray(t)?t:[u,t!=null?t:c],d=(0,it.CR)((h||[u,c]).map(function(x){return sm(x,n)}),2),f=d[0],v=d[1];if(this.attributes.type==="value")return[0,(0,Kt.Z)(v,s,o)];f>v&&(i=(0,it.CR)([v,f],2),f=i[0],v=i[1]);var p=v-f;return p>o-s?[s,o]:f<s?u===s&&c===v?[s,v]:[s,p+s]:v>o?c===o&&u===f?[f,o]:[o-p,o]:[f,v]},e.prototype.calcSelectionArea=function(t){var n=(0,it.CR)(this.clampValues(t),2),i=n[0],a=n[1],s=this.availableSpace,o=s.x,l=s.y,u=s.width,c=s.height;return this.getOrientVal([[{y:l,height:c,x:o,width:i*u},{y:l,height:c,x:i*u+o,width:(a-i)*u},{y:l,height:c,x:a*u,width:(1-a)*u}],[{x:o,width:u,y:l,height:i*c},{x:o,width:u,y:i*c+l,height:(a-i)*c},{x:o,width:u,y:a*c,height:(1-a)*c}]])},e.prototype.calcHandlePosition=function(t){var n=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,s=i.y,o=i.width,l=i.height,u=(0,it.CR)(this.clampValues(),2),c=u[0],h=u[1],d=t==="start"?-n:n,f=(t==="start"?c:h)*this.getOrientVal([o,l])+d;return{x:a+this.getOrientVal([f,o/2]),y:s+this.getOrientVal([l/2,f])}},e.prototype.inferTextStyle=function(t){var n=this.attributes.orientation;return n==="horizontal"?{}:t==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:t==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var n,i=this.attributes,a=i.type,s=i.orientation,o=i.formatter,l=i.autoFitLabel,u=$n(this.attributes,"handle"),c=$n(u,"label"),h=u.spacing,d=this.getHandleSize(),f=this.clampValues(),v=t==="start"?f[0]:f[1],p=o(v),x=new W0({style:(0,it.pi)((0,it.pi)((0,it.pi)({},c),this.inferTextStyle(t)),{text:p})}),A=x.getBBox(),N=A.width,I=A.height;if(x.destroy(),!l){if(a==="value")return{text:p,x:0,y:-I-h};var K=h+d+(s==="horizontal"?N/2:0);return n={text:p},n[s==="horizontal"?"x":"y"]=t==="start"?-K:K,n}var W=0,z=0,j=this.availableSpace,Z=j.width,vt=j.height,Tt=this.calcSelectionArea()[1],zt=Tt.x,Qt=Tt.y,ae=Tt.width,fe=Tt.height,ce=h+d;if(s==="horizontal"){var ct=ce+N/2;if(t==="start"){var $=zt-ce-N;W=$>0?-ct:ct}else{var Q=Z-zt-ae-ce>N;W=Q?ct:-ct}}else{var It=ce,ue=I+ce;t==="start"?z=Qt-d>I?-ue:It:z=vt-(Qt+fe)-d>I?ue:-It}return{x:W,y:z,text:p}},e.prototype.getHandleLabelStyle=function(t){var n=$n(this.attributes,"handleLabel");return(0,it.pi)((0,it.pi)((0,it.pi)({},n),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,n=$n(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return(0,it.pi)({cursor:i,shape:t,size:a},n)},e.prototype.getHandleStyle=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.showLabel,o=n.showLabelOnInteraction,l=n.orientation,u=this.calcHandlePosition(t),c=u.x,h=u.y,d=this.calcHandleText(t),f=s;return!s&&o&&(this.target?f=!0:f=!1),(0,it.pi)((0,it.pi)((0,it.pi)({},Cu(this.getHandleIconStyle(),"icon")),Cu((0,it.pi)((0,it.pi)({},this.getHandleLabelStyle(t)),d),"label")),{transform:"translate(".concat(c+i,", ").concat(h+a,")"),orientation:l,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,n=t.handleIconSize,i=t.width,a=t.height;return n||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},e.prototype.getOrientVal=function(t){var n=(0,it.CR)(t,2),i=n[0],a=n[1],s=this.attributes.orientation;return s==="horizontal"?i:a},e.prototype.setValuesOffset=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var a=this.attributes.type,s=(0,it.CR)(this.getValues(),2),o=s[0],l=s[1],u=a==="range"?t:0,c=[o+u,l+n].sort();i?this.setValues(c):this.innerSetValues(c,!0)},e.prototype.getRatio=function(t){var n=this.availableSpace,i=n.width,a=n.height;return t/this.getOrientVal([i,a])},e.prototype.dispatchCustomEvent=function(t,n,i){var a=this;t.on(n,function(s){s.stopPropagation(),a.dispatchEvent(new La(i,{detail:s}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){var n=this.attributes.scrollable;if(n){var i=t.deltaX,a=t.deltaY,s=a||i,o=this.getRatio(s);this.setValuesOffset(o,o,!0)}},e.tag="slider",e}(vi),E6={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(r){return r.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},um=Os({background:"background",labelGroup:"label-group",label:"label"},"indicator"),w6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,t,E6)||this;return n.point=[0,0],n.group=n.appendChild(new Ia({})),n.isMutationObserved=!0,n}return e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,n=t.position,i=t.padding,a=(0,it.CR)(ji(i),4),s=a[0],o=a[1],l=a[2],u=a[3],c=this.label.node().getLocalBounds(),h=c.min,d=c.max,f=new Hi(h[0]-u,h[1]-s,d[0]+o-h[0]+u,d[1]+l-h[1]+s),v=this.getPath(n,f),p=$n(this.attributes,"background");this.background=Sn(this.group).maybeAppendByClassName(um.background,"path").styles((0,it.pi)((0,it.pi)({},p),{d:v})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,n=t.formatter,i=t.labelText,a=$n(this.attributes,"label"),s=(0,it.CR)(mo(a),2),o=s[0],l=s[1],u=o.text,c=(0,it._T)(o,["text"]);if(this.label=Sn(this.group).maybeAppendByClassName(um.labelGroup,"g").styles(l),!!i){var h=this.label.maybeAppendByClassName(um.label,function(){return yo(n(i))}).style("text",n(i).toString());h.selectAll("text").styles(c)}},e.prototype.adjustLayout=function(){var t=(0,it.CR)(this.point,2),n=t[0],i=t[1],a=this.attributes,s=a.x,o=a.y;this.group.attr("transform","translate(".concat(s-n,", ").concat(o-i,")"))},e.prototype.getPath=function(t,n){var i=this.attributes.radius,a=n.x,s=n.y,o=n.width,l=n.height,u=[["M",a+i,s],["L",a+o-i,s],["A",i,i,0,0,1,a+o,s+i],["L",a+o,s+l-i],["A",i,i,0,0,1,a+o-i,s+l],["L",a+i,s+l],["A",i,i,0,0,1,a,s+l-i],["L",a,s+i],["A",i,i,0,0,1,a+i,s],["Z"]],c={top:4,right:6,bottom:0,left:2},h=c[t],d=this.createCorner([u[h].slice(-2),u[h+1].slice(-2)]);return u.splice.apply(u,(0,it.ev)([h+1,1],(0,it.CR)(d),!1)),u[0][0]="M",u},e.prototype.createCorner=function(t,n){n===void 0&&(n=10);var i=.8,a=GD.apply(void 0,(0,it.ev)([],(0,it.CR)(t),!1)),s=(0,it.CR)(t,2),o=(0,it.CR)(s[0],2),l=o[0],u=o[1],c=(0,it.CR)(s[1],2),h=c[0],d=c[1],f=(0,it.CR)(a?[h-l,[l,h]]:[d-u,[u,d]],2),v=f[0],p=(0,it.CR)(f[1],2),x=p[0],A=p[1],N=v/2,I=v/Math.abs(v),K=n*I,W=K/2,z=K*Math.sqrt(3)/2*i,j=(0,it.CR)([x,x+N-W,x+N,x+N+W,A],5),Z=j[0],vt=j[1],Tt=j[2],zt=j[3],Qt=j[4];return a?(this.point=[Tt,u-z],[["L",Z,u],["L",vt,u],["L",Tt,u-z],["L",zt,u],["L",Qt,u]]):(this.point=[l+z,Tt],[["L",l,Z],["L",l,vt],["L",l+z,Tt],["L",l,zt],["L",l,Qt]])},e.prototype.applyVisibility=function(){var t=this.attributes.visibility;t==="hidden"?Ts(this):Kc(this)},e.prototype.bindEvents=function(){this.label.on(fi.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(vi),S6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},e.defaultOptions,t))||this;return n.hoverColor="#f5f5f5",n.selectedColor="#e6f7ff",n.background=n.appendChild(new Au({})),n.label=n.background.appendChild(new Ia({})),n}return Object.defineProperty(e.prototype,"padding",{get:function(){return ji(this.style.padding)},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(){var t=this.style,n=t.label,i=t.value,a=$n(this.attributes,"label");Sn(this.label).maybeAppend(".label",function(){return yo(n)}).attr("className","label").styles(a),this.label.attr("__data__",i)},e.prototype.renderBackground=function(){var t=this.label.getBBox(),n=(0,it.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3],l=t.width,u=t.height,c=l+o+a,h=u+i+s,d=$n(this.attributes,"background"),f=this.style,v=f.width,p=v===void 0?0:v,x=f.height,A=x===void 0?0:x,N=f.selected;this.background.attr((0,it.pi)((0,it.pi)({},d),{width:Math.max(c,p),height:Math.max(h,A),fill:N?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((h-u)/2,")")})},e.prototype.render=function(){this.renderLabel(),this.renderBackground()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("pointerenter",function(){t.style.selected||t.background.attr("fill",t.hoverColor)}),this.addEventListener("pointerleave",function(){t.style.selected||t.background.attr("fill",t.style.backgroundFill)});var n=this;this.addEventListener("click",function(){var i=t.style,a=i.label,s=i.value,o=i.onClick;o==null||o(s,{label:a,value:s},n)})},e.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},e}(vi),_6=function(r){(0,it.ZT)(e,r);function e(t){var n,i,a=r.call(this,Oi({},e.defaultOptions,t))||this;a.currentValue=(n=e.defaultOptions.style)===null||n===void 0?void 0:n.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new Au({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new Au({className:"dropdown"}));var s=a.style.defaultValue;return s&&(!((i=a.style.options)===null||i===void 0)&&i.some(function(o){return o.value===s}))&&(a.currentValue=s),a}return e.prototype.setValue=function(t){this.currentValue=t,this.render()},e.prototype.getValue=function(){return this.currentValue},Object.defineProperty(e.prototype,"dropdownPadding",{get:function(){return ji(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),e.prototype.renderSelect=function(){var t=this,n,i=this.style,a=i.x,s=i.y,o=i.width,l=i.height,u=i.bordered,c=i.showDropdownIcon,h=$n(this.attributes,"select"),d=$n(this.attributes,"placeholder");this.select.attr((0,it.pi)((0,it.pi)({x:a,y:s,width:o,height:l},h),{fill:"#fff",strokeWidth:u?1:0}));var f=this.dropdownPadding,v=10;c&&Sn(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(a+o-v-f[1]-f[3],", ").concat(s+l/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var p=(n=this.style.options)===null||n===void 0?void 0:n.find(function(I){return I.value===t.currentValue}),x=(0,it.pi)({x:a+f[3]},d);Sn(this.select).selectAll(".placeholder").data(p?[]:[1]).join(function(I){return I.append("text").attr("className","placeholder").styles(x).style("y",function(){var K=this.getBBox();return s+(l-K.height)/2})},function(I){return I.styles(x)},function(I){return I.remove()});var A=$n(this.attributes,"optionLabel"),N=(0,it.pi)({x:a+f[3]},A);Sn(this.select).selectAll(".value").data(p?[p]:[]).join(function(I){return I.append(function(K){return yo(K.label)}).attr("className","value").styles(N).style("y",function(){var K=this.getBBox();return s+(l-K.height)/2})},function(I){return I.styles(N)},function(I){return I.remove()})},e.prototype.renderDropdown=function(){var t=this,n,i,a=this.style,s=a.x,o=a.y,l=a.width,u=a.height,c=a.options,h=a.onSelect,d=a.open,f=$n(this.attributes,"dropdown"),v=$n(this.attributes,"option"),p=this.dropdownPadding;Sn(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(c,function(N){return N.value}).join(function(N){return N.append(function(I){return new S6({className:"dropdown-item",style:(0,it.pi)((0,it.pi)((0,it.pi)({},I),v),{width:l-p[1]-p[3],selected:I.value===t.currentValue,onClick:function(K,W,z){t.setValue(K),h==null||h(K,W,z),t.dispatchEvent(new La("change",{detail:{value:K,option:W,item:z}})),Ts(t.dropdown)}})})}).each(function(I,K){var W,z=(W=this.parentNode)===null||W===void 0?void 0:W.children,j=z.reduce(function(Z,vt,Tt){return Tt<K&&(Z+=vt.getBBox().height),Z},0);this.attr("transform","translate(".concat(p[3],", ").concat(p[0]+j,")"))})},function(N){return N.update(function(I){return{selected:I.value===t.currentValue}})},function(N){return N.remove()});var x=(i=(n=this.dropdown.getElementsByClassName("dropdown-container"))===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.getBBox(),A=f.spacing;this.dropdown.attr((0,it.pi)({transform:"translate(".concat(s,", ").concat(o+u+A,")"),width:x.width+p[1]+p[3],height:x.height+p[0]+p[2]},f)),!d&&Ts(this.dropdown)},e.prototype.render=function(){this.renderSelect(),this.renderDropdown()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("click",function(n){n.stopPropagation()}),this.select.addEventListener("click",function(){t.dropdown.style.visibility==="visible"?Ts(t.dropdown):Kc(t.dropdown)}),this.addEventListener("pointerenter",function(){t.isPointerInSelect=!0}),this.addEventListener("pointerleave",function(){t.isPointerInSelect=!1}),document==null||document.addEventListener("click",function(){t.isPointerInSelect||Ts(t.dropdown)})},e.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"\u8BF7\u9009\u62E9",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}},e}(vi),Cs=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},{style:{backgroundOpacity:e.backgroundOpacities.default}},e.defaultOptions,t))||this;return n.showBackground=!0,n.background=n.appendChild(new Au({})),n.icon=n.appendChild(new Ia({})),n}return Object.defineProperty(e.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return ji(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){var t=this.attributes.size,n=(0,it.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3];return Math.max(t-Math.max(o+a,i+s),this.lineWidth*2+1)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.attributes,n=t.x,i=t.y,a=t.size,s=a/2,o=$n(this.attributes,"background");this.background.attr((0,it.pi)({x:n-s,y:i-s,width:a,height:a},o))},e.prototype.showIndicator=function(){if(this.label){var t=this.attributes.size,n=this.background.getBBox(),i=n.x,a=n.y;this.indicator.update({x:i+t/2,y:a-5,labelText:this.label,visibility:"visible"})}},e.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},e.prototype.connectedCallback=function(){var t;r.prototype.connectedCallback.call(this);var n=this.attributes.size,i=this.background.getBBox(),a=i.x,s=i.y,o=(t=this.ownerDocument)===null||t===void 0?void 0:t.defaultView;o&&(this.indicator=o.appendChild(new w6({style:{x:a+n/2,y:s-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},e.prototype.disconnectedCallback=function(){this.indicator.destroy()},e.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onClick;if(this.addEventListener("click",function(){n==null||n(t)}),this.showBackground){var i=function(){return t.background.attr({opacity:e.backgroundOpacities.default})},a=function(){return t.background.attr({opacity:e.backgroundOpacities.hover})},s=function(){return t.background.attr({opacity:e.backgroundOpacities.active})};this.addEventListener("pointerenter",function(){a(),t.showIndicator()}),this.addEventListener("pointerleave",function(){i(),t.hideIndicator()}),this.addEventListener("pointerdown",function(){s()}),this.addEventListener("pointerup",function(){i()})}},e.tag="IconBase",e.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},e.backgroundOpacities={default:0,hover:.8,active:1},e}(vi),ih=function(r,e){return e===void 0&&(e="#565758"),new P0({style:{fill:e,d:"M ".concat(r,",").concat(r," L -").concat(r,",0 L ").concat(r,",-").concat(r," Z"),transformOrigin:"center"}})},M6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.arcPath=function(t,n,i){var a=(0,it.CR)([i,i],2),s=a[0],o=a[1],l=function(p){return[t+i*Math.cos(p),n+i*Math.sin(p)]},u=(0,it.CR)(l(-5/4*Math.PI),2),c=u[0],h=u[1],d=(0,it.CR)(l(1/4*Math.PI),2),f=d[0],v=d[1];return"M".concat(c,",").concat(h,",A").concat(s,",").concat(o,",0,1,1,").concat(f,",").concat(v)},Object.defineProperty(e.prototype,"label",{get:function(){return"\u91CD\u7F6E"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=this.lineWidth,l=o+.5;Sn(this.icon).maybeAppend(".reset","path").styles({stroke:a,lineWidth:o,d:this.arcPath(n,i,s/2-o),markerStart:ih(l,a)})},e}(Cs),k6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u5FEB\u9000"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),u=[[n,i],[n,i-l],[n-o,i],[n,i+l],[n,i],[n+o,i-l],[n+o,i+l],[n,i]];Sn(this.icon).maybeAppend(".backward","polygon").styles({points:u,fill:a})},e}(Cs),T6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u5FEB\u8FDB"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),u=[[n,i],[n,i-l],[n+o,i],[n,i+l],[n,i],[n-o,i-l],[n-o,i+l],[n,i]];Sn(this.icon).maybeAppend(".forward","polygon").styles({points:u,fill:a})},e}(Cs),O6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u64AD\u653E"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/3*Math.pow(3,.5)*.8,l=[[n+o,i],[n-o/2,i-s/2*.8],[n-o/2,i+s/2*.8],[n+o,i]];Sn(this.icon).maybeAppend(".play","polygon").styles({points:l,fill:a})},e}(Cs),A6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u6682\u505C"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/3,l=[[n-o,i-s/2],[n-o,i+s/2],[n-o/2,i+s/2],[n-o/2,i-s/2],[n-o,i-s/2],[n+o/2,i-s/2],[n+o/2,i+s/2],[n+o,i+s/2],[n+o,i-s/2]];Sn(this.icon).maybeAppend(".pause","polygon").styles({points:l,fill:a})},e}(Cs),C6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u8303\u56F4\u65F6\u95F4"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,l=s.lineWidth,u=l;Sn(this.icon).maybeAppend(".left-line","line").styles({x1:n-o/2,y1:i-o/2,x2:n-o/2,y2:i+o/2,stroke:a,lineWidth:l}),Sn(this.icon).maybeAppend(".right-line","line").styles({x1:n+o/2,y1:i-o/2,x2:n+o/2,y2:i+o/2,stroke:a,lineWidth:l}),Sn(this.icon).maybeAppend(".left-arrow","line").styles({x1:n,y1:i,x2:n-o/2+u*2,y2:i,stroke:a,lineWidth:l,markerEnd:ih(l*2,a)}),Sn(this.icon).maybeAppend(".right-arrow","line").styles({x1:n,y1:i,x2:n+o/2-u*2,y2:i,stroke:a,lineWidth:l,markerEnd:ih(l*2,a)})},e}(Cs),P6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u5355\u4E00\u65F6\u95F4"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,l=s.lineWidth;Sn(this.icon).maybeAppend(".line","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l});var u=l;Sn(this.icon).maybeAppend(".left-arrow","line").styles({x1:n-o/2-u*2,y1:i,x2:n-u*2,y2:i,stroke:a,lineWidth:l,markerEnd:ih(l*2,a)}),Sn(this.icon).maybeAppend(".right-arrow","line").styles({x1:n+o/2+u*2,y1:i,x2:n+u*2,y2:i,stroke:a,lineWidth:l,markerEnd:ih(l*2,a)})},e}(Cs),s2=function(r){return[[-r/2,-r/2],[-r/2,r/2],[r/2,r/2]]},N6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u6298\u7EBF\u56FE"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,l=s.lineWidth,u=l,c=(o-u*2-l)/4,h=(o-u*2-l)/2,d=(0,it.CR)([n-o/2+u,i+o/2-u*2],2),f=d[0],v=d[1];Sn(this.icon).maybeAppend(".coordinate","polyline").styles({points:s2(o).map(function(p){var x=(0,it.CR)(p,2),A=x[0],N=x[1];return[A+n,N+i]}),stroke:a,lineWidth:l}),Sn(this.icon).maybeAppend(".line","polyline").styles({points:[[f,v],[f+c,v-h],[f+c*2,v],[f+c*4,v-h*2]],stroke:a,lineWidth:l})},e}(Cs),R6=function(r){(0,it.ZT)(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"\u6761\u5F62\u56FE"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.data,n=this.attributes,i=n.x,a=n.y,s=n.color,o=this,l=o.iconSize,u=o.lineWidth,c=u,h=(l-c)/t.length,d=(l-c*2)/4,f=(0,it.CR)([i-l/2+c*2,a+l/2-c],2),v=f[0],p=f[1];Sn(this.icon).maybeAppend(".coordinate","polyline").styles({points:s2(l).map(function(x){var A=(0,it.CR)(x,2),N=A[0],I=A[1];return[N+i,I+a]}),stroke:s,lineWidth:u}),Sn(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(function(x,A){return{value:x,index:A}})).join(function(x){return x.append("line").attr("className","column").style("x1",function(A){var N=A.index;return v+h*N}).style("y1",p).style("x2",function(A){var N=A.index;return v+h*N}).style("y2",function(A){var N=A.value;return p-d*N}).styles({y1:p,stroke:s,lineWidth:u})})},e}(Cs),L6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},{style:{color:"#d8d9d9"}},t))||this;return n.showBackground=!1,n}return e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,l=s.lineWidth;Sn(this.icon).maybeAppend(".split","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l})},e}(Cs),cm=function(r){(0,it.ZT)(e,r);function e(){var t=r.apply(this,(0,it.ev)([],(0,it.CR)(arguments),!1))||this;return t.showBackground=!1,t}return Object.defineProperty(e.prototype,"padding",{get:function(){return ji(0)},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.iconSize,n=this.attributes,i=n.x,a=n.y,s=n.speed,o=s===void 0?1:s,l=(0,qp.Z)(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),u=(0,Kt.Z)(t,20,1/0),c=20,h=(0,it.pi)((0,it.pi)({},l),{x:i-u/2,y:a-c/2,width:u,height:c,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});Sn(this.icon).maybeAppend(".speed",function(){return new _6({style:h})}).attr("className","speed").each(function(){this.update(h)})},e.tag="SpeedSelect",e}(Cs),hm=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,t)||this;return n.icon=n.appendChild(new Ia({})),n.currentType=n.attributes.type,n}return e.prototype.getType=function(){return this.currentType},e.prototype.render=function(){var t=this,n=this.attributes,i=n.onChange,a=(0,it._T)(n,["onChange"]);Sn(this.icon).selectAll(".icon").data([this.currentType]).join(function(s){return s.append(function(o){var l,u=(l=t.toggles.find(function(c){var h=(0,it.CR)(c,1),d=h[0];return d===o}))===null||l===void 0?void 0:l[1];if(!u)throw new Error("Invalid type: ".concat(o));return new u({})}).attr("className","icon").styles(a,!1).update({})},function(s){return s.styles({restStyles:a}).update({})},function(s){return s.remove()})},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onChange;this.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation();var a=(t.toggles.findIndex(function(o){var l=(0,it.CR)(o,1),u=l[0];return u===t.currentType})+1)%t.toggles.length,s=t.toggles[a][0];n==null||n(t.currentType),t.currentType=s,t.render()})},e.tag="ToggleIcon",e}(vi),dm=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},{style:{type:"play"}},t))||this;return n.toggles=[["play",O6],["pause",A6]],n}return e}(hm),fm=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},{style:{type:"range"}},t))||this;return n.toggles=[["range",C6],["value",P6]],n}return e}(hm),vm=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},{style:{type:"column"}},t))||this;return n.toggles=[["line",N6],["column",R6]],n}return e}(hm),D6={reset:M6,speed:cm,backward:k6,playPause:dm,forward:T6,selectionType:fm,chartType:vm,split:L6},I6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},e.defaultOptions,t))||this;return n.background=n.appendChild(new Au({})),n.functions=n.appendChild(new Ia({})),n}return Object.defineProperty(e.prototype,"padding",{get:function(){return ji(this.attributes.padding)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.style,n=t.x,i=t.y,a=t.width,s=t.height,o=$n(this.attributes,"background");this.background.attr((0,it.pi)({x:n,y:i,width:a,height:s},o))},e.prototype.renderFunctions=function(){var t=this,n,i=this.attributes,a=i.functions,s=i.iconSize,o=i.iconSpacing,l=i.x,u=i.y,c=i.width,h=i.height,d=i.align,f=(0,it.CR)(this.padding,4),v=f[1],p=f[3],x=a.reduce(function(I,K){return I.length&&K.length?I.concat.apply(I,(0,it.ev)(["split"],(0,it.CR)(K),!1)):I.concat.apply(I,(0,it.ev)([],(0,it.CR)(K),!1))},[]),A=x.length*(s+o)-o,N={left:p+s/2,center:(c-A)/2+s/2,right:c-A-p-v+s/2}[d]||0;(n=this.speedSelect)===null||n===void 0||n.destroy(),this.functions.removeChildren(),x.forEach(function(I,K){var W,z=D6[I],j={x:l+K*(s+o)+N,y:u+h/2,size:s};if(z===cm?(j.speed=t.attributes.speed,j.onSelect=function(vt){return t.handleFunctionChange(I,{value:vt})}):[dm,fm,vm].includes(z)?(j.onChange=function(vt){return t.handleFunctionChange(I,{value:vt})},z===dm&&(j.type=t.attributes.state==="play"?"pause":"play"),z===fm&&(j.type=t.attributes.selectionType==="range"?"value":"range"),z===vm&&(j.type=t.attributes.chartType==="line"?"column":"line")):j.onClick=function(){return t.handleFunctionChange(I,{value:I})},z===cm){var Z=(W=t.ownerDocument)===null||W===void 0?void 0:W.defaultView;Z&&(t.speedSelect=new z({style:(0,it.pi)((0,it.pi)({},j),{zIndex:100})}),Z.appendChild(t.speedSelect))}else t.functions.appendChild(new z({style:j}))})},e.prototype.disconnectedCallback=function(){var t;r.prototype.disconnectedCallback.call(this),(t=this.speedSelect)===null||t===void 0||t.destroy()},e.prototype.render=function(){this.renderBackground(),this.renderFunctions()},e.prototype.handleFunctionChange=function(t,n){var i=this.attributes.onChange;i==null||i(t,n)},e.defaultOptions={style:{x:0,y:0,width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}},e}(vi),F6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},e.defaultOptions,t))||this;return n.bindEvents(),n}return e.prototype.bindEvents=function(){var t=this;this.addEventListener("mouseenter",function(){t.attr("lineWidth",Math.ceil(+(t.style.r||0)/2))}),this.addEventListener("mouseleave",function(){t.attr("lineWidth",0)})},e.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},e}(C0),B6=function(r){(0,it.ZT)(e,r);function e(t){return r.call(this,Oi({},e.defaultOptions,t))||this}return e.prototype.renderBackground=function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=$n(this.attributes,"background");Sn(this).maybeAppend("background","rect").attr("className","background").styles((0,it.pi)({x:n-a/2,y:i-s/2,width:a,height:s},o))},e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.iconSize,s=$n(this.attributes,"icon"),o=1,l=a/2;Sn(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,it.pi)({x1:n-o,y1:i-l,x2:n-o,y2:i+l},s)),Sn(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,it.pi)({x1:n+o,y1:i-l,x2:n+o,y2:i+l},s))},e.prototype.renderBorder=function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=t.type,l=$n(this.attributes,"border"),u=o==="start"?+a/2:-a/2;Sn(this).maybeAppend("border","line").attr("className","border").styles((0,it.pi)({x1:u+n,y1:i-s/2,x2:u+n,y2:i+s/2},l))},e.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},e.defaultOptions={style:{x:0,y:0,width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}},e}(vi);function z6(r,e){return typeof r=="number"?o2(r):j6(r,e)}function j6(r,e){var t=new Date(r);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(t.getHours())&&t.getMinutes()===0?sa(t,`HH:mm
|
|
|
YYYY-MM-DD`):sa(t,"HH:mm");case"half-day":return t.getHours()<12?`AM
|
|
|
`.concat(sa(t,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(t.getDate())?sa(t,`DD
|
|
|
YYYY-MM`):sa(t,"DD");case"week":return t.getDate()<=7?sa(t,`DD
|
|
|
YYYY-MM`):sa(t,"DD");case"month":return[0,6].includes(t.getMonth())?sa(t,`MM\u6708
|
|
|
YYYY`):sa(t,"MM\u6708");case"season":return[0].includes(t.getMonth())?sa(t,`MM\u6708
|
|
|
YYYY`):sa(t,"MM\u6708");case"year":return sa(t,"YYYY");default:return sa(t,"YYYY-MM-DD HH:mm")}}function o2(r){var e=String(Math.floor(r/3600)).padStart(2,"0"),t=String(Math.floor(r%3600/60)).padStart(2,"0"),n=String(Math.floor(r%60)).padStart(2,"0");return r<3600?"".concat(t,":").concat(n):"".concat(e,":").concat(t,":").concat(n)}var G6=function(r){(0,it.ZT)(e,r);function e(t){var n=r.call(this,Oi({},e.defaultOptions,t))||this;n.axis=n.appendChild(new a6({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),n.timeline=n.appendChild(new x6({style:{onChange:function(h){n.handleSliderChange(h)}}})),n.controller=n.appendChild(new I6({})),n.states={},n.handleSliderChange=function(h){var d=function(){var f=n.states.values;return Array.isArray(f)?(0,it.ev)([],(0,it.CR)(f),!1):f}();n.setBySliderValues(h),n.dispatchOnChange(d)};var i=n.attributes,a=i.selectionType,s=i.chartType,o=i.speed,l=i.state,u=i.playMode,c=i.values;return n.states={chartType:s,playMode:u,selectionType:a,speed:o,state:l},n.setByTimebarValues(c),n}return Object.defineProperty(e.prototype,"data",{get:function(){var t=this.attributes.data,n=function(i,a){return i.time<a.time?-1:i.time>a.time?1:0};return t.sort(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=t.type,l=t.controllerHeight,u=(0,Kt.Z)(+s-l,0,+s),c=new Hi(n,i+ +s-l,+a,l),h,d=0;o==="chart"?(d=35,h=new Hi(n,i+u-d,+a,d)):h=new Hi;var f=o==="time"?10:u,v=new Hi(n,i+(o==="time"?u:u-f),+a,f-d);return{axisBBox:h,controllerBBox:c,timelineBBox:v}},enumerable:!1,configurable:!0}),e.prototype.setBySliderValues=function(t){var n,i,a=this.data,s=(0,it.CR)(Array.isArray(t)?t:[0,t],2),o=s[0],l=s[1],u=a.length,c=a[Math.floor(o*u)],h=a[Math.ceil(l*u)-(Array.isArray(t)?0:1)];this.states.values=[(n=c==null?void 0:c.time)!==null&&n!==void 0?n:a[0].time,(i=h==null?void 0:h.time)!==null&&i!==void 0?i:1/0]},e.prototype.setByTimebarValues=function(t){var n,i,a,s=this.data,o=(0,it.CR)(Array.isArray(t)?t:[void 0,t],2),l=o[0],u=o[1],c=s.find(function(d){var f=d.time;return f===l}),h=s.find(function(d){var f=d.time;return f===u});this.states.values=[(n=c==null?void 0:c.time)!==null&&n!==void 0?n:(i=s[0])===null||i===void 0?void 0:i.time,(a=h==null?void 0:h.time)!==null&&a!==void 0?a:1/0]},e.prototype.setByIndex=function(t){var n,i,a,s,o=this.data,l=(0,it.CR)(t,2),u=l[0],c=l[1];this.states.values=[(i=(n=o[u])===null||n===void 0?void 0:n.time)!==null&&i!==void 0?i:o[0].time,(s=(a=this.data[c])===null||a===void 0?void 0:a.time)!==null&&s!==void 0?s:1/0]},Object.defineProperty(e.prototype,"sliderValues",{get:function(){var t=this.states,n=t.values,i=t.selectionType,a=(0,it.CR)(Array.isArray(n)?n:[void 0,n],2),s=a[0],o=a[1],l=this.data,u=l.length,c=i==="value",h=function(){var f=l.findIndex(function(v){var p=v.time;return p===s});return c?0:f>-1?f/u:0},d=function(){if(o===1/0)return 1;var f=l.findIndex(function(v){var p=v.time;return p===o});return f>-1?f/u:c?.5:1};return[h(),d()]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){var t=this.states,n=t.values,i=t.selectionType,a=(0,it.CR)(Array.isArray(n)?n:[this.data[0].time,n],2),s=a[0],o=a[1];return i==="value"?o:[s,o]},enumerable:!1,configurable:!0}),e.prototype.getDatumByRatio=function(t){var n=this.data,i=n.length,a=Math.floor(t*(i-1));return n[a]},Object.defineProperty(e.prototype,"chartHandleIconShape",{get:function(){var t=this.states.selectionType,n=this.space.timelineBBox.height;return t==="range"?function(i){return new B6({style:{type:i,height:n,iconSize:n/6}})}:function(){return new zE({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),e.prototype.getChartStyle=function(t){var n=this,i=t.x,a=t.y,s=t.width,o=t.height,l=this.states,u=l.selectionType,c=l.chartType,h=this.data,d=this.attributes,f=d.type,v=d.labelFormatter,p=$n(this.attributes,"chart"),x=p.type,A=(0,it._T)(p,["type"]),N=u==="range";if(f==="time")return(0,it.pi)({handleIconShape:function(){return new F6({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:N?-15:0,autoFitLabel:N,handleSpacing:N?-15:0,trackFill:"#edeeef",trackLength:s,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:u,values:this.sliderValues,formatter:function(W){if(v)return v(W);var z=n.getDatumByRatio(W).time;return typeof z=="number"?o2(z):sa(z,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},A);var I=u==="range"?5:0,K=h.map(function(W){var z=W.value;return z});return(0,it.pi)({handleIconOffset:I,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:K,sparklineType:c,sparklineScale:.8,trackLength:s,trackSize:o,type:u,values:this.sliderValues,transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},A)},e.prototype.renderChart=function(t){t===void 0&&(t=this.space.timelineBBox),this.timeline.update(this.getChartStyle(t))},e.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},e.prototype.getAxisStyle=function(t){var n=this.data,i=this.attributes,a=i.interval,s=i.labelFormatter,o=$n(this.attributes,"axis"),l=t.x,u=t.y,c=t.width,h=(0,it.ev)((0,it.ev)([],(0,it.CR)(n),!1),[{time:0}],!1).map(function(f,v,p){var x=f.time;return{label:"".concat(x),value:v/(p.length-1),time:x}}),d=(0,it.pi)({startPos:[l,u],endPos:[l+c,u],data:h,labelFilter:function(f,v){return v<h.length-1},labelFormatter:function(f){var v=f.time;return s?s(v):z6(v,a)}},o);return d},e.prototype.renderAxis=function(t){t===void 0&&(t=this.space.axisBBox);var n=this.attributes.type;n==="chart"&&this.axis.update(this.getAxisStyle(t))},e.prototype.renderController=function(t){t===void 0&&(t=this.space.controllerBBox);var n=this.attributes.type,i=this.states,a=i.state,s=i.speed,o=i.selectionType,l=i.chartType,u=$n(this.attributes,"controller"),c=this,h=(0,it.pi)((0,it.pi)((0,it.pi)({},t),{iconSize:20,speed:s,state:a,selectionType:o,chartType:l,onChange:function(d,f){var v=f.value;switch(d){case"reset":c.internalReset();break;case"speed":c.handleSpeedChange(v);break;case"backward":c.internalBackward();break;case"playPause":v==="play"?c.internalPlay():c.internalPause();break;case"forward":c.internalForward();break;case"selectionType":c.handleSelectionTypeChange(v);break;case"chartType":c.handleChartTypeChange(v);break;default:break}}}),u);n==="time"&&(h.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(h)},e.prototype.dispatchOnChange=function(t){var n=this.data,i=this.attributes.onChange,a=this.states,s=a.values,o=a.selectionType,l=(0,it.CR)(s,2),u=l[0],c=l[1],h=c===1/0?n.at(-1).time:c,d=o==="range"?[u,h]:h,f=function(v,p){return Array.isArray(v)?Array.isArray(p)?v[0]===p[0]&&(v[1]===p[1]||v[1]===1/0||p[1]===1/0):!1:Array.isArray(p)?!1:v===p};(!t||!f(t,d))&&(i==null||i(o==="range"?[u,h]:h))},e.prototype.internalReset=function(t){var n,i,a=this.states.selectionType;this.internalPause(),this.setBySliderValues(a==="range"?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onReset)===null||i===void 0||i.call(n),this.dispatchOnChange())},e.prototype.reset=function(){this.internalReset()},e.prototype.moveSelection=function(t,n){var i=this.data,a=i.length,s=this.states,o=s.values,l=s.selectionType,u=s.playMode,c=(0,it.CR)(o,2),h=c[0],d=c[1],f=i.findIndex(function(I){var K=I.time;return K===h}),v=i.findIndex(function(I){var K=I.time;return K===d});v===-1&&(v=a);var p=t==="backward"?-1:1,x;l==="range"?u==="acc"?(x=[f,v+p],p===-1&&f===v&&(x=[f,a])):x=[f+p,v+p]:x=[f,v+p];var A=function(I){var K=(0,it.CR)(I.sort(function(Z,vt){return Z-vt}),2),W=K[0],z=K[1],j=function(Z){return(0,Kt.Z)(Z,0,a)};return z>a?l==="value"?[0,0]:u==="acc"?[j(W),j(W)]:[0,j(z-W)]:W<0?u==="acc"?[0,j(z)]:[j(W+a-z),a]:[j(W),j(z)]},N=A(x);return this.setByIndex(N),this.updateSelection(),N},e.prototype.internalBackward=function(t){var n,i,a=this.moveSelection("backward",t);return t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onBackward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},e.prototype.backward=function(){this.internalBackward()},e.prototype.internalPlay=function(t){var n=this,i,a,s=this.data,o=this.attributes.loop,l=this.states.speed,u=l===void 0?1:l;this.playInterval=window.setInterval(function(){var c=n.internalForward();c[1]===s.length&&!o&&(n.internalPause(),n.renderController())},1e3/u),this.states.state="play",!t&&((a=(i=this.attributes)===null||i===void 0?void 0:i.onPlay)===null||a===void 0||a.call(i))},e.prototype.play=function(){this.internalPlay()},e.prototype.internalPause=function(t){var n,i;clearInterval(this.playInterval),this.states.state="pause",!t&&((i=(n=this.attributes)===null||n===void 0?void 0:n.onPause)===null||i===void 0||i.call(n))},e.prototype.pause=function(){this.internalPause()},e.prototype.internalForward=function(t){var n,i,a=this.moveSelection("forward",t);return t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onForward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},e.prototype.forward=function(){this.internalForward()},e.prototype.handleSpeedChange=function(t){var n,i;this.states.speed=t;var a=this.states.state;a==="play"&&(this.internalPause(!0),this.internalPlay(!0)),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSpeedChange)===null||i===void 0||i.call(n,t)},e.prototype.handleSelectionTypeChange=function(t){var n,i;this.states.selectionType=t,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSelectionTypeChange)===null||i===void 0||i.call(n,t)},e.prototype.handleChartTypeChange=function(t){var n,i;this.states.chartType=t,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onChartTypeChange)===null||i===void 0||i.call(n,t)},e.prototype.render=function(){var t=this.space,n=t.axisBBox,i=t.controllerBBox,a=t.timelineBBox;this.renderController(i),this.renderAxis(n),this.renderChart(a),this.states.state==="play"&&this.internalPlay()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.internalPause(!0)},e.defaultOptions={style:{x:0,y:0,axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}},e}(vi),W6=g(69246),U6=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})},Z6=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const V6=["timestamp","time","date","datetime"];class Ov extends zi{get padding(){return Ws(this.options.padding)}constructor(e,t){super(e,Object.assign({},Ov.defaultOptions,t)),this.backup(),this.upsertTimebar()}play(){var e;(e=this.timebar)===null||e===void 0||e.play()}pause(){var e;(e=this.timebar)===null||e===void 0||e.pause()}forward(){var e;(e=this.timebar)===null||e===void 0||e.forward()}backward(){var e;(e=this.timebar)===null||e===void 0||e.backward()}reset(){var e;(e=this.timebar)===null||e===void 0||e.reset()}update(e){super.update(e),this.backup(),this.upsertTimebar()}backup(){this.originalData=l2(this.context.graph.getData())}upsertTimebar(){const{canvas:e}=this.context,t=this.options,{onChange:n,timebarType:i,data:a,x:s,y:o,width:l,height:u,mode:c}=t,h=Z6(t,["onChange","timebarType","data","x","y","width","height","mode"]),d=e.getSize(),[f]=this.padding;this.upsertCanvas().ready.then(()=>{var v;const p=Object.assign(Object.assign({x:d[0]/2-l/2,y:f,onChange:x=>{const A=((0,S.Z)(x)?x:[x,x]).map(N=>(0,W6.Z)(N)?N.getTime():N);this.options.mode==="modify"?this.filterElements(A):this.hiddenElements(A),n==null||n(A)}},h),{data:a.map(x=>(0,bt.Z)(x)?{time:x,value:0}:x),width:l,height:u,type:i});this.timebar?this.timebar.update(p):(this.timebar=new G6({style:p}),(v=this.canvas)===null||v===void 0||v.appendChild(this.timebar))})}upsertCanvas(){if(this.canvas)return this.canvas;const{className:e,height:t,position:n}=this.options,i=this.context.canvas,[a]=i.getSize(),[s,,o]=this.padding,[l,u]=X0({width:a,height:t+s+o,graphCanvas:i,className:"timebar",placement:n});return this.container=l,e&&l.classList.add(e),this.canvas=u,this.canvas}filterElements(e){return U6(this,void 0,void 0,function*(){var t;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:a,element:s}=this.context,o=l2(this.originalData);n.forEach(u=>{const c=`${u}s`;o[c]=(this.originalData[c]||[]).filter(h=>{const d=i(h);return!!u2(d,e)})});const l=[...o.nodes,...o.combos].map(u=>Re(u));o.edges=o.edges.filter(u=>{const c=u.source,h=u.target;return l.includes(c)&&l.includes(h)}),a.setData(o),yield(t=s.draw({animation:!1,silence:!0}))===null||t===void 0?void 0:t.finished})}hiddenElements(e){const{graph:t}=this.context,{elementTypes:n,getTime:i}=this.options,a=[],s=[];n.forEach(o=>{var l;const u=`${o}s`;(((l=this.originalData)===null||l===void 0?void 0:l[u])||[]).forEach(h=>{const d=Re(h),f=i(h);u2(f,e)?s.push(d):a.push(d)})}),t.hideElement(a,!1),t.showElement(s,!1)}destroy(){var e,t,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),(e=this.timebar)===null||e===void 0||e.destroy(),(t=this.canvas)===null||t===void 0||t.destroy(),(n=this.container)===null||n===void 0||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}Ov.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:r=>Y6(r,V6,void 0),loop:!1};const l2=r=>{const{nodes:e=[],edges:t=[],combos:n=[]}=r;return{nodes:[...e],edges:[...t],combos:[...n]}},u2=(r,e)=>{if((0,bt.Z)(e))return r===e;const[t,n]=e;return r>=t&&r<=n},Y6=(r,e,t)=>{var n;for(let i=0;i<e.length;i++){const a=e[i],s=(n=r.data)===null||n===void 0?void 0:n[a];if(s)return s}return t};function H6(r){const e={top:"unset",right:"unset",bottom:"unset",left:"unset"};return r.split("-").forEach(n=>{e[n]="8px"}),e.flexDirection=r.startsWith("top")||r.startsWith("bottom")?"row":"column",e}const X6=`
|
|
|
.g6-toolbar {
|
|
|
position: absolute;
|
|
|
z-index: 100;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 4px;
|
|
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
|
|
|
opacity: 0.65;
|
|
|
}
|
|
|
.g6-toolbar .g6-toolbar-item {
|
|
|
display: inline-block;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
padding: 4px;
|
|
|
cursor: pointer;
|
|
|
box-sizing: content-box;
|
|
|
}
|
|
|
|
|
|
.g6-toolbar .g6-toolbar-item:hover {
|
|
|
background-color: #f0f0f0;
|
|
|
}
|
|
|
|
|
|
.g6-toolbar .g6-toolbar-item svg {
|
|
|
display: inline-block;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
`,K6=`
|
|
|
<svg>
|
|
|
<symbol id="zoom-in" viewBox="64 64 896 896">
|
|
|
<path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="zoom-out" viewBox="64 64 896 896">
|
|
|
<path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="edit" viewBox="64 64 896 896">
|
|
|
<path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="delete" viewBox="64 64 896 896">
|
|
|
<path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="redo" viewBox="64 64 896 896">
|
|
|
<path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="undo" viewBox="64 64 896 896">
|
|
|
<path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="export" viewBox="64 64 896 896">
|
|
|
<path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="auto-fit" viewBox="64 64 896 896">
|
|
|
<path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>
|
|
|
<path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="reset" viewBox="64 64 896 896">
|
|
|
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>
|
|
|
</symbol>
|
|
|
<symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
|
|
|
<path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>
|
|
|
<symbol id="request-fullscreen" viewBox="0 0 1024 1024">
|
|
|
<path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>
|
|
|
</svg>
|
|
|
`;var c2=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Av extends zi{constructor(e,t){super(e,Object.assign({},Av.defaultOptions,t)),this.$element=bu("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const s=i.target.getAttribute("value");a==null||a(s,i.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),t0("g6-toolbar-css","style",{},X6,document.head),t0("g6-toolbar-svgicon","div",{display:"none"},K6),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return c2(this,void 0,void 0,function*(){t.update.call(this,e);const{className:n,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,a,H6(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return c2(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(t=>`
|
|
|
<div class="g6-toolbar-item" value="${t.value}">
|
|
|
<svg aria-hidden="true" focusable="false">
|
|
|
<use xlink:href="#${t.id}"></use>
|
|
|
</svg>
|
|
|
</div>`).join("")})}}Av.defaultOptions={position:"top-left"};var gm=g(88204),$6=g(68856),h2=function(r,e){if(e==null){r.innerHTML="";return}r.replaceChildren?Array.isArray(e)?r.replaceChildren.apply(r,(0,it.ev)([],(0,it.CR)(e),!1)):r.replaceChildren(e):(r.innerHTML="",Array.isArray(e)?e.forEach(function(t){return r.appendChild(t)}):r.appendChild(e))};function pm(r){return r===void 0&&(r=""),{CONTAINER:"".concat(r,"tooltip"),TITLE:"".concat(r,"tooltip-title"),LIST:"".concat(r,"tooltip-list"),LIST_ITEM:"".concat(r,"tooltip-list-item"),NAME:"".concat(r,"tooltip-list-item-name"),MARKER:"".concat(r,"tooltip-list-item-marker"),NAME_LABEL:"".concat(r,"tooltip-list-item-name-label"),VALUE:"".concat(r,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(r,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(r,"tooltip-crosshair-y")}}var d2={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Q6(r){var e;r===void 0&&(r="");var t=pm(r);return e={},e[".".concat(t.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(t.NAME_LABEL)]=(0,it.pi)({flex:1},d2),e[".".concat(t.VALUE)]=(0,it.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},d2),e[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var J6=function(r){(0,it.ZT)(e,r);function e(t){var n=this,i,a,s=(a=(i=t.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,o=pm(s);return n=r.call(this,t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,`" data-index={index}>
|
|
|
<span class="`).concat(o.NAME,`">
|
|
|
<span class="`).concat(o.MARKER,`" style="background:{color}"></span>
|
|
|
<span class="`).concat(o.NAME_LABEL,`" title="{name}">{name}</span>
|
|
|
</span>
|
|
|
<span class="`).concat(o.VALUE,`" title="{value}">{value}</span>
|
|
|
</li>`)},style:Q6(s)})||this,n.timestamp=-1,n.prevCustomContentKey=n.attributes.contentKey,n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){var t=this.element.offsetWidth,n=this.element.offsetHeight;return{width:t,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,n=t.data,i=t.template;return n.map(function(a,s){var o=a.name,l=o===void 0?"":o,u=a.color,c=u===void 0?"black":u,h=a.index,d=(0,it._T)(a,["name","color","index"]),f=(0,it.pi)({name:l,color:c,index:h!=null?h:s},d);return(0,gm.L)((0,$6.Z)(i.item,f))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,n){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var t;(t=this.element)===null||t===void 0||t.remove(),r.prototype.destroy.call(this)},e.prototype.show=function(t,n){var i=this;if(t!==void 0&&n!==void 0){var a=this.element.style.visibility==="hidden",s=function(){i.attributes.x=t!=null?t:i.attributes.x,i.attributes.y=n!=null?n:i.attributes.y,i.updatePosition()};a?this.closeTransition(s):s()}this.element.style.visibility="visible"},e.prototype.hide=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=this.attributes.enterable;i&&this.isCursorEntered(t,n)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=(0,gm.L)(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&(typeof t=="string"?this.element.innerHTML=t:h2(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,n,i=this.attributes,a=i.template,s=i.title,o=i.enterable,l=i.style,u=i.content,c=pm(a.prefixCls),h=this.element;if(this.element.style.pointerEvents=o?"auto":"none",u)this.renderCustomContent();else{s?(h.innerHTML=a.title,h.getElementsByClassName(c.TITLE)[0].innerHTML=s):(n=(t=h.getElementsByClassName(c.TITLE))===null||t===void 0?void 0:t[0])===null||n===void 0||n.remove();var d=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,h2(f,d);var v=this.element.querySelector(".".concat(c.LIST));v?v.replaceWith(f):h.appendChild(f)}nD(h,l)},e.prototype.getRelativeOffsetFromCursor=function(t){var n=this.attributes,i=n.position,a=n.offset,s=t||i,o=s.split("-"),l={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},u=this.elementSize,c=u.width,h=u.height,d=[-c/2,-h/2];return o.forEach(function(f){var v=(0,it.CR)(d,2),p=v[0],x=v[1],A=(0,it.CR)(l[f],2),N=A[0],I=A[1];d=[p+(c/2+a[0])*N,x+(h/2+a[1])*I]}),d},e.prototype.setOffsetPosition=function(t){var n=(0,it.CR)(t,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=o===void 0?0:o,u=s.y,c=u===void 0?0:u,h=s.container,d=h.x,f=h.y;this.element.style.left="".concat(+l+d+i,"px"),this.element.style.top="".concat(+c+f+a,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,n=t===void 0?60:t,i=Date.now();this.timestamp>0&&i-this.timestamp<n||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var n=(0,it.CR)(t,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=s.y,u=s.bounding,c=s.position;if(!u)return[i,a];var h=this.element,d=h.offsetWidth,f=h.offsetHeight,v=(0,it.CR)([+o+i,+l+a],2),p=v[0],x=v[1],A={left:"right",right:"left",top:"bottom",bottom:"top"},N=u.x,I=u.y,K=u.width,W=u.height,z={left:p<N,right:p+d>N+K,top:x<I,bottom:x+f>I+W},j=[];c.split("-").forEach(function(vt){z[vt]?j.push(A[vt]):j.push(vt)});var Z=j.join("-");return this.getRelativeOffsetFromCursor(Z)},e.prototype.isCursorEntered=function(t,n){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,s=i.y,o=i.width,l=i.height;return new Hi(a,s,o,l).isPointIn(t,n)}return!1},e.prototype.closeTransition=function(t){var n=this,i=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){n.element.style.transition=i},10)},e.tag="tooltip",e}(vi);class Cv extends zi{constructor(e,t){super(e,Object.assign({},Cv.defaultOptions,t)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=n=>{const{enable:i}=this.options;return typeof i=="function"?i(n):i},this.onClick=n=>{const{target:{id:i}}=n;this.currentTarget===i?(this.hide(n),this.currentTarget=null):(this.currentTarget=i,this.show(n))},this.onPointerMove=n=>{const{target:i}=n;!this.currentTarget||i.id===this.currentTarget||this.show(n)},this.onPointerLeave=n=>{this.hide(n),this.currentTarget=null},this.onCanvasMove=n=>{this.hide(n),this.currentTarget=null},this.onPointerEnter=n=>{this.show(n)},this.showById=n=>{const i={target:{id:n}};this.show(i)},this.getElementData=(n,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([n]);case"edge":return a.getEdgeData([n]);case"combo":return a.getComboData([n]);default:return[]}},this.show=n=>{const{client:i,target:{id:a}}=n;if(lf(n.target)||!this.tooltipElement||!this.isEnable(n))return;const s=this.context.graph.getElementType(a),{getContent:o,title:l}=this.options;this.currentTarget=a;const u=this.getElementData(a,s);let c,h;if(i)c=i.x,h=i.y;else{const f=(0,na.Z)(u,"0.style",{x:0,y:0});c=f.x,h=f.y}let d={};if(o)d.content=o(n,u);else{const f=this.context.graph.getElementRenderStyle(a),v=s==="node"?f.fill:f.stroke;d={title:l||s,data:u.map(p=>({name:"ID",value:p.id||`${p.source} -> ${p.target}`,color:v}))}}this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:c,y:h,style:{".tooltip":{visibility:"visible"}}}),d))},this.hide=n=>{var i;if(!n){(i=this.tooltipElement)===null||i===void 0||i.hide();return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:a,y:s}}=n;this.tooltipElement.hide(a,s)},this.initTooltip=()=>{var n;const i=new J6({className:"tooltip",style:this.tooltipStyleProps});return(n=this.container)===null||n===void 0||n.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerenter":this.onPointerEnter,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerenter":this.onPointerEnter,"edge:pointermove":this.onPointerMove,"combo:pointerenter":this.onPointerEnter,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(e){var t;this.unbindEvents(),super.update(e),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:e}=this.context,t=e.getContainer();t&&(this.container=t,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:e}=this.context,t=this.getEvents();Object.keys(t).forEach(n=>{e.off(n,t[n])})}bindEvents(){const{graph:e}=this.context,t=this.getEvents();Object.keys(t).forEach(n=>{e.on(n,t[n])})}get tooltipStyleProps(){const{canvas:e}=this.context,{center:t}=e.getBounds(),n=e.getContainer(),{top:i,left:a}=n.getBoundingClientRect(),{style:s,position:o,enterable:l,container:u={x:-a,y:-i},title:c,offset:h}=this.options,[d,f]=t,[v,p]=e.getSize();return{x:d,y:f,container:u,title:c,bounding:{x:0,y:0,width:v,height:p},position:o,enterable:l,offset:h,style:s}}destroy(){var e;this.unbindEvents(),this.tooltipElement&&((e=this.container)===null||e===void 0||e.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}Cv.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var f2=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};let Lu;function v2(r,e){return Lu||(Lu=document.createElement("canvas")),Lu.width=r,Lu.height=e,Lu.getContext("2d").clearRect(0,0,r,e),Lu}function q6(r,e,t,n){return f2(this,void 0,void 0,function*(){const i=v2(r,e),a=i.getContext("2d"),{rotate:s,opacity:o,textFill:l,textFontSize:u,textFontFamily:c,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:v}=n;return a.textAlign=f,a.textBaseline=v,a.translate(r/2,e/2),a.font=`${u}px ${c} ${h} ${d}`,s&&a.rotate(s),o&&(a.globalAlpha=o),l&&(a.fillStyle=l,a.fillText(`${t}`,0,0)),i.toDataURL()})}function t4(r,e,t,n){return f2(this,void 0,void 0,function*(){const i=v2(r,e),a=i.getContext("2d"),{rotate:s,opacity:o}=n;s&&a.rotate(s),o&&(a.globalAlpha=o);const l=new Image;return l.crossOrigin="anonymous",l.src=t,new Promise(u=>{l.onload=function(){const c=r>l.width?(r-l.width)/2:0,h=e>l.height?(e-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,c,h,r-c*2,e-h*2),u(i.toDataURL())}})})}var e4=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})},n4=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Pv extends zi{constructor(e,t){super(e,Object.assign({},Pv.defaultOptions,t)),this.$element=bu("watermark"),this.context.canvas.getContainer().appendChild(this.$element),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return e4(this,void 0,void 0,function*(){t.update.call(this,e);const n=this.options,{width:i,height:a,text:s,imageURL:o}=n,l=n4(n,["width","height","text","imageURL"]);Object.keys(l).forEach(c=>{c.startsWith("background")&&(this.$element.style[c]=e[c])});const u=o?yield t4(i,a,o,l):yield q6(i,a,s,l);this.$element.style.backgroundImage=`url(${u})`})}destroy(){super.destroy(),this.$element.remove()}}Pv.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};function r4(r,e,t,n=!1){const i=Ug[r][e];!n&&i?i!==t&&da.warn(`The extension ${e} of ${r} has been registered before.`):Object.assign(Ug[r],{[e]:t})}var g2=function(){function r(e){rn(this,r),this.dragndropPluginOptions=e}return an(r,[{key:"apply",value:function(t){var n=this,i=t.renderingService,a=t.renderingContext,s=a.root.ownerDocument,o=s.defaultView,l=function(c){var h=c.target,d=h===s,f=d&&n.dragndropPluginOptions.isDocumentDraggable?s:h.closest&&h.closest("[draggable=true]");if(f){var v=!1,p=c.timeStamp,x=[c.clientX,c.clientY],A=null,N=[c.clientX,c.clientY],I=function(){var W=Y1(Ac().mark(function z(j){var Z,vt,Tt,zt,Qt,ae;return Ac().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(v){ce.next=8;break}if(Z=j.timeStamp-p,vt=(0,ye.y)([j.clientX,j.clientY],x),!(Z<=n.dragndropPluginOptions.dragstartTimeThreshold||vt<=n.dragndropPluginOptions.dragstartDistanceThreshold)){ce.next=5;break}return ce.abrupt("return");case 5:j.type="dragstart",f.dispatchEvent(j),v=!0;case 8:if(j.type="drag",j.dx=j.clientX-N[0],j.dy=j.clientY-N[1],f.dispatchEvent(j),N=[j.clientX,j.clientY],d){ce.next=21;break}return Tt=n.dragndropPluginOptions.overlap==="pointer"?[j.canvasX,j.canvasY]:h.getBounds().center,ce.next=17,s.elementsFromPoint(Tt[0],Tt[1]);case 17:zt=ce.sent,Qt=zt[zt.indexOf(h)+1],ae=(Qt==null?void 0:Qt.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?s:null),A!==ae&&(A&&(j.type="dragleave",j.target=A,A.dispatchEvent(j)),ae&&(j.type="dragenter",j.target=ae,ae.dispatchEvent(j)),A=ae,A&&(j.type="dragover",j.target=A,A.dispatchEvent(j)));case 21:case"end":return ce.stop()}},z)}));return function(j){return W.apply(this,arguments)}}();o.addEventListener("pointermove",I);var K=function(z){if(v){z.detail={preventClick:!0};var j=z.clone();A&&(j.type="drop",j.target=A,A.dispatchEvent(j)),j.type="dragend",f.dispatchEvent(j),v=!1}o.removeEventListener("pointermove",I)};h.addEventListener("pointerup",K,{once:!0}),h.addEventListener("pointerupoutside",K,{once:!0})}};i.hooks.init.tap(r.tag,function(){o.addEventListener("pointerdown",l)}),i.hooks.destroy.tap(r.tag,function(){o.removeEventListener("pointerdown",l)})}}])}();g2.tag="Dragndrop";var i4=function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return rn(this,e),t=dr(this,e),t.name="dragndrop",t.options=n,t}return fr(e,r),an(e,[{key:"init",value:function(){this.addRenderingPlugin(new g2(di({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)}}])}(Se),p2=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})},m2=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const y2=["main"],b2=["background","main","label","transient"];function a4(r){return r.main}class x2{getConfig(){return this.config}getLayer(e="main"){return this.extends.layers[e]||a4(this.getLayers())}getLayers(){return this.extends.layers}getRenderer(e){return this.extends.renderers[e]}getCamera(e="main"){return this.getLayer(e).getCamera()}getRoot(e="main"){return this.getLayer(e).getRoot()}getContextService(e="main"){return this.getLayer(e).getContextService()}setCursor(e){this.config.cursor=e,this.getLayer().setCursor(e)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(e){this.config={enableMultiLayer:!0},Object.assign(this.config,e);const t=this.config,{renderer:n,background:i,cursor:a,enableMultiLayer:s}=t,o=m2(t,["renderer","background","cursor","enableMultiLayer"]),l=s?b2:y2,u=E2(n,l),c=Object.fromEntries(l.map(h=>{const d=new Pg(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:u[h],background:s?h==="background"?i:void 0:i}));return[h,d]}));w2(c),this.extends={config:this.config,renderer:n,renderers:u,layers:c}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,e])=>e.ready))}resize(e,t){Object.assign(this.extends.config,{width:e,height:t}),Object.values(this.getLayers()).forEach(n=>{const i=n.getCamera(),a=i.getPosition(),s=i.getFocalPoint();n.resize(e,t),i.setPosition(a),i.setFocalPoint(s)})}getBounds(e){return gc(Object.values(this.getLayers()).map(t=>e?t.getRoot().childNodes.find(i=>i.classList.includes(e)):t.getRoot()).filter(t=>(t==null?void 0:t.childNodes.length)>0).map(t=>t.getBounds()))}getContainer(){const e=this.extends.config.container;return typeof e=="string"?document.getElementById(e):e}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(e,t){var n;const i=((n=e.style)===null||n===void 0?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(e,t)}setRenderer(e){if(e===this.extends.renderer)return;const t=E2(e,this.config.enableMultiLayer?b2:y2);this.extends.renderers=t,Object.entries(t).forEach(([n,i])=>this.getLayer(n).setRenderer(i)),w2(this.getLayers())}getCanvasByViewport(e){return Bi(this.getLayer().viewport2Canvas(bs(e)))}getViewportByCanvas(e){return Bi(this.getLayer().canvas2Viewport(bs(e)))}getViewportByClient(e){return Bi(this.getLayer().client2Viewport(bs(e)))}getClientByViewport(e){return Bi(this.getLayer().viewport2Client(bs(e)))}getClientByCanvas(e){return this.getClientByViewport(this.getViewportByCanvas(e))}getCanvasByClient(e){const t=this.getLayer(),n=t.client2Viewport(bs(e));return Bi(t.viewport2Canvas(n))}toDataURL(){return p2(this,arguments,void 0,function*(e={}){const t=globalThis.devicePixelRatio||1,{mode:n="viewport"}=e,i=m2(e,["mode"]);let[a,s,o,l]=[0,0,0,0];if(n==="viewport")[o,l]=this.getSize();else if(n==="overall"){const A=this.getBounds(),N=Po(A);[a,s]=A.min,[o,l]=N}const u=(0,gm.L)('<div id="virtual-image"></div>'),c=new Pg({width:o,height:l,renderer:new Kd,devicePixelRatio:t,container:u,background:this.extends.config.background});yield c.ready,c.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),c.appendChild(this.getRoot().cloneNode(!0));const h=this.getLayer("label").getRoot().cloneNode(!0),d=c.viewport2Canvas({x:0,y:0}),f=this.getCanvasByViewport([0,0]);h.translate([f[0]-d.x,f[1]-d.y]),h.scale(1/this.getCamera().getZoom()),c.appendChild(h),c.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const v=this.getCamera(),p=c.getCamera();if(n==="viewport")p.setZoom(v.getZoom()),p.setPosition(v.getPosition()),p.setFocalPoint(v.getFocalPoint());else if(n==="overall"){const[A,N,I]=p.getPosition(),[K,W,z]=p.getFocalPoint();p.setPosition([A+a,N+s,I]),p.setFocalPoint([K+a,W+s,z])}const x=c.getContextService();return new Promise(A=>{c.addEventListener(Ma.RERENDER,()=>p2(this,void 0,void 0,function*(){yield new Promise(I=>setTimeout(I,300));const N=yield x.toDataURL(i);A(N)}))})})}destroy(){Object.values(this.getLayers()).forEach(e=>{e.getCamera().cancelLandmarkAnimation(),e.destroy()})}}function E2(r,e){return Object.fromEntries(e.map(t=>{const n=(r==null?void 0:r(t))||new Kd;return t==="main"?n.registerPlugin(new i4({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[t,n]}))}function w2(r){Object.entries(r).forEach(([e,t])=>{const n=t.getContextService().getDomElement();n!=null&&n.style&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,e!=="main"&&(n.style.pointerEvents="none")),n!=null&&n.parentElement&&(n.parentElement.style.display="grid")})}const Du=r=>r?parseInt(r):0;function s4(r){const e=getComputedStyle(r),t=r.clientWidth||Du(e.width),n=r.clientHeight||Du(e.height),i=Du(e.paddingLeft)+Du(e.paddingRight),a=Du(e.paddingTop)+Du(e.paddingBottom);return[t-i,n-a]}function S2(r){if(!r)return[0,0];let e=640,t=480;const[n,i]=s4(r);e=n||e,t=i||t;const a=1,s=1;return[Math.max((0,bt.Z)(e)?e:a,a),Math.max((0,bt.Z)(t)?t:s,s)]}class Nv{constructor(e){this.type=e}}class Ai extends Nv{constructor(e,t){super(e),this.data=t}}class hs extends Nv{constructor(e,t,n,i){super(e),this.animationType=t,this.animation=n,this.data=i}}class Iu extends Nv{constructor(e,t,n){super(e),this.elementType=t,this.data=n}}class Rv extends Nv{constructor(e,t){super(e),this.data=t}}function Wi(r,e){r.emit(e.type,e)}function o4(r){if(!r)return null;if(r instanceof ty)return{type:"canvas",element:r};let e=r;for(;e;){if(Pc(e))return{type:"node",element:e};if(ub(e))return{type:"edge",element:e};if(Tp(e))return{type:"combo",element:e};e=e.parentElement}return null}function _2(r){var e;return((e=r==null?void 0:r.style)===null||e===void 0?void 0:e.zIndex)||0}const Fu="cachedStyle",Lv=r=>`__${r}__`;function l4(r,e){const t=Array.isArray(e)?e:[e];(0,na.Z)(r,Fu)||(0,Ec.Z)(r,Fu,{}),t.forEach(n=>{(0,Ec.Z)((0,na.Z)(r,Fu),Lv(n),r.attributes[n])})}function M2(r,e){return(0,na.Z)(r,[Fu,Lv(e)])}function u4(r,e){return Lv(e)in((0,na.Z)(r,Fu)||{})}function OB(r,e,t){set(r,[Fu,Lv(e)],t)}class c4{constructor(e){this.tasks=[],this.animations=new Set,this.context=e}getTasks(){const e=[...this.tasks];return this.tasks=[],e}add(e,t){this.tasks.push([e,t])}animate(e,t,n){var i,a,s;(i=t==null?void 0:t.before)===null||i===void 0||i.call(t);const o=this.getTasks().map(([u,c])=>{var h,d,f;const{element:v,elementType:p,stage:x}=u,A=O_(this.context.options,p,x,e);(h=c==null?void 0:c.before)===null||h===void 0||h.call(c);const N=A.length?C_(v,this.inferStyle(u,n),A):null;return N?((d=c==null?void 0:c.beforeAnimate)===null||d===void 0||d.call(c,N),N.finished.then(()=>{var I,K;(I=c==null?void 0:c.afterAnimate)===null||I===void 0||I.call(c,N),(K=c==null?void 0:c.after)===null||K===void 0||K.call(c),this.animations.delete(N)})):(f=c==null?void 0:c.after)===null||f===void 0||f.call(c),N}).filter(Boolean);o.forEach(u=>this.animations.add(u));const l=Zg(o);return l?((a=t==null?void 0:t.beforeAnimate)===null||a===void 0||a.call(t,l),l.finished.then(()=>{var u,c;(u=t==null?void 0:t.afterAnimate)===null||u===void 0||u.call(t,l),(c=t==null?void 0:t.after)===null||c===void 0||c.call(t),this.release()})):(s=t==null?void 0:t.after)===null||s===void 0||s.call(t),l}inferStyle(e,t){var n,i;const{element:a,elementType:s,stage:o,originalStyle:l,updatedStyle:u={}}=e;e.modifiedStyle||(e.modifiedStyle=Object.assign(Object.assign({},l),u));const{modifiedStyle:c}=e,h={},d={};if(o==="enter")Object.assign(h,{opacity:0});else if(o==="exit")Object.assign(d,{opacity:0});else if(o==="show")Object.assign(h,{opacity:0}),Object.assign(d,{opacity:(n=M2(a,"opacity"))!==null&&n!==void 0?n:vc("opacity")});else if(o==="hide")Object.assign(h,{opacity:(i=M2(a,"opacity"))!==null&&i!==void 0?i:vc("opacity")}),Object.assign(d,{opacity:0});else if(o==="collapse"){const{collapse:f}=t||{},{target:v,descendants:p,position:x}=f;if(s==="node"){if(p.includes(a.id)){const[A,N,I]=x;Object.assign(d,{x:A,y:N,z:I})}}else if(s==="combo"){if(a.id===v||p.includes(a.id)){const[A,N]=x;Object.assign(d,{x:A,y:N,childrenNode:l.childrenNode})}}else s==="edge"&&Object.assign(d,{sourceNode:c.sourceNode,targetNode:c.targetNode})}else if(o==="expand"){const{expand:f}=t||{},{target:v,descendants:p,position:x}=f;if(s==="node"){if(a.id===v||p.includes(a.id)){const[A,N,I]=x;Object.assign(h,{x:A,y:N,z:I})}}else if(s==="combo"){if(a.id===v||p.includes(a.id)){const[A,N,I]=x;Object.assign(h,{x:A,y:N,z:I,childrenNode:c.childrenNode})}}else s==="edge"&&Object.assign(h,{sourceNode:c.sourceNode,targetNode:c.targetNode})}return[Object.keys(h).length>0?Object.assign({},l,h):l,Object.keys(d).length>0?Object.assign({},c,d):c]}stop(){this.animations.forEach(e=>e.cancel())}clear(){this.tasks=[]}release(){var e,t;const{canvas:n}=this.context,i=(t=(e=n.document)===null||e===void 0?void 0:e.timeline)===null||t===void 0?void 0:t.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class h4{constructor(e){this.batchCount=0,this.context=e}emit(e){const{graph:t}=this.context;t.emit(e.type,e)}startBatch(e=!0){this.batchCount++,this.batchCount===1&&this.emit(new Ai(sn.BATCH_START,{initiate:e}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new Ai(sn.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class d4 extends Xg{constructor(e){super(e),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=t=>{const{target:n}=t,i=o4(n);if(!i)return;const{graph:a,canvas:s}=this.context,{type:o,element:l}=i;if("destroyed"in l&&(lf(l)||l.destroyed))return;const{type:u,detail:c,button:h}=t,d=Object.assign(Object.assign({},t),{target:l,targetType:o,originalTarget:n});u===Ue.POINTER_MOVE&&(this.currentTarget!==l&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${Ue.POINTER_LEAVE}`,Object.assign(Object.assign({},d),{type:Ue.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),l&&(Object.assign(d,{type:Ue.POINTER_ENTER}),a.emit(`${o}:${Ue.POINTER_ENTER}`,d))),this.currentTarget=l,this.currentTargetType=o),u===Ue.CLICK&&h===2||(a.emit(`${o}:${u}`,d),a.emit(u,d)),u===Ue.CLICK&&c===2&&(Object.assign(d,{type:Ue.DBLCLICK}),a.emit(`${o}:${Ue.DBLCLICK}`,d),a.emit(Ue.DBLCLICK,d)),u===Ue.POINTER_DOWN&&h===2&&(Object.assign(d,{type:Ue.CONTEXT_MENU,preventDefault:()=>{var f;(f=s.getContainer())===null||f===void 0||f.addEventListener(Ue.CONTEXT_MENU,v=>v.preventDefault(),{once:!0})}}),a.emit(`${o}:${Ue.CONTEXT_MENU}`,d),a.emit(Ue.CONTEXT_MENU,d))},this.forwardContainerEvents=t=>{this.context.graph.emit(t.type,t)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(e){this.setExtensions(e)}forwardEvents(){const e=this.context.canvas.getContainer();e&&[au.KEY_DOWN,au.KEY_UP].forEach(n=>{e.addEventListener(n,this.forwardContainerEvents)});const t=this.context.canvas.document;t&&[Ue.CLICK,Ue.DBLCLICK,Ue.POINTER_OVER,Ue.POINTER_LEAVE,Ue.POINTER_ENTER,Ue.POINTER_MOVE,Ue.POINTER_OUT,Ue.POINTER_DOWN,Ue.POINTER_UP,Ue.CONTEXT_MENU,Ue.DRAG_START,Ue.DRAG,Ue.DRAG_END,Ue.DRAG_ENTER,Ue.DRAG_OVER,Ue.DRAG_LEAVE,Ue.DROP,Ue.WHEEL].forEach(n=>{t.addEventListener(n,this.forwardCanvasEvents)})}destroy(){const e=this.context.canvas.getContainer();e&&[au.KEY_DOWN,au.KEY_UP].forEach(t=>{e.removeEventListener(t,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var f4=g(58029),ah=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function Qo(r,e){const{data:t,style:n}=r,i=ah(r,["data","style"]),{data:a,style:s}=e,o=ah(e,["data","style"]),l=Object.assign(Object.assign({},i),o);return(t||a)&&Object.assign(l,{data:Object.assign(Object.assign({},t),a)}),(n||s)&&Object.assign(l,{style:Object.assign(Object.assign({},n),s)}),l}function mm(r){const{data:e,style:t}=r,i=ah(r,["data","style"]);return e&&(i.data=Object.assign({},e)),t&&(i.style=Object.assign({},t)),i}function AB(r){return!get(r,["nodes","length"])&&!get(r,["edges","length"])&&!get(r,["combos","length"])}function Bu(r={},e={}){const{states:t=[],data:n={},style:i={},children:a=[]}=r,s=ah(r,["states","data","style","children"]),{states:o=[],data:l={},style:u={},children:c=[]}=e,h=ah(e,["states","data","style","children"]),d=(v,p)=>v.length!==p.length?!1:v.every((x,A)=>x===p[A]),f=(v,p)=>{const x=Object.keys(v),A=Object.keys(p);return x.length!==A.length?!1:x.every(N=>v[N]===p[N])};return!(!f(s,h)||!d(a,c)||!d(t,o)||!f(n,l)||!f(i,u))}var v4=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function ym(r){const{id:e=Re(r),style:t,data:n}=r,i=v4(r,["id","style","data"]),a=Object.assign(Object.assign({},r),{style:Object.assign({},t),data:Object.assign({},n)});return I_(r)?Object.assign({id:e,data:a},i):{id:e,data:a}}function Ci(r){return r.data}function g4(r){if(r.hasTreeStructure(es))return;r.attachTreeStructure(es);const e=r.getAllEdges();for(const t of e){const{source:n,target:i}=t;r.setParent(i,n,es)}}class p4{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new _i.k}pushChange(e){if(this.isTraceless)return;const{type:t}=e;if(t===Qr.NodeUpdated||t===Qr.EdgeUpdated||t===Qr.ComboUpdated){const{value:n,original:i}=e;this.changes.push({value:mm(n),original:mm(i),type:t})}else this.changes.push({value:mm(e.value),type:t})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(e){this.batchCount++,this.model.batch(e),this.batchCount--}isBatching(){return this.batchCount>0}silence(e){this.isTraceless=!0,e(),this.isTraceless=!1}isCombo(e){return this.comboIds.has(e)||this.latestRemovedComboIds.has(e)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Ci(n);return this.isCombo(Re(i))||(e===void 0||e.includes(Re(i)))&&t.push(i),t},[])}getEdgeDatum(e){return Ci(this.model.getEdge(e))}getEdgeData(e){return this.model.getAllEdges().reduce((t,n)=>{const i=Ci(n);return(e===void 0||e.includes(Re(i)))&&t.push(i),t},[])}getComboData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Ci(n);return this.isCombo(Re(i))&&(e===void 0||e.includes(Re(i)))&&t.push(i),t},[])}getRootsData(e=es){return this.model.getRoots(e).map(Ci)}getAncestorsData(e,t){const{model:n}=this;return!n.hasNode(e)||!n.hasTreeStructure(t)?[]:n.getAncestors(e,t).map(Ci)}getDescendantsData(e){const t=this.getElementDataById(e),n=[];return yl(t,i=>{i!==t&&n.push(i)},i=>this.getChildrenData(Re(i)),"TB"),n}getParentData(e,t){const{model:n}=this;if(!t){da.warn("The hierarchy structure key is not specified");return}if(!n.hasNode(e)||!n.hasTreeStructure(t))return;const i=n.getParent(e,t);return i?Ci(i):void 0}getChildrenData(e){const t=this.getElementType(e)==="node"?es:Ir,{model:n}=this;return!n.hasNode(e)||!n.hasTreeStructure(t)?[]:n.getChildren(e,t).map(Ci)}getElementsDataByType(e){return e==="node"?this.getNodeData():e==="edge"?this.getEdgeData():e==="combo"?this.getComboData():[]}getElementDataById(e){return this.getElementType(e)==="edge"?this.getEdgeDatum(e):this.getNodeLikeDatum(e)}getNodeLikeDatum(e){const t=this.model.getNode(e);return Ci(t)}getNodeLikeData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Ci(n);return e?e.includes(Re(i))&&t.push(i):t.push(i),t},[])}getElementDataByState(e,t){return this.getElementsDataByType(e).filter(i=>{var a;return(a=i.states)===null||a===void 0?void 0:a.includes(t)})}getElementState(e){var t;return((t=this.getElementDataById(e))===null||t===void 0?void 0:t.states)||[]}hasNode(e){return this.model.hasNode(e)&&!this.isCombo(e)}hasEdge(e){return this.model.hasEdge(e)}hasCombo(e){return this.model.hasNode(e)&&this.isCombo(e)}getRelatedEdgesData(e,t="both"){return this.model.getRelatedEdges(e,t).map(Ci)}getNeighborNodesData(e){return this.model.getNeighbors(e).map(Ci)}setData(e){const{nodes:t=[],edges:n=[],combos:i=[]}=e,{nodes:a,edges:s,combos:o}=this.getData(),l=Lo(a,t,h=>Re(h),Bu),u=Lo(s,n,h=>Re(h),Bu),c=Lo(o,i,h=>Re(h),Bu);this.batch(()=>{const h={nodes:l.enter,edges:u.enter,combos:c.enter};this.addData(h),this.computeZIndex(h,"add",!0);const d={nodes:l.update,edges:u.update,combos:c.update};this.updateData(d),this.computeZIndex(d,"update",!0);const f={nodes:l.exit.map(Re),edges:u.exit.map(Re),combos:c.exit.map(Re)};this.removeData(f)})}addData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.addComboData(i),this.addNodeData(t),this.addEdgeData(n)}),this.computeZIndex(e,"add")}addNodeData(e=[]){e.length&&(this.model.addNodes(e.map(t=>(this.pushChange({value:t,type:Qr.NodeAdded}),ym(t)))),this.updateNodeLikeHierarchy(e),this.computeZIndex({nodes:e},"add"))}addEdgeData(e=[]){e.length&&(this.model.addEdges(e.map(t=>(this.pushChange({value:t,type:Qr.EdgeAdded}),ym(t)))),this.computeZIndex({edges:e},"add"))}addComboData(e=[]){if(!e.length)return;const{model:t}=this;t.hasTreeStructure(Ir)||t.attachTreeStructure(Ir),t.addNodes(e.map(n=>(this.comboIds.add(Re(n)),this.pushChange({value:n,type:Qr.ComboAdded}),ym(n)))),this.updateNodeLikeHierarchy(e),this.computeZIndex({combos:e},"add")}addChildrenData(e,t){const n=this.getNodeLikeDatum(e),i=t.map(Re);this.addNodeData(t),this.updateNodeData([{id:e,children:[...n.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:e,target:a})))}computeZIndex(e,t,n=!1){!n&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:s=[]}=e;s.forEach(o=>{var l,u,c;const h=Re(o);if(t==="add"&&(0,bt.Z)((l=o.style)===null||l===void 0?void 0:l.zIndex)||t==="update"&&!("combo"in o))return;const d=this.getParentData(h,Ir),f=d?((c=(u=d.style)===null||u===void 0?void 0:u.zIndex)!==null&&c!==void 0?c:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:h,style:{zIndex:f}}])})}),i.forEach(o=>{var l,u,c;const h=Re(o);if(t==="add"&&(0,bt.Z)((l=o.style)===null||l===void 0?void 0:l.zIndex)||t==="update"&&!("combo"in o)&&!("children"in o))return;let d=0;const f=this.getParentData(h,Ir);if(f)d=(((u=f.style)===null||u===void 0?void 0:u.zIndex)||0)+1;else{const v=this.getParentData(h,es);v&&(d=((c=v==null?void 0:v.style)===null||c===void 0?void 0:c.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:h,style:{zIndex:d}}])})}),a.forEach(o=>{var l,u,c,h,d;if((0,bt.Z)((l=o.style)===null||l===void 0?void 0:l.zIndex))return;let{id:f,source:v,target:p}=o;if(!f)f=Re(o);else{const N=this.getEdgeDatum(f);v=N.source,p=N.target}if(!v||!p)return;const x=((c=(u=this.getNodeLikeDatum(v))===null||u===void 0?void 0:u.style)===null||c===void 0?void 0:c.zIndex)||0,A=((d=(h=this.getNodeLikeDatum(p))===null||h===void 0?void 0:h.style)===null||d===void 0?void 0:d.zIndex)||0;this.updateEdgeData([{id:Re(o),style:{zIndex:Math.max(x,A)-1}}])})})}getFrontZIndex(e){var t;const n=this.getElementType(e),i=this.getElementDataById(e),a=this.getData();if(Object.assign(a,{[`${n}s`]:a[`${n}s`].filter(s=>Re(s)!==e)}),n==="combo"&&!Oa(i)){const s=new Set(this.getAncestorsData(e,Ir).map(Re));a.nodes=a.nodes.filter(o=>!s.has(Re(o))),a.combos=a.combos.filter(o=>!s.has(Re(o))),a.edges=a.edges.filter(({source:o,target:l})=>!s.has(o)&&!s.has(l))}return Math.max(((t=i.style)===null||t===void 0?void 0:t.zIndex)||0,0,...Object.values(a).flat().map(s=>{var o;return(((o=s==null?void 0:s.style)===null||o===void 0?void 0:o.zIndex)||0)+1}))}updateNodeLikeHierarchy(e){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:t}=this;e.forEach(n=>{const i=Re(n);wd(n)&&(t.hasTreeStructure(Ir)||t.attachTreeStructure(Ir),this.setParent(i,wd(n),Ir));const s=n.children||[];if(s.length){t.hasTreeStructure(es)||t.attachTreeStructure(es);const o=s.filter(l=>t.hasNode(l));o.forEach(l=>this.setParent(l,i,es)),o.length!==s.length&&this.updateNodeData([{id:i,children:o}])}})}preventUpdateNodeLikeHierarchy(e){this.enableUpdateNodeLikeHierarchy=!1,e(),this.enableUpdateNodeLikeHierarchy=!0}updateData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.updateNodeData(t),this.updateComboData(i),this.updateEdgeData(n)}),this.computeZIndex(e,"update")}updateNodeData(e=[]){if(!e.length)return;const{model:t}=this;this.batch(()=>{const n=[];e.forEach(i=>{const a=Re(i),s=Ci(t.getNode(a));if(Bu(s,i))return;const o=Qo(s,i);this.pushChange({value:o,original:s,type:Qr.NodeUpdated}),t.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({nodes:e},"update")}refreshData(){const{nodes:e,edges:t,combos:n}=this.getData();e.forEach(i=>{this.pushChange({value:i,original:i,type:Qr.NodeUpdated})}),t.forEach(i=>{this.pushChange({value:i,original:i,type:Qr.EdgeUpdated})}),n.forEach(i=>{this.pushChange({value:i,original:i,type:Qr.ComboUpdated})})}syncNodeDatum(e){const{model:t}=this,n=Re(e),i=Ci(t.getNode(n)),a=Qo(i,e);t.mergeNodeData(n,a)}updateEdgeData(e=[]){if(!e.length)return;const{model:t}=this;this.batch(()=>{e.forEach(n=>{const i=Re(n),a=Ci(t.getEdge(i));if(Bu(a,n))return;n.source&&a.source!==n.source&&t.updateEdgeSource(i,n.source),n.target&&a.target!==n.target&&t.updateEdgeTarget(i,n.target);const s=Qo(a,n);this.pushChange({value:s,original:a,type:Qr.EdgeUpdated}),t.mergeEdgeData(i,s)})}),this.computeZIndex({edges:e},"update")}updateComboData(e=[]){if(!e.length)return;const{model:t}=this;t.batch(()=>{const n=[];e.forEach(i=>{const a=Re(i),s=Ci(t.getNode(a));if(Bu(s,i))return;const o=Qo(s,i);this.pushChange({value:o,original:s,type:Qr.ComboUpdated}),t.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({combos:e},"update")}setParent(e,t,n,i=!0){if(e===t)return;const a=this.getNodeLikeDatum(e),s=wd(a);if(s!==t&&n===Ir){const o={id:e,combo:t};this.isCombo(e)?this.syncComboDatum(o):this.syncNodeDatum(o)}this.model.setParent(e,t,n),i&&n===Ir&&(0,f4.Z)([s,t]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(e){const t=this.getComboData([e])[0],n=this.getAncestorsData(e,Ir);t&&this.pushChange({value:t,original:t,type:Qr.ComboUpdated}),n.forEach(i=>{this.pushChange({value:i,original:i,type:Qr.ComboUpdated})})}syncComboDatum(e){const{model:t}=this,n=Re(e);if(!t.hasNode(n))return;const i=Ci(t.getNode(n)),a=Qo(i,e);t.mergeNodeData(n,a)}getElementPosition(e){const t=this.getElementDataById(e);return Fi(t)}translateNodeLikeBy(e,t){this.isCombo(e)?this.translateComboBy(e,t):this.translateNodeBy(e,t)}translateNodeLikeTo(e,t){this.isCombo(e)?this.translateComboTo(e,t):this.translateNodeTo(e,t)}translateNodeBy(e,t){const n=this.getElementPosition(e),i=Qn(n,[...t,0].slice(0,3));this.translateNodeTo(e,i)}translateNodeTo(e,t){const[n=0,i=0,a=0]=t;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:e,style:{x:n,y:i,z:a}}])})}translateComboBy(e,t){const[n=0,i=0,a=0]=t;if([n,i,a].some(isNaN)||[n,i,a].every(l=>l===0))return;const s=this.getComboData([e])[0];if(!s)return;const o=new Set;yl(s,l=>{const u=Re(l);if(o.has(u))return;o.add(u);const[c,h,d]=Fi(l),f=Qo(l,{style:{x:c+n,y:h+i,z:d+a}});this.pushChange({value:f,original:l,type:this.isCombo(u)?Qr.ComboUpdated:Qr.NodeUpdated}),this.model.mergeNodeData(u,f)},l=>this.getChildrenData(Re(l)),"BT")}translateComboTo(e,t){var n;if(t.some(isNaN))return;const[i=0,a=0,s=0]=t,o=(n=this.getComboData([e]))===null||n===void 0?void 0:n[0];if(!o)return;const[l,u,c]=Fi(o),h=i-l,d=a-u,f=s-c;yl(o,v=>{const p=Re(v),[x,A,N]=Fi(v),I=Qo(v,{style:{x:x+h,y:A+d,z:N+f}});this.pushChange({value:I,original:v,type:this.isCombo(p)?Qr.ComboUpdated:Qr.NodeUpdated}),this.model.mergeNodeData(p,I)},v=>this.getChildrenData(Re(v)),"BT")}removeData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.removeEdgeData(n),this.removeNodeData(t),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(e=[]){e.length&&this.batch(()=>{e.forEach(t=>{this.removeEdgeData(this.getRelatedEdgesData(t).map(Re)),this.pushChange({value:this.getNodeData([t])[0],type:Qr.NodeRemoved}),this.removeNodeLikeHierarchy(t)}),this.model.removeNodes(e)})}removeEdgeData(e=[]){e.length&&(e.forEach(t=>this.pushChange({value:this.getEdgeData([t])[0],type:Qr.EdgeRemoved})),this.model.removeEdges(e))}removeComboData(e=[]){e.length&&this.batch(()=>{e.forEach(t=>{this.pushChange({value:this.getComboData([t])[0],type:Qr.ComboRemoved}),this.removeNodeLikeHierarchy(t),this.comboIds.delete(t)}),this.model.removeNodes(e)})}removeNodeLikeHierarchy(e){if(this.model.hasTreeStructure(Ir)){const t=wd(this.getNodeLikeDatum(e));this.setParent(e,void 0,Ir,!1),this.model.getChildren(e,Ir).forEach(n=>{const i=Ci(n),a=Re(i);this.setParent(Re(i),t,Ir,!1);const s=Qo(i,{id:Re(i),combo:t});this.pushChange({value:s,original:i,type:this.isCombo(a)?Qr.ComboUpdated:Qr.NodeUpdated}),this.model.mergeNodeData(Re(i),s)}),(0,Yt.Z)(t)||this.refreshComboData(t)}}getElementType(e){if(this.model.hasNode(e))return this.isCombo(e)?"combo":"node";if(this.model.hasEdge(e))return"edge";throw new Error(oo(`Unknown element type of id: ${e}`))}destroy(){const{model:e}=this,t=e.getAllNodes(),n=e.getAllEdges();e.removeEdges(n.map(i=>i.id)),e.removeNodes(t.map(i=>i.id)),this.context={}}}var Dv=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class m4{constructor(e){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=e}init(){if(!this.container){const{canvas:e}=this.context;this.container=e.appendChild(new eu({className:"elements"}))}}emit(e,t){t.silence||Wi(this.context.graph,e)}forEachElementData(e){ml.forEach(t=>{const n=this.context.model.getElementsDataByType(t);e(t,n)})}getElementType(e,t){var n;const{options:i,graph:a}=this.context,s=((n=i[e])===null||n===void 0?void 0:n.type)||t.type;return s?typeof s=="string"?s:s.call(a,t):e==="edge"?"line":"circle"}getTheme(e){return ky(this.context.options)[e]||{}}getThemeStyle(e){return this.getTheme(e).style||{}}getThemeStateStyle(e,t){const{state:n={}}=this.getTheme(e);return Object.assign({},...t.map(i=>n[i]||{}))}computePaletteStyle(){const{options:e}=this.context;this.paletteStyle={},this.forEachElementData((t,n)=>{var i,a;const s=Object.assign({},t1((i=this.getTheme(t))===null||i===void 0?void 0:i.palette),t1((a=e[t])===null||a===void 0?void 0:a.palette));s!=null&&s.field&&Object.assign(this.paletteStyle,pM(n,s))})}getPaletteStyle(e,t){const n=this.paletteStyle[t];return n?e==="edge"?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(e,t){var n;const{options:i}=this.context,a=((n=i[e])===null||n===void 0?void 0:n.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[Re(t.datum)]=Jy(a,t)}computeElementsDefaultStyle(e){const{graph:t}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];(e===void 0||e.includes(Re(o)))&&this.computeElementDefaultStyle(n,{datum:o,graph:t})}})}getDefaultStyle(e){return this.defaultStyle[e]||{}}getElementState(e){try{const{model:t}=this.context;return t.getElementState(e)}catch(t){return[]}}getElementStateStyle(e,t,n){var i,a;const{options:s}=this.context,o=((a=(i=s[e])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[t])||{};return Jy(o,n)}computeElementStatesStyle(e,t,n){this.stateStyle[Re(n.datum)]=Object.assign({},...t.map(i=>this.getElementStateStyle(e,i,n)))}computeElementsStatesStyle(e){const{graph:t}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];if(e===void 0||e.includes(Re(o))){const l=this.getElementState(Re(o));this.computeElementStatesStyle(n,l,{datum:o,graph:t})}}})}getStateStyle(e){return this.stateStyle[e]||{}}computeStyle(e,t){e&&["translate","zIndex"].includes(e)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(t),this.computeElementsStatesStyle(t))}getElement(e){return this.elementMap[e]}getNodes(){return this.context.model.getNodeData().map(({id:e})=>this.elementMap[e])}getEdges(){return this.context.model.getEdgeData().map(e=>this.elementMap[Re(e)])}getCombos(){return this.context.model.getComboData().map(({id:e})=>this.elementMap[e])}getElementComputedStyle(e,t){const n=Re(t),i=this.getThemeStyle(e),a=this.getPaletteStyle(e,n),s=t.style||{},o=this.getDefaultStyle(n),l=this.getThemeStateStyle(e,this.getElementState(n)),u=this.getStateStyle(n),c=Object.assign({},i,a,s,o,l,u);if(e==="combo"){const h=this.context.model.getChildrenData(n),f=!!c.collapsed?[]:h.map(Re).filter(v=>this.getElement(v));Object.assign(c,{childrenNode:f,childrenData:h})}return c}draw(e={animation:!0}){this.init();const t=this.computeChangesAndDrawData(e);if(!t)return null;const{type:n="draw",stage:i=n,animation:a,silence:s}=e,{dataChanges:o,drawData:l}=t;this.markDestroyElement(l),this.computeStyle(i);const{add:u,update:c,remove:h}=l;return this.destroyElements(h,e),this.createElements(u,e),this.updateElements(c,e),this.context.animation.animate(a,s?{}:{before:()=>this.emit(new Ai(sn.BEFORE_DRAW,{dataChanges:o,animation:a,stage:i,render:n==="render"}),e),beforeAnimate:d=>this.emit(new hs(sn.BEFORE_ANIMATE,ha.DRAW,d,l),e),afterAnimate:d=>this.emit(new hs(sn.AFTER_ANIMATE,ha.DRAW,d,l),e),after:()=>this.emit(new Ai(sn.AFTER_DRAW,{dataChanges:o,animation:a,stage:i,render:n==="render",firstRender:this.context.graph.rendered===!1}),e)})}computeChangesAndDrawData(e){const{model:t}=this.context,n=t.getChanges(),i=n0(n);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:s=[],NodeRemoved:o=[],EdgeAdded:l=[],EdgeUpdated:u=[],EdgeRemoved:c=[],ComboAdded:h=[],ComboUpdated:d=[],ComboRemoved:f=[]}=(0,xd.Z)(i,A=>A.type),v=A=>new Map(A.map(N=>{const I=N.value;return[Re(I),I]})),p={add:{nodes:v(a),edges:v(l),combos:v(h)},update:{nodes:v(s),edges:v(u),combos:v(d)},remove:{nodes:v(o),edges:v(c),combos:v(f)}},x=this.transformData(p,e);return t.clearChanges(),{dataChanges:n,drawData:x}}transformData(e,t){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce((i,a)=>a.beforeDraw(i,t),e)}createElement(e,t,n){var i;const a=Re(t);if(this.getElement(a))return;const o=this.getElementType(e,t),l=this.getElementComputedStyle(e,t),u=so(e,o);if(!u)return da.warn(`The element ${o} of ${e} is not registered.`);this.emit(new Iu(sn.BEFORE_ELEMENT_CREATE,e,t),n);const c=this.container.appendChild(new u({id:a,context:this.context,style:Object.assign({},l)}));this.shapeTypeMap[a]=o,this.elementMap[a]=c;const{stage:h="enter"}=n;(i=this.context.animation)===null||i===void 0||i.add({element:c,elementType:e,stage:h,originalStyle:Object.assign({},c.attributes),updatedStyle:l},{after:()=>{var d;this.emit(new Iu(sn.AFTER_ELEMENT_CREATE,e,t),n),(d=c.onCreate)===null||d===void 0||d.call(c)}})}createElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(u=>this.createElement(o,u,t))})}getUpdateStageStyle(e,t,n){const{stage:i="update"}=n;if(i==="translate")if(e==="node"||e==="combo"){const{style:{x:a=0,y:s=0,z:o=0}={}}=t;return{x:a,y:s,z:o}}else return{};return this.getElementComputedStyle(e,t)}updateElement(e,t,n){var i;const a=Re(t),{stage:s="update"}=n,o=this.getElement(a);if(!o)return()=>null;this.emit(new Iu(sn.BEFORE_ELEMENT_UPDATE,e,t),n);const l=this.getElementType(e,t),u=this.getUpdateStageStyle(e,t,n);this.shapeTypeMap[a]!==l&&(o.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(e,t,{animation:!1,silence:!0}));const c=s!=="visibility"?s:u.visibility==="hidden"?"hide":"show";c==="hide"&&delete u.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:e,stage:c,originalStyle:Object.assign({},o.attributes),updatedStyle:u},{before:()=>{const h=this.elementMap[a];s!=="collapse"&&Pp(h,u),s==="visibility"&&(u4(h,"opacity")||l4(h,"opacity"),this.visibilityCache.set(h,c==="show"?"visible":"hidden"),c==="show"&&gl(h,"visible"))},after:()=>{var h;const d=this.elementMap[a];s==="collapse"&&Pp(d,u),c==="hide"&&gl(d,this.visibilityCache.get(d)),this.emit(new Iu(sn.AFTER_ELEMENT_UPDATE,e,t),n),(h=d.onUpdate)===null||h===void 0||h.call(d)}})}updateElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(u=>this.updateElement(o,u,t))})}markDestroyElement(e){Object.values(e.remove).forEach(t=>{t.forEach(n=>{const i=Re(n),a=this.getElement(i);a&&eO(a)})})}destroyElement(e,t,n){var i;const{stage:a="exit"}=n,s=Re(t),o=this.elementMap[s];if(!o)return()=>null;this.emit(new Iu(sn.BEFORE_ELEMENT_DESTROY,e,t),n),(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:e,stage:a,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var l;this.clearElement(s),o.destroy(),(l=o.onDestroy)===null||l===void 0||l.call(o),this.emit(new Iu(sn.AFTER_ELEMENT_DESTROY,e,t),n)}})}destroyElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["combo",a],["edge",i],["node",n]].forEach(([o,l])=>{l.forEach(u=>this.destroyElement(o,u,t))})}clearElement(e){delete this.paletteStyle[e],delete this.defaultStyle[e],delete this.stateStyle[e],delete this.elementMap[e],delete this.shapeTypeMap[e]}collapseNode(e,t){return Dv(this,void 0,void 0,function*(){var n;const{model:i,layout:a}=this.context,s=this.computeChangesAndDrawData({stage:"collapse",animation:t});if(!s)return;this.markDestroyElement(s.drawData);const o=yield a.simulate();i.updateData(o);const l=this.computeChangesAndDrawData({stage:"collapse",animation:t});if(!l)return;const{drawData:u}=l,{add:c,remove:h,update:d}=u;this.markDestroyElement(u);const f={animation:t,stage:"collapse",data:u};this.destroyElements(h,f),this.createElements(c,f),this.updateElements(d,f),yield(n=this.context.animation.animate(t,{beforeAnimate:v=>this.emit(new hs(sn.BEFORE_ANIMATE,ha.COLLAPSE,v,u),f),afterAnimate:v=>this.emit(new hs(sn.AFTER_ANIMATE,ha.COLLAPSE,v,u),f)},{collapse:{target:e,descendants:Array.from(h.nodes).map(([,v])=>Re(v)),position:Fi(d.nodes.get(e))}}))===null||n===void 0?void 0:n.finished})}expandNode(e,t){return Dv(this,void 0,void 0,function*(){var n;const{model:i,layout:a}=this.context;if(!i.getAncestorsData(e,Ir).every(v=>Oa(v)))return;const s=Fi(i.getNodeData([e])[0]),o=this.computeChangesAndDrawData({stage:"expand",animation:t});if(!o)return;const{drawData:{add:l}}=o;this.createElements(l,{animation:!1,stage:"expand",target:e}),this.context.animation.clear();const u=yield a.simulate();i.updateData(u),this.computeStyle("expand");const c=this.computeChangesAndDrawData({stage:"collapse",animation:t});if(!c)return;const{drawData:h}=c,{update:d}=h,f={animation:t,stage:"expand",data:h};l.edges.forEach(v=>d.edges.set(Re(v),v)),l.nodes.forEach(v=>d.nodes.set(Re(v),v)),this.updateElements(d,f),yield(n=this.context.animation.animate(t,{beforeAnimate:v=>this.emit(new hs(sn.BEFORE_ANIMATE,ha.EXPAND,v,h),f),afterAnimate:v=>this.emit(new hs(sn.AFTER_ANIMATE,ha.EXPAND,v,h),f)},{expand:{target:e,descendants:Array.from(l.nodes).map(([,v])=>Re(v)),position:s}}))===null||n===void 0?void 0:n.finished})}collapseCombo(e,t){return Dv(this,void 0,void 0,function*(){var n;const{model:i,element:a}=this.context;if(i.getAncestorsData(e,Ir).some(p=>Oa(p)))return;const s=a.getElement(e),o=s.getComboPosition(Object.assign(Object.assign({},s.attributes),{collapsed:!0})),l=this.computeChangesAndDrawData({stage:"collapse",animation:t});if(!l)return;const{dataChanges:u,drawData:c}=l;this.markDestroyElement(c);const{update:h,remove:d}=c,f={animation:t,stage:"collapse",data:c};this.destroyElements(d,f),this.updateElements(h,f);const v=p=>Array.from(p).map(([,x])=>Re(x));yield(n=this.context.animation.animate(t,{before:()=>this.emit(new Ai(sn.BEFORE_DRAW,{dataChanges:u,animation:t}),f),beforeAnimate:p=>this.emit(new hs(sn.BEFORE_ANIMATE,ha.COLLAPSE,p,c),f),afterAnimate:p=>this.emit(new hs(sn.AFTER_ANIMATE,ha.COLLAPSE,p,c),f),after:()=>this.emit(new Ai(sn.AFTER_DRAW,{dataChanges:u,animation:t}),f)},{collapse:{target:e,descendants:[...v(d.nodes),...v(d.combos)],position:o}}))===null||n===void 0?void 0:n.finished})}expandCombo(e,t){return Dv(this,void 0,void 0,function*(){var n;const{model:i}=this.context,a=Fi(i.getComboData([e])[0]);this.computeStyle("expand");const s=this.computeChangesAndDrawData({stage:"expand",animation:t});if(!s)return;const{dataChanges:o,drawData:l}=s,{add:u,update:c}=l,h={animation:t,stage:"expand",data:l,target:e};this.createElements(u,h),this.updateElements(c,h);const d=f=>Array.from(f).map(([,v])=>Re(v));yield(n=this.context.animation.animate(t,{before:()=>this.emit(new Ai(sn.BEFORE_DRAW,{dataChanges:o,animation:t}),h),beforeAnimate:f=>this.emit(new hs(sn.BEFORE_ANIMATE,ha.EXPAND,f,l),h),afterAnimate:f=>this.emit(new hs(sn.AFTER_ANIMATE,ha.EXPAND,f,l),h),after:()=>this.emit(new Ai(sn.AFTER_DRAW,{dataChanges:o,animation:t}),h)},{expand:{target:e,descendants:[...d(u.nodes),...d(u.combos)],position:a}}))===null||n===void 0?void 0:n.finished})}destroy(){this.container.destroy(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={},this.context={}}}var k2=g(54375);class y4 extends e0.Z{constructor(e,t,n){super(),this.graph=e,this.layout=t,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=k2.Ud(new Worker(new URL(g.p+g.u(7509),g.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var e;return Jn(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const t=this.layout.options,{onTick:n}=t,i=Eb(t,["onTick"]),a={};Object.keys(i).forEach(u=>{(0,At.Z)(i[u])||(a[u]=i[u])});const s={layout:{id:this.layout.id,options:a,iterations:(e=this.options)===null||e===void 0?void 0:e.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[l]=yield this.proxy.calculateLayout(s,[o]);return l})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[k2.Yy]()}isRunning(){return this.running}}var sh=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})},b4=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class x4{get presetOptions(){return{animation:!!Ty(this.context.options,!0)}}get options(){const{options:e}=this.context;return e.layout}constructor(e){this.instances=[],this.context=e}getLayoutInstance(){return this.instances}layout(){return sh(this,void 0,void 0,function*(){if(!this.options)return;const e=Array.isArray(this.options)?this.options:[this.options],{graph:t}=this.context;Wi(t,new Ai(sn.BEFORE_LAYOUT));for(const n of e){const i=e.indexOf(n),a=this.getLayoutData(n),s=Object.assign(Object.assign({},this.presetOptions),n);Wi(t,new Ai(sn.BEFORE_STAGE_LAYOUT,{options:s,index:i}));const o=yield this.stepLayout(a,s,i);Wi(t,new Ai(sn.AFTER_STAGE_LAYOUT,{options:s,index:i})),n.animation||this.updateElementPosition(o,!1)}Wi(t,new Ai(sn.AFTER_LAYOUT)),this.transformDataAfterLayout()})}transformDataAfterLayout(){const e=this.context.transform.getTransformInstance();Object.values(e).forEach(t=>t.afterLayout())}simulate(){return sh(this,void 0,void 0,function*(){if(!this.options)return{};const e=Array.isArray(this.options)?this.options:[this.options];let t={};for(const n of e){const i=e.indexOf(n),a=this.getLayoutData(n);t=yield this.stepLayout(a,Object.assign(Object.assign(Object.assign({},this.presetOptions),n),{animation:!1}),i)}return t})}stepLayout(e,t,n){return sh(this,void 0,void 0,function*(){return oO(t)?yield this.treeLayout(e,t,n):yield this.graphLayout(e,t,n)})}graphLayout(e,t,n){return sh(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:s=300}=t,o=this.initGraphLayout(t);if(!o)return{};if(this.instances[n]=o,this.instance=o,a){const u=o;return this.supervisor=new y4(u.graphData2LayoutModel(e),u.instance,{iterations:s}),vf(yield this.supervisor.execute())}if(Kp(o))return i?yield o.execute(e,{onTick:u=>{this.updateElementPosition(u,!1)}}):(o.execute(e),o.stop(),o.tick(s));const l=yield o.execute(e);if(i){const u=this.updateElementPosition(l,i);yield u==null?void 0:u.finished}return l})}treeLayout(e,t,n){return sh(this,void 0,void 0,function*(){const{type:i,animation:a}=t,s=so("layout",i);if(!s)return{};const{nodes:o=[],edges:l=[]}=e,u=new _i.k({nodes:o.map(v=>({id:Re(v),data:v.data||{}})),edges:l.map(v=>({id:Re(v),source:v.source,target:v.target,data:v.data||{}}))});g4(u);const c={nodes:[],edges:[]},h={nodes:[],edges:[]};u.getRoots(es).forEach(v=>{yl(v,I=>{I.children=u.getSuccessors(I.id)},I=>u.getSuccessors(I.id),"TB");const p=s(v,t),{x,y:A,z:N=0}=p;yl(p,I=>{const{id:K,x:W,y:z,z:j=0}=I;c.nodes.push({id:K,style:{x,y:A,z:N}}),h.nodes.push({id:K,style:{x:W,y:z,z:j}})},I=>I.children,"TB")});const f=this.inferTreeLayoutOffset(h);if(T2(h,f),a){T2(c,f),this.updateElementPosition(c,!1);const v=this.updateElementPosition(h,a);yield v==null?void 0:v.finished}return h})}inferTreeLayoutOffset(e){var t;let[n,i]=[1/0,-1/0],[a,s]=[1/0,-1/0];(t=e.nodes)===null||t===void 0||t.forEach(p=>{const{x=0,y:A=0}=p.style||{};n=Math.min(n,x),i=Math.max(i,x),a=Math.min(a,A),s=Math.max(s,A)});const{canvas:o}=this.context,l=o.getSize(),[u,c]=o.getCanvasByViewport([0,0]),[h,d]=o.getCanvasByViewport(l);if(n>=u&&i<=h&&a>=c&&s<=d)return[0,0];const f=(u+h)/2,v=(c+d)/2;return[f-(n+i)/2,v-(a+s)/2]}stopLayout(){this.instance&&Kp(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(e){const{nodeFilter:t=()=>!0}=e,{nodes:n,edges:i,combos:a}=this.context.model.getData(),s=c=>this.context.element.getElement(c),o=n.filter(c=>{const h=Re(c),d=s(h);return!d||lf(d)?!1:t(c)}),l=new Map(o.map(c=>[Re(c),c])),u=i.filter(c=>{const{source:h,target:d}=c;return!(!l.has(h)||!l.has(d))});return{nodes:o,edges:u,combos:a}}initGraphLayout(e){var t;const{element:n,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:l}=e,u=b4(e,["type","enableWorker","animation","iterations"]),[c,h]=i.getCanvasSize(),d=[c/2,h/2],f=(t=e==null?void 0:e.nodeSize)!==null&&t!==void 0?t:N=>{const I=n==null?void 0:n.getElement(N.id),{size:K}=(I==null?void 0:I.attributes)||{};return K},v=so("layout",a);if(!v)return da.warn(`The layout of ${a} is not registered.`);const p=Object.getPrototypeOf(v.prototype)===Np.prototype?v:lO(v,this.context),x=new p(this.context),A={nodeSize:f,width:c,height:h,center:d};switch(x.id){case"d3-force":case"d3-force-3d":Object.assign(A,{center:{x:c/2,y:h/2,z:0}});break;default:break}return(0,Ta.Z)(x.options,A,u),x}updateElementPosition(e,t){const{model:n,element:i}=this.context;return i?(n.updateData(e),i.draw({animation:t,silence:!0})):null}destroy(){var e;this.stopLayout(),this.context={},(e=this.supervisor)===null||e===void 0||e.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const T2=(r,e)=>{var t;const[n,i]=e;(t=r.nodes)===null||t===void 0||t.forEach(a=>{if(a.style){const{x:s=0,y:o=0}=a.style;a.style.x=s+n,a.style.y=o+i}else a.style={x:n,y:i}})};class E4 extends Xg{constructor(e){super(e),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(e){this.setExtensions(e)}getPluginInstance(e){const t=this.extensionMap[e];if(t)return t;da.warn(`Cannot find the plugin ${e}, will try to find it by type.`);const n=this.extensions.find(i=>i.type===e);if(n)return this.extensionMap[n.key]}}const Iv=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class w4 extends Xg{constructor(e){super(e),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(e){this.setExtensions([...Iv.slice(0,Iv.length-1),...e,Iv[Iv.length-1]])}getTransformInstance(e){return e?this.extensionMap[e]:this.extensionMap}}var oh=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class S4{get padding(){return Ws(this.context.options.padding)}get paddingOffset(){const[e,t,n,i]=this.padding,[a,s,o]=[(i-t)/2,(e-n)/2,0];return[a,s,o]}constructor(e){this.landmarkCounter=0,this.context=e;const[t,n]=this.paddingOffset,{zoom:i,rotation:a,x:s=t,y:o=n}=e.options;this.transform({mode:"absolute",scale:i,translate:[s,o],rotate:a},!1)}get camera(){const{canvas:e}=this.context;return new Proxy(e.getCamera(),{get:(t,n)=>{const a=Object.entries(e.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),s=t[n];if(typeof s=="function")return(...o)=>{const l=s.apply(t,o);return a.forEach(u=>{u[n].apply(u,o)}),l}}})}createLandmark(e){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,e)}getAnimation(e){const t=Ty(this.context.options,e);return t?(0,El.Z)(Object.assign({},t),["easing","duration"]):!1}getCanvasSize(){const{canvas:e}=this.context,{width:t=0,height:n=0}=e.getConfig();return[t,n]}getCanvasCenter(){const{canvas:e}=this.context,{width:t=0,height:n=0}=e.getConfig();return[t/2,n/2,0]}getViewportCenter(){const[e,t]=this.camera.getPosition();return[e,t,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(e){const{camera:t}=this,{mode:n,translate:i=[]}=e,a=this.getZoom(),s=t.getPosition(),o=t.getFocalPoint(),[l,u]=this.getCanvasCenter(),[c=0,h=0,d=0]=i,f=ys([-c,-h,-d],a);return n==="relative"?{position:Qn(s,f),focalPoint:Qn(o,f)}:{position:Qn([l,u,s[2]],f),focalPoint:Qn([l,u,o[2]],f)}}getRotateOptions(e){const{mode:t,rotate:n=0}=e;return{roll:t==="relative"?this.camera.getRoll()+n:n}}getZoomOptions(e){const{zoomRange:t}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:a=1}=e;return(0,Kt.Z)(i==="relative"?n*a:a,...t)}transform(e,t){return oh(this,void 0,void 0,function*(){const{graph:n}=this.context,{translate:i,rotate:a,scale:s,origin:o}=e;this.cancelAnimation();const l=this.getAnimation(t);if(Wi(n,new Rv(sn.BEFORE_TRANSFORM,e)),!a&&s&&!i&&o&&!l){this.camera.setZoomByViewportPoint(this.getZoomOptions(e),o),Wi(n,new Rv(sn.AFTER_TRANSFORM,e));return}const u={};if(i&&Object.assign(u,this.getTranslateOptions(e)),(0,bt.Z)(a)&&Object.assign(u,this.getRotateOptions(e)),(0,bt.Z)(s)&&Object.assign(u,{zoom:this.getZoomOptions(e)}),l)return Wi(n,new hs(sn.BEFORE_ANIMATE,ha.TRANSFORM,null,e)),new Promise(c=>{this.transformResolver=c,this.camera.gotoLandmark(this.createLandmark(u),Object.assign(Object.assign({},l),{onfinish:()=>{Wi(n,new hs(sn.AFTER_ANIMATE,ha.TRANSFORM,null,e)),Wi(n,new Rv(sn.AFTER_TRANSFORM,e)),this.transformResolver=void 0,c()}}))});this.camera.gotoLandmark(this.createLandmark(u),{duration:0}),Wi(n,new Rv(sn.AFTER_TRANSFORM,e))})}fitView(e,t){return oh(this,void 0,void 0,function*(){const[n,i,a,s]=this.padding,{when:o="always",direction:l="both"}=e||{},[u,c]=this.context.canvas.getSize(),h=u-s-i,d=c-n-a,f=this.context.canvas.getBounds(),v=this.getBBoxInViewport(f),[p,x]=Po(v),A=l==="x"&&p>=h||l==="y"&&x>=d||l==="both"&&p>=h&&x>=d;if(o==="overflow"&&!A)return yield this.fitCenter(t);const N=h/p,I=d/x,K=l==="x"?N:l==="y"?I:Math.min(N,I),W=this.getAnimation(t);yield this.transform({mode:"relative",scale:K,translate:Qn(Fr(this.getCanvasCenter(),this.getBBoxInViewport(f).center),ys(this.paddingOffset,K))},W)})}fitCenter(e){return oh(this,void 0,void 0,function*(){const t=this.context.canvas.getBounds();yield this.focus(t,e)})}focusElements(e,t){return oh(this,void 0,void 0,function*(){const{element:n}=this.context;if(!n)return;const i=gc(e.map(a=>n.getElement(a).getRenderBounds()));yield this.focus(i,t)})}focus(e,t){return oh(this,void 0,void 0,function*(){const n=this.context.graph.getViewportByCanvas(e.center),i=this.getCanvasCenter(),a=Fr(i,n);yield this.transform({mode:"relative",translate:Qn(a,this.paddingOffset)},t)})}getBBoxInViewport(e){const{min:t,max:n}=e,{graph:i}=this.context,[a,s]=i.getViewportByCanvas(t),[o,l]=i.getViewportByCanvas(n),u=new Ln;return u.setMinMax([a,s,0],[o,l,0]),u}isInViewport(e,t=!1,n=0){const{graph:i}=this.context,a=this.getCanvasSize(),[s,o]=i.getCanvasByViewport([0,0]),[l,u]=i.getCanvasByViewport(a);let c=new Ln;return c.setMinMax([s,o,0],[l,u,0]),n&&(c=Ro(c,n)),ou(e)?ms(e,c):t?z_(e,c):c.intersects(e)}cancelAnimation(){var e,t;!((e=this.camera.landmarks)===null||e===void 0)&&e.length&&this.camera.cancelLandmarkAnimation(),(t=this.transformResolver)===null||t===void 0||t.call(this)}}var Zr=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Fv extends e0.Z{constructor(e){var t;super(),this.rendered=!1,this.destroyed=!1,this.context={model:new p4},this.isCollapsingExpanding=!1,this.onResize=(0,Rc.Z)(()=>{this.resize()},300),this.options=Object.assign({},Fv.defaultOptions,e),this._setOptions(this.options,!0),this.context.graph=this,this.options.autoResize&&((t=globalThis.addEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(e){this._setOptions(e,!1)}_setOptions(e,t){if(this.updateCanvas(e),t){const{data:d}=e;d&&this.addData(d);return}Object.assign(this.options,e);const{behaviors:n,combo:i,data:a,edge:s,layout:o,node:l,plugins:u,theme:c,transforms:h}=e;n&&this.setBehaviors(n),a&&this.setData(a),l&&this.setNode(l),s&&this.setEdge(s),i&&this.setCombo(i),o&&this.setLayout(o),c&&this.setTheme(c),u&&this.setPlugins(u),h&&this.setTransforms(h)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(e,t){e&&(this.options.width=e),t&&(this.options.height=t),this.resize(e,t)}setZoomRange(e){this.options.zoomRange=e}getZoomRange(){return this.options.zoomRange}setNode(e){this.options.node=e,this.context.model.refreshData()}setEdge(e){this.options.edge=e,this.context.model.refreshData()}setCombo(e){this.options.combo=e,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(e){this.options.theme=(0,At.Z)(e)?e(this.getTheme()):e}setLayout(e){this.options.layout=(0,At.Z)(e)?e(this.getLayout()):e}getLayout(){return this.options.layout}setBehaviors(e){var t;this.options.behaviors=(0,At.Z)(e)?e(this.getBehaviors()):e,(t=this.context.behavior)===null||t===void 0||t.setBehaviors(this.options.behaviors)}updateBehavior(e){this.setBehaviors(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n))}getBehaviors(){return this.options.behaviors||[]}setPlugins(e){var t;this.options.plugins=(0,At.Z)(e)?e(this.getPlugins()):e,(t=this.context.plugin)===null||t===void 0||t.setPlugins(this.options.plugins)}updatePlugin(e){this.setPlugins(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n))}getPlugins(){return this.options.plugins||[]}getPluginInstance(e){return this.context.plugin.getPluginInstance(e)}setTransforms(e){var t;this.options.transforms=(0,At.Z)(e)?e(this.getTransforms()):e,(t=this.context.transform)===null||t===void 0||t.setTransforms(this.options.transforms)}updateTransform(e){this.setTransforms(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n)),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}getElementData(e){return Array.isArray(e)?e.map(t=>this.context.model.getElementDataById(t)):this.context.model.getElementDataById(e)}getNodeData(e){var t;return e===void 0?this.context.model.getNodeData():Array.isArray(e)?this.context.model.getNodeData(e):(t=this.context.model.getNodeData([e]))===null||t===void 0?void 0:t[0]}getEdgeData(e){var t;return e===void 0?this.context.model.getEdgeData():Array.isArray(e)?this.context.model.getEdgeData(e):(t=this.context.model.getEdgeData([e]))===null||t===void 0?void 0:t[0]}getComboData(e){var t;return e===void 0?this.context.model.getComboData():Array.isArray(e)?this.context.model.getComboData(e):(t=this.context.model.getComboData([e]))===null||t===void 0?void 0:t[0]}setData(e){this.context.model.setData((0,At.Z)(e)?e(this.getData()):e)}addData(e){this.context.model.addData((0,At.Z)(e)?e(this.getData()):e)}addNodeData(e){this.context.model.addNodeData((0,At.Z)(e)?e(this.getNodeData()):e)}addEdgeData(e){this.context.model.addEdgeData((0,At.Z)(e)?e(this.getEdgeData()):e)}addComboData(e){this.context.model.addComboData((0,At.Z)(e)?e(this.getComboData()):e)}addChildrenData(e,t){this.context.model.addChildrenData(e,t)}updateData(e){this.context.model.updateData((0,At.Z)(e)?e(this.getData()):e)}updateNodeData(e){this.context.model.updateNodeData((0,At.Z)(e)?e(this.getNodeData()):e)}updateEdgeData(e){this.context.model.updateEdgeData((0,At.Z)(e)?e(this.getEdgeData()):e)}updateComboData(e){this.context.model.updateComboData((0,At.Z)(e)?e(this.getComboData()):e)}removeData(e){this.context.model.removeData((0,At.Z)(e)?e(this.getData()):e)}removeNodeData(e){this.context.model.removeNodeData((0,At.Z)(e)?e(this.getNodeData()):e)}removeEdgeData(e){this.context.model.removeEdgeData((0,At.Z)(e)?e(this.getEdgeData()):e)}removeComboData(e){this.context.model.removeComboData((0,At.Z)(e)?e(this.getComboData()):e)}getElementType(e){return this.context.model.getElementType(e)}getRelatedEdgesData(e,t="both"){return this.context.model.getRelatedEdgesData(e,t)}getNeighborNodesData(e){return this.context.model.getNeighborNodesData(e)}getAncestorsData(e,t){return this.context.model.getAncestorsData(e,t)}getParentData(e,t){return this.context.model.getParentData(e,t)}getChildrenData(e){return this.context.model.getChildrenData(e)}getDescendantsData(e){return this.context.model.getDescendantsData(e)}getElementDataByState(e,t){return this.context.model.getElementDataByState(e,t)}initCanvas(){return Zr(this,void 0,void 0,function*(){var e;if(this.context.canvas)return yield this.context.canvas.ready;const{container:t="container",width:n,height:i,renderer:a,cursor:s,background:o,canvas:l,devicePixelRatio:u=(e=globalThis.devicePixelRatio)!==null&&e!==void 0?e:1}=this.options;if(t instanceof x2)this.context.canvas=t,s&&t.setCursor(s),a&&t.setRenderer(a),yield t.ready;else{const c=(0,Gt.Z)(t)?document.getElementById(t):t,h=S2(c);this.emit(sn.BEFORE_CANVAS_INIT,{container:c,width:n,height:i});const d=Object.assign(Object.assign({},l),{container:c,width:n||h[0],height:i||h[1],background:o,renderer:a,cursor:s,devicePixelRatio:u}),f=new x2(d);this.context.canvas=f,yield f.ready,this.emit(sn.AFTER_CANVAS_INIT,{canvas:f})}})}updateCanvas(e){var t,n;const{renderer:i,cursor:a,height:s,width:o}=e,l=this.context.canvas;l&&(i&&(this.emit(sn.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),l.setRenderer(i),this.emit(sn.AFTER_RENDERER_CHANGE,{renderer:i})),a&&l.setCursor(a),((0,bt.Z)(o)||(0,bt.Z)(s))&&this.setSize((t=o!=null?o:this.options.width)!==null&&t!==void 0?t:0,(n=s!=null?s:this.options.height)!==null&&n!==void 0?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new h4(this.context)),this.context.plugin||(this.context.plugin=new E4(this.context)),this.context.viewport||(this.context.viewport=new S4(this.context)),this.context.transform||(this.context.transform=new w4(this.context)),this.context.element||(this.context.element=new m4(this.context)),this.context.animation||(this.context.animation=new c4(this.context)),this.context.layout||(this.context.layout=new x4(this.context)),this.context.behavior||(this.context.behavior=new d4(this.context))}prepare(){return Zr(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed)throw new Error(oo("The graph instance has been destroyed"));yield this.initCanvas(),this.initRuntime()})}render(){return Zr(this,void 0,void 0,function*(){yield this.prepare(),Wi(this,new Ai(sn.BEFORE_RENDER));const e=this.context.element.draw({type:"render"});yield Promise.all([e==null?void 0:e.finished,this.context.layout.layout()]),yield this.autoFit(),this.rendered=!0,Wi(this,new Ai(sn.AFTER_RENDER))})}draw(){return Zr(this,void 0,void 0,function*(){var e;yield this.prepare(),yield(e=this.context.element.draw())===null||e===void 0?void 0:e.finished})}layout(){return Zr(this,void 0,void 0,function*(){yield this.context.layout.layout()})}stopLayout(){this.context.layout.stopLayout()}clear(){return Zr(this,void 0,void 0,function*(){this.context.model.setData({}),yield this.draw()})}destroy(){var e;Wi(this,new Ai(sn.BEFORE_DESTROY));const{layout:t,animation:n,element:i,model:a,canvas:s,behavior:o,plugin:l}=this.context;l==null||l.destroy(),o==null||o.destroy(),t==null||t.destroy(),n==null||n.destroy(),i==null||i.destroy(),a.destroy(),s==null||s.destroy(),this.options={},this.context={},this.off(),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"resize",this.onResize),this.destroyed=!0,Wi(this,new Ai(sn.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(e,t){var n;const i=S2((n=this.context.canvas)===null||n===void 0?void 0:n.getContainer()),a=[e||i[0],t||i[1]];if(!this.context.canvas)return;const s=this.context.canvas.getSize();(0,pi.Z)(a,s)||(Wi(this,new Ai(sn.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),Wi(this,new Ai(sn.AFTER_SIZE_CHANGE,{size:a})))}fitView(e,t){return Zr(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.fitView(e,t)})}fitCenter(e){return Zr(this,void 0,void 0,function*(){var t;yield(t=this.context.viewport)===null||t===void 0?void 0:t.fitCenter(e)})}autoFit(){return Zr(this,void 0,void 0,function*(){const{autoFit:e}=this.context.options;if(e)if((0,Gt.Z)(e))e==="view"?yield this.fitView():e==="center"&&(yield this.fitCenter());else{const{type:t,animation:n}=e;t==="view"?yield this.fitView(e.options,n):t==="center"&&(yield this.fitCenter(n))}})}focusElement(e,t){return Zr(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.focusElements(Array.isArray(e)?e:[e],t)})}zoomBy(e,t,n){return Zr(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:e,origin:n},t)})}zoomTo(e,t,n){return Zr(this,void 0,void 0,function*(){this.context.viewport.transform({mode:"absolute",scale:e,origin:n},t)})}getZoom(){return this.context.viewport.getZoom()}rotateBy(e,t,n){return Zr(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:e,origin:n},t)})}rotateTo(e,t,n){return Zr(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",rotate:e,origin:n},t)})}getRotation(){return this.context.viewport.getRotation()}translateBy(e,t){return Zr(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:e},t)})}translateTo(e,t){return Zr(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:e},t)})}getPosition(){return Fr([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(e,t){return Zr(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,u]=(0,ie.Z)(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([c,h])=>this.context.model.translateNodeLikeBy(c,h)),yield(o=this.context.element.draw({animation:u,stage:"translate"}))===null||o===void 0?void 0:o.finished})}translateElementTo(e,t){return Zr(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,u]=(0,ie.Z)(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([c,h])=>this.context.model.translateNodeLikeTo(c,h)),yield(o=this.context.element.draw({animation:u,stage:"translate"}))===null||o===void 0?void 0:o.finished})}getElementPosition(e){return this.context.model.getElementPosition(e)}getElementRenderStyle(e){return(0,qp.Z)(this.context.element.getElement(e).attributes,["context"])}setElementVisibility(e,t){return Zr(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,u]=(0,ie.Z)(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],c={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([f,v])=>{const p=this.getElementType(f);c[`${p}s`].push({id:f,style:{visibility:v}})});const{model:h,element:d}=this.context;h.preventUpdateNodeLikeHierarchy(()=>{h.updateData(c)}),yield(o=d.draw({animation:u,stage:"visibility"}))===null||o===void 0?void 0:o.finished})}showElement(e,t){return Zr(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:[e];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"visible"])),t)})}hideElement(e,t){return Zr(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:[e];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"hidden"])),t)})}getElementVisibility(e){var t,n;const i=this.context.element.getElement(e);return(n=(t=i==null?void 0:i.style)===null||t===void 0?void 0:t.visibility)!==null&&n!==void 0?n:"visible"}setElementZIndex(e,t){return Zr(this,void 0,void 0,function*(){var n;const i={nodes:[],edges:[],combos:[]},a=(0,ie.Z)(e)?e:{[e]:t};Object.entries(a).forEach(([l,u])=>{const c=this.getElementType(l);i[`${c}s`].push({id:l,style:{zIndex:u}})});const{model:s,element:o}=this.context;s.preventUpdateNodeLikeHierarchy(()=>s.updateData(i)),yield(n=o.draw({animation:!1,stage:"zIndex"}))===null||n===void 0?void 0:n.finished})}frontElement(e){return Zr(this,void 0,void 0,function*(){const t=Array.isArray(e)?e:[e],{model:n}=this.context,i={};t.map(a=>{const s=n.getFrontZIndex(a);if(n.getElementType(a)==="combo"){const l=n.getAncestorsData(a,Ir).at(-1)||this.getComboData(a),u=[l,...n.getDescendantsData(Re(l))],c=s-_2(l);u.forEach(d=>{i[Re(d)]=this.getElementZIndex(Re(d))+c});const{internal:h}=kp(u.map(Re),d=>n.getRelatedEdgesData(d));h.forEach(d=>{const f=Re(d);i[f]=this.getElementZIndex(f)+c})}else i[a]=s}),yield this.setElementZIndex(i)})}getElementZIndex(e){return _2(this.context.model.getElementDataById(e))}setElementState(e,t){return Zr(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,u]=(0,ie.Z)(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],c=d=>d?Array.isArray(d)?d:[d]:[],h={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([d,f])=>{const v=this.getElementType(d);h[`${v}s`].push({id:d,states:c(f)})}),this.updateData(h),yield(o=this.context.element.draw({animation:u,stage:"state"}))===null||o===void 0?void 0:o.finished})}getElementState(e){return this.context.model.getElementState(e)}getElementRenderBounds(e){return this.context.element.getElement(e).getRenderBounds()}collapseElement(e){return Zr(this,arguments,void 0,function*(t,n=!0){const{model:i,element:a}=this.context;if(Oa(i.getNodeLikeData([t])[0])||this.isCollapsingExpanding)return;const s=i.getElementType(t);yield this.frontElement(t),this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!0),s==="node"?yield a.collapseNode(t,n):s==="combo"&&(yield a.collapseCombo(t,n)),this.isCollapsingExpanding=!1})}expandElement(e){return Zr(this,arguments,void 0,function*(t,n=!0){const{model:i,element:a}=this.context;if(!Oa(i.getNodeLikeData([t])[0])||this.isCollapsingExpanding)return;const s=i.getElementType(t);this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!1),s==="node"?yield a.expandNode(t,n):s==="combo"&&(yield a.expandCombo(t,n)),this.isCollapsingExpanding=!1})}setElementCollapsibility(e,t){const n=this.getElementType(e);n==="node"?this.updateNodeData([{id:e,style:{collapsed:t}}]):n==="combo"&&this.updateComboData([{id:e,style:{collapsed:t}}])}toDataURL(){return Zr(this,arguments,void 0,function*(e={}){return this.context.canvas.toDataURL(e)})}getCanvasByViewport(e){return this.context.canvas.getCanvasByViewport(e)}getViewportByCanvas(e){return this.context.canvas.getViewportByCanvas(e)}getClientByCanvas(e){return this.context.canvas.getClientByCanvas(e)}getCanvasByClient(e){return this.context.canvas.getCanvasByClient(e)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(e,t,n){return super.on(e,t,n)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}}Fv.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};class Jo extends Kg{beforeDraw(e,t){return e}afterLayout(){}}class _4 extends Jo{beforeDraw(e){const{model:t}=this.context,n=e.add.combos,i=a=>{const s=[];return a.forEach((o,l)=>{const c=t.getAncestorsData(l,"combo").map(h=>Re(h)).reverse();s.push([l,o,c.length])}),new Map(s.sort(([,,o],[,,l])=>l-o).map(([o,l])=>[o,l]))};return e.add.combos=i(n),e.update.combos=i(e.update.combos),e}}function za(r,e,t,n,i){const a=Re(n),s=`${t}s`,o=i?n:r.add[s].get(a)||r.update[s].get(a)||r.remove[s].get(a)||n;Object.entries(r).forEach(([l,u])=>{e===l?u[s].set(a,o):u[s].delete(a)})}function Bv(r,e){return Object.keys(r).every(t=>r[t]===e[t])}class M4 extends Jo{beforeDraw(e,t){if(t.stage==="visibility"||!this.context.model.model.hasTreeStructure(Ir))return e;const{model:n}=this.context,{add:i,update:a}=e,s=[...e.update.combos.entries(),...e.add.combos.entries()];for(;s.length;){const[o,l]=s.pop();if(Oa(l)){const u=n.getDescendantsData(o),c=u.map(Re),{internal:h,external:d}=kp(c,f=>n.getRelatedEdgesData(f));u.forEach(f=>{const v=Re(f),p=s.findIndex(([A])=>A===v);p!==-1&&s.splice(p,1);const x=n.getElementType(v);za(e,"remove",x,f)}),h.forEach(f=>za(e,"remove","edge",f)),d.forEach(f=>{var v;const p=Re(f);((v=this.context.element)===null||v===void 0?void 0:v.getElement(p))?a.edges.set(p,f):i.edges.set(p,f)})}else{const u=n.getChildrenData(o),c=u.map(Re),{edges:h}=kp(c,d=>n.getRelatedEdgesData(d));[...u,...h].forEach(d=>{var f;const v=Re(d),p=n.getElementType(v);((f=this.context.element)===null||f===void 0?void 0:f.getElement(v))?za(e,"update",p,d):za(e,"add",p,d),p==="combo"&&s.push([v,d])})}}return e}}const O2=(r,e,t,n)=>{const i=`${t}s`,a=Re(n);!r.add[i].has(a)&&!r.update[i].has(a)&&r[e][i].set(Re(n),n)};class k4 extends Jo{getElement(e){return this.context.element.getElement(e)}handleExpand(e,t){if(O2(t,"add","node",e),Oa(e))return;const n=Re(e);O2(t,"add","node",e),this.context.model.getRelatedEdgesData(n,"out").forEach(s=>{za(t,"add","edge",s)}),this.context.model.getChildrenData(n).forEach(s=>{this.handleExpand(s,t)})}beforeDraw(e){const{graph:t,model:n}=this.context;if(!n.model.hasTreeStructure(es))return e;const{add:{nodes:i,edges:a},update:{nodes:s}}=e,o=new Map,l=new Map;i.forEach((c,h)=>{Oa(c)&&o.set(h,c)}),a.forEach(c=>{if(t.getElementType(c.source)!=="node")return;const h=t.getNodeData(c.source);Oa(h)&&o.set(c.source,h)}),s.forEach((c,h)=>{const d=this.getElement(h);if(!d)return;const f=d.attributes.collapsed;Oa(c)?f||o.set(h,c):f&&l.set(h,c)});const u=new Set;return o.forEach((c,h)=>{n.getDescendantsData(h).forEach(f=>{const v=Re(f);if(u.has(v))return;za(e,"remove","node",f),n.getRelatedEdgesData(v).forEach(x=>{za(e,"remove","edge",x)}),u.add(v)})}),l.forEach((c,h)=>{if(n.getAncestorsData(h,es).some(Oa)){za(e,"remove","node",c);return}this.handleExpand(c,e)}),e}}class T4 extends Jo{beforeDraw(e){const{add:t,update:n}=e,{model:i}=this.context;return[...t.edges.entries(),...n.edges.entries()].forEach(([,a])=>{A2(i,a)}),e}}const A2=(r,e)=>{const{source:t,target:n}=e,i=r.getElementDataById(t),a=r.getElementDataById(n),s=rb(i,h=>r.getParentData(h,Ir)),o=rb(a,h=>r.getParentData(h,Ir)),l=Re(s),u=Re(o),c={sourceNode:l,targetNode:u};return e.style?Object.assign(e.style,c):e.style=c,e},O4=(r,e,t)=>{const[n,i]=e,[a,s]=t;if(i===n)return a;const o=(r-n)/(i-n);return a+o*(s-a)},A4=(r,e,t)=>{const[n,i]=e,[a,s]=t,o=Math.log(r-n+1)/Math.log(i-n+1);return a+o*(s-a)},C4=(r,e,t,n=2)=>{const[i,a]=e,[s,o]=t,l=Math.pow((r-i)/(a-i),n);return s+l*(o-s)},P4=(r,e,t)=>{const[n,i]=e,[a,s]=t,o=Math.sqrt((r-n)/(i-n));return a+o*(s-a)};class zv extends Jo{constructor(e,t){super(e,(0,Ta.Z)({},zv.defaultOptions,t)),this.assignSizeByCentrality=(n,i,a,s,o,l)=>{const u=[i,a],c=[s[0],o[0]],h=[s[1],o[1]],d=[s[2],o[2]],f=(v,p)=>{if(typeof l=="function")return l(v,u,p);switch(l){case"linear":return O4(v,u,p);case"log":return A4(v,u,p);case"pow":return C4(v,u,p,2);case"sqrt":return P4(v,u,p);default:return p[0]}};return[f(n,c),f(n,h),f(n,d)]}}beforeDraw(e){const{model:t}=this.context,n=t.getNodeData(),i=ns(this.options.maxSize),a=ns(this.options.minSize),s=this.getCentralities(this.options.centrality),o=s.size>0?Math.max(...s.values()):0,l=s.size>0?Math.min(...s.values()):0;return n.forEach(u=>{var c;const h=this.assignSizeByCentrality(s.get(Re(u))||0,l,o,a,i,this.options.scale),d=(c=this.context.element)===null||c===void 0?void 0:c.getElement(Re(u)),f={size:h};this.assignLabelStyle(f,h,u,d),(!d||!Bv(f,d.attributes))&&za(e,d?"update":"add","node",(0,Ta.Z)(u,{style:f}),!0)}),e}assignLabelStyle(e,t,n,i){var a;const s=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",n);if(Object.assign(e,(0,El.Z)(s,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const o=this.getLabelSizeByNodeSize(t,1/0,Number(e.labelFontSize));Object.assign(e,{labelFontSize:o,labelLineHeight:o+B_(e.labelPadding)})}return e}getLabelSizeByNodeSize(e,t,n){const i=Math.min(...e)/2,[a,s]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,t];return Math.min(s,Math.max(i,a))}getCentralities(e){const{model:t}=this.context,n=t.getData();if(typeof e=="function")return e(n);const i=t.getRelatedEdgesData.bind(t);return Dy(n,i,e)}}zv.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class jv extends Jo{constructor(e,t){super(e,Object.assign({},jv.defaultOptions,t))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var e;const t=Fi(this.ref),{graph:n,model:i}=this.context;(e=i.getData().nodes)===null||e===void 0||e.forEach(s=>{if(Re(s)===Re(this.ref))return;const o=By(Fr(Fi(s),t)),l=Math.abs(o)>Math.PI/2,u=!s.children||s.children.length===0,c=ns(n.getElementRenderStyle(Re(s)).size)[0]/2,h=(u?1:-1)*(c+this.options.offset),d=[["translate",h*Math.cos(o),h*Math.sin(o)],["rotate",l?vr(o)+180:vr(o)]];i.updateNodeData([{id:Re(s),style:{labelTextAlign:l===u?"right":"left",labelTextBaseline:"middle",labelTransform:d}}])}),n.draw()}}jv.defaultOptions={offset:5};const N4="quadratic",C2=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class Gv extends Jo{constructor(e,t){super(e,Object.assign({},Gv.defaultOptions,t)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=n=>{const{add:{edges:i},update:{nodes:a,edges:s,combos:o},remove:{edges:l}}=n,{model:u}=this.context,c=new Map,h=(v,p)=>{u.getRelatedEdgesData(p).forEach(A=>!c.has(Re(A))&&c.set(Re(A),A))};a.forEach(h),o.forEach(h);const d=v=>{const p=u.getEdgeData().map(A=>A2(u,A));R4(v,p,!0).forEach(A=>!c.has(Re(A))&&c.set(Re(A),A))};if(l.size&&l.forEach(d),i.size&&i.forEach(d),s.size){const v=kx(n0(u.getChanges())).update.edges;s.forEach(p=>{var x;d(p);const A=(x=v.find(N=>Re(N.value)===Re(p)))===null||x===void 0?void 0:x.original;A&&!bm(p,A)&&d(A)})}(0,Vs.Z)(this.options.edges)||c.forEach((v,p)=>!this.options.edges.includes(p)&&c.delete(p));const f=u.getEdgeData().map(Re);return new Map([...c].sort((v,p)=>f.indexOf(v[0])-f.indexOf(p[0])))},this.applyBundlingStyle=(n,i,a)=>{const{edgeMap:s,reverses:o}=P2(i);s.forEach(l=>{l.forEach((u,c,h)=>{var d;const f=h.length,v=u.style||{};if(u.source===u.target){const A=C2.length;v.loopPlacement=C2[c%A],v.loopDist=Math.floor(c/A)*a+50}else if(f===1)v.curveOffset=0;else{const A=(c%2===0?1:-1)*(o[`${u.source}|${u.target}|${c}`]?-1:1);v.curveOffset=f%2===1?A*Math.ceil(c/2)*a*2:A*(Math.floor(c/2)*a*2+a)}const p=Object.assign(u,{type:N4,style:v}),x=(d=this.context.element)===null||d===void 0?void 0:d.getElement(Re(u));(!x||!Bv(p.style,x.attributes))&&za(n,x?"update":"add","edge",p,!0)})})},this.resetEdgeStyle=n=>{const i=n.style||{},a=this.cacheMergeStyle.get(Re(n))||{};return Object.keys(a).forEach(s=>{(0,pi.Z)(i[s],a[s])&&(n[s]?i[s]=n[s]:delete i[s])}),Object.assign(n,{style:i})},this.applyMergingStyle=(n,i)=>{const{edgeMap:a,reverses:s}=P2(i);a.forEach(o=>{var l;if(o.length===1){const c=o[0],h=(l=this.context.element)===null||l===void 0?void 0:l.getElement(Re(c)),d=this.resetEdgeStyle(c);(!h||!Bv(d,h.attributes))&&za(n,h?"update":"add","edge",d);return}const u=o.map(({source:c,target:h,style:d={}},f)=>{const{startArrow:v,endArrow:p}=d,x={},[A,N]=s[`${c}|${h}|${f}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return(0,Y.Z)(v)&&(x[A]=v),(0,Y.Z)(p)&&(x[N]=p),x}).reduce((c,h)=>Object.assign(Object.assign({},c),h),{});o.forEach((c,h,d)=>{var f;if(h!==0){za(n,"remove","edge",c);return}const v=Object.assign({},(0,At.Z)(this.options.style)?this.options.style(d):this.options.style,{childrenData:d});this.cacheMergeStyle.set(Re(c),v);const p=Object.assign(Object.assign({},c),{type:"line",style:Object.assign(Object.assign(Object.assign({},c.style),u),v)}),x=(f=this.context.element)===null||f===void 0?void 0:f.getElement(Re(c));(!x||!Bv(p.style,x.attributes))&&za(n,x?"update":"add","edge",p,!0)})})}}beforeDraw(e){const t=this.getAffectedParallelEdges(e);return t.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(e,t,this.options.distance):this.applyMergingStyle(e,t)),e}}Gv.defaultOptions={mode:"bundle",distance:15};const P2=r=>{const e=new Map,t=new Set,n={};for(const[i,a]of r){if(t.has(i))continue;const{source:s,target:o}=a,l=`${s}-${o}`;e.has(l)||e.set(l,[]),e.get(l).push(a),t.add(i);for(const[u,c]of r)t.has(u)||bm(a,c)&&(e.get(l).push(c),t.add(u),s===c.target&&o===c.source&&(n[`${c.source}|${c.target}|${e.get(l).length-1}`]=!0))}return{edgeMap:e,reverses:n}},R4=(r,e,t)=>e.filter(n=>(t||Re(n)!==Re(r))&&bm(n,r)),bm=(r,e)=>{const{sourceNode:t,targetNode:n}=r.style||{},{sourceNode:i,targetNode:a}=e.style||{};return t===i&&n===a||t===a&&n===i};class L4 extends Jo{beforeDraw(e,t){const{stage:n}=t;if(n==="visibility")return e;const{model:i}=this.context,{update:{nodes:a,edges:s,combos:o}}=e,l=(u,c)=>{i.getRelatedEdgesData(c).forEach(d=>!s.has(Re(d))&&s.set(Re(d),d))};return a.forEach(l),o.forEach(l),e}}var D4=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function I4(r,e){const{getNodeData:t=(o,l)=>{if(o.depth=l,!o.children)return o;const{children:u}=o,c=D4(o,["children"]);return Object.assign(Object.assign({},c),{children:u.map(h=>h.id)})},getEdgeData:n=(o,l)=>({source:o.id,target:l.id}),getChildren:i=o=>o.children||[]}=e||{},a=[],s=[];return yl(r,(o,l)=>{a.push(t(o,l));const u=i(o);for(const c of u)s.push(n(o,c))},o=>i(o),"TB"),{nodes:a,edges:s}}var F4=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{u(n.next(c))}catch(h){s(h)}}function l(c){try{u(n.throw(c))}catch(h){s(h)}}function u(c){c.done?a(c.value):i(c.value).then(o,l)}u((n=n.apply(r,e||[])).next())})};class Wv extends Np{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const e=this.context.model.getRootsData();if(!((0,Vs.Z)(e)||e.length>2))return e[0]}formatSize(e){const t=typeof e=="function"?e:()=>e;return n=>ns(t(n))}doLayout(e,t){const{hGap:n,getRibSep:i,vGap:a,nodeSize:s,height:o}=t,{model:l}=this.context,u=this.formatSize(s);let c=u(e)[0]+i(e);const h=(I,K=0)=>{var W;return K+=n*((I.children||[]).length+1),(W=I.children)===null||W===void 0||W.forEach(z=>{var j;(j=l.getNodeLikeDatum(z).children)===null||j===void 0||j.forEach(vt=>{const Tt=l.getNodeLikeDatum(vt);K=h(Tt,K)})}),K},d=I=>{if(I.depth===1)return c;const K=l.getParentData(I.id,"tree");if(zu(I)){const W=l.getParentData(K.id,"tree"),z=p(I)-p(W);return d(K)+z*n/a}else{const W=(K.children||[]).indexOf(I.id),z=l.getNodeData((K.children||[]).slice(W));return f(K)-z.reduce((j,Z)=>j+h(Z),0)-u(K)[0]/2}},f=(0,Jp.Z)(I=>{if(xm(I))return u(I)[0]/2;const K=l.getParentData(I.id,"tree");if(zu(I))return d(I)+h(I)+u(I)[0]/2;{const W=p(I)-p(K),z=n/a;return d(I)+W*z}},I=>I.id),v=I=>p(l.getParentData(I,"tree")),p=(0,Jp.Z)(I=>{if(xm(I))return o/2;if(zu(I)){const K=l.getParentData(I.id,"tree"),W=K.children.indexOf(I.id);if(W===0)return v(K.id)+a;const z=l.getNodeLikeDatum(K.children[W-1]);if((0,Vs.Z)(z.children))return p(z)+a;const j=l.getDescendantsData(z.id);return Math.max(...j.map(Z=>zu(Z)?v(Z.id):p(Z)))+a}else{if((0,Vs.Z)(I.children))return v(I.id)+a;const K=l.getNodeLikeDatum(I.children.slice(-1)[0]);if((0,Vs.Z)(K.children))return p(K)+a;const W=l.getDescendantsData(I.id).slice(-1)[0];return(zu(W)?v(W.id):p(W))+a}},I=>I.id);let x=0;const A={nodes:[],edges:[]},N=I=>{var K;(K=I.children)===null||K===void 0||K.forEach(vt=>N(l.getNodeLikeDatum(vt)));const W=p(I),z=f(I);if(A.nodes.push({id:I.id,x:z,y:W}),xm(I))return;const j=l.getRelatedEdgesData(I.id,"in")[0],Z=[d(I),zu(I)?W:v(I.id)];A.edges.push({id:Re(j),controlPoints:[Z],relatedNodeId:I.id}),x=Math.max(x,z+i(I)),I.depth===1&&(c=x)};return N(e),A}placeAlterative(e,t){const n=(t.children||[]).filter((o,l)=>l%2!==0);if(n.length===0)return e;const{model:i}=this.context,a=e.nodes.find(o=>o.id===t.id).y,s=o=>{const l=i.getAncestorsData(o,"tree");if((0,Vs.Z)(l))return!1;const u=l.length===1?o:l[l.length-2].id;return n.includes(u)};e.nodes.forEach(o=>{s(o.id)&&(o.y=2*a-o.y)}),e.edges.forEach(o=>{s(o.relatedNodeId)&&(o.controlPoints=o.controlPoints.map(l=>[l[0],2*a-l[1]]))})}rightToLeft(e,t){return e.nodes.forEach(n=>n.x=t.width-n.x),e.edges.forEach(n=>{n.controlPoints=n.controlPoints.map(i=>[t.width-i[0],i[1]])}),e}execute(e,t){return F4(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign({},Wv.defaultOptions),this.options),t),{direction:i,nodeSize:a}=n,s=this.getRoot();if(!s)return e;const o=this.formatSize(a);n.vGap||(n.vGap=Math.max(...(e.nodes||[]).map(d=>o(d)[1]))),n.hGap||(n.hGap=Math.max(...(e.nodes||[]).map(d=>o(d)[0])));let l=this.doLayout(s,n);this.placeAlterative(l,s),i==="RL"&&(l=this.rightToLeft(l,n));const{model:u}=this.context,c=[],h=[];return l.nodes.forEach(d=>{const{id:f,x:v,y:p}=d,x=u.getNodeLikeDatum(f);c.push(N2(x,{x:v,y:p}))}),l.edges.forEach(d=>{const{id:f,controlPoints:v}=d,p=u.getEdgeDatum(f);h.push(N2(p,{controlPoints:v}))}),{nodes:c,edges:h}})}}Wv.defaultOptions={direction:"RL",getRibSep:()=>60};const N2=(r,e)=>Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},r.style||{}),e)}),xm=r=>r.depth===0,zu=r=>(r.depth||(r.depth=0))%2===0,B4=["rgb(158, 1, 66)","rgb(213, 62, 79)","rgb(244, 109, 67)","rgb(253, 174, 97)","rgb(254, 224, 139)","rgb(255, 255, 191)","rgb(230, 245, 152)","rgb(171, 221, 164)","rgb(102, 194, 165)","rgb(50, 136, 189)","rgb(94, 79, 162)"],z4=["rgb(78, 121, 167)","rgb(242, 142, 44)","rgb(225, 87, 89)","rgb(118, 183, 178)","rgb(89, 161, 79)","rgb(237, 201, 73)","rgb(175, 122, 161)","rgb(255, 157, 167)","rgb(156, 117, 95)","rgb(186, 176, 171)"],j4=["rgb(255, 245, 235)","rgb(254, 230, 206)","rgb(253, 208, 162)","rgb(253, 174, 107)","rgb(253, 141, 60)","rgb(241, 105, 19)","rgb(217, 72, 1)","rgb(166, 54, 3)","rgb(127, 39, 4)"],G4=["rgb(247, 252, 245)","rgb(229, 245, 224)","rgb(199, 233, 192)","rgb(161, 217, 155)","rgb(116, 196, 118)","rgb(65, 171, 93)","rgb(35, 139, 69)","rgb(0, 109, 44)","rgb(0, 68, 27)"],W4=["rgb(247, 251, 255)","rgb(222, 235, 247)","rgb(198, 219, 239)","rgb(158, 202, 225)","rgb(107, 174, 214)","rgb(66, 146, 198)","rgb(33, 113, 181)","rgb(8, 81, 156)","rgb(8, 48, 107)"],U4=["#7E92B5","#F4664A","#FFBE3A"],Z4={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},V4={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function R2(r){const{bgColor:e,textColor:t,nodeColor:n,nodeColorDisabled:i,nodeStroke:a,nodeHaloStrokeOpacityActive:s=.15,nodeHaloStrokeOpacitySelected:o=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:u=.85,nodeOpacityInactive:c=.25,nodeBadgePalette:h=U4,nodePaletteOptions:d=Z4,edgeColor:f,edgeColorDisabled:v,edgePaletteOptions:p=V4,comboColor:x,comboColorDisabled:A,comboStroke:N,comboStrokeDisabled:I,edgeColorInactive:K}=r;return{background:e,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:n,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:t,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:n,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:o,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:s},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:c,donutOpacity:c,fillOpacity:c,iconOpacity:u,labelFill:t,labelFillOpacity:c,strokeOpacity:c},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:i,fillOpacity:l,iconFill:i,iconOpacity:.25,labelFill:t,labelFillOpacity:.25,strokeOpacity:l}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:p,style:{badgeBackgroundFill:f,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:t,labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelPlacement:"center",labelTextBaseline:"middle",lineWidth:1,stroke:f,strokeOpacity:1,zIndex:1},state:{selected:{halo:!0,haloStrokeOpacity:.25,labelFontSize:14,labelFontWeight:"bold",lineWidth:3},active:{halo:!0,haloStrokeOpacity:.15},highlight:{labelFontWeight:"bold",lineWidth:3},inactive:{stroke:K,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:v,fillOpacity:.45,strokeOpacity:.45,labelOpacity:.25,badgeBackgroundOpacity:.45}},animation:{enter:"fade",exit:"fade",expand:"path-in",collapse:"path-out",show:"fade",hide:"fade",update:[{fields:["sourceNode","targetNode"]},{fields:["stroke"],shape:"key"}],translate:[{fields:["sourceNode","targetNode"]}]}},combo:{style:{collapsedMarkerFill:e,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:x,halo:!1,haloLineWidth:12,haloStroke:N,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:t,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:N},state:{selected:{halo:!0,labelFontSize:14,labelFontWeight:700,lineWidth:4},active:{halo:!0},highlight:{labelFontWeight:700,lineWidth:4},inactive:{fillOpacity:.65,labelOpacity:.25,strokeOpacity:.65},disabled:{fill:A,fillOpacity:.25,labelOpacity:.25,stroke:I,strokeOpacity:.25}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"combo-expand",collapse:"combo-collapse",update:[{fields:["x","y"]},{fields:["fill","stroke","lineWidth"],shape:"key"}],translate:[{fields:["x","y"]}]}}}}const Y4=R2({bgColor:"#000000",comboColor:"#fdfdfd",comboColorDisabled:"#d0e4ff",comboStroke:"#99add1",comboStrokeDisabled:"#969696",edgeColor:"#637088",edgeColorDisabled:"#637088",edgeColorInactive:"#D0E4FF",edgePaletteOptions:{type:"group",color:["#637088","#0F55A6","#008383","#9C5D38","#8B53A6","#4E40A6","#8F6608","#3E801D","#A65383","#175E75","#0F8248"]},nodeColor:"#1783ff",nodeColorDisabled:"#D0E4FF",nodeHaloStrokeOpacityActive:.25,nodeHaloStrokeOpacitySelected:.45,nodeIconOpacityInactive:.45,nodeOpacityDisabled:.25,nodeOpacityInactive:.45,nodeStroke:"#d0e4ff",textColor:"#ffffff"}),H4=R2({bgColor:"#ffffff",comboColor:"#99ADD1",comboColorDisabled:"#f0f0f0",comboStroke:"#99add1",comboStrokeDisabled:"#d9d9d9",edgeColor:"#99add1",edgeColorDisabled:"#d9d9d9",edgeColorInactive:"#1B324F",nodeColor:"#1783ff",nodeColorDisabled:"#1B324F",nodeHaloStrokeOpacityActive:.15,nodeHaloStrokeOpacitySelected:.25,nodeIconOpacityInactive:.85,nodeOpacityDisabled:.06,nodeOpacityInactive:.25,nodeStroke:"#000000",textColor:"#000000"}),X4={animation:{"combo-collapse":Py,"combo-expand":D_,"node-collapse":Ay,"node-expand":R_,"path-in":Cy,"path-out":L_,fade:P_,translate:N_},behavior:{"brush-select":xc,"click-select":Ad,"collapse-expand":uf,"create-edge":df,"drag-canvas":ff,"drag-element-force":cO,"drag-element":Lc,"fix-element-size":gf,"focus-element":pf,"hover-activate":mf,"lasso-select":dO,"auto-adapt-label":Sd,"optimize-viewport-transform":yf,"scroll-canvas":bf,"zoom-canvas":xf},combo:{circle:fT,rect:vT},edge:{cubic:wl,line:af,polyline:sf,quadratic:of,"cubic-horizontal":ef,"cubic-radial":nf,"cubic-vertical":rf},layout:{"antv-dagre":qA,"combo-combined":SC,"compact-box":Ef.compactBox,"d3-force":NC,"force-atlas2":DC,circular:nC,concentric:Vp,dagre:Sf,dendrogram:Ef.dendrogram,fishbone:Wv,force:lx,fruchterman:BC,grid:jC,indented:Ef.indented,mds:vx,mindmap:Ef.mindmap,radial:KC,random:nP},node:{circle:bl,diamond:TM,ellipse:Ld,hexagon:NM,html:$d,image:Qd,rect:hT,star:dT,donut:Nd,triangle:Jd},palette:{spectral:B4,tableau:z4,oranges:j4,greens:G4,blues:W4},theme:{dark:Y4,light:H4},plugin:{"bubble-sets":Tf,"edge-bundling":Af,"edge-filter-lens":Cf,"grid-line":Rf,background:kf,contextmenu:Of,fisheye:Pf,fullscreen:Nf,history:Lf,hull:Df,legend:yv,minimap:bv,snapline:xv,timebar:Ov,toolbar:Av,tooltip:Cv,watermark:Pv},transform:{"arrange-draw-order":_4,"collapse-expand-combo":M4,"collapse-expand-node":k4,"get-edge-actual-ends":T4,"map-node-size":zv,"place-radial-labels":jv,"process-parallel-edges":Gv,"update-related-edges":L4},shape:{circle:tu,ellipse:Qh,group:eu,html:Jh,image:ip,line:cc,path:ro,polygon:nu,polyline:Og,rect:ps,text:ru,label:Fo,badge:uu}};function K4(){Object.entries(X4).forEach(([r,e])=>{Object.entries(e).forEach(([t,n])=>{r4(r,t,n)})})}Ke.enableMassiveParsedStyleAssignOptimization=!0,K4();const RB={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css",js:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js"}},44326:function(q,J,g){"use strict";g.d(J,{k:function(){return L}});var m=g(90494),F=g(69991),R=g(35105);class L extends m.Z{constructor(b){super();ri(this,"nodeMap",new Map);ri(this,"edgeMap",new Map);ri(this,"inEdgesMap",new Map);ri(this,"outEdgesMap",new Map);ri(this,"bothEdgesMap",new Map);ri(this,"treeIndices",new Map);ri(this,"changes",[]);ri(this,"batchCount",0);ri(this,"onChanged",()=>{});ri(this,"batch",b=>{this.batchCount+=1,b(),this.batchCount-=1,this.batchCount||this.commit()});b&&(b.nodes&&this.addNodes(b.nodes),b.edges&&this.addEdges(b.edges),b.tree&&this.addTree(b.tree),b.onChanged&&(this.onChanged=b.onChanged))}commit(){const b=this.changes;this.changes=[];const E={graph:this,changes:b};this.emit("changed",E),this.onChanged(E)}reduceChanges(b){let E=[];return b.forEach(T=>{switch(T.type){case"NodeRemoved":{let _=!1;E=E.filter(P=>{if(P.type==="NodeAdded"){const B=P.value.id===T.value.id;return B&&(_=!0),!B}else{if(P.type==="NodeDataUpdated")return P.id!==T.value.id;if(P.type==="TreeStructureChanged")return P.nodeId!==T.value.id}return!0}),_||E.push(T);break}case"EdgeRemoved":{let _=!1;E=E.filter(P=>{if(P.type==="EdgeAdded"){const B=P.value.id===T.value.id;return B&&(_=!0),!B}else if(P.type==="EdgeDataUpdated"||P.type==="EdgeUpdated")return P.id!==T.value.id;return!0}),_||E.push(T);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const _=E.findIndex(B=>B.type===T.type&&B.id===T.id&&(T.propertyName===void 0||B.propertyName===T.propertyName)),P=E[_];P?T.propertyName!==void 0?P.newValue=T.newValue:(E.splice(_,1),E.push(T)):E.push(T);break}case"TreeStructureDetached":{E=E.filter(_=>_.type==="TreeStructureAttached"||_.type==="TreeStructureChanged"?_.treeKey!==T.treeKey:!0),E.push(T);break}case"TreeStructureChanged":{const _=E.find(P=>P.type==="TreeStructureChanged"&&P.treeKey===T.treeKey&&P.nodeId===T.nodeId);_?_.newParentId=T.newParentId:E.push(T);break}default:E.push(T);break}}),E}checkNodeExistence(b){this.getNode(b)}hasNode(b){return this.nodeMap.has(b)}areNeighbors(b,E){return this.getNeighbors(E).some(T=>T.id===b)}getNode(b){const E=this.nodeMap.get(b);if(!E)throw new Error("Node not found for id: "+b);return E}getRelatedEdges(b,E){if(this.checkNodeExistence(b),E==="in"){const T=this.inEdgesMap.get(b);return Array.from(T)}else if(E==="out"){const T=this.outEdgesMap.get(b);return Array.from(T)}else{const T=this.bothEdgesMap.get(b);return Array.from(T)}}getDegree(b,E){return this.getRelatedEdges(b,E).length}getSuccessors(b){const T=this.getRelatedEdges(b,"out").map(_=>this.getNode(_.target));return Array.from(new Set(T))}getPredecessors(b){const T=this.getRelatedEdges(b,"in").map(_=>this.getNode(_.source));return Array.from(new Set(T))}getNeighbors(b){const E=this.getPredecessors(b),T=this.getSuccessors(b);return Array.from(new Set([...E,...T]))}doAddNode(b){if(this.hasNode(b.id))throw new Error("Node already exists: "+b.id);this.nodeMap.set(b.id,b),this.inEdgesMap.set(b.id,new Set),this.outEdgesMap.set(b.id,new Set),this.bothEdgesMap.set(b.id,new Set),this.treeIndices.forEach(E=>{E.childrenMap.set(b.id,new Set)}),this.changes.push({type:"NodeAdded",value:b})}addNodes(b){this.batch(()=>{for(const E of b)this.doAddNode(E)})}addNode(b){this.addNodes([b])}doRemoveNode(b){const E=this.getNode(b),T=this.bothEdgesMap.get(b);T==null||T.forEach(_=>this.doRemoveEdge(_.id)),this.nodeMap.delete(b),this.treeIndices.forEach(_=>{var B,tt;(B=_.childrenMap.get(b))==null||B.forEach(st=>{_.parentMap.delete(st.id)});const P=_.parentMap.get(b);P&&((tt=_.childrenMap.get(P.id))==null||tt.delete(E)),_.parentMap.delete(b),_.childrenMap.delete(b)}),this.bothEdgesMap.delete(b),this.inEdgesMap.delete(b),this.outEdgesMap.delete(b),this.changes.push({type:"NodeRemoved",value:E})}removeNodes(b){this.batch(()=>{b.forEach(E=>this.doRemoveNode(E))})}removeNode(b){this.removeNodes([b])}updateNodeDataProperty(b,E,T){const _=this.getNode(b);this.batch(()=>{const P=_.data[E],B=T;_.data[E]=B,this.changes.push({type:"NodeDataUpdated",id:b,propertyName:E,oldValue:P,newValue:B})})}mergeNodeData(b,E){this.batch(()=>{Object.entries(E).forEach(([T,_])=>{this.updateNodeDataProperty(b,T,_)})})}updateNodeData(...b){const E=b[0],T=this.getNode(E);if(typeof b[1]=="string"){this.updateNodeDataProperty(E,b[1],b[2]);return}let _;if(typeof b[1]=="function"){const P=b[1];_=P(T.data)}else typeof b[1]=="object"&&(_=b[1]);this.batch(()=>{const P=T.data,B=_;T.data=_,this.changes.push({type:"NodeDataUpdated",id:E,oldValue:P,newValue:B})})}checkEdgeExistence(b){if(!this.hasEdge(b))throw new Error("Edge not found for id: "+b)}hasEdge(b){return this.edgeMap.has(b)}getEdge(b){return this.checkEdgeExistence(b),this.edgeMap.get(b)}getEdgeDetail(b){const E=this.getEdge(b);return{edge:E,source:this.getNode(E.source),target:this.getNode(E.target)}}doAddEdge(b){if(this.hasEdge(b.id))throw new Error("Edge already exists: "+b.id);this.checkNodeExistence(b.source),this.checkNodeExistence(b.target),this.edgeMap.set(b.id,b);const E=this.inEdgesMap.get(b.target),T=this.outEdgesMap.get(b.source),_=this.bothEdgesMap.get(b.source),P=this.bothEdgesMap.get(b.target);E.add(b),T.add(b),_.add(b),P.add(b),this.changes.push({type:"EdgeAdded",value:b})}addEdges(b){this.batch(()=>{for(const E of b)this.doAddEdge(E)})}addEdge(b){this.addEdges([b])}doRemoveEdge(b){const E=this.getEdge(b),T=this.outEdgesMap.get(E.source),_=this.inEdgesMap.get(E.target),P=this.bothEdgesMap.get(E.source),B=this.bothEdgesMap.get(E.target);T.delete(E),_.delete(E),P.delete(E),B.delete(E),this.edgeMap.delete(b),this.changes.push({type:"EdgeRemoved",value:E})}removeEdges(b){this.batch(()=>{b.forEach(E=>this.doRemoveEdge(E))})}removeEdge(b){this.removeEdges([b])}updateEdgeSource(b,E){const T=this.getEdge(b);this.checkNodeExistence(E);const _=T.source,P=E;this.outEdgesMap.get(_).delete(T),this.bothEdgesMap.get(_).delete(T),this.outEdgesMap.get(P).add(T),this.bothEdgesMap.get(P).add(T),T.source=E,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:b,propertyName:"source",oldValue:_,newValue:P})})}updateEdgeTarget(b,E){const T=this.getEdge(b);this.checkNodeExistence(E);const _=T.target,P=E;this.inEdgesMap.get(_).delete(T),this.bothEdgesMap.get(_).delete(T),this.inEdgesMap.get(P).add(T),this.bothEdgesMap.get(P).add(T),T.target=E,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:b,propertyName:"target",oldValue:_,newValue:P})})}updateEdgeDataProperty(b,E,T){const _=this.getEdge(b);this.batch(()=>{const P=_.data[E],B=T;_.data[E]=B,this.changes.push({type:"EdgeDataUpdated",id:b,propertyName:E,oldValue:P,newValue:B})})}updateEdgeData(...b){const E=b[0],T=this.getEdge(E);if(typeof b[1]=="string"){this.updateEdgeDataProperty(E,b[1],b[2]);return}let _;if(typeof b[1]=="function"){const P=b[1];_=P(T.data)}else typeof b[1]=="object"&&(_=b[1]);this.batch(()=>{const P=T.data,B=_;T.data=_,this.changes.push({type:"EdgeDataUpdated",id:E,oldValue:P,newValue:B})})}mergeEdgeData(b,E){this.batch(()=>{Object.entries(E).forEach(([T,_])=>{this.updateEdgeDataProperty(b,T,_)})})}checkTreeExistence(b){if(!this.hasTreeStructure(b))throw new Error("Tree structure not found for treeKey: "+b)}hasTreeStructure(b){return this.treeIndices.has(b)}attachTreeStructure(b){this.treeIndices.has(b)||(this.treeIndices.set(b,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:b})}))}detachTreeStructure(b){this.checkTreeExistence(b),this.treeIndices.delete(b),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:b})})}addTree(b,E){this.batch(()=>{this.attachTreeStructure(E);const T=[],_=Array.isArray(b)?b:[b];for(;_.length;){const P=_.shift();T.push(P),P.children&&_.push(...P.children)}this.addNodes(T),T.forEach(P=>{var B;(B=P.children)==null||B.forEach(tt=>{this.setParent(tt.id,P.id,E)})})})}getRoots(b){return this.checkTreeExistence(b),this.getAllNodes().filter(E=>!this.getParent(E.id,b))}getChildren(b,E){this.checkNodeExistence(b),this.checkTreeExistence(E);const _=this.treeIndices.get(E).childrenMap.get(b);return Array.from(_||[])}getParent(b,E){return this.checkNodeExistence(b),this.checkTreeExistence(E),this.treeIndices.get(E).parentMap.get(b)||null}getAncestors(b,E){const T=[];let _=this.getNode(b),P;for(;P=this.getParent(_.id,E);)T.push(P),_=P;return T}setParent(b,E,T){var Rt,xt;this.checkTreeExistence(T);const _=this.treeIndices.get(T),P=this.getNode(b),B=_.parentMap.get(b);if((B==null?void 0:B.id)===E)return;if(E===void 0){B&&((Rt=_.childrenMap.get(B.id))==null||Rt.delete(P)),_.parentMap.delete(b);return}const tt=this.getNode(E);_.parentMap.set(b,tt),B&&((xt=_.childrenMap.get(B.id))==null||xt.delete(P));let st=_.childrenMap.get(tt.id);st||(st=new Set,_.childrenMap.set(tt.id,st)),st.add(P),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:T,nodeId:b,oldParentId:B==null?void 0:B.id,newParentId:tt.id})})}dfsTree(b,E,T){const _=P=>this.getChildren(P,T);return(0,R.I)(this.getNode(b),new Set,E,_)}bfsTree(b,E,T){const _=P=>this.getChildren(P,T);return(0,R.O)([this.getNode(b)],new Set,E,_)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(b,E,T="out"){const _={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[T];return(0,R.O)([this.getNode(b)],new Set,E,_)}dfs(b,E,T="out"){const _={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[T];return(0,R.I)(this.getNode(b),new Set,E,_)}clone(){const b=this.getAllNodes().map(_=>Tm(ju({},_),{data:ju({},_.data)})),E=this.getAllEdges().map(_=>Tm(ju({},_),{data:ju({},_.data)})),T=new L({nodes:b,edges:E});return this.treeIndices.forEach(({parentMap:_,childrenMap:P},B)=>{const tt=new Map;_.forEach((Rt,xt)=>{tt.set(xt,T.getNode(Rt.id))});const st=new Map;P.forEach((Rt,xt)=>{st.set(xt,new Set(Array.from(Rt).map(nt=>T.getNode(nt.id))))}),T.treeIndices.set(B,{parentMap:tt,childrenMap:st})}),T}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(b){return new F.t(ju({graph:this},b))}}},69991:function(q,J,g){"use strict";g.d(J,{t:function(){return R}});var m=g(35105);const F=()=>!0;class R{constructor(k){ri(this,"graph");ri(this,"nodeFilter");ri(this,"edgeFilter");ri(this,"cacheEnabled");ri(this,"inEdgesMap",new Map);ri(this,"outEdgesMap",new Map);ri(this,"bothEdgesMap",new Map);ri(this,"allNodesMap",new Map);ri(this,"allEdgesMap",new Map);ri(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()});ri(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(k=>k.id))});ri(this,"updateCache",k=>{const O=new Set;k.forEach(b=>{const E=this.bothEdgesMap.get(b);if(E&&E.forEach(T=>O.add(T.id)),!this.hasNode(b))this.inEdgesMap.delete(b),this.outEdgesMap.delete(b),this.bothEdgesMap.delete(b),this.allNodesMap.delete(b);else{const T=this.graph.getRelatedEdges(b,"in").filter(this.edgeFilter),_=this.graph.getRelatedEdges(b,"out").filter(this.edgeFilter),P=Array.from(new Set([...T,..._]));P.forEach(B=>O.add(B.id)),this.inEdgesMap.set(b,T),this.outEdgesMap.set(b,_),this.bothEdgesMap.set(b,P),this.allNodesMap.set(b,this.graph.getNode(b))}}),O.forEach(b=>{this.hasEdge(b)?this.allEdgesMap.set(b,this.graph.getEdge(b)):this.allEdgesMap.delete(b)})});ri(this,"handleGraphChanged",k=>{const O=new Set;k.changes.forEach(b=>{switch(b.type){case"NodeAdded":O.add(b.value.id);break;case"NodeDataUpdated":O.add(b.id);break;case"EdgeAdded":O.add(b.value.source),O.add(b.value.target);break;case"EdgeUpdated":(b.propertyName==="source"||b.propertyName==="target")&&(O.add(b.oldValue),O.add(b.newValue));break;case"EdgeDataUpdated":if(k.graph.hasEdge(b.id)){const E=k.graph.getEdge(b.id);O.add(E.source),O.add(E.target)}break;case"EdgeRemoved":O.add(b.value.source),O.add(b.value.target);break;case"NodeRemoved":O.add(b.value.id);break;default:break}}),this.updateCache(O)});this.graph=k.graph;const O=k.nodeFilter||F,b=k.edgeFilter||F;this.nodeFilter=O,this.edgeFilter=E=>{const{source:T,target:_}=this.graph.getEdgeDetail(E.id);return!O(T)||!O(_)?!1:b(E,T,_)},k.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):k.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}checkNodeExistence(k){this.getNode(k)}hasNode(k){if(!this.graph.hasNode(k))return!1;const O=this.graph.getNode(k);return this.nodeFilter(O)}areNeighbors(k,O){return this.checkNodeExistence(k),this.getNeighbors(O).some(b=>b.id===k)}getNode(k){const O=this.graph.getNode(k);if(!this.nodeFilter(O))throw new Error("Node not found for id: "+k);return O}getRelatedEdges(k,O){return this.checkNodeExistence(k),this.cacheEnabled?O==="in"?this.inEdgesMap.get(k):O==="out"?this.outEdgesMap.get(k):this.bothEdgesMap.get(k):this.graph.getRelatedEdges(k,O).filter(this.edgeFilter)}getDegree(k,O){return this.getRelatedEdges(k,O).length}getSuccessors(k){const b=this.getRelatedEdges(k,"out").map(E=>this.getNode(E.target));return Array.from(new Set(b))}getPredecessors(k){const b=this.getRelatedEdges(k,"in").map(E=>this.getNode(E.source));return Array.from(new Set(b))}getNeighbors(k){const O=this.getPredecessors(k),b=this.getSuccessors(k);return Array.from(new Set([...O,...b]))}hasEdge(k){if(!this.graph.hasEdge(k))return!1;const O=this.graph.getEdge(k);return this.edgeFilter(O)}getEdge(k){const O=this.graph.getEdge(k);if(!this.edgeFilter(O))throw new Error("Edge not found for id: "+k);return O}getEdgeDetail(k){const O=this.getEdge(k);return{edge:O,source:this.getNode(O.source),target:this.getNode(O.target)}}hasTreeStructure(k){return this.graph.hasTreeStructure(k)}getRoots(k){return this.graph.getRoots(k).filter(this.nodeFilter)}getChildren(k,O){return this.checkNodeExistence(k),this.graph.getChildren(k,O).filter(this.nodeFilter)}getParent(k,O){this.checkNodeExistence(k);const b=this.graph.getParent(k,O);return!b||!this.nodeFilter(b)?null:b}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(k,O,b="out"){const E={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[b];(0,m.O)([this.getNode(k)],new Set,O,E)}dfs(k,O,b="out"){const E={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[b];(0,m.I)(this.getNode(k),new Set,O,E)}}},35105:function(q,J,g){"use strict";g.d(J,{I:function(){return F},O:function(){return m}});function m(R,L,k,O){for(;R.length;){const b=R.shift();if(k(b))return!0;L.add(b.id),O(b.id).forEach(T=>{L.has(T.id)||(L.add(T.id),R.push(T))})}return!1}function F(R,L,k,O){if(k(R))return!0;L.add(R.id);for(const E of O(R.id))if(!L.has(E.id)&&F(E,L,k,O))return!0;return!1}},81746:function(q){(function(g,m){q.exports=m()})(typeof self!="undefined"?self:this,function(){return function(J){var g={};function m(F){if(g[F])return g[F].exports;var R=g[F]={i:F,l:!1,exports:{}};return J[F].call(R.exports,R,R.exports,m),R.l=!0,R.exports}return m.m=J,m.c=g,m.d=function(F,R,L){m.o(F,R)||Object.defineProperty(F,R,{configurable:!1,enumerable:!0,get:L})},m.n=function(F){var R=F&&F.__esModule?function(){return F.default}:function(){return F};return m.d(R,"a",R),R},m.o=function(F,R){return Object.prototype.hasOwnProperty.call(F,R)},m.p="",m(m.s=5)}([function(J,g){function m(F,R,L,k){return k===void 0&&(k="height"),L==="center"?(F[k]+R[k])/2:F.height}J.exports={assign:Object.assign,getHeight:m}},function(J,g,m){var F=m(3),R=function(){function L(O,b){b===void 0&&(b={});var E=this;E.options=b,E.rootNode=F(O,b)}var k=L.prototype;return k.execute=function(){throw new Error("please override this method")},L}();J.exports=R},function(J,g,m){var F=m(4),R=["LR","RL","TB","BT","H","V"],L=["LR","RL","H"],k=function(T){return L.indexOf(T)>-1},O=R[0];J.exports=function(E,T,_){var P=T.direction||O;if(T.isHorizontal=k(P),P&&R.indexOf(P)===-1)throw new TypeError("Invalid direction: "+P);if(P===R[0])_(E,T);else if(P===R[1])_(E,T),E.right2left();else if(P===R[2])_(E,T);else if(P===R[3])_(E,T),E.bottom2top();else if(P===R[4]||P===R[5]){var B=F(E,T),tt=B.left,st=B.right;_(tt,T),_(st,T),T.isHorizontal?tt.right2left():tt.bottom2top(),st.translate(tt.x-st.x,tt.y-st.y),E.x=tt.x,E.y=st.y;var Rt=E.getBoundingBox();T.isHorizontal?Rt.top<0&&E.translate(0,-Rt.top):Rt.left<0&&E.translate(-Rt.left,0)}var xt=T.fixedRoot;return xt===void 0&&(xt=!0),xt&&E.translate(-(E.x+E.width/2+E.hgap),-(E.y+E.height/2+E.vgap)),b(E,T),E};function b(E,T){if(T.radial){var _=T.isHorizontal?["x","y"]:["y","x"],P=_[0],B=_[1],tt={x:1/0,y:1/0},st={x:-1/0,y:-1/0},Rt=0;E.DFTraverse(function(Et){Rt++;var ot=Et.x,Ct=Et.y;tt.x=Math.min(tt.x,ot),tt.y=Math.min(tt.y,Ct),st.x=Math.max(st.x,ot),st.y=Math.max(st.y,Ct)});var xt=st[B]-tt[B];if(xt===0)return;var nt=Math.PI*2/Rt;E.DFTraverse(function(Et){var ot=(Et[B]-tt[B])/xt*(Math.PI*2-nt)+nt,Ct=Et[P]-E[P];Et.x=Math.cos(ot)*Ct,Et.y=Math.sin(ot)*Ct})}}},function(J,g,m){var F=m(0),R=18,L=R*2,k=R,O={getId:function(_){return _.id||_.name},getPreH:function(_){return _.preH||0},getPreV:function(_){return _.preV||0},getHGap:function(_){return _.hgap||k},getVGap:function(_){return _.vgap||k},getChildren:function(_){return _.children},getHeight:function(_){return _.height||L},getWidth:function(_){var P=_.label||" ";return _.width||P.split("").length*R}};function b(T,_){var P=this;if(P.vgap=P.hgap=0,T instanceof b)return T;P.data=T;var B=_.getHGap(T),tt=_.getVGap(T);return P.preH=_.getPreH(T),P.preV=_.getPreV(T),P.width=_.getWidth(T),P.height=_.getHeight(T),P.width+=P.preH,P.height+=P.preV,P.id=_.getId(T),P.x=P.y=0,P.depth=0,P.children||(P.children=[]),P.addGap(B,tt),P}F.assign(b.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(_,P){var B=this;B.hgap+=_,B.vgap+=P,B.width+=2*_,B.height+=2*P},eachNode:function(_){for(var P=this,B=[P],tt;tt=B.shift();)_(tt),B=tt.children.concat(B)},DFTraverse:function(_){this.eachNode(_)},BFTraverse:function(_){for(var P=this,B=[P],tt;tt=B.shift();)_(tt),B=B.concat(tt.children)},getBoundingBox:function(){var _={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(P){_.left=Math.min(_.left,P.x),_.top=Math.min(_.top,P.y),_.width=Math.max(_.width,P.x+P.width),_.height=Math.max(_.height,P.y+P.height)}),_},translate:function(_,P){_===void 0&&(_=0),P===void 0&&(P=0),this.eachNode(function(B){B.x+=_,B.y+=P,B.x+=B.preH,B.y+=B.preV})},right2left:function(){var _=this,P=_.getBoundingBox();_.eachNode(function(B){B.x=B.x-(B.x-P.left)*2-B.width}),_.translate(P.width,0)},bottom2top:function(){var _=this,P=_.getBoundingBox();_.eachNode(function(B){B.y=B.y-(B.y-P.top)*2-B.height}),_.translate(0,P.height)}});function E(T,_,P){_===void 0&&(_={}),_=F.assign({},O,_);var B=new b(T,_),tt=[B],st;if(!P&&!T.collapsed){for(;st=tt.shift();)if(!st.data.collapsed){var Rt=_.getChildren(st.data),xt=Rt?Rt.length:0;if(st.children=new Array(xt),Rt&&xt)for(var nt=0;nt<xt;nt++){var Et=new b(Rt[nt],_);st.children[nt]=Et,tt.push(Et),Et.parent=st,Et.depth=st.depth+1}}}return B}J.exports=E},function(J,g,m){var F=m(3);J.exports=function(R,L){for(var k=F(R.data,L,!0),O=F(R.data,L,!0),b=R.children.length,E=Math.round(b/2),T=L.getSide||function(tt,st){return st<E?"right":"left"},_=0;_<b;_++){var P=R.children[_],B=T(P,_);B==="right"?O.children.push(P):k.children.push(P)}return k.eachNode(function(tt){tt.isRoot()||(tt.side="left")}),O.eachNode(function(tt){tt.isRoot()||(tt.side="right")}),{left:k,right:O}}},function(J,g,m){var F={compactBox:m(6),dendrogram:m(8),indented:m(10),mindmap:m(12)};J.exports=F},function(J,g,m){function F(P,B){P.prototype=Object.create(B.prototype),P.prototype.constructor=P,R(P,B)}function R(P,B){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(tt,st){return tt.__proto__=st,tt},R(P,B)}var L=m(1),k=m(7),O=m(2),b=m(0),E=function(P){function B(){return P.apply(this,arguments)||this}F(B,P);var tt=B.prototype;return tt.execute=function(){var Rt=this;return O(Rt.rootNode,Rt.options,k)},B}(L),T={};function _(P,B){return B=b.assign({},T,B),new E(P,B).execute()}J.exports=_},function(J,g){function m(b,E,T,_){_===void 0&&(_=[]);var P=this;P.w=b||0,P.h=E||0,P.y=T||0,P.x=0,P.c=_||[],P.cs=_.length,P.prelim=0,P.mod=0,P.shift=0,P.change=0,P.tl=null,P.tr=null,P.el=null,P.er=null,P.msel=0,P.mser=0}m.fromNode=function(b,E){if(!b)return null;var T=[];return b.children.forEach(function(_){T.push(m.fromNode(_,E))}),E?new m(b.height,b.width,b.x,T):new m(b.width,b.height,b.y,T)};function F(b,E,T){T?b.y+=E:b.x+=E,b.children.forEach(function(_){F(_,E,T)})}function R(b,E){var T=E?b.y:b.x;return b.children.forEach(function(_){T=Math.min(R(_,E),T)}),T}function L(b,E){var T=R(b,E);F(b,-T,E)}function k(b,E,T){T?E.y=b.x:E.x=b.x,b.c.forEach(function(_,P){k(_,E.children[P],T)})}function O(b,E,T){T===void 0&&(T=0),E?(b.x=T,T+=b.width):(b.y=T,T+=b.height),b.children.forEach(function(_){O(_,E,T)})}J.exports=function(b,E){E===void 0&&(E={});var T=E.isHorizontal;function _(Ft){if(Ft.cs===0){P(Ft);return}_(Ft.c[0]);for(var jt=Ot(xt(Ft.c[0].el),0,null),re=1;re<Ft.cs;++re){_(Ft.c[re]);var Ee=xt(Ft.c[re].er);B(Ft,re,jt),jt=Ot(Ee,re,jt)}ot(Ft),P(Ft)}function P(Ft){Ft.cs===0?(Ft.el=Ft,Ft.er=Ft,Ft.msel=Ft.mser=0):(Ft.el=Ft.c[0].el,Ft.msel=Ft.c[0].msel,Ft.er=Ft.c[Ft.cs-1].er,Ft.mser=Ft.c[Ft.cs-1].mser)}function B(Ft,jt,re){for(var Ee=Ft.c[jt-1],et=Ee.mod,ge=Ft.c[jt],yt=ge.mod;Ee!==null&&ge!==null;){xt(Ee)>re.low&&(re=re.nxt);var te=et+Ee.prelim+Ee.w-(yt+ge.prelim);te>0&&(yt+=te,tt(Ft,jt,re.index,te));var Xt=xt(Ee),rt=xt(ge);Xt<=rt&&(Ee=Rt(Ee),Ee!==null&&(et+=Ee.mod)),Xt>=rt&&(ge=st(ge),ge!==null&&(yt+=ge.mod))}!Ee&&ge?nt(Ft,jt,ge,yt):Ee&&!ge&&Et(Ft,jt,Ee,et)}function tt(Ft,jt,re,Ee){Ft.c[jt].mod+=Ee,Ft.c[jt].msel+=Ee,Ft.c[jt].mser+=Ee,_t(Ft,jt,re,Ee)}function st(Ft){return Ft.cs===0?Ft.tl:Ft.c[0]}function Rt(Ft){return Ft.cs===0?Ft.tr:Ft.c[Ft.cs-1]}function xt(Ft){return Ft.y+Ft.h}function nt(Ft,jt,re,Ee){var et=Ft.c[0].el;et.tl=re;var ge=Ee-re.mod-Ft.c[0].msel;et.mod+=ge,et.prelim-=ge,Ft.c[0].el=Ft.c[jt].el,Ft.c[0].msel=Ft.c[jt].msel}function Et(Ft,jt,re,Ee){var et=Ft.c[jt].er;et.tr=re;var ge=Ee-re.mod-Ft.c[jt].mser;et.mod+=ge,et.prelim-=ge,Ft.c[jt].er=Ft.c[jt-1].er,Ft.c[jt].mser=Ft.c[jt-1].mser}function ot(Ft){Ft.prelim=(Ft.c[0].prelim+Ft.c[0].mod+Ft.c[Ft.cs-1].mod+Ft.c[Ft.cs-1].prelim+Ft.c[Ft.cs-1].w)/2-Ft.w/2}function Ct(Ft,jt){jt+=Ft.mod,Ft.x=Ft.prelim+jt,dt(Ft);for(var re=0;re<Ft.cs;re++)Ct(Ft.c[re],jt)}function _t(Ft,jt,re,Ee){if(re!==jt-1){var et=jt-re;Ft.c[re+1].shift+=Ee/et,Ft.c[jt].shift-=Ee/et,Ft.c[jt].change-=Ee-Ee/et}}function dt(Ft){for(var jt=0,re=0,Ee=0;Ee<Ft.cs;Ee++)jt+=Ft.c[Ee].shift,re+=jt+Ft.c[Ee].change,Ft.c[Ee].mod+=re}function Ot(Ft,jt,re){for(;re!==null&&Ft>=re.low;)re=re.nxt;return{low:Ft,index:jt,nxt:re}}O(b,T);var wt=m.fromNode(b,T);return _(wt),Ct(wt,0),k(wt,b,T),L(b,T),b}},function(J,g,m){function F(P,B){P.prototype=Object.create(B.prototype),P.prototype.constructor=P,R(P,B)}function R(P,B){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(tt,st){return tt.__proto__=st,tt},R(P,B)}var L=m(1),k=m(9),O=m(2),b=m(0),E=function(P){function B(){return P.apply(this,arguments)||this}F(B,P);var tt=B.prototype;return tt.execute=function(){var Rt=this;return Rt.rootNode.width=0,O(Rt.rootNode,Rt.options,k)},B}(L),T={};function _(P,B){return B=b.assign({},T,B),new E(P,B).execute()}J.exports=_},function(J,g,m){var F=m(0);function R(O,b){O===void 0&&(O=0),b===void 0&&(b=[]);var E=this;E.x=E.y=0,E.leftChild=E.rightChild=null,E.height=0,E.children=b}var L={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function k(O,b,E){E?(b.x=O.x,b.y=O.y):(b.x=O.y,b.y=O.x),O.children.forEach(function(T,_){k(T,b.children[_],E)})}J.exports=function(O,b){b===void 0&&(b={}),b=F.assign({},L,b);var E=0;function T(st){if(!st)return null;st.width=0,st.depth&&st.depth>E&&(E=st.depth);var Rt=st.children,xt=Rt.length,nt=new R(st.height,[]);return Rt.forEach(function(Et,ot){var Ct=T(Et);nt.children.push(Ct),ot===0&&(nt.leftChild=Ct),ot===xt-1&&(nt.rightChild=Ct)}),nt.originNode=st,nt.isLeaf=st.isLeaf(),nt}function _(st){if(st.isLeaf||st.children.length===0)st.drawingDepth=E;else{var Rt=st.children.map(function(nt){return _(nt)}),xt=Math.min.apply(null,Rt);st.drawingDepth=xt-1}return st.drawingDepth}var P;function B(st){st.x=st.drawingDepth*b.rankSep,st.isLeaf?(st.y=0,P&&(st.y=P.y+P.height+b.nodeSep,st.originNode.parent!==P.originNode.parent&&(st.y+=b.subTreeSep)),P=st):(st.children.forEach(function(Rt){B(Rt)}),st.y=(st.leftChild.y+st.rightChild.y)/2)}var tt=T(O);return _(tt),B(tt),k(tt,O,b.isHorizontal),O}},function(J,g,m){function F(tt,st){tt.prototype=Object.create(st.prototype),tt.prototype.constructor=tt,R(tt,st)}function R(tt,st){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Rt,xt){return Rt.__proto__=xt,Rt},R(tt,st)}var L=m(1),k=m(11),O=m(4),b=m(0),E=["LR","RL","H"],T=E[0],_=function(tt){function st(){return tt.apply(this,arguments)||this}F(st,tt);var Rt=st.prototype;return Rt.execute=function(){var nt=this,Et=nt.options,ot=nt.rootNode;Et.isHorizontal=!0;var Ct=Et.indent,_t=Ct===void 0?20:Ct,dt=Et.dropCap,Ot=dt===void 0?!0:dt,wt=Et.direction,Ft=wt===void 0?T:wt,jt=Et.align;if(Ft&&E.indexOf(Ft)===-1)throw new TypeError("Invalid direction: "+Ft);if(Ft===E[0])k(ot,_t,Ot,jt);else if(Ft===E[1])k(ot,_t,Ot,jt),ot.right2left();else if(Ft===E[2]){var re=O(ot,Et),Ee=re.left,et=re.right;k(Ee,_t,Ot,jt),Ee.right2left(),k(et,_t,Ot,jt);var ge=Ee.getBoundingBox();et.translate(ge.width,0),ot.x=et.x-ot.width/2}return ot},st}(L),P={};function B(tt,st){return st=b.assign({},P,st),new _(tt,st).execute()}J.exports=B},function(J,g,m){var F=m(0);function R(L,k,O,b,E){var T=(typeof O=="function"?O(L):O)*L.depth;if(!b)try{if(L.id===L.parent.children[0].id){L.x+=T,L.y=k?k.y:0;return}}catch(B){}if(L.x+=T,k){if(L.y=k.y+F.getHeight(k,L,E),k.parent&&L.parent.id!==k.parent.id){var _=k.parent,P=_.y+F.getHeight(_,L,E);L.y=P>L.y?P:L.y}}else L.y=0}J.exports=function(L,k,O,b){var E=null;L.eachNode(function(T){R(T,E,k,O,b),E=T})}},function(J,g,m){function F(P,B){P.prototype=Object.create(B.prototype),P.prototype.constructor=P,R(P,B)}function R(P,B){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(tt,st){return tt.__proto__=st,tt},R(P,B)}var L=m(1),k=m(13),O=m(2),b=m(0),E=function(P){function B(){return P.apply(this,arguments)||this}F(B,P);var tt=B.prototype;return tt.execute=function(){var Rt=this;return O(Rt.rootNode,Rt.options,k)},B}(L),T={};function _(P,B){return B=b.assign({},T,B),new E(P,B).execute()}J.exports=_},function(J,g,m){var F=m(0);function R(O,b){var E=0;return O.children.length?O.children.forEach(function(T){E+=R(T,b)}):E=O.height,O._subTreeSep=b.getSubTreeSep(O.data),O.totalHeight=Math.max(O.height,E)+2*O._subTreeSep,O.totalHeight}function L(O){var b=O.children,E=b.length;if(E){b.forEach(function(st){L(st)});var T=b[0],_=b[E-1],P=_.y-T.y+_.height,B=0;if(b.forEach(function(st){B+=st.totalHeight}),P>O.height)O.y=T.y+P/2-O.height/2;else if(b.length!==1||O.height>B){var tt=O.y+(O.height-P)/2-T.y;b.forEach(function(st){st.translate(0,tt)})}else O.y=(T.y+T.height/2+_.y+_.height/2)/2-O.height/2}}var k={getSubTreeSep:function(){return 0}};J.exports=function(O,b){b===void 0&&(b={}),b=F.assign({},k,b),O.parent={x:0,width:0,height:0,y:0},O.BFTraverse(function(E){E.x=E.parent.x+E.parent.width}),O.parent=null,R(O,b),O.startY=0,O.y=O.totalHeight/2-O.height/2,O.eachNode(function(E){var T=E.children,_=T.length;if(_){var P=T[0];if(P.startY=E.startY+E._subTreeSep,_===1)P.y=E.y+E.height/2-P.height/2;else{P.y=P.startY+P.totalHeight/2-P.height/2;for(var B=1;B<_;B++){var tt=T[B];tt.startY=T[B-1].startY+T[B-1].totalHeight,tt.y=tt.startY+tt.totalHeight/2-tt.height/2}}}}),L(O)}}])})},15278:function(q,J,g){"use strict";g.d(J,{t:function(){return nt}});function m({map:Et,initKey:ot},Ct){const _t=ot(Ct);return Et.has(_t)?Et.get(_t):Ct}function F({map:Et,initKey:ot},Ct){const _t=ot(Ct);return Et.has(_t)?Et.get(_t):(Et.set(_t,Ct),Ct)}function R({map:Et,initKey:ot},Ct){const _t=ot(Ct);return Et.has(_t)&&(Ct=Et.get(_t),Et.delete(_t)),Ct}function L(Et){return typeof Et=="object"?Et.valueOf():Et}class k extends Map{constructor(ot){if(super(),this.map=new Map,this.initKey=L,ot!==null)for(const[Ct,_t]of ot)this.set(Ct,_t)}get(ot){return super.get(m({map:this.map,initKey:this.initKey},ot))}has(ot){return super.has(m({map:this.map,initKey:this.initKey},ot))}set(ot,Ct){return super.set(F({map:this.map,initKey:this.initKey},ot),Ct)}delete(ot){return super.delete(R({map:this.map,initKey:this.initKey},ot))}}var O=g(74271);const b=Symbol("defaultUnknown");function E(Et,ot,Ct){for(let _t=0;_t<ot.length;_t+=1)Et.has(ot[_t])||Et.set(Ct(ot[_t]),_t)}function T(Et){const{value:ot,from:Ct,to:_t,mapper:dt,notFoundReturn:Ot}=Et;let wt=dt.get(ot);if(wt===void 0){if(Ot!==b)return Ot;wt=Ct.push(ot)-1,dt.set(ot,wt)}return _t[wt%_t.length]}function _(Et){return Et instanceof Date?ot=>`${ot}`:typeof Et=="object"?ot=>JSON.stringify(ot):ot=>ot}class P extends O.X{getDefaultOptions(){return{domain:[],range:[],unknown:b}}constructor(ot){super(ot)}map(ot){return this.domainIndexMap.size===0&&E(this.domainIndexMap,this.getDomain(),this.domainKey),T({value:this.domainKey(ot),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(ot){return this.rangeIndexMap.size===0&&E(this.rangeIndexMap,this.getRange(),this.rangeKey),T({value:this.rangeKey(ot),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(ot){const[Ct]=this.options.domain,[_t]=this.options.range;if(this.domainKey=_(Ct),this.rangeKey=_(_t),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!ot||ot.range)&&this.rangeIndexMap.clear(),(!ot||ot.domain||ot.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new P(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:ot,compare:Ct}=this.options;return this.sortedDomain=Ct?[...ot].sort(Ct):ot,this.sortedDomain}}function B(Et){const ot=Math.min(...Et);return Et.map(Ct=>Ct/ot)}function tt(Et,ot){const Ct=Et.length,_t=ot-Ct;return _t>0?[...Et,...new Array(_t).fill(1)]:_t<0?Et.slice(0,ot):Et}function st(Et){return Math.round(Et*1e12)/1e12}function Rt(Et){const{domain:ot,range:Ct,paddingOuter:_t,paddingInner:dt,flex:Ot,round:wt,align:Ft}=Et,jt=ot.length,re=tt(Ot,jt),[Ee,et]=Ct,ge=et-Ee,yt=2/jt*_t+1-1/jt*dt,te=ge/yt,Xt=te*dt/jt,rt=te-jt*Xt,bt=B(re),ye=bt.reduce((ve,kt)=>ve+kt),be=rt/ye,Gt=new k(ot.map((ve,kt)=>{const ee=bt[kt]*be;return[ve,wt?Math.floor(ee):ee]})),Kt=new k(ot.map((ve,kt)=>{const me=bt[kt]*be+Xt;return[ve,wt?Math.floor(me):me]})),we=Array.from(Kt.values()).reduce((ve,kt)=>ve+kt),oe=(ge-(we-we/jt*dt))*Ft,ht=Ee+oe;let ut=wt?Math.round(ht):ht;const Vt=new Array(jt);for(let ve=0;ve<jt;ve+=1){Vt[ve]=st(ut);const kt=ot[ve];ut+=Kt.get(kt)}return{valueBandWidth:Gt,valueStep:Kt,adjustedRange:Vt}}function xt(Et){var ot;const{domain:Ct}=Et,_t=Ct.length;if(_t===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((ot=Et.flex)===null||ot===void 0)&&ot.length))return Rt(Et);const{range:Ot,paddingOuter:wt,paddingInner:Ft,round:jt,align:re}=Et;let Ee,et,ge=Ot[0];const te=Ot[1]-ge,Xt=wt*2,rt=_t-Ft;Ee=te/Math.max(1,Xt+rt),jt&&(Ee=Math.floor(Ee)),ge+=(te-Ee*(_t-Ft))*re,et=Ee*(1-Ft),jt&&(ge=Math.round(ge),et=Math.round(et));const bt=new Array(_t).fill(0).map((ye,be)=>ge+be*Ee);return{valueStep:Ee,valueBandWidth:et,adjustedRange:bt}}class nt extends P{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:b,flex:[]}}constructor(ot){super(ot)}clone(){return new nt(this.options)}getStep(ot){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:ot===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(ot)}getBandWidth(ot){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:ot===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(ot)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:ot,paddingInner:Ct}=this.options;return ot>0?ot:Ct}getPaddingOuter(){const{padding:ot,paddingOuter:Ct}=this.options;return ot>0?ot:Ct}rescale(){super.rescale();const{align:ot,domain:Ct,range:_t,round:dt,flex:Ot}=this.options,{adjustedRange:wt,valueBandWidth:Ft,valueStep:jt}=xt({align:ot,range:_t,round:dt,flex:Ot,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:Ct});this.valueStep=jt,this.valueBandWidth=Ft,this.adjustedRange=wt}}},74271:function(q,J,g){"use strict";g.d(J,{X:function(){return F}});var m=g(83787);class F{constructor(L){this.options=(0,m.Z)({},this.getDefaultOptions()),this.update(L)}getOptions(){return this.options}update(L={}){this.options=(0,m.Z)({},this.options,L),this.rescale(L)}rescale(L){}}},53715:function(q,J,g){"use strict";g.d(J,{b:function(){return ge}});var m=function(yt){return yt},F=g(74271);function R(yt,te){return te-yt?Xt=>(Xt-yt)/(te-yt):Xt=>.5}function L(yt,...te){return te.reduce((Xt,rt)=>bt=>Xt(rt(bt)),yt)}function k(yt,te,Xt,rt,bt){let ye=Xt||0,be=rt||yt.length;const Gt=bt||(Kt=>Kt);for(;ye<be;){const Kt=Math.floor((ye+be)/2);Gt(yt[Kt])>te?be=Kt:ye=Kt+1}return ye}var O=g(19818),b=g.n(O);function E(yt,te,Xt){let rt=Xt;return rt<0&&(rt+=1),rt>1&&(rt-=1),rt<1/6?yt+(te-yt)*6*rt:rt<1/2?te:rt<2/3?yt+(te-yt)*(2/3-rt)*6:yt}function T(yt){const te=yt[0]/360,Xt=yt[1]/100,rt=yt[2]/100,bt=yt[3];if(Xt===0)return[rt*255,rt*255,rt*255,bt];const ye=rt<.5?rt*(1+Xt):rt+Xt-rt*Xt,be=2*rt-ye,Gt=E(be,ye,te+1/3),Kt=E(be,ye,te),we=E(be,ye,te-1/3);return[Gt*255,Kt*255,we*255,bt]}function _(yt){const te=b().get(yt);if(!te)return null;const{model:Xt,value:rt}=te;return Xt==="rgb"?rt:Xt==="hsl"?T(rt):null}const P=(yt,te)=>Xt=>yt*(1-Xt)+te*Xt,B=(yt,te)=>{const Xt=_(yt),rt=_(te);return Xt===null||rt===null?Xt?()=>yt:()=>te:bt=>{const ye=new Array(4);for(let Bt=0;Bt<4;Bt+=1){const oe=Xt[Bt],ht=rt[Bt];ye[Bt]=oe*(1-bt)+ht*bt}const[be,Gt,Kt,we]=ye;return`rgba(${Math.round(be)}, ${Math.round(Gt)}, ${Math.round(Kt)}, ${we})`}},tt=(yt,te)=>typeof yt=="number"&&typeof te=="number"?P(yt,te):typeof yt=="string"&&typeof te=="string"?B(yt,te):()=>yt,st=(yt,te)=>{const Xt=P(yt,te);return rt=>Math.round(Xt(rt))};var Rt=g(71154);function xt(yt){return yt===null}function nt(yt){return!(0,Rt.Z)(yt)&&!xt(yt)&&!Number.isNaN(yt)}const Et=Math.sqrt(50),ot=Math.sqrt(10),Ct=Math.sqrt(2);function _t(yt,te,Xt){const rt=(te-yt)/Math.max(0,Xt),bt=Math.floor(Math.log(rt)/Math.LN10),ye=rt/ph(10,bt);return bt>=0?(ye>=Et?10:ye>=ot?5:ye>=Ct?2:1)*ph(10,bt):-ph(10,-bt)/(ye>=Et?10:ye>=ot?5:ye>=Ct?2:1)}function dt(yt,te,Xt){const rt=Math.abs(te-yt)/Math.max(0,Xt);let bt=ph(10,Math.floor(Math.log(rt)/Math.LN10));const ye=rt/bt;return ye>=Et?bt*=10:ye>=ot?bt*=5:ye>=Ct&&(bt*=2),te<yt?-bt:bt}const Ot=(yt,te,Xt=5)=>{const rt=[yt,te];let bt=0,ye=rt.length-1,be=rt[bt],Gt=rt[ye],Kt;return Gt<be&&([be,Gt]=[Gt,be],[bt,ye]=[ye,bt]),Kt=_t(be,Gt,Xt),Kt>0?(be=Math.floor(be/Kt)*Kt,Gt=Math.ceil(Gt/Kt)*Kt,Kt=_t(be,Gt,Xt)):Kt<0&&(be=Math.ceil(be*Kt)/Kt,Gt=Math.floor(Gt*Kt)/Kt,Kt=_t(be,Gt,Xt)),Kt>0?(rt[bt]=Math.floor(be/Kt)*Kt,rt[ye]=Math.ceil(Gt/Kt)*Kt):Kt<0&&(rt[bt]=Math.ceil(be*Kt)/Kt,rt[ye]=Math.floor(Gt*Kt)/Kt),rt};function wt(yt,te){const Xt=te<yt?te:yt,rt=yt>te?yt:te;return bt=>Math.min(Math.max(Xt,bt),rt)}const Ft=(yt,te,Xt)=>{const[rt,bt]=yt,[ye,be]=te;let Gt,Kt;return rt<bt?(Gt=R(rt,bt),Kt=Xt(ye,be)):(Gt=R(bt,rt),Kt=Xt(be,ye)),L(Kt,Gt)},jt=(yt,te,Xt)=>{const rt=Math.min(yt.length,te.length)-1,bt=new Array(rt),ye=new Array(rt),be=yt[0]>yt[rt],Gt=be?[...yt].reverse():yt,Kt=be?[...te].reverse():te;for(let we=0;we<rt;we+=1)bt[we]=R(Gt[we],Gt[we+1]),ye[we]=Xt(Kt[we],Kt[we+1]);return we=>{const Bt=k(yt,we,1,rt)-1,oe=bt[Bt],ht=ye[Bt];return L(ht,oe)(we)}},re=(yt,te,Xt,rt)=>(Math.min(yt.length,te.length)>2?jt:Ft)(yt,te,rt?st:Xt);class Ee extends F.X{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:P,tickCount:5}}map(te){return nt(te)?this.output(te):this.options.unknown}invert(te){return nt(te)?this.input(te):this.options.unknown}nice(){if(!this.options.nice)return;const[te,Xt,rt,...bt]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(te,Xt,rt,...bt)}getTicks(){const{tickMethod:te}=this.options,[Xt,rt,bt,...ye]=this.getTickMethodOptions();return te(Xt,rt,bt,...ye)}getTickMethodOptions(){const{domain:te,tickCount:Xt}=this.options,rt=te[0],bt=te[te.length-1];return[rt,bt,Xt]}chooseNice(){return Ot}rescale(){this.nice();const[te,Xt]=this.chooseTransforms();this.composeOutput(te,this.chooseClamp(te)),this.composeInput(te,Xt,this.chooseClamp(Xt))}chooseClamp(te){const{clamp:Xt,range:rt}=this.options,bt=this.options.domain.map(te),ye=Math.min(bt.length,rt.length);return Xt?wt(bt[0],bt[ye-1]):m}composeOutput(te,Xt){const{domain:rt,range:bt,round:ye,interpolate:be}=this.options,Gt=re(rt.map(te),bt,be,ye);this.output=L(Gt,Xt,te)}composeInput(te,Xt,rt){const{domain:bt,range:ye}=this.options,be=re(ye,bt.map(te),P);this.input=L(Xt,rt,be)}}const et=(yt,te,Xt)=>{let rt,bt,ye=yt,be=te;if(ye===be&&Xt>0)return[ye];let Gt=_t(ye,be,Xt);if(Gt===0||!Number.isFinite(Gt))return[];if(Gt>0){ye=Math.ceil(ye/Gt),be=Math.floor(be/Gt),bt=new Array(rt=Math.ceil(be-ye+1));for(let Kt=0;Kt<rt;Kt+=1)bt[Kt]=(ye+Kt)*Gt}else{Gt=-Gt,ye=Math.ceil(ye*Gt),be=Math.floor(be*Gt),bt=new Array(rt=Math.ceil(be-ye+1));for(let Kt=0;Kt<rt;Kt+=1)bt[Kt]=(ye+Kt)/Gt}return bt};class ge extends Ee{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:tt,tickMethod:et,tickCount:5}}chooseTransforms(){return[m,m]}clone(){return new ge(this.options)}}},88204:function(q,J,g){"use strict";g.d(J,{L:function(){return m}});function m(F){var R=document.createElement("div");R.innerHTML=F;var L=R.childNodes[0];return L&&R.contains(L)&&R.removeChild(L),L}},81957:function(q,J){"use strict";var g=function(m,F,R){return m<F?F:m>R?R:m};J.Z=g},83207:function(q,J,g){"use strict";var m=g(44978),F=function(R){if(typeof R!="object"||R===null)return R;var L;if((0,m.Z)(R)){L=[];for(var k=0,O=R.length;k<O;k++)typeof R[k]=="object"&&R[k]!=null?L[k]=F(R[k]):L[k]=R[k]}else{L={};for(var b in R)typeof R[b]=="object"&&R[b]!=null?L[b]=F(R[b]):L[b]=R[b]}return L};J.Z=F},68040:function(q,J){"use strict";function g(m,F,R){var L;return function(){var k=this,O=arguments,b=function(){L=null,R||m.apply(k,O)},E=R&&!L;clearTimeout(L),L=setTimeout(b,F),E&&m.apply(k,O)}}J.Z=g},83787:function(q,J,g){"use strict";var m=g(44978),F=g(83845),R=5;function L(b,E){if(Object.hasOwn)return Object.hasOwn(b,E);if(b==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(b),E)}function k(b,E,T,_){T=T||0,_=_||R;for(var P in E)if(L(E,P)){var B=E[P];B!==null&&(0,F.Z)(B)?((0,F.Z)(b[P])||(b[P]={}),T<_?k(b[P],B,T+1,_):b[P]=E[P]):(0,m.Z)(B)?(b[P]=[],b[P]=b[P].concat(B)):B!==void 0&&(b[P]=B)}}var O=function(b){for(var E=[],T=1;T<arguments.length;T++)E[T-1]=arguments[T];for(var _=0;_<E.length;_+=1)k(b,E[_]);return b};J.Z=O},50814:function(q,J,g){"use strict";g.d(J,{Z:function(){return b}});var m=g(82844),F=function(E,T){if(!(0,m.Z)(E))return E;for(var _=[],P=0;P<E.length;P++){var B=E[P];T(B,P)&&_.push(B)}return _},R=F,L=function(E,T){return(0,m.Z)(E)?E.indexOf(T)>-1:!1},k=L,O=function(E,T){return T===void 0&&(T=[]),R(E,function(_){return!k(T,_)})},b=O},15255:function(q,J,g){"use strict";var m=g(44978),F=g(4637);function R(L,k){if(L){var O;if((0,m.Z)(L))for(var b=0,E=L.length;b<E&&(O=k(L[b],b),O!==!1);b++);else if((0,F.Z)(L)){for(var T in L)if(L.hasOwnProperty(T)&&(O=k(L[T],T),O===!1))break}}}J.Z=R},53032:function(q,J,g){"use strict";var m=g(76714);J.Z=function(F,R,L){for(var k=0,O=(0,m.Z)(R)?R.split("."):R;F&&k<O.length;)F=F[O[k++]];return F===void 0||k<O.length?L:F}},73584:function(q,J,g){"use strict";var m=g(44978),F=g(45607),R=Object.prototype.hasOwnProperty;function L(k,O){if(!O||!(0,m.Z)(k))return{};for(var b={},E=(0,F.Z)(O)?O:function(B){return B[O]},T,_=0;_<k.length;_++){var P=k[_];T=E(P),R.call(b,T)?b[T].push(P):b[T]=[P]}return b}J.Z=L},82844:function(q,J){"use strict";var g=function(m){return m!==null&&typeof m!="function"&&isFinite(m.length)};J.Z=g},44978:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return Array.isArray(F)}},90134:function(q,J,g){"use strict";var m=g(95456),F=function(R){return(0,m.Z)(R,"Boolean")};J.Z=F},69246:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return F instanceof Date}},95904:function(q,J,g){"use strict";g.d(J,{Z:function(){return P}});var m=g(95147),F=g(82844),R={}.toString,L=function(B){return R.call(B).replace(/^\[object /,"").replace(/]$/,"")},k=L,O=Object.prototype,b=function(B){var tt=B&&B.constructor,st=typeof tt=="function"&&tt.prototype||O;return B===st},E=b,T=Object.prototype.hasOwnProperty;function _(B){if((0,m.Z)(B))return!0;if((0,F.Z)(B))return!B.length;var tt=k(B);if(tt==="Map"||tt==="Set")return!B.size;if(E(B))return!Object.keys(B).length;for(var st in B)if(T.call(B,st))return!1;return!0}var P=_},30335:function(q,J,g){"use strict";var m=g(6241),F=g(82844),R=g(76714),L=function(k,O){if(k===O)return!0;if(!k||!O||(0,R.Z)(k)||(0,R.Z)(O))return!1;if((0,F.Z)(k)||(0,F.Z)(O)){if(k.length!==O.length)return!1;for(var b=!0,E=0;E<k.length&&(b=L(k[E],O[E]),!!b);E++);return b}if((0,m.Z)(k)||(0,m.Z)(O)){var T=Object.keys(k),_=Object.keys(O);if(T.length!==_.length)return!1;for(var b=!0,E=0;E<T.length&&(b=L(k[T[E]],O[T[E]]),!!b);E++);return b}return!1};J.Z=L},45607:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return typeof F=="function"}},95147:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return F==null}},80450:function(q,J,g){"use strict";g.d(J,{Z:function(){return F}});var m=1e-5;function F(R,L,k){return k===void 0&&(k=m),R===L||Math.abs(R-L)<k}},25897:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return typeof F=="number"}},6241:function(q,J){"use strict";var g=function(m){return typeof m=="object"&&m!==null};J.Z=g},4637:function(q,J){"use strict";J.Z=function(g){var m=typeof g;return g!==null&&m==="object"||m==="function"}},83845:function(q,J,g){"use strict";var m=g(6241),F=g(95456),R=function(L){if(!(0,m.Z)(L)||!(0,F.Z)(L,"Object"))return!1;if(Object.getPrototypeOf(L)===null)return!0;for(var k=L;Object.getPrototypeOf(k)!==null;)k=Object.getPrototypeOf(k);return Object.getPrototypeOf(L)===k};J.Z=R},76714:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return typeof F=="string"}},95456:function(q,J){"use strict";var g={}.toString,m=function(F,R){return g.call(F)==="[object "+R+"]"};J.Z=m},71154:function(q,J){"use strict";var g=function(m){return m===void 0};J.Z=g},73576:function(q,J,g){"use strict";var m=g(92123),F=function(R){var L=(0,m.Z)(R);return L.charAt(0).toLowerCase()+L.substring(1)};J.Z=F},93442:function(q,J,g){"use strict";var m=g(44978),F=g(45607);J.Z=function(R,L){if((0,m.Z)(R)){for(var k,O=-1/0,b=0;b<R.length;b++){var E=R[b],T=(0,F.Z)(L)?L(E):E[L];T>O&&(k=E,O=T)}return k}}},13882:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){if(!Array.isArray(F))return-1/0;var R=F.length;if(!R)return-1/0;for(var L=F[0],k=1;k<R;k++)L=Math.max(L,F[k]);return L}},92426:function(q,J,g){"use strict";g.d(J,{Z:function(){return R}});function m(L){var k,O,b,E=L||1;function T(P,B){++k>E&&(b=O,_(1),++k),O[P]=B}function _(P){k=0,O=Object.create(null),P||(b=Object.create(null))}return _(),{clear:_,has:function(P){return O[P]!==void 0||b[P]!==void 0},get:function(P){var B=O[P];if(B!==void 0)return B;if((B=b[P])!==void 0)return T(P,B),B},set:function(P,B){O[P]!==void 0?O[P]=B:T(P,B)}}}var F=new Map;function R(L,k,O){O===void 0&&(O=128);var b=function(){for(var E=[],T=0;T<arguments.length;T++)E[T]=arguments[T];var _=k?k.apply(this,E):E[0];F.has(L)||F.set(L,m(O));var P=F.get(L);if(P.has(_))return P.get(_);var B=L.apply(this,E);return P.set(_,B),B};return b}},89372:function(q,J,g){"use strict";var m=g(44978),F=g(45607);J.Z=function(R,L){if((0,m.Z)(R)){for(var k,O=1/0,b=0;b<R.length;b++){var E=R[b],T=(0,F.Z)(L)?L(E):E[L];T<O&&(k=E,O=T)}return k}}},71523:function(q,J,g){"use strict";var m=g(44978);J.Z=function(F){if((0,m.Z)(F))return F.reduce(function(R,L){return Math.min(R,L)},F[0])}},8614:function(q,J){"use strict";var g=function(m,F){return(m%F+F)%F};J.Z=g},13279:function(q,J){"use strict";J.Z=function(){}},35278:function(q,J,g){"use strict";g.d(J,{Z:function(){return O}});var m=g(15255),F=g(44978),R=g(83845),L=function(b,E,T){if(!(0,F.Z)(b)&&!(0,R.Z)(b))return b;var _=T;return(0,m.Z)(b,function(P,B){_=E(_,P,B)}),_},k=L,O=function(b,E){return k(b,function(T,_,P){return E.includes(P)||(T[P]=_),T},{})}},23413:function(q,J,g){"use strict";var m=g(15255),F=g(83845),R=Object.prototype.hasOwnProperty;J.Z=function(L,k){if(L===null||!(0,F.Z)(L))return{};var O={};return(0,m.Z)(k,function(b){R.call(L,b)&&(O[b]=L[b])}),O}},17829:function(q,J,g){"use strict";var m=g(4637),F=g(76714),R=g(25897);J.Z=function(L,k,O){var b=L,E=(0,F.Z)(k)?k.split("."):k;return E.forEach(function(T,_){_<E.length-1?((0,m.Z)(b[T])||(b[T]=(0,R.Z)(E[_+1])?[]:{}),b=b[T]):b[T]=O}),L}},68856:function(q,J){"use strict";function g(m,F){return!m||!F?m:m.replace(/\\?\{([^{}]+)\}/g,function(R,L){return R.charAt(0)==="\\"?R.slice(1):F[L]===void 0?"":F[L]})}J.Z=g},99711:function(q,J){"use strict";J.Z=function(g,m,F){var R,L,k,O,b=0;F||(F={});var E=function(){b=F.leading===!1?0:Date.now(),R=null,O=g.apply(L,k),R||(L=k=null)},T=function(){var _=Date.now();!b&&F.leading===!1&&(b=_);var P=m-(_-b);return L=this,k=arguments,P<=0||P>m?(R&&(clearTimeout(R),R=null),b=_,O=g.apply(L,k),R||(L=k=null)):!R&&F.trailing!==!1&&(R=setTimeout(E,P)),O};return T.cancel=function(){clearTimeout(R),b=0,R=L=k=null},T}},92123:function(q,J,g){"use strict";var m=g(95147);J.Z=function(F){return(0,m.Z)(F)?"":F.toString()}},58029:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F,R){R===void 0&&(R=new Map);var L=[];if(Array.isArray(F))for(var k=0,O=F.length;k<O;k++){var b=F[k];R.has(b)||(L.push(b),R.set(b,!0))}return L}},71701:function(q,J){"use strict";var g={};J.Z=function(m){return m=m||"g",g[m]?g[m]+=1:g[m]=1,m+g[m]}},83914:function(q,J,g){"use strict";var m=g(92123),F=function(R){var L=(0,m.Z)(R);return L.charAt(0).toUpperCase()+L.substring(1)};J.Z=F},75839:function(q,J,g){"use strict";g.d(J,{Y:function(){return B}});var m=g(97582),F=g(64985);function R(tt,st,Rt){if(tt[Rt].length>7){tt[Rt].shift();for(var xt=tt[Rt],nt=Rt;xt.length;)st[Rt]="A",tt.splice(nt+=1,0,["C"].concat(xt.splice(0,6)));tt.splice(Rt,1)}}var L=g(4848),k=g(11013);function O(tt){return(0,k.y)(tt)&&tt.every(function(st){var Rt=st[0];return"MC".includes(Rt)})}var b=g(74873);function E(tt,st,Rt,xt,nt,Et){var ot=.3333333333333333,Ct=2/3;return[ot*tt+Ct*Rt,ot*st+Ct*xt,ot*nt+Ct*Rt,ot*Et+Ct*xt,nt,Et]}var T=g(17570),_=function(tt,st,Rt,xt){var nt=.5,Et=(0,T.k)([tt,st],[Rt,xt],nt);return(0,m.ev)((0,m.ev)([],Et,!0),[Rt,xt,Rt,xt],!1)};function P(tt,st){var Rt=tt[0],xt=tt.slice(1).map(Number),nt=xt[0],Et=xt[1],ot,Ct=st.x1,_t=st.y1,dt=st.x,Ot=st.y;switch("TQ".includes(Rt)||(st.qx=null,st.qy=null),Rt){case"M":return st.x=nt,st.y=Et,tt;case"A":return ot=[Ct,_t].concat(xt),["C"].concat((0,b.W)(ot[0],ot[1],ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],ot[8],ot[9]));case"Q":return st.qx=nt,st.qy=Et,ot=[Ct,_t].concat(xt),["C"].concat(E(ot[0],ot[1],ot[2],ot[3],ot[4],ot[5]));case"L":return["C"].concat(_(Ct,_t,nt,Et));case"Z":return Ct===dt&&_t===Ot?["C",Ct,_t,dt,Ot,dt,Ot]:["C"].concat(_(Ct,_t,dt,Ot));default:}return tt}function B(tt,st){if(st===void 0&&(st=!1),O(tt)){var Rt=[].concat(tt);return st?[Rt,[]]:Rt}for(var xt=(0,L.A)(tt),nt=(0,m.pi)({},F.z),Et=[],ot="",Ct=xt.length,_t,dt,Ot=[],wt=0;wt<Ct;wt+=1){xt[wt]&&(ot=xt[wt][0]),Et[wt]=ot;var Ft=P(xt[wt],nt);xt[wt]=Ft,R(xt,Et,wt),Ct=xt.length,ot==="Z"&&Ot.push(wt),_t=xt[wt],dt=_t.length,nt.x1=+_t[dt-2],nt.y1=+_t[dt-1],nt.x2=+_t[dt-4]||nt.x1,nt.y2=+_t[dt-3]||nt.y1}return st?[xt,Ot]:xt}},18323:function(q,J,g){"use strict";g.d(J,{R:function(){return m}});var m={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0}},64985:function(q,J,g){"use strict";g.d(J,{z:function(){return m}});var m={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null}},74873:function(q,J,g){"use strict";g.d(J,{W:function(){return F}});function m(R,L,k){var O=R*Math.cos(k)-L*Math.sin(k),b=R*Math.sin(k)+L*Math.cos(k);return{x:O,y:b}}function F(R,L,k,O,b,E,T,_,P,B){var tt=R,st=L,Rt=k,xt=O,nt=_,Et=P,ot=Math.PI*120/180,Ct=Math.PI/180*(+b||0),_t=[],dt,Ot,wt,Ft,jt;if(B)Ot=B[0],wt=B[1],Ft=B[2],jt=B[3];else{dt=m(tt,st,-Ct),tt=dt.x,st=dt.y,dt=m(nt,Et,-Ct),nt=dt.x,Et=dt.y;var re=(tt-nt)/2,Ee=(st-Et)/2,et=re*re/(Rt*Rt)+Ee*Ee/(xt*xt);et>1&&(et=Math.sqrt(et),Rt*=et,xt*=et);var ge=Rt*Rt,yt=xt*xt,te=(E===T?-1:1)*Math.sqrt(Math.abs((ge*yt-ge*Ee*Ee-yt*re*re)/(ge*Ee*Ee+yt*re*re)));Ft=te*Rt*Ee/xt+(tt+nt)/2,jt=te*-xt*re/Rt+(st+Et)/2,Ot=Math.asin(((st-jt)/xt*Math.pow(10,9)>>0)/Math.pow(10,9)),wt=Math.asin(((Et-jt)/xt*Math.pow(10,9)>>0)/Math.pow(10,9)),Ot=tt<Ft?Math.PI-Ot:Ot,wt=nt<Ft?Math.PI-wt:wt,Ot<0&&(Ot=Math.PI*2+Ot),wt<0&&(wt=Math.PI*2+wt),T&&Ot>wt&&(Ot-=Math.PI*2),!T&&wt>Ot&&(wt-=Math.PI*2)}var Xt=wt-Ot;if(Math.abs(Xt)>ot){var rt=wt,bt=nt,ye=Et;wt=Ot+ot*(T&&wt>Ot?1:-1),nt=Ft+Rt*Math.cos(wt),Et=jt+xt*Math.sin(wt),_t=F(nt,Et,Rt,xt,b,0,T,bt,ye,[wt,rt,Ft,jt])}Xt=wt-Ot;var be=Math.cos(Ot),Gt=Math.sin(Ot),Kt=Math.cos(wt),we=Math.sin(wt),Bt=Math.tan(Xt/4),oe=4/3*Rt*Bt,ht=4/3*xt*Bt,ut=[tt,st],Vt=[tt+oe*Gt,st-ht*be],ve=[nt+oe*we,Et-ht*Kt],kt=[nt,Et];if(Vt[0]=2*ut[0]-Vt[0],Vt[1]=2*ut[1]-Vt[1],B)return Vt.concat(ve,kt,_t);_t=Vt.concat(ve,kt,_t);for(var ee=[],me=0,Nt=_t.length;me<Nt;me+=1)ee[me]=me%2?m(_t[me-1],_t[me],Ct).y:m(_t[me],_t[me+1],Ct).x;return ee}},28659:function(q,J,g){"use strict";g.d(J,{U:function(){return m}});function m(F){return F.map(function(R){return Array.isArray(R)?[].concat(R):R})}},4848:function(q,J,g){"use strict";g.d(J,{A:function(){return _t}});var m=g(97582),F=g(11013),R=g(64985),L=g(41010),k=g(56346),O=g(18323);function b(dt){for(var Ot=dt.pathValue[dt.segmentStart],wt=Ot.toLowerCase(),Ft=dt.data;Ft.length>=O.R[wt]&&(wt==="m"&&Ft.length>2?(dt.segments.push([Ot].concat(Ft.splice(0,2))),wt="l",Ot=Ot==="m"?"l":"L"):dt.segments.push([Ot].concat(Ft.splice(0,O.R[wt]))),!!O.R[wt]););}function E(dt){var Ot=dt.index,wt=dt.pathValue,Ft=wt.charCodeAt(Ot);if(Ft===48){dt.param=0,dt.index+=1;return}if(Ft===49){dt.param=1,dt.index+=1;return}dt.err='[path-util]: invalid Arc flag "'.concat(wt[Ot],'", expecting 0 or 1 at index ').concat(Ot)}function T(dt){return dt>=48&&dt<=57||dt===43||dt===45||dt===46}function _(dt){return dt>=48&&dt<=57}function P(dt){var Ot=dt.max,wt=dt.pathValue,Ft=dt.index,jt=Ft,re=!1,Ee=!1,et=!1,ge=!1,yt;if(jt>=Ot){dt.err="[path-util]: Invalid path value at index ".concat(jt,', "pathValue" is missing param');return}if(yt=wt.charCodeAt(jt),(yt===43||yt===45)&&(jt+=1,yt=wt.charCodeAt(jt)),!_(yt)&&yt!==46){dt.err="[path-util]: Invalid path value at index ".concat(jt,', "').concat(wt[jt],'" is not a number');return}if(yt!==46){if(re=yt===48,jt+=1,yt=wt.charCodeAt(jt),re&&jt<Ot&&yt&&_(yt)){dt.err="[path-util]: Invalid path value at index ".concat(Ft,', "').concat(wt[Ft],'" illegal number');return}for(;jt<Ot&&_(wt.charCodeAt(jt));)jt+=1,Ee=!0;yt=wt.charCodeAt(jt)}if(yt===46){for(ge=!0,jt+=1;_(wt.charCodeAt(jt));)jt+=1,et=!0;yt=wt.charCodeAt(jt)}if(yt===101||yt===69){if(ge&&!Ee&&!et){dt.err="[path-util]: Invalid path value at index ".concat(jt,', "').concat(wt[jt],'" invalid float exponent');return}if(jt+=1,yt=wt.charCodeAt(jt),(yt===43||yt===45)&&(jt+=1),jt<Ot&&_(wt.charCodeAt(jt)))for(;jt<Ot&&_(wt.charCodeAt(jt));)jt+=1;else{dt.err="[path-util]: Invalid path value at index ".concat(jt,', "').concat(wt[jt],'" invalid integer exponent');return}}dt.index=jt,dt.param=+dt.pathValue.slice(Ft,jt)}function B(dt){var Ot=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return dt===10||dt===13||dt===8232||dt===8233||dt===32||dt===9||dt===11||dt===12||dt===160||dt>=5760&&Ot.includes(dt)}function tt(dt){for(var Ot=dt.pathValue,wt=dt.max;dt.index<wt&&B(Ot.charCodeAt(dt.index));)dt.index+=1}function st(dt){switch(dt|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function Rt(dt){return(dt|32)===97}function xt(dt){var Ot=dt.max,wt=dt.pathValue,Ft=dt.index,jt=wt.charCodeAt(Ft),re=O.R[wt[Ft].toLowerCase()];if(dt.segmentStart=Ft,!st(jt)){dt.err='[path-util]: Invalid path value "'.concat(wt[Ft],'" is not a path command');return}if(dt.index+=1,tt(dt),dt.data=[],!re){b(dt);return}for(;;){for(var Ee=re;Ee>0;Ee-=1){if(Rt(jt)&&(Ee===3||Ee===4)?E(dt):P(dt),dt.err.length)return;dt.data.push(dt.param),tt(dt),dt.index<Ot&&wt.charCodeAt(dt.index)===44&&(dt.index+=1,tt(dt))}if(dt.index>=dt.max||!T(wt.charCodeAt(dt.index)))break}b(dt)}var nt=function(){function dt(Ot){this.pathValue=Ot,this.segments=[],this.max=Ot.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return dt}();function Et(dt){if((0,k.n)(dt))return[].concat(dt);var Ot=new nt(dt);for(tt(Ot);Ot.index<Ot.max&&!Ot.err.length;)xt(Ot);return Ot.err?Ot.err:Ot.segments}function ot(dt){if((0,L.b)(dt))return[].concat(dt);var Ot=Et(dt),wt=0,Ft=0,jt=0,re=0;return Ot.map(function(Ee){var et=Ee.slice(1).map(Number),ge=Ee[0],yt=ge.toUpperCase();if(ge==="M")return wt=et[0],Ft=et[1],jt=wt,re=Ft,["M",wt,Ft];var te;if(ge!==yt)switch(yt){case"A":te=[yt,et[0],et[1],et[2],et[3],et[4],et[5]+wt,et[6]+Ft];break;case"V":te=[yt,et[0]+Ft];break;case"H":te=[yt,et[0]+wt];break;default:{var Xt=et.map(function(bt,ye){return bt+(ye%2?Ft:wt)});te=[yt].concat(Xt)}}else te=[yt].concat(et);var rt=te.length;switch(yt){case"Z":wt=jt,Ft=re;break;case"H":wt=te[1];break;case"V":Ft=te[1];break;default:wt=te[rt-2],Ft=te[rt-1],yt==="M"&&(jt=wt,re=Ft)}return te})}function Ct(dt,Ot){var wt=dt[0],Ft=Ot.x1,jt=Ot.y1,re=Ot.x2,Ee=Ot.y2,et=dt.slice(1).map(Number),ge=dt;if("TQ".includes(wt)||(Ot.qx=null,Ot.qy=null),wt==="H")ge=["L",dt[1],jt];else if(wt==="V")ge=["L",Ft,dt[1]];else if(wt==="S"){var yt=Ft*2-re,te=jt*2-Ee;Ot.x1=yt,Ot.y1=te,ge=["C",yt,te].concat(et)}else if(wt==="T"){var Xt=Ft*2-Ot.qx,rt=jt*2-Ot.qy;Ot.qx=Xt,Ot.qy=rt,ge=["Q",Xt,rt].concat(et)}else if(wt==="Q"){var bt=et[0],ye=et[1];Ot.qx=bt,Ot.qy=ye}return ge}function _t(dt){if((0,F.y)(dt))return[].concat(dt);for(var Ot=ot(dt),wt=(0,m.pi)({},R.z),Ft=0;Ft<Ot.length;Ft+=1){Ot[Ft]=Ct(Ot[Ft],wt);var jt=Ot[Ft],re=jt.length;wt.x1=+jt[re-2],wt.y1=+jt[re-1],wt.x2=+jt[re-4]||wt.x1,wt.y2=+jt[re-3]||wt.y1}return Ot}},65850:function(q,J,g){"use strict";g.d(J,{G:function(){return m}});function m(F){var R=F.slice(1).map(function(L,k,O){return k?O[k-1].slice(-2).concat(L.slice(1)):F[0].slice(1).concat(L.slice(1))}).map(function(L){return L.map(function(k,O){return L[L.length-O-2*(1-O%2)]})}).reverse();return[["M"].concat(R[0].slice(0,2))].concat(R.map(function(L){return["C"].concat(L.slice(2))}))}},44078:function(q,J,g){"use strict";g.d(J,{y:function(){return m}});function m(F,R){return Math.sqrt((F[0]-R[0])*(F[0]-R[0])+(F[1]-R[1])*(F[1]-R[1]))}},99872:function(q,J,g){"use strict";g.d(J,{x:function(){return k}});var m=g(17570),F=g(6489);function R(O,b){b===void 0&&(b=.5);var E=O.slice(0,2),T=O.slice(2,4),_=O.slice(4,6),P=O.slice(6,8),B=(0,m.k)(E,T,b),tt=(0,m.k)(T,_,b),st=(0,m.k)(_,P,b),Rt=(0,m.k)(B,tt,b),xt=(0,m.k)(tt,st,b),nt=(0,m.k)(Rt,xt,b);return[["C"].concat(B,Rt,nt),["C"].concat(xt,st,P)]}function L(O){return O.map(function(b,E,T){var _=E&&T[E-1].slice(-2).concat(b.slice(1)),P=E?(0,F.S)(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],{bbox:!1}).length:0,B;return E?B=P?R(_):[b,b]:B=[b],{s:b,ss:B,l:P}})}function k(O,b,E){var T=L(O),_=L(b),P=T.length,B=_.length,tt=T.filter(function(dt){return dt.l}).length,st=_.filter(function(dt){return dt.l}).length,Rt=T.filter(function(dt){return dt.l}).reduce(function(dt,Ot){var wt=Ot.l;return dt+wt},0)/tt||0,xt=_.filter(function(dt){return dt.l}).reduce(function(dt,Ot){var wt=Ot.l;return dt+wt},0)/st||0,nt=E||Math.max(P,B),Et=[Rt,xt],ot=[nt-P,nt-B],Ct=0,_t=[T,_].map(function(dt,Ot){return dt.l===nt?dt.map(function(wt){return wt.s}):dt.map(function(wt,Ft){return Ct=Ft&&ot[Ot]&&wt.l>=Et[Ot],ot[Ot]-=Ct?1:0,Ct?wt.ss:[wt.s]}).flat()});return _t[0].length===_t[1].length?_t:k(_t[0],_t[1],nt)}},92455:function(q,J,g){"use strict";g.d(J,{b:function(){return L}});var m=g(75839);function F(k,O,b,E,T,_,P,B){return 3*((B-O)*(b+T)-(P-k)*(E+_)+E*(k-T)-b*(O-_)+B*(T+k/3)-P*(_+O/3))/20}function R(k){var O=0,b=0,E=0;return(0,m.Y)(k).map(function(T){var _;switch(T[0]){case"M":return O=T[1],b=T[2],0;default:var P=T.slice(1),B=P[0],tt=P[1],st=P[2],Rt=P[3],xt=P[4],nt=P[5];return E=F(O,b,B,tt,st,Rt,xt,nt),_=T.slice(-2),O=_[0],b=_[1],E}}).reduce(function(T,_){return T+_},0)}function L(k){return R(k)>=0}},84329:function(q,J,g){"use strict";g.d(J,{r:function(){return R}});var m=g(97582),F=g(32262);function R(L,k,O){return(0,F.s)(L,k,(0,m.pi)((0,m.pi)({},O),{bbox:!1,length:!0})).point}},83555:function(q,J,g){"use strict";g.d(J,{g:function(){return R}});var m=g(44078);function F(L){var k=L.length,O=k-1;return L.map(function(b,E){return L.map(function(T,_){var P=E+_,B;return _===0||L[P]&&L[P][0]==="M"?(B=L[P],["M"].concat(B.slice(-2))):(P>=k&&(P-=O),L[P])})})}function R(L,k){var O=L.length-1,b=[],E=0,T=0,_=F(L);return _.forEach(function(P,B){L.slice(1).forEach(function(tt,st){T+=(0,m.y)(L[(B+st)%O].slice(-2),k[st%O].slice(-2))}),b[B]=T,T=0}),E=b.indexOf(Math.min.apply(null,b)),_[E]}},69877:function(q,J,g){"use strict";g.d(J,{D:function(){return R}});var m=g(97582),F=g(32262);function R(L,k){return(0,F.s)(L,void 0,(0,m.pi)((0,m.pi)({},k),{bbox:!1,length:!0})).length}},41010:function(q,J,g){"use strict";g.d(J,{b:function(){return F}});var m=g(56346);function F(R){return(0,m.n)(R)&&R.every(function(L){var k=L[0];return k===k.toUpperCase()})}},11013:function(q,J,g){"use strict";g.d(J,{y:function(){return F}});var m=g(41010);function F(R){return(0,m.b)(R)&&R.every(function(L){var k=L[0];return"ACLMQZ".includes(k)})}},56346:function(q,J,g){"use strict";g.d(J,{n:function(){return F}});var m=g(18323);function F(R){return Array.isArray(R)&&R.every(function(L){var k=L[0].toLowerCase();return m.R[k]===L.length-1&&"achlmqstvz".includes(k)})}},17570:function(q,J,g){"use strict";g.d(J,{k:function(){return m}});function m(F,R,L){var k=F[0],O=F[1],b=R[0],E=R[1];return[k+(b-k)*L,O+(E-O)*L]}},32262:function(q,J,g){"use strict";g.d(J,{s:function(){return P}});var m=g(4848),F=g(17570),R=g(44078);function L(B,tt,st,Rt,xt){var nt=(0,R.y)([B,tt],[st,Rt]),Et={x:0,y:0};if(typeof xt=="number")if(xt<=0)Et={x:B,y:tt};else if(xt>=nt)Et={x:st,y:Rt};else{var ot=(0,F.k)([B,tt],[st,Rt],xt/nt),Ct=ot[0],_t=ot[1];Et={x:Ct,y:_t}}return{length:nt,point:Et,min:{x:Math.min(B,st),y:Math.min(tt,Rt)},max:{x:Math.max(B,st),y:Math.max(tt,Rt)}}}function k(B,tt){var st=B.x,Rt=B.y,xt=tt.x,nt=tt.y,Et=st*xt+Rt*nt,ot=Math.sqrt((Math.pow(st,2)+Math.pow(Rt,2))*(Math.pow(xt,2)+Math.pow(nt,2))),Ct=st*nt-Rt*xt<0?-1:1,_t=Ct*Math.acos(Et/ot);return _t}function O(B,tt,st,Rt,xt,nt,Et,ot,Ct,_t){var dt=Math.abs,Ot=Math.sin,wt=Math.cos,Ft=Math.sqrt,jt=Math.PI,re=dt(st),Ee=dt(Rt),et=(xt%360+360)%360,ge=et*(jt/180);if(B===ot&&tt===Ct)return{x:B,y:tt};if(re===0||Ee===0)return L(B,tt,ot,Ct,_t).point;var yt=(B-ot)/2,te=(tt-Ct)/2,Xt={x:wt(ge)*yt+Ot(ge)*te,y:-Ot(ge)*yt+wt(ge)*te},rt=Math.pow(Xt.x,2)/Math.pow(re,2)+Math.pow(Xt.y,2)/Math.pow(Ee,2);rt>1&&(re*=Ft(rt),Ee*=Ft(rt));var bt=Math.pow(re,2)*Math.pow(Ee,2)-Math.pow(re,2)*Math.pow(Xt.y,2)-Math.pow(Ee,2)*Math.pow(Xt.x,2),ye=Math.pow(re,2)*Math.pow(Xt.y,2)+Math.pow(Ee,2)*Math.pow(Xt.x,2),be=bt/ye;be=be<0?0:be;var Gt=(nt!==Et?1:-1)*Ft(be),Kt={x:Gt*(re*Xt.y/Ee),y:Gt*(-(Ee*Xt.x)/re)},we={x:wt(ge)*Kt.x-Ot(ge)*Kt.y+(B+ot)/2,y:Ot(ge)*Kt.x+wt(ge)*Kt.y+(tt+Ct)/2},Bt={x:(Xt.x-Kt.x)/re,y:(Xt.y-Kt.y)/Ee},oe=k({x:1,y:0},Bt),ht={x:(-Xt.x-Kt.x)/re,y:(-Xt.y-Kt.y)/Ee},ut=k(Bt,ht);!Et&&ut>0?ut-=2*jt:Et&&ut<0&&(ut+=2*jt),ut%=2*jt;var Vt=oe+ut*_t,ve=re*wt(Vt),kt=Ee*Ot(Vt),ee={x:wt(ge)*ve-Ot(ge)*kt+we.x,y:Ot(ge)*ve+wt(ge)*kt+we.y};return ee}function b(B,tt,st,Rt,xt,nt,Et,ot,Ct,_t,dt){var Ot,wt=dt.bbox,Ft=wt===void 0?!0:wt,jt=dt.length,re=jt===void 0?!0:jt,Ee=dt.sampleSize,et=Ee===void 0?30:Ee,ge=typeof _t=="number",yt=B,te=tt,Xt=0,rt=[yt,te,Xt],bt=[yt,te],ye=0,be={x:0,y:0},Gt=[{x:yt,y:te}];ge&&_t<=0&&(be={x:yt,y:te});for(var Kt=0;Kt<=et;Kt+=1){if(ye=Kt/et,Ot=O(B,tt,st,Rt,xt,nt,Et,ot,Ct,ye),yt=Ot.x,te=Ot.y,Ft&&Gt.push({x:yt,y:te}),re&&(Xt+=(0,R.y)(bt,[yt,te])),bt=[yt,te],ge&&Xt>=_t&&_t>rt[2]){var we=(Xt-_t)/(Xt-rt[2]);be={x:bt[0]*(1-we)+rt[0]*we,y:bt[1]*(1-we)+rt[1]*we}}rt=[yt,te,Xt]}return ge&&_t>=Xt&&(be={x:ot,y:Ct}),{length:Xt,point:be,min:{x:Math.min.apply(null,Gt.map(function(Bt){return Bt.x})),y:Math.min.apply(null,Gt.map(function(Bt){return Bt.y}))},max:{x:Math.max.apply(null,Gt.map(function(Bt){return Bt.x})),y:Math.max.apply(null,Gt.map(function(Bt){return Bt.y}))}}}var E=g(6489);function T(B,tt,st,Rt,xt,nt,Et){var ot=1-Et;return{x:Math.pow(ot,2)*B+2*ot*Et*st+Math.pow(Et,2)*xt,y:Math.pow(ot,2)*tt+2*ot*Et*Rt+Math.pow(Et,2)*nt}}function _(B,tt,st,Rt,xt,nt,Et,ot){var Ct,_t=ot.bbox,dt=_t===void 0?!0:_t,Ot=ot.length,wt=Ot===void 0?!0:Ot,Ft=ot.sampleSize,jt=Ft===void 0?10:Ft,re=typeof Et=="number",Ee=B,et=tt,ge=0,yt=[Ee,et,ge],te=[Ee,et],Xt=0,rt={x:0,y:0},bt=[{x:Ee,y:et}];re&&Et<=0&&(rt={x:Ee,y:et});for(var ye=0;ye<=jt;ye+=1){if(Xt=ye/jt,Ct=T(B,tt,st,Rt,xt,nt,Xt),Ee=Ct.x,et=Ct.y,dt&&bt.push({x:Ee,y:et}),wt&&(ge+=(0,R.y)(te,[Ee,et])),te=[Ee,et],re&&ge>=Et&&Et>yt[2]){var be=(ge-Et)/(ge-yt[2]);rt={x:te[0]*(1-be)+yt[0]*be,y:te[1]*(1-be)+yt[1]*be}}yt=[Ee,et,ge]}return re&&Et>=ge&&(rt={x:xt,y:nt}),{length:ge,point:rt,min:{x:Math.min.apply(null,bt.map(function(Gt){return Gt.x})),y:Math.min.apply(null,bt.map(function(Gt){return Gt.y}))},max:{x:Math.max.apply(null,bt.map(function(Gt){return Gt.x})),y:Math.max.apply(null,bt.map(function(Gt){return Gt.y}))}}}function P(B,tt,st){for(var Rt,xt,nt,Et,ot,Ct,_t=(0,m.A)(B),dt=typeof tt=="number",Ot,wt=[],Ft,jt=0,re=0,Ee=0,et=0,ge,yt=[],te=[],Xt=0,rt={x:0,y:0},bt=rt,ye=rt,be=rt,Gt=0,Kt=0,we=_t.length;Kt<we;Kt+=1)ge=_t[Kt],Ft=ge[0],Ot=Ft==="M",wt=Ot?wt:[jt,re].concat(ge.slice(1)),Ot?(Ee=ge[1],et=ge[2],rt={x:Ee,y:et},bt=rt,Xt=0,dt&&tt<.001&&(be=rt)):Ft==="L"?(Rt=L(wt[0],wt[1],wt[2],wt[3],(tt||0)-Gt),Xt=Rt.length,rt=Rt.min,bt=Rt.max,ye=Rt.point):Ft==="A"?(xt=b(wt[0],wt[1],wt[2],wt[3],wt[4],wt[5],wt[6],wt[7],wt[8],(tt||0)-Gt,st||{}),Xt=xt.length,rt=xt.min,bt=xt.max,ye=xt.point):Ft==="C"?(nt=(0,E.S)(wt[0],wt[1],wt[2],wt[3],wt[4],wt[5],wt[6],wt[7],(tt||0)-Gt,st||{}),Xt=nt.length,rt=nt.min,bt=nt.max,ye=nt.point):Ft==="Q"?(Et=_(wt[0],wt[1],wt[2],wt[3],wt[4],wt[5],(tt||0)-Gt,st||{}),Xt=Et.length,rt=Et.min,bt=Et.max,ye=Et.point):Ft==="Z"&&(wt=[jt,re,Ee,et],ot=L(wt[0],wt[1],wt[2],wt[3],(tt||0)-Gt),Xt=ot.length,rt=ot.min,bt=ot.max,ye=ot.point),dt&&Gt<tt&&Gt+Xt>=tt&&(be=ye),te.push(bt),yt.push(rt),Gt+=Xt,Ct=Ft!=="Z"?ge.slice(-2):[Ee,et],jt=Ct[0],re=Ct[1];return dt&&tt>=Gt&&(be={x:jt,y:re}),{length:Gt,point:be,min:{x:Math.min.apply(null,yt.map(function(Bt){return Bt.x})),y:Math.min.apply(null,yt.map(function(Bt){return Bt.y}))},max:{x:Math.max.apply(null,te.map(function(Bt){return Bt.x})),y:Math.max.apply(null,te.map(function(Bt){return Bt.y}))}}}},6489:function(q,J,g){"use strict";g.d(J,{S:function(){return R}});var m=g(44078);function F(L,k,O,b,E,T,_,P,B){var tt=1-B;return{x:Math.pow(tt,3)*L+3*Math.pow(tt,2)*B*O+3*tt*Math.pow(B,2)*E+Math.pow(B,3)*_,y:Math.pow(tt,3)*k+3*Math.pow(tt,2)*B*b+3*tt*Math.pow(B,2)*T+Math.pow(B,3)*P}}function R(L,k,O,b,E,T,_,P,B,tt){var st,Rt=tt.bbox,xt=Rt===void 0?!0:Rt,nt=tt.length,Et=nt===void 0?!0:nt,ot=tt.sampleSize,Ct=ot===void 0?10:ot,_t=typeof B=="number",dt=L,Ot=k,wt=0,Ft=[dt,Ot,wt],jt=[dt,Ot],re=0,Ee={x:0,y:0},et=[{x:dt,y:Ot}];_t&&B<=0&&(Ee={x:dt,y:Ot});for(var ge=0;ge<=Ct;ge+=1){if(re=ge/Ct,st=F(L,k,O,b,E,T,_,P,re),dt=st.x,Ot=st.y,xt&&et.push({x:dt,y:Ot}),Et&&(wt+=(0,m.y)(jt,[dt,Ot])),jt=[dt,Ot],_t&&wt>=B&&B>Ft[2]){var yt=(wt-B)/(wt-Ft[2]);Ee={x:jt[0]*(1-yt)+Ft[0]*yt,y:jt[1]*(1-yt)+Ft[1]*yt}}Ft=[dt,Ot,wt]}return _t&&B>=wt&&(Ee={x:_,y:P}),{length:wt,point:Ee,min:{x:Math.min.apply(null,et.map(function(te){return te.x})),y:Math.min.apply(null,et.map(function(te){return te.y}))},max:{x:Math.max.apply(null,et.map(function(te){return te.x})),y:Math.max.apply(null,et.map(function(te){return te.y}))}}}},62309:function(q,J,g){"use strict";var m=g(67294),F=g(50976),R=g(43085),L=g.n(R),k=Object.defineProperty,O=Object.defineProperties,b=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,P=(nt,Et,ot)=>Et in nt?k(nt,Et,{enumerable:!0,configurable:!0,writable:!0,value:ot}):nt[Et]=ot,B=(nt,Et)=>{for(var ot in Et||(Et={}))T.call(Et,ot)&&P(nt,ot,Et[ot]);if(E)for(var ot of E(Et))_.call(Et,ot)&&P(nt,ot,Et[ot]);return nt},tt=(nt,Et)=>O(nt,b(Et));function st(nt,Et,ot=1/3,Ct){let _t=nt*Math.PI*2,dt=Et*Math.PI*2;return{u:{min:-Math.PI,max:Math.PI*3,step:Math.PI/32},v:{min:0,max:Math.PI*2,step:Math.PI/20},x:function(Ot,wt){return Ot<_t?Math.cos(_t)*(1+Math.cos(wt)*ot):Ot>dt?Math.cos(dt)*(1+Math.cos(wt)*ot):Math.cos(Ot)*(1+Math.cos(wt)*ot)},y:function(Ot,wt){return Ot<_t?Math.sin(_t)*(1+Math.cos(wt)*ot):Ot>dt?Math.sin(dt)*(1+Math.cos(wt)*ot):Math.sin(Ot)*(1+Math.cos(wt)*ot)},z:function(Ot,wt){return Ot<-Math.PI*.5?Math.sin(Ot):Ot>Math.PI*2.5?Math.sin(Ot)*Ct*.1:Math.sin(wt)>0?1*Ct*.1:-1}}}function Rt({pieData:nt=[],internalDiameterRatio:Et=1/3}){var ot,Ct,_t,dt;const Ot=[],wt=nt==null?void 0:nt.reduce((et,ge)=>(et||0)+((ge==null?void 0:ge.value)||0),0);let Ft=0,jt=0;const re=[];for(let et=0;et<(nt==null?void 0:nt.length);et++){jt=Ft+(wt==0?1:((ot=nt==null?void 0:nt[et])==null?void 0:ot.value)||0);const ge={itemStyle:((Ct=nt==null?void 0:nt[et])==null?void 0:Ct.itemStyle)||{},name:((_t=nt==null?void 0:nt[et])==null?void 0:_t.name)||`name${et}`,type:"surface",parametric:!0,parametricEquation:st(Ft/(wt||(nt==null?void 0:nt.length)),jt/(wt||(nt==null?void 0:nt.length)),Et,((dt=nt==null?void 0:nt[et])==null?void 0:dt.value)||(wt==0?25:0)),wireframe:{show:!1},pieData:nt==null?void 0:nt[et]};re.push(ge.name),Ot.push(ge),Ft=jt}return Ot.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:et=>`${et.value}
|
|
|
|
|
|
${et.name}`},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:[...nt||[]].reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:re},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:Ot}}const xt=({dataSource:nt=[{name:"\u638C\u63E1\u738780%~100%",value:0,itemStyle:{color:"rgb(223,209,38)"}},{name:"\u638C\u63D0\u738760%~79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63A8\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}}],className:Et="",style:ot={},legend:Ct={},internalDiameterRatio:_t=1/3})=>{const[dt,Ot]=(0,m.useState)([]),wt=(0,m.useCallback)(re=>{const Ee=re.selected||{},et=nt.map(ge=>ge.name).filter(ge=>Ee[ge]===!1);Ot(et)},[nt]),Ft=(0,m.useMemo)(()=>nt.filter(re=>!dt.includes(re.name)),[nt,dt]),jt=(0,m.useMemo)(()=>{const re=Rt({pieData:Ft,internalDiameterRatio:_t}),Ee=nt.map(ge=>ge.name),et=nt.reduce((ge,yt)=>(ge[yt.name]=!dt.includes(yt.name),ge),{});return re.legend=tt(B(B({},re.legend),Ct),{data:Ee,selected:et}),re},[Ft,Ct,_t,nt,dt]);return m.createElement(F.Z,{onEvents:{legendselectchanged:wt},className:`w-full h-full ${Et}`,option:jt,style:B({height:"100%"},ot)})};J.Z=xt},48202:function(q,J,g){"use strict";var m,F=Object.defineProperty,R=gt=>{throw TypeError(gt)},L=Math.pow,k=(gt,w,M)=>w in gt?F(gt,w,{enumerable:!0,configurable:!0,writable:!0,value:M}):gt[w]=M,O=(gt,w,M)=>k(gt,typeof w!="symbol"?w+"":w,M),b=(gt,w,M)=>w.has(gt)||R("Cannot "+M),E=(gt,w,M)=>(b(gt,w,"read from private field"),M?M.call(gt):w.get(gt)),T=(gt,w,M)=>w.has(gt)?R("Cannot add the same private member more than once"):w instanceof WeakSet?w.add(gt):w.set(gt,M),_=(gt,w,M,y)=>(b(gt,w,"write to private field"),y?y.call(gt,M):w.set(gt,M),M),P=(gt,w,M)=>(b(gt,w,"access private method"),M),B,tt,st;m={value:!0};var Rt=g(44091),xt=g(75823);const nt=" ".repeat(2),Et=" ".repeat(4);function ot(){return Ct(this)}function Ct(gt,w={}){const{maxRows:M=15,maxColumns:y=10,maxNumSize:C=8,padMinus:U="auto"}=w;return`${gt.constructor.name} {
|
|
|
${nt}[
|
|
|
${Et}${_t(gt,M,y,C,U)}
|
|
|
${nt}]
|
|
|
${nt}rows: ${gt.rows}
|
|
|
${nt}columns: ${gt.columns}
|
|
|
}`}function _t(gt,w,M,y,C){const{rows:U,columns:Wt}=gt,Ut=Math.min(U,w),Jt=Math.min(Wt,M),qt=[];if(C==="auto"){C=!1;t:for(let Pe=0;Pe<Ut;Pe++)for(let xe=0;xe<Jt;xe++)if(gt.get(Pe,xe)<0){C=!0;break t}}for(let Pe=0;Pe<Ut;Pe++){let xe=[];for(let je=0;je<Jt;je++)xe.push(dt(gt.get(Pe,je),y,C));qt.push(`${xe.join(" ")}`)}return Jt!==Wt&&(qt[qt.length-1]+=` ... ${Wt-M} more columns`),Ut!==U&&qt.push(`... ${U-w} more rows`),qt.join(`
|
|
|
${Et}`)}function dt(gt,w,M){return(gt>=0&&M?` ${Ot(gt,w-1)}`:Ot(gt,w)).padEnd(w)}function Ot(gt,w){let M=gt.toString();if(M.length<=w)return M;let y=gt.toFixed(w);if(y.length>w&&(y=gt.toFixed(Math.max(0,w-(y.length-w)))),y.length<=w&&!y.startsWith("0.000")&&!y.startsWith("-0.000"))return y;let C=gt.toExponential(w);return C.length>w&&(C=gt.toExponential(Math.max(0,w-(C.length-w)))),C.slice(0)}function wt(gt,w){gt.prototype.add=function(y){return typeof y=="number"?this.addS(y):this.addM(y)},gt.prototype.addS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)+y);return this},gt.prototype.addM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)+y.get(C,U));return this},gt.add=function(y,C){return new w(y).add(C)},gt.prototype.sub=function(y){return typeof y=="number"?this.subS(y):this.subM(y)},gt.prototype.subS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)-y);return this},gt.prototype.subM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)-y.get(C,U));return this},gt.sub=function(y,C){return new w(y).sub(C)},gt.prototype.subtract=gt.prototype.sub,gt.prototype.subtractS=gt.prototype.subS,gt.prototype.subtractM=gt.prototype.subM,gt.subtract=gt.sub,gt.prototype.mul=function(y){return typeof y=="number"?this.mulS(y):this.mulM(y)},gt.prototype.mulS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)*y);return this},gt.prototype.mulM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)*y.get(C,U));return this},gt.mul=function(y,C){return new w(y).mul(C)},gt.prototype.multiply=gt.prototype.mul,gt.prototype.multiplyS=gt.prototype.mulS,gt.prototype.multiplyM=gt.prototype.mulM,gt.multiply=gt.mul,gt.prototype.div=function(y){return typeof y=="number"?this.divS(y):this.divM(y)},gt.prototype.divS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)/y);return this},gt.prototype.divM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)/y.get(C,U));return this},gt.div=function(y,C){return new w(y).div(C)},gt.prototype.divide=gt.prototype.div,gt.prototype.divideS=gt.prototype.divS,gt.prototype.divideM=gt.prototype.divM,gt.divide=gt.div,gt.prototype.mod=function(y){return typeof y=="number"?this.modS(y):this.modM(y)},gt.prototype.modS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)%y);return this},gt.prototype.modM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)%y.get(C,U));return this},gt.mod=function(y,C){return new w(y).mod(C)},gt.prototype.modulus=gt.prototype.mod,gt.prototype.modulusS=gt.prototype.modS,gt.prototype.modulusM=gt.prototype.modM,gt.modulus=gt.mod,gt.prototype.and=function(y){return typeof y=="number"?this.andS(y):this.andM(y)},gt.prototype.andS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)&y);return this},gt.prototype.andM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)&y.get(C,U));return this},gt.and=function(y,C){return new w(y).and(C)},gt.prototype.or=function(y){return typeof y=="number"?this.orS(y):this.orM(y)},gt.prototype.orS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)|y);return this},gt.prototype.orM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)|y.get(C,U));return this},gt.or=function(y,C){return new w(y).or(C)},gt.prototype.xor=function(y){return typeof y=="number"?this.xorS(y):this.xorM(y)},gt.prototype.xorS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)^y);return this},gt.prototype.xorM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)^y.get(C,U));return this},gt.xor=function(y,C){return new w(y).xor(C)},gt.prototype.leftShift=function(y){return typeof y=="number"?this.leftShiftS(y):this.leftShiftM(y)},gt.prototype.leftShiftS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)<<y);return this},gt.prototype.leftShiftM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)<<y.get(C,U));return this},gt.leftShift=function(y,C){return new w(y).leftShift(C)},gt.prototype.signPropagatingRightShift=function(y){return typeof y=="number"?this.signPropagatingRightShiftS(y):this.signPropagatingRightShiftM(y)},gt.prototype.signPropagatingRightShiftS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)>>y);return this},gt.prototype.signPropagatingRightShiftM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)>>y.get(C,U));return this},gt.signPropagatingRightShift=function(y,C){return new w(y).signPropagatingRightShift(C)},gt.prototype.rightShift=function(y){return typeof y=="number"?this.rightShiftS(y):this.rightShiftM(y)},gt.prototype.rightShiftS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)>>>y);return this},gt.prototype.rightShiftM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,this.get(C,U)>>>y.get(C,U));return this},gt.rightShift=function(y,C){return new w(y).rightShift(C)},gt.prototype.zeroFillRightShift=gt.prototype.rightShift,gt.prototype.zeroFillRightShiftS=gt.prototype.rightShiftS,gt.prototype.zeroFillRightShiftM=gt.prototype.rightShiftM,gt.zeroFillRightShift=gt.rightShift,gt.prototype.not=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,~this.get(y,C));return this},gt.not=function(y){return new w(y).not()},gt.prototype.abs=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.abs(this.get(y,C)));return this},gt.abs=function(y){return new w(y).abs()},gt.prototype.acos=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.acos(this.get(y,C)));return this},gt.acos=function(y){return new w(y).acos()},gt.prototype.acosh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.acosh(this.get(y,C)));return this},gt.acosh=function(y){return new w(y).acosh()},gt.prototype.asin=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.asin(this.get(y,C)));return this},gt.asin=function(y){return new w(y).asin()},gt.prototype.asinh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.asinh(this.get(y,C)));return this},gt.asinh=function(y){return new w(y).asinh()},gt.prototype.atan=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.atan(this.get(y,C)));return this},gt.atan=function(y){return new w(y).atan()},gt.prototype.atanh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.atanh(this.get(y,C)));return this},gt.atanh=function(y){return new w(y).atanh()},gt.prototype.cbrt=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.cbrt(this.get(y,C)));return this},gt.cbrt=function(y){return new w(y).cbrt()},gt.prototype.ceil=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.ceil(this.get(y,C)));return this},gt.ceil=function(y){return new w(y).ceil()},gt.prototype.clz32=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.clz32(this.get(y,C)));return this},gt.clz32=function(y){return new w(y).clz32()},gt.prototype.cos=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.cos(this.get(y,C)));return this},gt.cos=function(y){return new w(y).cos()},gt.prototype.cosh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.cosh(this.get(y,C)));return this},gt.cosh=function(y){return new w(y).cosh()},gt.prototype.exp=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.exp(this.get(y,C)));return this},gt.exp=function(y){return new w(y).exp()},gt.prototype.expm1=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.expm1(this.get(y,C)));return this},gt.expm1=function(y){return new w(y).expm1()},gt.prototype.floor=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.floor(this.get(y,C)));return this},gt.floor=function(y){return new w(y).floor()},gt.prototype.fround=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.fround(this.get(y,C)));return this},gt.fround=function(y){return new w(y).fround()},gt.prototype.log=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.log(this.get(y,C)));return this},gt.log=function(y){return new w(y).log()},gt.prototype.log1p=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.log1p(this.get(y,C)));return this},gt.log1p=function(y){return new w(y).log1p()},gt.prototype.log10=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.log10(this.get(y,C)));return this},gt.log10=function(y){return new w(y).log10()},gt.prototype.log2=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.log2(this.get(y,C)));return this},gt.log2=function(y){return new w(y).log2()},gt.prototype.round=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.round(this.get(y,C)));return this},gt.round=function(y){return new w(y).round()},gt.prototype.sign=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.sign(this.get(y,C)));return this},gt.sign=function(y){return new w(y).sign()},gt.prototype.sin=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.sin(this.get(y,C)));return this},gt.sin=function(y){return new w(y).sin()},gt.prototype.sinh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.sinh(this.get(y,C)));return this},gt.sinh=function(y){return new w(y).sinh()},gt.prototype.sqrt=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.sqrt(this.get(y,C)));return this},gt.sqrt=function(y){return new w(y).sqrt()},gt.prototype.tan=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.tan(this.get(y,C)));return this},gt.tan=function(y){return new w(y).tan()},gt.prototype.tanh=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.tanh(this.get(y,C)));return this},gt.tanh=function(y){return new w(y).tanh()},gt.prototype.trunc=function(){for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.set(y,C,Math.trunc(this.get(y,C)));return this},gt.trunc=function(y){return new w(y).trunc()},gt.pow=function(y,C){return new w(y).pow(C)},gt.prototype.pow=function(y){return typeof y=="number"?this.powS(y):this.powM(y)},gt.prototype.powS=function(y){for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,L(this.get(C,U),y));return this},gt.prototype.powM=function(y){if(y=w.checkMatrix(y),this.rows!==y.rows||this.columns!==y.columns)throw new RangeError("Matrices dimensions must be equal");for(let C=0;C<this.rows;C++)for(let U=0;U<this.columns;U++)this.set(C,U,L(this.get(C,U),y.get(C,U)));return this}}function Ft(gt,w,M){let y=M?gt.rows:gt.rows-1;if(w<0||w>y)throw new RangeError("Row index out of range")}function jt(gt,w,M){let y=M?gt.columns:gt.columns-1;if(w<0||w>y)throw new RangeError("Column index out of range")}function re(gt,w){if(w.to1DArray&&(w=w.to1DArray()),w.length!==gt.columns)throw new RangeError("vector size must be the same as the number of columns");return w}function Ee(gt,w){if(w.to1DArray&&(w=w.to1DArray()),w.length!==gt.rows)throw new RangeError("vector size must be the same as the number of rows");return w}function et(gt,w){if(!Rt.isAnyArray(w))throw new TypeError("row indices must be an array");for(let M=0;M<w.length;M++)if(w[M]<0||w[M]>=gt.rows)throw new RangeError("row indices are out of range")}function ge(gt,w){if(!Rt.isAnyArray(w))throw new TypeError("column indices must be an array");for(let M=0;M<w.length;M++)if(w[M]<0||w[M]>=gt.columns)throw new RangeError("column indices are out of range")}function yt(gt,w,M,y,C){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(Xt("startRow",w),Xt("endRow",M),Xt("startColumn",y),Xt("endColumn",C),w>M||y>C||w<0||w>=gt.rows||M<0||M>=gt.rows||y<0||y>=gt.columns||C<0||C>=gt.columns)throw new RangeError("Submatrix indices are out of range")}function te(gt,w=0){let M=[];for(let y=0;y<gt;y++)M.push(w);return M}function Xt(gt,w){if(typeof w!="number")throw new TypeError(`${gt} must be a number`)}function rt(gt){if(gt.isEmpty())throw new Error("Empty matrix has no elements to index")}function bt(gt){let w=te(gt.rows);for(let M=0;M<gt.rows;++M)for(let y=0;y<gt.columns;++y)w[M]+=gt.get(M,y);return w}function ye(gt){let w=te(gt.columns);for(let M=0;M<gt.rows;++M)for(let y=0;y<gt.columns;++y)w[y]+=gt.get(M,y);return w}function be(gt){let w=0;for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)w+=gt.get(M,y);return w}function Gt(gt){let w=te(gt.rows,1);for(let M=0;M<gt.rows;++M)for(let y=0;y<gt.columns;++y)w[M]*=gt.get(M,y);return w}function Kt(gt){let w=te(gt.columns,1);for(let M=0;M<gt.rows;++M)for(let y=0;y<gt.columns;++y)w[y]*=gt.get(M,y);return w}function we(gt){let w=1;for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)w*=gt.get(M,y);return w}function Bt(gt,w,M){const y=gt.rows,C=gt.columns,U=[];for(let Wt=0;Wt<y;Wt++){let Ut=0,Jt=0,qt=0;for(let Pe=0;Pe<C;Pe++)qt=gt.get(Wt,Pe)-M[Wt],Ut+=qt,Jt+=qt*qt;w?U.push((Jt-Ut*Ut/C)/(C-1)):U.push((Jt-Ut*Ut/C)/C)}return U}function oe(gt,w,M){const y=gt.rows,C=gt.columns,U=[];for(let Wt=0;Wt<C;Wt++){let Ut=0,Jt=0,qt=0;for(let Pe=0;Pe<y;Pe++)qt=gt.get(Pe,Wt)-M[Wt],Ut+=qt,Jt+=qt*qt;w?U.push((Jt-Ut*Ut/y)/(y-1)):U.push((Jt-Ut*Ut/y)/y)}return U}function ht(gt,w,M){const y=gt.rows,C=gt.columns,U=y*C;let Wt=0,Ut=0,Jt=0;for(let qt=0;qt<y;qt++)for(let Pe=0;Pe<C;Pe++)Jt=gt.get(qt,Pe)-M,Wt+=Jt,Ut+=Jt*Jt;return w?(Ut-Wt*Wt/U)/(U-1):(Ut-Wt*Wt/U)/U}function ut(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)-w[M])}function Vt(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)-w[y])}function ve(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)-w)}function kt(gt){const w=[];for(let M=0;M<gt.rows;M++){let y=0;for(let C=0;C<gt.columns;C++)y+=L(gt.get(M,C),2)/(gt.columns-1);w.push(Math.sqrt(y))}return w}function ee(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)/w[M])}function me(gt){const w=[];for(let M=0;M<gt.columns;M++){let y=0;for(let C=0;C<gt.rows;C++)y+=L(gt.get(C,M),2)/(gt.rows-1);w.push(Math.sqrt(y))}return w}function Nt(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)/w[y])}function Zt(gt){const w=gt.size-1;let M=0;for(let y=0;y<gt.columns;y++)for(let C=0;C<gt.rows;C++)M+=L(gt.get(C,y),2)/w;return Math.sqrt(M)}function Yt(gt,w){for(let M=0;M<gt.rows;M++)for(let y=0;y<gt.columns;y++)gt.set(M,y,gt.get(M,y)/w)}class S{static from1DArray(w,M,y){if(w*M!==y.length)throw new RangeError("data length does not match given dimensions");let U=new $t(w,M);for(let Wt=0;Wt<w;Wt++)for(let Ut=0;Ut<M;Ut++)U.set(Wt,Ut,y[Wt*M+Ut]);return U}static rowVector(w){let M=new $t(1,w.length);for(let y=0;y<w.length;y++)M.set(0,y,w[y]);return M}static columnVector(w){let M=new $t(w.length,1);for(let y=0;y<w.length;y++)M.set(y,0,w[y]);return M}static zeros(w,M){return new $t(w,M)}static ones(w,M){return new $t(w,M).fill(1)}static rand(w,M,y={}){if(typeof y!="object")throw new TypeError("options must be an object");const{random:C=Math.random}=y;let U=new $t(w,M);for(let Wt=0;Wt<w;Wt++)for(let Ut=0;Ut<M;Ut++)U.set(Wt,Ut,C());return U}static randInt(w,M,y={}){if(typeof y!="object")throw new TypeError("options must be an object");const{min:C=0,max:U=1e3,random:Wt=Math.random}=y;if(!Number.isInteger(C))throw new TypeError("min must be an integer");if(!Number.isInteger(U))throw new TypeError("max must be an integer");if(C>=U)throw new RangeError("min must be smaller than max");let Ut=U-C,Jt=new $t(w,M);for(let qt=0;qt<w;qt++)for(let Pe=0;Pe<M;Pe++){let xe=C+Math.round(Wt()*Ut);Jt.set(qt,Pe,xe)}return Jt}static eye(w,M,y){M===void 0&&(M=w),y===void 0&&(y=1);let C=Math.min(w,M),U=this.zeros(w,M);for(let Wt=0;Wt<C;Wt++)U.set(Wt,Wt,y);return U}static diag(w,M,y){let C=w.length;M===void 0&&(M=C),y===void 0&&(y=M);let U=Math.min(C,M,y),Wt=this.zeros(M,y);for(let Ut=0;Ut<U;Ut++)Wt.set(Ut,Ut,w[Ut]);return Wt}static min(w,M){w=this.checkMatrix(w),M=this.checkMatrix(M);let y=w.rows,C=w.columns,U=new $t(y,C);for(let Wt=0;Wt<y;Wt++)for(let Ut=0;Ut<C;Ut++)U.set(Wt,Ut,Math.min(w.get(Wt,Ut),M.get(Wt,Ut)));return U}static max(w,M){w=this.checkMatrix(w),M=this.checkMatrix(M);let y=w.rows,C=w.columns,U=new this(y,C);for(let Wt=0;Wt<y;Wt++)for(let Ut=0;Ut<C;Ut++)U.set(Wt,Ut,Math.max(w.get(Wt,Ut),M.get(Wt,Ut)));return U}static checkMatrix(w){return S.isMatrix(w)?w:new $t(w)}static isMatrix(w){return w!=null&&w.klass==="Matrix"}get size(){return this.rows*this.columns}apply(w){if(typeof w!="function")throw new TypeError("callback must be a function");for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)w.call(this,M,y);return this}to1DArray(){let w=[];for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)w.push(this.get(M,y));return w}to2DArray(){let w=[];for(let M=0;M<this.rows;M++){w.push([]);for(let y=0;y<this.columns;y++)w[M].push(this.get(M,y))}return w}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let w=0;w<this.rows;w++)for(let M=0;M<=w;M++)if(this.get(w,M)!==this.get(M,w))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let w=0;w<this.rows;w++)if(this.get(w,w)!==0)return!1;return!0}isEchelonForm(){let w=0,M=0,y=-1,C=!0,U=!1;for(;w<this.rows&&C;){for(M=0,U=!1;M<this.columns&&U===!1;)this.get(w,M)===0?M++:this.get(w,M)===1&&M>y?(U=!0,y=M):(C=!1,U=!0);w++}return C}isReducedEchelonForm(){let w=0,M=0,y=-1,C=!0,U=!1;for(;w<this.rows&&C;){for(M=0,U=!1;M<this.columns&&U===!1;)this.get(w,M)===0?M++:this.get(w,M)===1&&M>y?(U=!0,y=M):(C=!1,U=!0);for(let Wt=M+1;Wt<this.rows;Wt++)this.get(w,Wt)!==0&&(C=!1);w++}return C}echelonForm(){let w=this.clone(),M=0,y=0;for(;M<w.rows&&y<w.columns;){let C=M;for(let U=M;U<w.rows;U++)w.get(U,y)>w.get(C,y)&&(C=U);if(w.get(C,y)===0)y++;else{w.swapRows(M,C);let U=w.get(M,y);for(let Wt=y;Wt<w.columns;Wt++)w.set(M,Wt,w.get(M,Wt)/U);for(let Wt=M+1;Wt<w.rows;Wt++){let Ut=w.get(Wt,y)/w.get(M,y);w.set(Wt,y,0);for(let Jt=y+1;Jt<w.columns;Jt++)w.set(Wt,Jt,w.get(Wt,Jt)-w.get(M,Jt)*Ut)}M++,y++}}return w}reducedEchelonForm(){let w=this.echelonForm(),M=w.columns,y=w.rows,C=y-1;for(;C>=0;)if(w.maxRow(C)===0)C--;else{let U=0,Wt=!1;for(;U<y&&Wt===!1;)w.get(C,U)===1?Wt=!0:U++;for(let Ut=0;Ut<C;Ut++){let Jt=w.get(Ut,U);for(let qt=U;qt<M;qt++){let Pe=w.get(Ut,qt)-Jt*w.get(C,qt);w.set(Ut,qt,Pe)}}C--}return w}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(w={}){if(typeof w!="object")throw new TypeError("options must be an object");const{rows:M=1,columns:y=1}=w;if(!Number.isInteger(M)||M<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(y)||y<=0)throw new TypeError("columns must be a positive integer");let C=new $t(this.rows*M,this.columns*y);for(let U=0;U<M;U++)for(let Wt=0;Wt<y;Wt++)C.setSubMatrix(this,this.rows*U,this.columns*Wt);return C}fill(w){for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,w);return this}neg(){return this.mulS(-1)}getRow(w){Ft(this,w);let M=[];for(let y=0;y<this.columns;y++)M.push(this.get(w,y));return M}getRowVector(w){return $t.rowVector(this.getRow(w))}setRow(w,M){Ft(this,w),M=re(this,M);for(let y=0;y<this.columns;y++)this.set(w,y,M[y]);return this}swapRows(w,M){Ft(this,w),Ft(this,M);for(let y=0;y<this.columns;y++){let C=this.get(w,y);this.set(w,y,this.get(M,y)),this.set(M,y,C)}return this}getColumn(w){jt(this,w);let M=[];for(let y=0;y<this.rows;y++)M.push(this.get(y,w));return M}getColumnVector(w){return $t.columnVector(this.getColumn(w))}setColumn(w,M){jt(this,w),M=Ee(this,M);for(let y=0;y<this.rows;y++)this.set(y,w,M[y]);return this}swapColumns(w,M){jt(this,w),jt(this,M);for(let y=0;y<this.rows;y++){let C=this.get(y,w);this.set(y,w,this.get(y,M)),this.set(y,M,C)}return this}addRowVector(w){w=re(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)+w[y]);return this}subRowVector(w){w=re(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)-w[y]);return this}mulRowVector(w){w=re(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)*w[y]);return this}divRowVector(w){w=re(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)/w[y]);return this}addColumnVector(w){w=Ee(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)+w[M]);return this}subColumnVector(w){w=Ee(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)-w[M]);return this}mulColumnVector(w){w=Ee(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)*w[M]);return this}divColumnVector(w){w=Ee(this,w);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)this.set(M,y,this.get(M,y)/w[M]);return this}mulRow(w,M){Ft(this,w);for(let y=0;y<this.columns;y++)this.set(w,y,this.get(w,y)*M);return this}mulColumn(w,M){jt(this,w);for(let y=0;y<this.rows;y++)this.set(y,w,this.get(y,w)*M);return this}max(w){if(this.isEmpty())return NaN;switch(w){case"row":{const M=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)>M[y]&&(M[y]=this.get(y,C));return M}case"column":{const M=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)>M[C]&&(M[C]=this.get(y,C));return M}case void 0:{let M=this.get(0,0);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)>M&&(M=this.get(y,C));return M}default:throw new Error(`invalid option: ${w}`)}}maxIndex(){rt(this);let w=this.get(0,0),M=[0,0];for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)>w&&(w=this.get(y,C),M[0]=y,M[1]=C);return M}min(w){if(this.isEmpty())return NaN;switch(w){case"row":{const M=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)<M[y]&&(M[y]=this.get(y,C));return M}case"column":{const M=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)<M[C]&&(M[C]=this.get(y,C));return M}case void 0:{let M=this.get(0,0);for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)<M&&(M=this.get(y,C));return M}default:throw new Error(`invalid option: ${w}`)}}minIndex(){rt(this);let w=this.get(0,0),M=[0,0];for(let y=0;y<this.rows;y++)for(let C=0;C<this.columns;C++)this.get(y,C)<w&&(w=this.get(y,C),M[0]=y,M[1]=C);return M}maxRow(w){if(Ft(this,w),this.isEmpty())return NaN;let M=this.get(w,0);for(let y=1;y<this.columns;y++)this.get(w,y)>M&&(M=this.get(w,y));return M}maxRowIndex(w){Ft(this,w),rt(this);let M=this.get(w,0),y=[w,0];for(let C=1;C<this.columns;C++)this.get(w,C)>M&&(M=this.get(w,C),y[1]=C);return y}minRow(w){if(Ft(this,w),this.isEmpty())return NaN;let M=this.get(w,0);for(let y=1;y<this.columns;y++)this.get(w,y)<M&&(M=this.get(w,y));return M}minRowIndex(w){Ft(this,w),rt(this);let M=this.get(w,0),y=[w,0];for(let C=1;C<this.columns;C++)this.get(w,C)<M&&(M=this.get(w,C),y[1]=C);return y}maxColumn(w){if(jt(this,w),this.isEmpty())return NaN;let M=this.get(0,w);for(let y=1;y<this.rows;y++)this.get(y,w)>M&&(M=this.get(y,w));return M}maxColumnIndex(w){jt(this,w),rt(this);let M=this.get(0,w),y=[0,w];for(let C=1;C<this.rows;C++)this.get(C,w)>M&&(M=this.get(C,w),y[0]=C);return y}minColumn(w){if(jt(this,w),this.isEmpty())return NaN;let M=this.get(0,w);for(let y=1;y<this.rows;y++)this.get(y,w)<M&&(M=this.get(y,w));return M}minColumnIndex(w){jt(this,w),rt(this);let M=this.get(0,w),y=[0,w];for(let C=1;C<this.rows;C++)this.get(C,w)<M&&(M=this.get(C,w),y[0]=C);return y}diag(){let w=Math.min(this.rows,this.columns),M=[];for(let y=0;y<w;y++)M.push(this.get(y,y));return M}norm(w="frobenius"){switch(w){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${w}`)}}cumulativeSum(){let w=0;for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)w+=this.get(M,y),this.set(M,y,w);return this}dot(w){S.isMatrix(w)&&(w=w.to1DArray());let M=this.to1DArray();if(M.length!==w.length)throw new RangeError("vectors do not have the same size");let y=0;for(let C=0;C<M.length;C++)y+=M[C]*w[C];return y}mmul(w){w=$t.checkMatrix(w);let M=this.rows,y=this.columns,C=w.columns,U=new $t(M,C),Wt=new Float64Array(y);for(let Ut=0;Ut<C;Ut++){for(let Jt=0;Jt<y;Jt++)Wt[Jt]=w.get(Jt,Ut);for(let Jt=0;Jt<M;Jt++){let qt=0;for(let Pe=0;Pe<y;Pe++)qt+=this.get(Jt,Pe)*Wt[Pe];U.set(Jt,Ut,qt)}}return U}mpow(w){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(w)||w<0)throw new RangeError("Exponent must be a non-negative integer");let M=$t.eye(this.rows),y=this;for(let C=w;C>1;C/=2)C&1&&(M=M.mmul(y)),y=y.mmul(y);return M}strassen2x2(w){w=$t.checkMatrix(w);let M=new $t(2,2);const y=this.get(0,0),C=w.get(0,0),U=this.get(0,1),Wt=w.get(0,1),Ut=this.get(1,0),Jt=w.get(1,0),qt=this.get(1,1),Pe=w.get(1,1),xe=(y+qt)*(C+Pe),je=(Ut+qt)*C,en=y*(Wt-Pe),Be=qt*(Jt-C),he=(y+U)*Pe,mn=(Ut-y)*(C+Wt),Se=(U-qt)*(Jt+Pe),nn=xe+Be-he+Se,yn=en+he,Bn=je+Be,Xn=xe-je+en+mn;return M.set(0,0,nn),M.set(0,1,yn),M.set(1,0,Bn),M.set(1,1,Xn),M}strassen3x3(w){w=$t.checkMatrix(w);let M=new $t(3,3);const y=this.get(0,0),C=this.get(0,1),U=this.get(0,2),Wt=this.get(1,0),Ut=this.get(1,1),Jt=this.get(1,2),qt=this.get(2,0),Pe=this.get(2,1),xe=this.get(2,2),je=w.get(0,0),en=w.get(0,1),Be=w.get(0,2),he=w.get(1,0),mn=w.get(1,1),Se=w.get(1,2),nn=w.get(2,0),yn=w.get(2,1),Bn=w.get(2,2),Xn=(y+C+U-Wt-Ut-Pe-xe)*mn,Gr=(y-Wt)*(-en+mn),An=Ut*(-je+en+he-mn-Se-nn+Bn),Rn=(-y+Wt+Ut)*(je-en+mn),Ln=(Wt+Ut)*(-je+en),Ce=y*je,Xe=(-y+qt+Pe)*(je-Be+Se),bn=(-y+qt)*(Be-Se),Ye=(qt+Pe)*(-je+Be),Er=(y+C+U-Ut-Jt-qt-Pe)*Se,Cn=Pe*(-je+Be+he-mn-Se-nn+yn),mr=(-U+Pe+xe)*(mn+nn-yn),Wr=(U-xe)*(mn-yn),Kr=U*nn,Ui=(Pe+xe)*(-nn+yn),ur=(-U+Ut+Jt)*(Se+nn-Bn),ya=(U-Jt)*(Se-Bn),qn=(Ut+Jt)*(-nn+Bn),er=C*he,vr=Jt*yn,Zi=Wt*Be,$i=qt*en,ui=xe*Bn,mh=Ce+Kr+er,tl=Xn+Rn+Ln+Ce+mr+Kr+Ui,yh=Ce+Xe+Ye+Er+Kr+ur+qn,Gu=Gr+An+Rn+Ce+Kr+ur+ya,el=Gr+Rn+Ln+Ce+vr,bh=Kr+ur+ya+qn+Zi,Wu=Ce+Xe+bn+Cn+mr+Wr+Kr,Uu=mr+Wr+Kr+Ui+$i,ba=Ce+Xe+bn+Ye+ui;return M.set(0,0,mh),M.set(0,1,tl),M.set(0,2,yh),M.set(1,0,Gu),M.set(1,1,el),M.set(1,2,bh),M.set(2,0,Wu),M.set(2,1,Uu),M.set(2,2,ba),M}mmulStrassen(w){w=$t.checkMatrix(w);let M=this.clone(),y=M.rows,C=M.columns,U=w.rows,Wt=w.columns;C!==U&&console.warn(`Multiplying ${y} x ${C} and ${U} x ${Wt} matrix: dimensions do not match.`);function Ut(xe,je,en){let Be=xe.rows,he=xe.columns;if(Be===je&&he===en)return xe;{let mn=S.zeros(je,en);return mn=mn.setSubMatrix(xe,0,0),mn}}let Jt=Math.max(y,U),qt=Math.max(C,Wt);M=Ut(M,Jt,qt),w=Ut(w,Jt,qt);function Pe(xe,je,en,Be){if(en<=512||Be<=512)return xe.mmul(je);en%2===1&&Be%2===1?(xe=Ut(xe,en+1,Be+1),je=Ut(je,en+1,Be+1)):en%2===1?(xe=Ut(xe,en+1,Be),je=Ut(je,en+1,Be)):Be%2===1&&(xe=Ut(xe,en,Be+1),je=Ut(je,en,Be+1));let he=parseInt(xe.rows/2,10),mn=parseInt(xe.columns/2,10),Se=xe.subMatrix(0,he-1,0,mn-1),nn=je.subMatrix(0,he-1,0,mn-1),yn=xe.subMatrix(0,he-1,mn,xe.columns-1),Bn=je.subMatrix(0,he-1,mn,je.columns-1),Xn=xe.subMatrix(he,xe.rows-1,0,mn-1),Gr=je.subMatrix(he,je.rows-1,0,mn-1),An=xe.subMatrix(he,xe.rows-1,mn,xe.columns-1),Rn=je.subMatrix(he,je.rows-1,mn,je.columns-1),Ln=Pe(S.add(Se,An),S.add(nn,Rn),he,mn),Ce=Pe(S.add(Xn,An),nn,he,mn),Xe=Pe(Se,S.sub(Bn,Rn),he,mn),bn=Pe(An,S.sub(Gr,nn),he,mn),Ye=Pe(S.add(Se,yn),Rn,he,mn),Er=Pe(S.sub(Xn,Se),S.add(nn,Bn),he,mn),Cn=Pe(S.sub(yn,An),S.add(Gr,Rn),he,mn),mr=S.add(Ln,bn);mr.sub(Ye),mr.add(Cn);let Wr=S.add(Xe,Ye),Kr=S.add(Ce,bn),Ui=S.sub(Ln,Ce);Ui.add(Xe),Ui.add(Er);let ur=S.zeros(2*mr.rows,2*mr.columns);return ur=ur.setSubMatrix(mr,0,0),ur=ur.setSubMatrix(Wr,mr.rows,0),ur=ur.setSubMatrix(Kr,0,mr.columns),ur=ur.setSubMatrix(Ui,mr.rows,mr.columns),ur.subMatrix(0,en-1,0,Be-1)}return Pe(M,w,Jt,qt)}scaleRows(w={}){if(typeof w!="object")throw new TypeError("options must be an object");const{min:M=0,max:y=1}=w;if(!Number.isFinite(M))throw new TypeError("min must be a number");if(!Number.isFinite(y))throw new TypeError("max must be a number");if(M>=y)throw new RangeError("min must be smaller than max");let C=new $t(this.rows,this.columns);for(let U=0;U<this.rows;U++){const Wt=this.getRow(U);Wt.length>0&&xt(Wt,{min:M,max:y,output:Wt}),C.setRow(U,Wt)}return C}scaleColumns(w={}){if(typeof w!="object")throw new TypeError("options must be an object");const{min:M=0,max:y=1}=w;if(!Number.isFinite(M))throw new TypeError("min must be a number");if(!Number.isFinite(y))throw new TypeError("max must be a number");if(M>=y)throw new RangeError("min must be smaller than max");let C=new $t(this.rows,this.columns);for(let U=0;U<this.columns;U++){const Wt=this.getColumn(U);Wt.length&&xt(Wt,{min:M,max:y,output:Wt}),C.setColumn(U,Wt)}return C}flipRows(){const w=Math.ceil(this.columns/2);for(let M=0;M<this.rows;M++)for(let y=0;y<w;y++){let C=this.get(M,y),U=this.get(M,this.columns-1-y);this.set(M,y,U),this.set(M,this.columns-1-y,C)}return this}flipColumns(){const w=Math.ceil(this.rows/2);for(let M=0;M<this.columns;M++)for(let y=0;y<w;y++){let C=this.get(y,M),U=this.get(this.rows-1-y,M);this.set(y,M,U),this.set(this.rows-1-y,M,C)}return this}kroneckerProduct(w){w=$t.checkMatrix(w);let M=this.rows,y=this.columns,C=w.rows,U=w.columns,Wt=new $t(M*C,y*U);for(let Ut=0;Ut<M;Ut++)for(let Jt=0;Jt<y;Jt++)for(let qt=0;qt<C;qt++)for(let Pe=0;Pe<U;Pe++)Wt.set(C*Ut+qt,U*Jt+Pe,this.get(Ut,Jt)*w.get(qt,Pe));return Wt}kroneckerSum(w){if(w=$t.checkMatrix(w),!this.isSquare()||!w.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let M=this.rows,y=w.rows,C=this.kroneckerProduct($t.eye(y,y)),U=$t.eye(M,M).kroneckerProduct(w);return C.add(U)}transpose(){let w=new $t(this.columns,this.rows);for(let M=0;M<this.rows;M++)for(let y=0;y<this.columns;y++)w.set(y,M,this.get(M,y));return w}sortRows(w=Y){for(let M=0;M<this.rows;M++)this.setRow(M,this.getRow(M).sort(w));return this}sortColumns(w=Y){for(let M=0;M<this.columns;M++)this.setColumn(M,this.getColumn(M).sort(w));return this}subMatrix(w,M,y,C){yt(this,w,M,y,C);let U=new $t(M-w+1,C-y+1);for(let Wt=w;Wt<=M;Wt++)for(let Ut=y;Ut<=C;Ut++)U.set(Wt-w,Ut-y,this.get(Wt,Ut));return U}subMatrixRow(w,M,y){if(M===void 0&&(M=0),y===void 0&&(y=this.columns-1),M>y||M<0||M>=this.columns||y<0||y>=this.columns)throw new RangeError("Argument out of range");let C=new $t(w.length,y-M+1);for(let U=0;U<w.length;U++)for(let Wt=M;Wt<=y;Wt++){if(w[U]<0||w[U]>=this.rows)throw new RangeError(`Row index out of range: ${w[U]}`);C.set(U,Wt-M,this.get(w[U],Wt))}return C}subMatrixColumn(w,M,y){if(M===void 0&&(M=0),y===void 0&&(y=this.rows-1),M>y||M<0||M>=this.rows||y<0||y>=this.rows)throw new RangeError("Argument out of range");let C=new $t(y-M+1,w.length);for(let U=0;U<w.length;U++)for(let Wt=M;Wt<=y;Wt++){if(w[U]<0||w[U]>=this.columns)throw new RangeError(`Column index out of range: ${w[U]}`);C.set(Wt-M,U,this.get(Wt,w[U]))}return C}setSubMatrix(w,M,y){if(w=$t.checkMatrix(w),w.isEmpty())return this;let C=M+w.rows-1,U=y+w.columns-1;yt(this,M,C,y,U);for(let Wt=0;Wt<w.rows;Wt++)for(let Ut=0;Ut<w.columns;Ut++)this.set(M+Wt,y+Ut,w.get(Wt,Ut));return this}selection(w,M){et(this,w),ge(this,M);let y=new $t(w.length,M.length);for(let C=0;C<w.length;C++){let U=w[C];for(let Wt=0;Wt<M.length;Wt++){let Ut=M[Wt];y.set(C,Wt,this.get(U,Ut))}}return y}trace(){let w=Math.min(this.rows,this.columns),M=0;for(let y=0;y<w;y++)M+=this.get(y,y);return M}clone(){return this.constructor.copy(this,new $t(this.rows,this.columns))}static copy(w,M){for(const[y,C,U]of w.entries())M.set(y,C,U);return M}sum(w){switch(w){case"row":return bt(this);case"column":return ye(this);case void 0:return be(this);default:throw new Error(`invalid option: ${w}`)}}product(w){switch(w){case"row":return Gt(this);case"column":return Kt(this);case void 0:return we(this);default:throw new Error(`invalid option: ${w}`)}}mean(w){const M=this.sum(w);switch(w){case"row":{for(let y=0;y<this.rows;y++)M[y]/=this.columns;return M}case"column":{for(let y=0;y<this.columns;y++)M[y]/=this.rows;return M}case void 0:return M/this.size;default:throw new Error(`invalid option: ${w}`)}}variance(w,M={}){if(typeof w=="object"&&(M=w,w=void 0),typeof M!="object")throw new TypeError("options must be an object");const{unbiased:y=!0,mean:C=this.mean(w)}=M;if(typeof y!="boolean")throw new TypeError("unbiased must be a boolean");switch(w){case"row":{if(!Rt.isAnyArray(C))throw new TypeError("mean must be an array");return Bt(this,y,C)}case"column":{if(!Rt.isAnyArray(C))throw new TypeError("mean must be an array");return oe(this,y,C)}case void 0:{if(typeof C!="number")throw new TypeError("mean must be a number");return ht(this,y,C)}default:throw new Error(`invalid option: ${w}`)}}standardDeviation(w,M){typeof w=="object"&&(M=w,w=void 0);const y=this.variance(w,M);if(w===void 0)return Math.sqrt(y);for(let C=0;C<y.length;C++)y[C]=Math.sqrt(y[C]);return y}center(w,M={}){if(typeof w=="object"&&(M=w,w=void 0),typeof M!="object")throw new TypeError("options must be an object");const{center:y=this.mean(w)}=M;switch(w){case"row":{if(!Rt.isAnyArray(y))throw new TypeError("center must be an array");return ut(this,y),this}case"column":{if(!Rt.isAnyArray(y))throw new TypeError("center must be an array");return Vt(this,y),this}case void 0:{if(typeof y!="number")throw new TypeError("center must be a number");return ve(this,y),this}default:throw new Error(`invalid option: ${w}`)}}scale(w,M={}){if(typeof w=="object"&&(M=w,w=void 0),typeof M!="object")throw new TypeError("options must be an object");let y=M.scale;switch(w){case"row":{if(y===void 0)y=kt(this);else if(!Rt.isAnyArray(y))throw new TypeError("scale must be an array");return ee(this,y),this}case"column":{if(y===void 0)y=me(this);else if(!Rt.isAnyArray(y))throw new TypeError("scale must be an array");return Nt(this,y),this}case void 0:{if(y===void 0)y=Zt(this);else if(typeof y!="number")throw new TypeError("scale must be a number");return Yt(this,y),this}default:throw new Error(`invalid option: ${w}`)}}toString(w){return Ct(this,w)}[Symbol.iterator](){return this.entries()}*entries(){for(let w=0;w<this.rows;w++)for(let M=0;M<this.columns;M++)yield[w,M,this.get(w,M)]}*values(){for(let w=0;w<this.rows;w++)for(let M=0;M<this.columns;M++)yield this.get(w,M)}}S.prototype.klass="Matrix",typeof Symbol!="undefined"&&(S.prototype[Symbol.for("nodejs.util.inspect.custom")]=ot);function Y(gt,w){return gt-w}function At(gt){return gt.every(w=>typeof w=="number")}S.random=S.rand,S.randomInt=S.randInt,S.diagonal=S.diag,S.prototype.diagonal=S.prototype.diag,S.identity=S.eye,S.prototype.negate=S.prototype.neg,S.prototype.tensorProduct=S.prototype.kroneckerProduct;const ie=class Om extends S{constructor(w,M){if(super(),T(this,B),O(this,"data"),Om.isMatrix(w))P(this,B,tt).call(this,w.rows,w.columns),Om.copy(w,this);else if(Number.isInteger(w)&&w>=0)P(this,B,tt).call(this,w,M);else if(Rt.isAnyArray(w)){const y=w;if(w=y.length,M=w?y[0].length:0,typeof M!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let C=0;C<w;C++){if(y[C].length!==M)throw new RangeError("Inconsistent array dimensions");if(!At(y[C]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(y[C]))}this.rows=w,this.columns=M}else throw new TypeError("First argument must be a positive number or an array")}set(w,M,y){return this.data[w][M]=y,this}get(w,M){return this.data[w][M]}removeRow(w){return Ft(this,w),this.data.splice(w,1),this.rows-=1,this}addRow(w,M){return M===void 0&&(M=w,w=this.rows),Ft(this,w,!0),M=Float64Array.from(re(this,M)),this.data.splice(w,0,M),this.rows+=1,this}removeColumn(w){jt(this,w);for(let M=0;M<this.rows;M++){const y=new Float64Array(this.columns-1);for(let C=0;C<w;C++)y[C]=this.data[M][C];for(let C=w+1;C<this.columns;C++)y[C-1]=this.data[M][C];this.data[M]=y}return this.columns-=1,this}addColumn(w,M){typeof M=="undefined"&&(M=w,w=this.columns),jt(this,w,!0),M=Ee(this,M);for(let y=0;y<this.rows;y++){const C=new Float64Array(this.columns+1);let U=0;for(;U<w;U++)C[U]=this.data[y][U];for(C[U++]=M[y];U<this.columns+1;U++)C[U]=this.data[y][U-1];this.data[y]=C}return this.columns+=1,this}};B=new WeakSet,tt=function(gt,w){if(this.data=[],Number.isInteger(w)&&w>=0)for(let M=0;M<gt;M++)this.data.push(new Float64Array(w));else throw new TypeError("nColumns must be a positive integer");this.rows=gt,this.columns=w};let $t=ie;wt(S,$t);const Oe=class Am extends S{constructor(w){if(super(),T(this,st),$t.isMatrix(w)){if(!w.isSymmetric())throw new TypeError("not symmetric data");_(this,st,$t.copy(w,new $t(w.rows,w.rows)))}else if(Number.isInteger(w)&&w>=0)_(this,st,new $t(w,w));else if(_(this,st,new $t(w)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return E(this,st).size}get rows(){return E(this,st).rows}get columns(){return E(this,st).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(w){return $t.isMatrix(w)&&w.klassType==="SymmetricMatrix"}static zeros(w){return new this(w)}static ones(w){return new this(w).fill(1)}clone(){const w=new Am(this.diagonalSize);for(const[M,y,C]of this.upperRightEntries())w.set(M,y,C);return w}toMatrix(){return new $t(this)}get(w,M){return E(this,st).get(w,M)}set(w,M,y){return E(this,st).set(w,M,y),E(this,st).set(M,w,y),this}removeCross(w){return E(this,st).removeRow(w),E(this,st).removeColumn(w),this}addCross(w,M){M===void 0&&(M=w,w=this.diagonalSize);const y=M.slice();return y.splice(w,1),E(this,st).addRow(w,y),E(this,st).addColumn(w,M),this}applyMask(w){if(w.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const M=[];for(const[y,C]of w.entries())C||M.push(y);M.reverse();for(const y of M)this.removeCross(y);return this}toCompact(){const{diagonalSize:w}=this,M=new Array(w*(w+1)/2);for(let y=0,C=0,U=0;U<M.length;U++)M[U]=this.get(C,y),++y>=w&&(y=++C);return M}static fromCompact(w){const M=w.length,y=(Math.sqrt(8*M+1)-1)/2;if(!Number.isInteger(y))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(w)}`);const C=new Am(y);for(let U=0,Wt=0,Ut=0;Ut<M;Ut++)C.set(U,Wt,w[Ut]),++U>=y&&(U=++Wt);return C}*upperRightEntries(){for(let w=0,M=0;w<this.diagonalSize;void 0){const y=this.get(w,M);yield[w,M,y],++M>=this.diagonalSize&&(M=++w)}}*upperRightValues(){for(let w=0,M=0;w<this.diagonalSize;void 0)yield this.get(w,M),++M>=this.diagonalSize&&(M=++w)}};st=new WeakMap;let Ne=Oe;Ne.prototype.klassType="SymmetricMatrix";class Le extends Ne{static isDistanceMatrix(w){return Ne.isSymmetricMatrix(w)&&w.klassSubType==="DistanceMatrix"}constructor(w){if(super(w),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(w,M,y){return w===M&&(y=0),super.set(w,M,y)}addCross(w,M){return M===void 0&&(M=w,w=this.diagonalSize),M=M.slice(),M[w]=0,super.addCross(w,M)}toSymmetricMatrix(){return new Ne(this)}clone(){const w=new Le(this.diagonalSize);for(const[M,y,C]of this.upperRightEntries())M!==y&&w.set(M,y,C);return w}toCompact(){const{diagonalSize:w}=this,M=(w-1)*w/2,y=new Array(M);for(let C=1,U=0,Wt=0;Wt<y.length;Wt++)y[Wt]=this.get(U,C),++C>=w&&(C=++U+1);return y}static fromCompact(w){const M=w.length;if(M===0)return new this(0);const y=(Math.sqrt(8*M+1)+1)/2;if(!Number.isInteger(y))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(w)}`);const C=new this(y);for(let U=1,Wt=0,Ut=0;Ut<M;Ut++)C.set(U,Wt,w[Ut]),++U>=y&&(U=++Wt+1);return C}}Le.prototype.klassSubType="DistanceMatrix";class at extends S{constructor(w,M,y){super(),this.matrix=w,this.rows=M,this.columns=y}}class V extends at{constructor(w,M){jt(w,M),super(w,w.rows,1),this.column=M}set(w,M,y){return this.matrix.set(w,this.column,y),this}get(w){return this.matrix.get(w,this.column)}}class St extends at{constructor(w,M){ge(w,M),super(w,w.rows,M.length),this.columnIndices=M}set(w,M,y){return this.matrix.set(w,this.columnIndices[M],y),this}get(w,M){return this.matrix.get(w,this.columnIndices[M])}}class Pt extends at{constructor(w){super(w,w.rows,w.columns)}set(w,M,y){return this.matrix.set(w,this.columns-M-1,y),this}get(w,M){return this.matrix.get(w,this.columns-M-1)}}class pt extends at{constructor(w){super(w,w.rows,w.columns)}set(w,M,y){return this.matrix.set(this.rows-w-1,M,y),this}get(w,M){return this.matrix.get(this.rows-w-1,M)}}class mt extends at{constructor(w,M){Ft(w,M),super(w,1,w.columns),this.row=M}set(w,M,y){return this.matrix.set(this.row,M,y),this}get(w,M){return this.matrix.get(this.row,M)}}class Lt extends at{constructor(w,M){et(w,M),super(w,M.length,w.columns),this.rowIndices=M}set(w,M,y){return this.matrix.set(this.rowIndices[w],M,y),this}get(w,M){return this.matrix.get(this.rowIndices[w],M)}}class Ht extends at{constructor(w,M,y){et(w,M),ge(w,y),super(w,M.length,y.length),this.rowIndices=M,this.columnIndices=y}set(w,M,y){return this.matrix.set(this.rowIndices[w],this.columnIndices[M],y),this}get(w,M){return this.matrix.get(this.rowIndices[w],this.columnIndices[M])}}class Dt extends at{constructor(w,M,y,C,U){yt(w,M,y,C,U),super(w,y-M+1,U-C+1),this.startRow=M,this.startColumn=C}set(w,M,y){return this.matrix.set(this.startRow+w,this.startColumn+M,y),this}get(w,M){return this.matrix.get(this.startRow+w,this.startColumn+M)}}class ne extends at{constructor(w){super(w,w.columns,w.rows)}set(w,M,y){return this.matrix.set(M,w,y),this}get(w,M){return this.matrix.get(M,w)}}class _e extends S{constructor(w,M={}){const{rows:y=1}=M;if(w.length%y!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=y,this.columns=w.length/y,this.data=w}set(w,M,y){let C=this._calculateIndex(w,M);return this.data[C]=y,this}get(w,M){let y=this._calculateIndex(w,M);return this.data[y]}_calculateIndex(w,M){return w*this.columns+M}}class Me extends S{constructor(w){super(),this.data=w,this.rows=w.length,this.columns=w[0].length}set(w,M,y){return this.data[w][M]=y,this}get(w,M){return this.data[w][M]}}function Ae(gt,w){if(Rt.isAnyArray(gt))return gt[0]&&Rt.isAnyArray(gt[0])?new Me(gt):new _e(gt,w);throw new Error("the argument is not an array")}class ze{constructor(w){w=Me.checkMatrix(w);let M=w.clone(),y=M.rows,C=M.columns,U=new Float64Array(y),Wt=1,Ut,Jt,qt,Pe,xe,je,en,Be,he;for(Ut=0;Ut<y;Ut++)U[Ut]=Ut;for(Be=new Float64Array(y),Jt=0;Jt<C;Jt++){for(Ut=0;Ut<y;Ut++)Be[Ut]=M.get(Ut,Jt);for(Ut=0;Ut<y;Ut++){for(he=Math.min(Ut,Jt),xe=0,qt=0;qt<he;qt++)xe+=M.get(Ut,qt)*Be[qt];Be[Ut]-=xe,M.set(Ut,Jt,Be[Ut])}for(Pe=Jt,Ut=Jt+1;Ut<y;Ut++)Math.abs(Be[Ut])>Math.abs(Be[Pe])&&(Pe=Ut);if(Pe!==Jt){for(qt=0;qt<C;qt++)je=M.get(Pe,qt),M.set(Pe,qt,M.get(Jt,qt)),M.set(Jt,qt,je);en=U[Pe],U[Pe]=U[Jt],U[Jt]=en,Wt=-Wt}if(Jt<y&&M.get(Jt,Jt)!==0)for(Ut=Jt+1;Ut<y;Ut++)M.set(Ut,Jt,M.get(Ut,Jt)/M.get(Jt,Jt))}this.LU=M,this.pivotVector=U,this.pivotSign=Wt}isSingular(){let w=this.LU,M=w.columns;for(let y=0;y<M;y++)if(w.get(y,y)===0)return!0;return!1}solve(w){w=$t.checkMatrix(w);let M=this.LU;if(M.rows!==w.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let C=w.columns,U=w.subMatrixRow(this.pivotVector,0,C-1),Wt=M.columns,Ut,Jt,qt;for(qt=0;qt<Wt;qt++)for(Ut=qt+1;Ut<Wt;Ut++)for(Jt=0;Jt<C;Jt++)U.set(Ut,Jt,U.get(Ut,Jt)-U.get(qt,Jt)*M.get(Ut,qt));for(qt=Wt-1;qt>=0;qt--){for(Jt=0;Jt<C;Jt++)U.set(qt,Jt,U.get(qt,Jt)/M.get(qt,qt));for(Ut=0;Ut<qt;Ut++)for(Jt=0;Jt<C;Jt++)U.set(Ut,Jt,U.get(Ut,Jt)-U.get(qt,Jt)*M.get(Ut,qt))}return U}get determinant(){let w=this.LU;if(!w.isSquare())throw new Error("Matrix must be square");let M=this.pivotSign,y=w.columns;for(let C=0;C<y;C++)M*=w.get(C,C);return M}get lowerTriangularMatrix(){let w=this.LU,M=w.rows,y=w.columns,C=new $t(M,y);for(let U=0;U<M;U++)for(let Wt=0;Wt<y;Wt++)U>Wt?C.set(U,Wt,w.get(U,Wt)):U===Wt?C.set(U,Wt,1):C.set(U,Wt,0);return C}get upperTriangularMatrix(){let w=this.LU,M=w.rows,y=w.columns,C=new $t(M,y);for(let U=0;U<M;U++)for(let Wt=0;Wt<y;Wt++)U<=Wt?C.set(U,Wt,w.get(U,Wt)):C.set(U,Wt,0);return C}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Ve(gt,w){let M=0;return Math.abs(gt)>Math.abs(w)?(M=w/gt,Math.abs(gt)*Math.sqrt(1+M*M)):w!==0?(M=gt/w,Math.abs(w)*Math.sqrt(1+M*M)):0}class Je{constructor(w){w=Me.checkMatrix(w);let M=w.clone(),y=w.rows,C=w.columns,U=new Float64Array(C),Wt,Ut,Jt,qt;for(Jt=0;Jt<C;Jt++){let Pe=0;for(Wt=Jt;Wt<y;Wt++)Pe=Ve(Pe,M.get(Wt,Jt));if(Pe!==0){for(M.get(Jt,Jt)<0&&(Pe=-Pe),Wt=Jt;Wt<y;Wt++)M.set(Wt,Jt,M.get(Wt,Jt)/Pe);for(M.set(Jt,Jt,M.get(Jt,Jt)+1),Ut=Jt+1;Ut<C;Ut++){for(qt=0,Wt=Jt;Wt<y;Wt++)qt+=M.get(Wt,Jt)*M.get(Wt,Ut);for(qt=-qt/M.get(Jt,Jt),Wt=Jt;Wt<y;Wt++)M.set(Wt,Ut,M.get(Wt,Ut)+qt*M.get(Wt,Jt))}}U[Jt]=-Pe}this.QR=M,this.Rdiag=U}solve(w){w=$t.checkMatrix(w);let M=this.QR,y=M.rows;if(w.rows!==y)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let C=w.columns,U=w.clone(),Wt=M.columns,Ut,Jt,qt,Pe;for(qt=0;qt<Wt;qt++)for(Jt=0;Jt<C;Jt++){for(Pe=0,Ut=qt;Ut<y;Ut++)Pe+=M.get(Ut,qt)*U.get(Ut,Jt);for(Pe=-Pe/M.get(qt,qt),Ut=qt;Ut<y;Ut++)U.set(Ut,Jt,U.get(Ut,Jt)+Pe*M.get(Ut,qt))}for(qt=Wt-1;qt>=0;qt--){for(Jt=0;Jt<C;Jt++)U.set(qt,Jt,U.get(qt,Jt)/this.Rdiag[qt]);for(Ut=0;Ut<qt;Ut++)for(Jt=0;Jt<C;Jt++)U.set(Ut,Jt,U.get(Ut,Jt)-U.get(qt,Jt)*M.get(Ut,qt))}return U.subMatrix(0,Wt-1,0,C-1)}isFullRank(){let w=this.QR.columns;for(let M=0;M<w;M++)if(this.Rdiag[M]===0)return!1;return!0}get upperTriangularMatrix(){let w=this.QR,M=w.columns,y=new $t(M,M),C,U;for(C=0;C<M;C++)for(U=0;U<M;U++)C<U?y.set(C,U,w.get(C,U)):C===U?y.set(C,U,this.Rdiag[C]):y.set(C,U,0);return y}get orthogonalMatrix(){let w=this.QR,M=w.rows,y=w.columns,C=new $t(M,y),U,Wt,Ut,Jt;for(Ut=y-1;Ut>=0;Ut--){for(U=0;U<M;U++)C.set(U,Ut,0);for(C.set(Ut,Ut,1),Wt=Ut;Wt<y;Wt++)if(w.get(Ut,Ut)!==0){for(Jt=0,U=Ut;U<M;U++)Jt+=w.get(U,Ut)*C.get(U,Wt);for(Jt=-Jt/w.get(Ut,Ut),U=Ut;U<M;U++)C.set(U,Wt,C.get(U,Wt)+Jt*w.get(U,Ut))}}return C}}class pn{constructor(w,M={}){if(w=Me.checkMatrix(w),w.isEmpty())throw new Error("Matrix must be non-empty");let y=w.rows,C=w.columns;const{computeLeftSingularVectors:U=!0,computeRightSingularVectors:Wt=!0,autoTranspose:Ut=!1}=M;let Jt=!!U,qt=!!Wt,Pe=!1,xe;if(y<C)if(!Ut)xe=w.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{xe=w.transpose(),y=xe.rows,C=xe.columns,Pe=!0;let Ce=Jt;Jt=qt,qt=Ce}else xe=w.clone();let je=Math.min(y,C),en=Math.min(y+1,C),Be=new Float64Array(en),he=new $t(y,je),mn=new $t(C,C),Se=new Float64Array(C),nn=new Float64Array(y),yn=new Float64Array(en);for(let Ce=0;Ce<en;Ce++)yn[Ce]=Ce;let Bn=Math.min(y-1,C),Xn=Math.max(0,Math.min(C-2,y)),Gr=Math.max(Bn,Xn);for(let Ce=0;Ce<Gr;Ce++){if(Ce<Bn){Be[Ce]=0;for(let Xe=Ce;Xe<y;Xe++)Be[Ce]=Ve(Be[Ce],xe.get(Xe,Ce));if(Be[Ce]!==0){xe.get(Ce,Ce)<0&&(Be[Ce]=-Be[Ce]);for(let Xe=Ce;Xe<y;Xe++)xe.set(Xe,Ce,xe.get(Xe,Ce)/Be[Ce]);xe.set(Ce,Ce,xe.get(Ce,Ce)+1)}Be[Ce]=-Be[Ce]}for(let Xe=Ce+1;Xe<C;Xe++){if(Ce<Bn&&Be[Ce]!==0){let bn=0;for(let Ye=Ce;Ye<y;Ye++)bn+=xe.get(Ye,Ce)*xe.get(Ye,Xe);bn=-bn/xe.get(Ce,Ce);for(let Ye=Ce;Ye<y;Ye++)xe.set(Ye,Xe,xe.get(Ye,Xe)+bn*xe.get(Ye,Ce))}Se[Xe]=xe.get(Ce,Xe)}if(Jt&&Ce<Bn)for(let Xe=Ce;Xe<y;Xe++)he.set(Xe,Ce,xe.get(Xe,Ce));if(Ce<Xn){Se[Ce]=0;for(let Xe=Ce+1;Xe<C;Xe++)Se[Ce]=Ve(Se[Ce],Se[Xe]);if(Se[Ce]!==0){Se[Ce+1]<0&&(Se[Ce]=0-Se[Ce]);for(let Xe=Ce+1;Xe<C;Xe++)Se[Xe]/=Se[Ce];Se[Ce+1]+=1}if(Se[Ce]=-Se[Ce],Ce+1<y&&Se[Ce]!==0){for(let Xe=Ce+1;Xe<y;Xe++)nn[Xe]=0;for(let Xe=Ce+1;Xe<y;Xe++)for(let bn=Ce+1;bn<C;bn++)nn[Xe]+=Se[bn]*xe.get(Xe,bn);for(let Xe=Ce+1;Xe<C;Xe++){let bn=-Se[Xe]/Se[Ce+1];for(let Ye=Ce+1;Ye<y;Ye++)xe.set(Ye,Xe,xe.get(Ye,Xe)+bn*nn[Ye])}}if(qt)for(let Xe=Ce+1;Xe<C;Xe++)mn.set(Xe,Ce,Se[Xe])}}let An=Math.min(C,y+1);if(Bn<C&&(Be[Bn]=xe.get(Bn,Bn)),y<An&&(Be[An-1]=0),Xn+1<An&&(Se[Xn]=xe.get(Xn,An-1)),Se[An-1]=0,Jt){for(let Ce=Bn;Ce<je;Ce++){for(let Xe=0;Xe<y;Xe++)he.set(Xe,Ce,0);he.set(Ce,Ce,1)}for(let Ce=Bn-1;Ce>=0;Ce--)if(Be[Ce]!==0){for(let Xe=Ce+1;Xe<je;Xe++){let bn=0;for(let Ye=Ce;Ye<y;Ye++)bn+=he.get(Ye,Ce)*he.get(Ye,Xe);bn=-bn/he.get(Ce,Ce);for(let Ye=Ce;Ye<y;Ye++)he.set(Ye,Xe,he.get(Ye,Xe)+bn*he.get(Ye,Ce))}for(let Xe=Ce;Xe<y;Xe++)he.set(Xe,Ce,-he.get(Xe,Ce));he.set(Ce,Ce,1+he.get(Ce,Ce));for(let Xe=0;Xe<Ce-1;Xe++)he.set(Xe,Ce,0)}else{for(let Xe=0;Xe<y;Xe++)he.set(Xe,Ce,0);he.set(Ce,Ce,1)}}if(qt)for(let Ce=C-1;Ce>=0;Ce--){if(Ce<Xn&&Se[Ce]!==0)for(let Xe=Ce+1;Xe<C;Xe++){let bn=0;for(let Ye=Ce+1;Ye<C;Ye++)bn+=mn.get(Ye,Ce)*mn.get(Ye,Xe);bn=-bn/mn.get(Ce+1,Ce);for(let Ye=Ce+1;Ye<C;Ye++)mn.set(Ye,Xe,mn.get(Ye,Xe)+bn*mn.get(Ye,Ce))}for(let Xe=0;Xe<C;Xe++)mn.set(Xe,Ce,0);mn.set(Ce,Ce,1)}let Rn=An-1,Ln=Number.EPSILON;for(;An>0;){let Ce,Xe;for(Ce=An-2;Ce>=-1&&Ce!==-1;Ce--){const bn=Number.MIN_VALUE+Ln*Math.abs(Be[Ce]+Math.abs(Be[Ce+1]));if(Math.abs(Se[Ce])<=bn||Number.isNaN(Se[Ce])){Se[Ce]=0;break}}if(Ce===An-2)Xe=4;else{let bn;for(bn=An-1;bn>=Ce&&bn!==Ce;bn--){let Ye=(bn!==An?Math.abs(Se[bn]):0)+(bn!==Ce+1?Math.abs(Se[bn-1]):0);if(Math.abs(Be[bn])<=Ln*Ye){Be[bn]=0;break}}bn===Ce?Xe=3:bn===An-1?Xe=1:(Xe=2,Ce=bn)}switch(Ce++,Xe){case 1:{let bn=Se[An-2];Se[An-2]=0;for(let Ye=An-2;Ye>=Ce;Ye--){let Er=Ve(Be[Ye],bn),Cn=Be[Ye]/Er,mr=bn/Er;if(Be[Ye]=Er,Ye!==Ce&&(bn=-mr*Se[Ye-1],Se[Ye-1]=Cn*Se[Ye-1]),qt)for(let Wr=0;Wr<C;Wr++)Er=Cn*mn.get(Wr,Ye)+mr*mn.get(Wr,An-1),mn.set(Wr,An-1,-mr*mn.get(Wr,Ye)+Cn*mn.get(Wr,An-1)),mn.set(Wr,Ye,Er)}break}case 2:{let bn=Se[Ce-1];Se[Ce-1]=0;for(let Ye=Ce;Ye<An;Ye++){let Er=Ve(Be[Ye],bn),Cn=Be[Ye]/Er,mr=bn/Er;if(Be[Ye]=Er,bn=-mr*Se[Ye],Se[Ye]=Cn*Se[Ye],Jt)for(let Wr=0;Wr<y;Wr++)Er=Cn*he.get(Wr,Ye)+mr*he.get(Wr,Ce-1),he.set(Wr,Ce-1,-mr*he.get(Wr,Ye)+Cn*he.get(Wr,Ce-1)),he.set(Wr,Ye,Er)}break}case 3:{const bn=Math.max(Math.abs(Be[An-1]),Math.abs(Be[An-2]),Math.abs(Se[An-2]),Math.abs(Be[Ce]),Math.abs(Se[Ce])),Ye=Be[An-1]/bn,Er=Be[An-2]/bn,Cn=Se[An-2]/bn,mr=Be[Ce]/bn,Wr=Se[Ce]/bn,Kr=((Er+Ye)*(Er-Ye)+Cn*Cn)/2,Ui=Ye*Cn*(Ye*Cn);let ur=0;(Kr!==0||Ui!==0)&&(Kr<0?ur=0-Math.sqrt(Kr*Kr+Ui):ur=Math.sqrt(Kr*Kr+Ui),ur=Ui/(Kr+ur));let ya=(mr+Ye)*(mr-Ye)+ur,qn=mr*Wr;for(let er=Ce;er<An-1;er++){let vr=Ve(ya,qn);vr===0&&(vr=Number.MIN_VALUE);let Zi=ya/vr,$i=qn/vr;if(er!==Ce&&(Se[er-1]=vr),ya=Zi*Be[er]+$i*Se[er],Se[er]=Zi*Se[er]-$i*Be[er],qn=$i*Be[er+1],Be[er+1]=Zi*Be[er+1],qt)for(let ui=0;ui<C;ui++)vr=Zi*mn.get(ui,er)+$i*mn.get(ui,er+1),mn.set(ui,er+1,-$i*mn.get(ui,er)+Zi*mn.get(ui,er+1)),mn.set(ui,er,vr);if(vr=Ve(ya,qn),vr===0&&(vr=Number.MIN_VALUE),Zi=ya/vr,$i=qn/vr,Be[er]=vr,ya=Zi*Se[er]+$i*Be[er+1],Be[er+1]=-$i*Se[er]+Zi*Be[er+1],qn=$i*Se[er+1],Se[er+1]=Zi*Se[er+1],Jt&&er<y-1)for(let ui=0;ui<y;ui++)vr=Zi*he.get(ui,er)+$i*he.get(ui,er+1),he.set(ui,er+1,-$i*he.get(ui,er)+Zi*he.get(ui,er+1)),he.set(ui,er,vr)}Se[An-2]=ya;break}case 4:{if(Be[Ce]<=0&&(Be[Ce]=Be[Ce]<0?-Be[Ce]:0,qt))for(let bn=0;bn<=Rn;bn++)mn.set(bn,Ce,-mn.get(bn,Ce));for(;Ce<Rn&&!(Be[Ce]>=Be[Ce+1]);){let bn=Be[Ce];if(Be[Ce]=Be[Ce+1],Be[Ce+1]=bn,qt&&Ce<C-1)for(let Ye=0;Ye<C;Ye++)bn=mn.get(Ye,Ce+1),mn.set(Ye,Ce+1,mn.get(Ye,Ce)),mn.set(Ye,Ce,bn);if(Jt&&Ce<y-1)for(let Ye=0;Ye<y;Ye++)bn=he.get(Ye,Ce+1),he.set(Ye,Ce+1,he.get(Ye,Ce)),he.set(Ye,Ce,bn);Ce++}An--;break}}}if(Pe){let Ce=mn;mn=he,he=Ce}this.m=y,this.n=C,this.s=Be,this.U=he,this.V=mn}solve(w){let M=w,y=this.threshold,C=this.s.length,U=$t.zeros(C,C);for(let je=0;je<C;je++)Math.abs(this.s[je])<=y?U.set(je,je,0):U.set(je,je,1/this.s[je]);let Wt=this.U,Ut=this.rightSingularVectors,Jt=Ut.mmul(U),qt=Ut.rows,Pe=Wt.rows,xe=$t.zeros(qt,Pe);for(let je=0;je<qt;je++)for(let en=0;en<Pe;en++){let Be=0;for(let he=0;he<C;he++)Be+=Jt.get(je,he)*Wt.get(en,he);xe.set(je,en,Be)}return xe.mmul(M)}solveForDiagonal(w){return this.solve($t.diag(w))}inverse(){let w=this.V,M=this.threshold,y=w.rows,C=w.columns,U=new $t(y,this.s.length);for(let Pe=0;Pe<y;Pe++)for(let xe=0;xe<C;xe++)Math.abs(this.s[xe])>M&&U.set(Pe,xe,w.get(Pe,xe)/this.s[xe]);let Wt=this.U,Ut=Wt.rows,Jt=Wt.columns,qt=new $t(y,Ut);for(let Pe=0;Pe<y;Pe++)for(let xe=0;xe<Ut;xe++){let je=0;for(let en=0;en<Jt;en++)je+=U.get(Pe,en)*Wt.get(xe,en);qt.set(Pe,xe,je)}return qt}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let w=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,M=0,y=this.s;for(let C=0,U=y.length;C<U;C++)y[C]>w&&M++;return M}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return $t.diag(this.s)}}function jn(gt,w=!1){return gt=Me.checkMatrix(gt),w?new pn(gt).inverse():hn(gt,$t.eye(gt.rows))}function hn(gt,w,M=!1){return gt=Me.checkMatrix(gt),w=Me.checkMatrix(w),M?new pn(gt).solve(w):gt.isSquare()?new ze(gt).solve(w):new Je(gt).solve(w)}function En(gt){if(gt=$t.checkMatrix(gt),gt.isSquare()){if(gt.columns===0)return 1;let w,M,y,C;if(gt.columns===2)return w=gt.get(0,0),M=gt.get(0,1),y=gt.get(1,0),C=gt.get(1,1),w*C-M*y;if(gt.columns===3){let U,Wt,Ut;return U=new Ht(gt,[1,2],[1,2]),Wt=new Ht(gt,[1,2],[0,2]),Ut=new Ht(gt,[1,2],[0,1]),w=gt.get(0,0),M=gt.get(0,1),y=gt.get(0,2),w*En(U)-M*En(Wt)+y*En(Ut)}else return new ze(gt).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Gn(gt,w){let M=[];for(let y=0;y<gt;y++)y!==w&&M.push(y);return M}function Tn(gt,w,M,y=1e-9,C=1e-9){if(gt>C)return new Array(w.rows+1).fill(0);{let U=w.addRow(M,[0]);for(let Wt=0;Wt<U.rows;Wt++)Math.abs(U.get(Wt,0))<y&&U.set(Wt,0,0);return U.to1DArray()}}function Pn(gt,w={}){const{thresholdValue:M=1e-9,thresholdError:y=1e-9}=w;gt=$t.checkMatrix(gt);let C=gt.rows,U=new $t(C,C);for(let Wt=0;Wt<C;Wt++){let Ut=$t.columnVector(gt.getRow(Wt)),Jt=gt.subMatrixRow(Gn(C,Wt)).transpose(),Pe=new pn(Jt).solve(Ut),xe=$t.sub(Ut,Jt.mmul(Pe)).abs().max();U.setRow(Wt,Tn(xe,Pe,Wt,M,y))}return U}function Tr(gt,w=Number.EPSILON){if(gt=$t.checkMatrix(gt),gt.isEmpty())return gt.transpose();let M=new pn(gt,{autoTranspose:!0}),y=M.leftSingularVectors,C=M.rightSingularVectors,U=M.diagonal;for(let Wt=0;Wt<U.length;Wt++)Math.abs(U[Wt])>w?U[Wt]=1/U[Wt]:U[Wt]=0;return C.mmul($t.diag(U).mmul(y.transpose()))}function wi(gt,w=gt,M={}){gt=new $t(gt);let y=!1;if(typeof w=="object"&&!$t.isMatrix(w)&&!Rt.isAnyArray(w)?(M=w,w=gt,y=!0):w=new $t(w),gt.rows!==w.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:C=!0}=M;C&&(gt=gt.center("column"),y||(w=w.center("column")));const U=gt.transpose().mmul(w);for(let Wt=0;Wt<U.rows;Wt++)for(let Ut=0;Ut<U.columns;Ut++)U.set(Wt,Ut,U.get(Wt,Ut)*(1/(gt.rows-1)));return U}function Vr(gt,w=gt,M={}){gt=new $t(gt);let y=!1;if(typeof w=="object"&&!$t.isMatrix(w)&&!Rt.isAnyArray(w)?(M=w,w=gt,y=!0):w=new $t(w),gt.rows!==w.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:C=!0,scale:U=!0}=M;C&&(gt.center("column"),y||w.center("column")),U&&(gt.scale("column"),y||w.scale("column"));const Wt=gt.standardDeviation("column",{unbiased:!0}),Ut=y?Wt:w.standardDeviation("column",{unbiased:!0}),Jt=gt.transpose().mmul(w);for(let qt=0;qt<Jt.rows;qt++)for(let Pe=0;Pe<Jt.columns;Pe++)Jt.set(qt,Pe,Jt.get(qt,Pe)*(1/(Wt[qt]*Ut[Pe]))*(1/(gt.rows-1)));return Jt}class Ga{constructor(w,M={}){const{assumeSymmetric:y=!1}=M;if(w=Me.checkMatrix(w),!w.isSquare())throw new Error("Matrix is not a square matrix");if(w.isEmpty())throw new Error("Matrix must be non-empty");let C=w.columns,U=new $t(C,C),Wt=new Float64Array(C),Ut=new Float64Array(C),Jt=w,qt,Pe,xe=!1;if(y?xe=!0:xe=w.isSymmetric(),xe){for(qt=0;qt<C;qt++)for(Pe=0;Pe<C;Pe++)U.set(qt,Pe,Jt.get(qt,Pe));Wa(C,Ut,Wt,U),qs(C,Ut,Wt,U)}else{let je=new $t(C,C),en=new Float64Array(C);for(Pe=0;Pe<C;Pe++)for(qt=0;qt<C;qt++)je.set(qt,Pe,Jt.get(qt,Pe));Ns(C,je,en,U),Ua(C,Ut,Wt,U,je)}this.n=C,this.e=Ut,this.d=Wt,this.V=U}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let w=this.n,M=this.e,y=this.d,C=new $t(w,w),U,Wt;for(U=0;U<w;U++){for(Wt=0;Wt<w;Wt++)C.set(U,Wt,0);C.set(U,U,y[U]),M[U]>0?C.set(U,U+1,M[U]):M[U]<0&&C.set(U,U-1,M[U])}return C}}function Wa(gt,w,M,y){let C,U,Wt,Ut,Jt,qt,Pe,xe;for(Jt=0;Jt<gt;Jt++)M[Jt]=y.get(gt-1,Jt);for(Ut=gt-1;Ut>0;Ut--){for(xe=0,Wt=0,qt=0;qt<Ut;qt++)xe=xe+Math.abs(M[qt]);if(xe===0)for(w[Ut]=M[Ut-1],Jt=0;Jt<Ut;Jt++)M[Jt]=y.get(Ut-1,Jt),y.set(Ut,Jt,0),y.set(Jt,Ut,0);else{for(qt=0;qt<Ut;qt++)M[qt]/=xe,Wt+=M[qt]*M[qt];for(C=M[Ut-1],U=Math.sqrt(Wt),C>0&&(U=-U),w[Ut]=xe*U,Wt=Wt-C*U,M[Ut-1]=C-U,Jt=0;Jt<Ut;Jt++)w[Jt]=0;for(Jt=0;Jt<Ut;Jt++){for(C=M[Jt],y.set(Jt,Ut,C),U=w[Jt]+y.get(Jt,Jt)*C,qt=Jt+1;qt<=Ut-1;qt++)U+=y.get(qt,Jt)*M[qt],w[qt]+=y.get(qt,Jt)*C;w[Jt]=U}for(C=0,Jt=0;Jt<Ut;Jt++)w[Jt]/=Wt,C+=w[Jt]*M[Jt];for(Pe=C/(Wt+Wt),Jt=0;Jt<Ut;Jt++)w[Jt]-=Pe*M[Jt];for(Jt=0;Jt<Ut;Jt++){for(C=M[Jt],U=w[Jt],qt=Jt;qt<=Ut-1;qt++)y.set(qt,Jt,y.get(qt,Jt)-(C*w[qt]+U*M[qt]));M[Jt]=y.get(Ut-1,Jt),y.set(Ut,Jt,0)}}M[Ut]=Wt}for(Ut=0;Ut<gt-1;Ut++){if(y.set(gt-1,Ut,y.get(Ut,Ut)),y.set(Ut,Ut,1),Wt=M[Ut+1],Wt!==0){for(qt=0;qt<=Ut;qt++)M[qt]=y.get(qt,Ut+1)/Wt;for(Jt=0;Jt<=Ut;Jt++){for(U=0,qt=0;qt<=Ut;qt++)U+=y.get(qt,Ut+1)*y.get(qt,Jt);for(qt=0;qt<=Ut;qt++)y.set(qt,Jt,y.get(qt,Jt)-U*M[qt])}}for(qt=0;qt<=Ut;qt++)y.set(qt,Ut+1,0)}for(Jt=0;Jt<gt;Jt++)M[Jt]=y.get(gt-1,Jt),y.set(gt-1,Jt,0);y.set(gt-1,gt-1,1),w[0]=0}function qs(gt,w,M,y){let C,U,Wt,Ut,Jt,qt,Pe,xe,je,en,Be,he,mn,Se,nn,yn;for(Wt=1;Wt<gt;Wt++)w[Wt-1]=w[Wt];w[gt-1]=0;let Bn=0,Xn=0,Gr=Number.EPSILON;for(qt=0;qt<gt;qt++){for(Xn=Math.max(Xn,Math.abs(M[qt])+Math.abs(w[qt])),Pe=qt;Pe<gt&&!(Math.abs(w[Pe])<=Gr*Xn);)Pe++;if(Pe>qt)do{for(C=M[qt],xe=(M[qt+1]-C)/(2*w[qt]),je=Ve(xe,1),xe<0&&(je=-je),M[qt]=w[qt]/(xe+je),M[qt+1]=w[qt]*(xe+je),en=M[qt+1],U=C-M[qt],Wt=qt+2;Wt<gt;Wt++)M[Wt]-=U;for(Bn=Bn+U,xe=M[Pe],Be=1,he=Be,mn=Be,Se=w[qt+1],nn=0,yn=0,Wt=Pe-1;Wt>=qt;Wt--)for(mn=he,he=Be,yn=nn,C=Be*w[Wt],U=Be*xe,je=Ve(xe,w[Wt]),w[Wt+1]=nn*je,nn=w[Wt]/je,Be=xe/je,xe=Be*M[Wt]-nn*C,M[Wt+1]=U+nn*(Be*C+nn*M[Wt]),Jt=0;Jt<gt;Jt++)U=y.get(Jt,Wt+1),y.set(Jt,Wt+1,nn*y.get(Jt,Wt)+Be*U),y.set(Jt,Wt,Be*y.get(Jt,Wt)-nn*U);xe=-nn*yn*mn*Se*w[qt]/en,w[qt]=nn*xe,M[qt]=Be*xe}while(Math.abs(w[qt])>Gr*Xn);M[qt]=M[qt]+Bn,w[qt]=0}for(Wt=0;Wt<gt-1;Wt++){for(Jt=Wt,xe=M[Wt],Ut=Wt+1;Ut<gt;Ut++)M[Ut]<xe&&(Jt=Ut,xe=M[Ut]);if(Jt!==Wt)for(M[Jt]=M[Wt],M[Wt]=xe,Ut=0;Ut<gt;Ut++)xe=y.get(Ut,Wt),y.set(Ut,Wt,y.get(Ut,Jt)),y.set(Ut,Jt,xe)}}function Ns(gt,w,M,y){let C=0,U=gt-1,Wt,Ut,Jt,qt,Pe,xe,je;for(xe=C+1;xe<=U-1;xe++){for(je=0,qt=xe;qt<=U;qt++)je=je+Math.abs(w.get(qt,xe-1));if(je!==0){for(Jt=0,qt=U;qt>=xe;qt--)M[qt]=w.get(qt,xe-1)/je,Jt+=M[qt]*M[qt];for(Ut=Math.sqrt(Jt),M[xe]>0&&(Ut=-Ut),Jt=Jt-M[xe]*Ut,M[xe]=M[xe]-Ut,Pe=xe;Pe<gt;Pe++){for(Wt=0,qt=U;qt>=xe;qt--)Wt+=M[qt]*w.get(qt,Pe);for(Wt=Wt/Jt,qt=xe;qt<=U;qt++)w.set(qt,Pe,w.get(qt,Pe)-Wt*M[qt])}for(qt=0;qt<=U;qt++){for(Wt=0,Pe=U;Pe>=xe;Pe--)Wt+=M[Pe]*w.get(qt,Pe);for(Wt=Wt/Jt,Pe=xe;Pe<=U;Pe++)w.set(qt,Pe,w.get(qt,Pe)-Wt*M[Pe])}M[xe]=je*M[xe],w.set(xe,xe-1,je*Ut)}}for(qt=0;qt<gt;qt++)for(Pe=0;Pe<gt;Pe++)y.set(qt,Pe,qt===Pe?1:0);for(xe=U-1;xe>=C+1;xe--)if(w.get(xe,xe-1)!==0){for(qt=xe+1;qt<=U;qt++)M[qt]=w.get(qt,xe-1);for(Pe=xe;Pe<=U;Pe++){for(Ut=0,qt=xe;qt<=U;qt++)Ut+=M[qt]*y.get(qt,Pe);for(Ut=Ut/M[xe]/w.get(xe,xe-1),qt=xe;qt<=U;qt++)y.set(qt,Pe,y.get(qt,Pe)+Ut*M[qt])}}}function Ua(gt,w,M,y,C){let U=gt-1,Wt=0,Ut=gt-1,Jt=Number.EPSILON,qt=0,Pe=0,xe=0,je=0,en=0,Be=0,he=0,mn=0,Se,nn,yn,Bn,Xn,Gr,An,Rn,Ln,Ce,Xe,bn,Ye,Er,Cn;for(Se=0;Se<gt;Se++)for((Se<Wt||Se>Ut)&&(M[Se]=C.get(Se,Se),w[Se]=0),nn=Math.max(Se-1,0);nn<gt;nn++)Pe=Pe+Math.abs(C.get(Se,nn));for(;U>=Wt;){for(Bn=U;Bn>Wt&&(Be=Math.abs(C.get(Bn-1,Bn-1))+Math.abs(C.get(Bn,Bn)),Be===0&&(Be=Pe),!(Math.abs(C.get(Bn,Bn-1))<Jt*Be));)Bn--;if(Bn===U)C.set(U,U,C.get(U,U)+qt),M[U]=C.get(U,U),w[U]=0,U--,mn=0;else if(Bn===U-1){if(An=C.get(U,U-1)*C.get(U-1,U),xe=(C.get(U-1,U-1)-C.get(U,U))/2,je=xe*xe+An,he=Math.sqrt(Math.abs(je)),C.set(U,U,C.get(U,U)+qt),C.set(U-1,U-1,C.get(U-1,U-1)+qt),Rn=C.get(U,U),je>=0){for(he=xe>=0?xe+he:xe-he,M[U-1]=Rn+he,M[U]=M[U-1],he!==0&&(M[U]=Rn-An/he),w[U-1]=0,w[U]=0,Rn=C.get(U,U-1),Be=Math.abs(Rn)+Math.abs(he),xe=Rn/Be,je=he/Be,en=Math.sqrt(xe*xe+je*je),xe=xe/en,je=je/en,nn=U-1;nn<gt;nn++)he=C.get(U-1,nn),C.set(U-1,nn,je*he+xe*C.get(U,nn)),C.set(U,nn,je*C.get(U,nn)-xe*he);for(Se=0;Se<=U;Se++)he=C.get(Se,U-1),C.set(Se,U-1,je*he+xe*C.get(Se,U)),C.set(Se,U,je*C.get(Se,U)-xe*he);for(Se=Wt;Se<=Ut;Se++)he=y.get(Se,U-1),y.set(Se,U-1,je*he+xe*y.get(Se,U)),y.set(Se,U,je*y.get(Se,U)-xe*he)}else M[U-1]=Rn+xe,M[U]=Rn+xe,w[U-1]=he,w[U]=-he;U=U-2,mn=0}else{if(Rn=C.get(U,U),Ln=0,An=0,Bn<U&&(Ln=C.get(U-1,U-1),An=C.get(U,U-1)*C.get(U-1,U)),mn===10){for(qt+=Rn,Se=Wt;Se<=U;Se++)C.set(Se,Se,C.get(Se,Se)-Rn);Be=Math.abs(C.get(U,U-1))+Math.abs(C.get(U-1,U-2)),Rn=Ln=.75*Be,An=-.4375*Be*Be}if(mn===30&&(Be=(Ln-Rn)/2,Be=Be*Be+An,Be>0)){for(Be=Math.sqrt(Be),Ln<Rn&&(Be=-Be),Be=Rn-An/((Ln-Rn)/2+Be),Se=Wt;Se<=U;Se++)C.set(Se,Se,C.get(Se,Se)-Be);qt+=Be,Rn=Ln=An=.964}for(mn=mn+1,Xn=U-2;Xn>=Bn&&(he=C.get(Xn,Xn),en=Rn-he,Be=Ln-he,xe=(en*Be-An)/C.get(Xn+1,Xn)+C.get(Xn,Xn+1),je=C.get(Xn+1,Xn+1)-he-en-Be,en=C.get(Xn+2,Xn+1),Be=Math.abs(xe)+Math.abs(je)+Math.abs(en),xe=xe/Be,je=je/Be,en=en/Be,!(Xn===Bn||Math.abs(C.get(Xn,Xn-1))*(Math.abs(je)+Math.abs(en))<Jt*(Math.abs(xe)*(Math.abs(C.get(Xn-1,Xn-1))+Math.abs(he)+Math.abs(C.get(Xn+1,Xn+1))))));)Xn--;for(Se=Xn+2;Se<=U;Se++)C.set(Se,Se-2,0),Se>Xn+2&&C.set(Se,Se-3,0);for(yn=Xn;yn<=U-1&&(Er=yn!==U-1,yn!==Xn&&(xe=C.get(yn,yn-1),je=C.get(yn+1,yn-1),en=Er?C.get(yn+2,yn-1):0,Rn=Math.abs(xe)+Math.abs(je)+Math.abs(en),Rn!==0&&(xe=xe/Rn,je=je/Rn,en=en/Rn)),Rn!==0);yn++)if(Be=Math.sqrt(xe*xe+je*je+en*en),xe<0&&(Be=-Be),Be!==0){for(yn!==Xn?C.set(yn,yn-1,-Be*Rn):Bn!==Xn&&C.set(yn,yn-1,-C.get(yn,yn-1)),xe=xe+Be,Rn=xe/Be,Ln=je/Be,he=en/Be,je=je/xe,en=en/xe,nn=yn;nn<gt;nn++)xe=C.get(yn,nn)+je*C.get(yn+1,nn),Er&&(xe=xe+en*C.get(yn+2,nn),C.set(yn+2,nn,C.get(yn+2,nn)-xe*he)),C.set(yn,nn,C.get(yn,nn)-xe*Rn),C.set(yn+1,nn,C.get(yn+1,nn)-xe*Ln);for(Se=0;Se<=Math.min(U,yn+3);Se++)xe=Rn*C.get(Se,yn)+Ln*C.get(Se,yn+1),Er&&(xe=xe+he*C.get(Se,yn+2),C.set(Se,yn+2,C.get(Se,yn+2)-xe*en)),C.set(Se,yn,C.get(Se,yn)-xe),C.set(Se,yn+1,C.get(Se,yn+1)-xe*je);for(Se=Wt;Se<=Ut;Se++)xe=Rn*y.get(Se,yn)+Ln*y.get(Se,yn+1),Er&&(xe=xe+he*y.get(Se,yn+2),y.set(Se,yn+2,y.get(Se,yn+2)-xe*en)),y.set(Se,yn,y.get(Se,yn)-xe),y.set(Se,yn+1,y.get(Se,yn+1)-xe*je)}}}if(Pe!==0){for(U=gt-1;U>=0;U--)if(xe=M[U],je=w[U],je===0)for(Bn=U,C.set(U,U,1),Se=U-1;Se>=0;Se--){for(An=C.get(Se,Se)-xe,en=0,nn=Bn;nn<=U;nn++)en=en+C.get(Se,nn)*C.get(nn,U);if(w[Se]<0)he=An,Be=en;else if(Bn=Se,w[Se]===0?C.set(Se,U,An!==0?-en/An:-en/(Jt*Pe)):(Rn=C.get(Se,Se+1),Ln=C.get(Se+1,Se),je=(M[Se]-xe)*(M[Se]-xe)+w[Se]*w[Se],Gr=(Rn*Be-he*en)/je,C.set(Se,U,Gr),C.set(Se+1,U,Math.abs(Rn)>Math.abs(he)?(-en-An*Gr)/Rn:(-Be-Ln*Gr)/he)),Gr=Math.abs(C.get(Se,U)),Jt*Gr*Gr>1)for(nn=Se;nn<=U;nn++)C.set(nn,U,C.get(nn,U)/Gr)}else if(je<0)for(Bn=U-1,Math.abs(C.get(U,U-1))>Math.abs(C.get(U-1,U))?(C.set(U-1,U-1,je/C.get(U,U-1)),C.set(U-1,U,-(C.get(U,U)-xe)/C.get(U,U-1))):(Cn=Ki(0,-C.get(U-1,U),C.get(U-1,U-1)-xe,je),C.set(U-1,U-1,Cn[0]),C.set(U-1,U,Cn[1])),C.set(U,U-1,0),C.set(U,U,1),Se=U-2;Se>=0;Se--){for(Ce=0,Xe=0,nn=Bn;nn<=U;nn++)Ce=Ce+C.get(Se,nn)*C.get(nn,U-1),Xe=Xe+C.get(Se,nn)*C.get(nn,U);if(An=C.get(Se,Se)-xe,w[Se]<0)he=An,en=Ce,Be=Xe;else if(Bn=Se,w[Se]===0?(Cn=Ki(-Ce,-Xe,An,je),C.set(Se,U-1,Cn[0]),C.set(Se,U,Cn[1])):(Rn=C.get(Se,Se+1),Ln=C.get(Se+1,Se),bn=(M[Se]-xe)*(M[Se]-xe)+w[Se]*w[Se]-je*je,Ye=(M[Se]-xe)*2*je,bn===0&&Ye===0&&(bn=Jt*Pe*(Math.abs(An)+Math.abs(je)+Math.abs(Rn)+Math.abs(Ln)+Math.abs(he))),Cn=Ki(Rn*en-he*Ce+je*Xe,Rn*Be-he*Xe-je*Ce,bn,Ye),C.set(Se,U-1,Cn[0]),C.set(Se,U,Cn[1]),Math.abs(Rn)>Math.abs(he)+Math.abs(je)?(C.set(Se+1,U-1,(-Ce-An*C.get(Se,U-1)+je*C.get(Se,U))/Rn),C.set(Se+1,U,(-Xe-An*C.get(Se,U)-je*C.get(Se,U-1))/Rn)):(Cn=Ki(-en-Ln*C.get(Se,U-1),-Be-Ln*C.get(Se,U),he,je),C.set(Se+1,U-1,Cn[0]),C.set(Se+1,U,Cn[1]))),Gr=Math.max(Math.abs(C.get(Se,U-1)),Math.abs(C.get(Se,U))),Jt*Gr*Gr>1)for(nn=Se;nn<=U;nn++)C.set(nn,U-1,C.get(nn,U-1)/Gr),C.set(nn,U,C.get(nn,U)/Gr)}for(Se=0;Se<gt;Se++)if(Se<Wt||Se>Ut)for(nn=Se;nn<gt;nn++)y.set(Se,nn,C.get(Se,nn));for(nn=gt-1;nn>=Wt;nn--)for(Se=Wt;Se<=Ut;Se++){for(he=0,yn=Wt;yn<=Math.min(nn,Ut);yn++)he=he+y.get(Se,yn)*C.get(yn,nn);y.set(Se,nn,he)}}}function Ki(gt,w,M,y){let C,U;return Math.abs(M)>Math.abs(y)?(C=y/M,U=M+C*y,[(gt+C*w)/U,(w-C*gt)/U]):(C=M/y,U=y+C*M,[(C*gt+w)/U,(C*w-gt)/U])}class qo{constructor(w){if(w=Me.checkMatrix(w),!w.isSymmetric())throw new Error("Matrix is not symmetric");let M=w,y=M.rows,C=new $t(y,y),U=!0,Wt,Ut,Jt;for(Ut=0;Ut<y;Ut++){let qt=0;for(Jt=0;Jt<Ut;Jt++){let Pe=0;for(Wt=0;Wt<Jt;Wt++)Pe+=C.get(Jt,Wt)*C.get(Ut,Wt);Pe=(M.get(Ut,Jt)-Pe)/C.get(Jt,Jt),C.set(Ut,Jt,Pe),qt=qt+Pe*Pe}for(qt=M.get(Ut,Ut)-qt,U&&(U=qt>0),C.set(Ut,Ut,Math.sqrt(Math.max(qt,0))),Jt=Ut+1;Jt<y;Jt++)C.set(Ut,Jt,0)}this.L=C,this.positiveDefinite=U}isPositiveDefinite(){return this.positiveDefinite}solve(w){w=Me.checkMatrix(w);let M=this.L,y=M.rows;if(w.rows!==y)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let C=w.columns,U=w.clone(),Wt,Ut,Jt;for(Jt=0;Jt<y;Jt++)for(Ut=0;Ut<C;Ut++){for(Wt=0;Wt<Jt;Wt++)U.set(Jt,Ut,U.get(Jt,Ut)-U.get(Wt,Ut)*M.get(Jt,Wt));U.set(Jt,Ut,U.get(Jt,Ut)/M.get(Jt,Jt))}for(Jt=y-1;Jt>=0;Jt--)for(Ut=0;Ut<C;Ut++){for(Wt=Jt+1;Wt<y;Wt++)U.set(Jt,Ut,U.get(Jt,Ut)-U.get(Wt,Ut)*M.get(Wt,Jt));U.set(Jt,Ut,U.get(Jt,Ut)/M.get(Jt,Jt))}return U}get lowerTriangularMatrix(){return this.L}}class Bl{constructor(w,M={}){w=Me.checkMatrix(w);let{Y:y}=M;const{scaleScores:C=!1,maxIterations:U=1e3,terminationCriteria:Wt=1e-10}=M;let Ut;if(y){if(Rt.isAnyArray(y)&&typeof y[0]=="number"?y=$t.columnVector(y):y=Me.checkMatrix(y),y.rows!==w.rows)throw new Error("Y should have the same number of rows as X");Ut=y.getColumnVector(0)}else Ut=w.getColumnVector(0);let Jt=1,qt,Pe,xe,je;for(let en=0;en<U&&Jt>Wt;en++)xe=w.transpose().mmul(Ut).div(Ut.transpose().mmul(Ut).get(0,0)),xe=xe.div(xe.norm()),qt=w.mmul(xe).div(xe.transpose().mmul(xe).get(0,0)),en>0&&(Jt=qt.clone().sub(je).pow(2).sum()),je=qt.clone(),y?(Pe=y.transpose().mmul(qt).div(qt.transpose().mmul(qt).get(0,0)),Pe=Pe.div(Pe.norm()),Ut=y.mmul(Pe).div(Pe.transpose().mmul(Pe).get(0,0))):Ut=qt;if(y){let en=w.transpose().mmul(qt).div(qt.transpose().mmul(qt).get(0,0));en=en.div(en.norm());let Be=w.clone().sub(qt.clone().mmul(en.transpose())),he=Ut.transpose().mmul(qt).div(qt.transpose().mmul(qt).get(0,0)),mn=y.clone().sub(qt.clone().mulS(he.get(0,0)).mmul(Pe.transpose()));this.t=qt,this.p=en.transpose(),this.w=xe.transpose(),this.q=Pe,this.u=Ut,this.s=qt.transpose().mmul(qt),this.xResidual=Be,this.yResidual=mn,this.betas=he}else this.w=xe.transpose(),this.s=qt.transpose().mmul(qt).sqrt(),C?this.t=qt.clone().div(this.s.get(0,0)):this.t=qt,this.xResidual=w.sub(qt.mmul(xe.transpose()))}}J.XA=S,J.a_=qo,J.yQ=qo,J.Hs=Le,J.Ec=Ga,J.dx=Ga,J.LU=ze,J.Rm=ze,J.y3=$t,J.qK=St,J.pb=V,J.j=Pt,J.sO=pt,J.BZ=Lt,J.EK=mt,J.Db=Ht,J.Fx=Dt,J.tU=ne,J.Ym=Bl,J.rs=Bl,J.QR=Je,J.TB=Je,J.oH=pn,J.Sc=pn,J.BN=Ne,J.it=_e,J.$r=Me,J.QM=Vr,J.AV=wi,m=$t,J.GH=En,J.SO=jn,J.uZ=Pn,J.yU=Tr,J.F1=hn,J.re=Ae},89558:function(q,J,g){"use strict";g.d(J,{Ae:function(){return nt},CF:function(){return $t},vC:function(){return S},x1:function(){return O}});function m(at,V,St,Pt,pt,mt){const Lt=at,Ht=V,Dt=St-Lt,ne=Pt-Ht;let _e=pt-Lt,Me=mt-Ht,Ae=_e*Dt+Me*ne,ze=0;Ae<=0?ze=0:(_e=Dt-_e,Me=ne-Me,Ae=_e*Dt+Me*ne,Ae<=0?ze=0:ze=Ae*Ae/(Dt*Dt+ne*ne));const Ve=_e*_e+Me*Me-ze;return Ve<0?0:Ve}function F(at,V,St,Pt){return(at-St)*(at-St)+(V-Pt)*(V-Pt)}function R(at,V,St,Pt,pt){return F(at,V,St,Pt)<pt*pt}function L(at){if(!Number.isFinite(at))return St=>St;if(at===0)return Math.round;const V=Math.pow(10,at);return St=>Math.round(St*V)/V}function k(at){const V=Math.min(at.x1,at.x2),St=Math.max(at.x1,at.x2),Pt=Math.min(at.y1,at.y2),pt=Math.max(at.y1,at.y2);return{x:V,y:Pt,x2:St,y2:pt,width:St-V,height:pt-Pt}}class O{constructor(V,St,Pt,pt){this.x1=V,this.y1=St,this.x2=Pt,this.y2=pt}equals(V){return this.x1===V.x1&&this.y1===V.y1&&this.x2===V.x2&&this.y2===V.y2}draw(V){V.moveTo(this.x1,this.y1),V.lineTo(this.x2,this.y2)}toString(){return`Line(from=(${this.x1},${this.y1}),to=(${this.x2},${this.y2}))`}static from(V){return new O(V.x1,V.y1,V.x2,V.y2)}cuts(V,St){if(this.y1===this.y2||St<this.y1&&St<=this.y2||St>this.y1&&St>=this.y2||V>this.x1&&V>=this.x2)return!1;if(V<this.x1&&V<=this.x2)return!0;const Pt=this.x1+(St-this.y1)*(this.x2-this.x1)/(this.y2-this.y1);return V<=Pt}distSquare(V,St){return m(this.x1,this.y1,this.x2,this.y2,V,St)}ptClose(V,St,Pt){if(this.x1<this.x2){if(V<this.x1-Pt||V>this.x2+Pt)return!1}else if(V<this.x2-Pt||V>this.x1+Pt)return!1;if(this.y1<this.y2){if(St<this.y1-Pt||St>this.y2+Pt)return!1}else if(St<this.y2-Pt||St>this.y1+Pt)return!1;return!0}}var b;(function(at){at[at.POINT=1]="POINT",at[at.PARALLEL=2]="PARALLEL",at[at.COINCIDENT=3]="COINCIDENT",at[at.NONE=4]="NONE"})(b||(b={}));class E{constructor(V,St=0,Pt=0){this.state=V,this.x=St,this.y=Pt}}function T(at,V){const St=(V.x2-V.x1)*(at.y1-V.y1)-(V.y2-V.y1)*(at.x1-V.x1),Pt=(at.x2-at.x1)*(at.y1-V.y1)-(at.y2-at.y1)*(at.x1-V.x1),pt=(V.y2-V.y1)*(at.x2-at.x1)-(V.x2-V.x1)*(at.y2-at.y1);if(pt){const mt=St/pt,Lt=Pt/pt;return 0<=mt&&mt<=1&&0<=Lt&&Lt<=1?new E(b.POINT,at.x1+mt*(at.x2-at.x1),at.y1+mt*(at.y2-at.y1)):new E(b.NONE)}return new E(St===0||Pt===0?b.COINCIDENT:b.PARALLEL)}function _(at,V){const St=(V.x2-V.x1)*(at.y1-V.y1)-(V.y2-V.y1)*(at.x1-V.x1),Pt=(at.x2-at.x1)*(at.y1-V.y1)-(at.y2-at.y1)*(at.x1-V.x1),pt=(V.y2-V.y1)*(at.x2-at.x1)-(V.x2-V.x1)*(at.y2-at.y1);if(pt){const mt=St/pt,Lt=Pt/pt;if(0<=mt&&mt<=1&&0<=Lt&&Lt<=1)return mt}return Number.POSITIVE_INFINITY}function P(at,V){function St(pt,mt,Lt,Ht){let Dt=_(V,new O(pt,mt,Lt,Ht));return Dt=Math.abs(Dt-.5),Dt>=0&&Dt<=1?1:0}let Pt=St(at.x,at.y,at.x2,at.y);return Pt+=St(at.x,at.y,at.x,at.y2),Pt>1||(Pt+=St(at.x,at.y2,at.x2,at.y2),Pt>1)?!0:(Pt+=St(at.x2,at.y,at.x2,at.y2),Pt>0)}var B;(function(at){at[at.LEFT=0]="LEFT",at[at.TOP=1]="TOP",at[at.RIGHT=2]="RIGHT",at[at.BOTTOM=3]="BOTTOM"})(B||(B={}));function tt(at,V,St){const Pt=new Set;return at.width<=0?(Pt.add(B.LEFT),Pt.add(B.RIGHT)):V<at.x?Pt.add(B.LEFT):V>at.x+at.width&&Pt.add(B.RIGHT),at.height<=0?(Pt.add(B.TOP),Pt.add(B.BOTTOM)):St<at.y?Pt.add(B.TOP):St>at.y+at.height&&Pt.add(B.BOTTOM),Pt}function st(at,V){let St=V.x1,Pt=V.y1;const pt=V.x2,mt=V.y2,Lt=Array.from(tt(at,pt,mt));if(Lt.length===0)return!0;let Ht=tt(at,St,Pt);for(;Ht.size!==0;){for(const Dt of Lt)if(Ht.has(Dt))return!1;if(Ht.has(B.RIGHT)||Ht.has(B.LEFT)){let Dt=at.x;Ht.has(B.RIGHT)&&(Dt+=at.width),Pt=Pt+(Dt-St)*(mt-Pt)/(pt-St),St=Dt}else{let Dt=at.y;Ht.has(B.BOTTOM)&&(Dt+=at.height),St=St+(Dt-Pt)*(pt-St)/(mt-Pt),Pt=Dt}Ht=tt(at,St,Pt)}return!0}function Rt(at,V){let St=Number.POSITIVE_INFINITY,Pt=0;function pt(mt,Lt,Ht,Dt){let ne=_(V,new O(mt,Lt,Ht,Dt));ne=Math.abs(ne-.5),ne>=0&&ne<=1&&(Pt++,ne<St&&(St=ne))}return pt(at.x,at.y,at.x2,at.y),pt(at.x,at.y,at.x,at.y2),Pt>1||(pt(at.x,at.y2,at.x2,at.y2),Pt>1)?St:(pt(at.x2,at.y,at.x2,at.y2),Pt===0?-1:St)}function xt(at,V){let St=0;const Pt=T(at,new O(V.x,V.y,V.x2,V.y));St+=Pt.state===b.POINT?1:0;const pt=T(at,new O(V.x,V.y,V.x,V.y2));St+=pt.state===b.POINT?1:0;const mt=T(at,new O(V.x,V.y2,V.x2,V.y2));St+=mt.state===b.POINT?1:0;const Lt=T(at,new O(V.x2,V.y,V.x2,V.y2));return St+=Lt.state===b.POINT?1:0,{top:Pt,left:pt,bottom:mt,right:Lt,count:St}}class nt{constructor(V,St,Pt,pt){this.x=V,this.y=St,this.width=Pt,this.height=pt}get x2(){return this.x+this.width}get y2(){return this.y+this.height}get cx(){return this.x+this.width/2}get cy(){return this.y+this.height/2}get radius(){return Math.max(this.width,this.height)/2}static from(V){return new nt(V.x,V.y,V.width,V.height)}equals(V){return this.x===V.x&&this.y===V.y&&this.width===V.width&&this.height===V.height}clone(){return new nt(this.x,this.y,this.width,this.height)}add(V){const St=Math.min(this.x,V.x),Pt=Math.min(this.y,V.y),pt=Math.max(this.x2,V.x+V.width),mt=Math.max(this.y2,V.y+V.height);this.x=St,this.y=Pt,this.width=pt-St,this.height=mt-Pt}addPoint(V){const St=Math.min(this.x,V.x),Pt=Math.min(this.y,V.y),pt=Math.max(this.x2,V.x),mt=Math.max(this.y2,V.y);this.x=St,this.y=Pt,this.width=pt-St,this.height=mt-Pt}toString(){return`Rectangle[x=${this.x}, y=${this.y}, w=${this.width}, h=${this.height}]`}draw(V){V.rect(this.x,this.y,this.width,this.height)}containsPt(V,St){return V>=this.x&&V<=this.x2&&St>=this.y&&St<=this.y2}get area(){return this.width*this.height}intersects(V){return this.area<=0||V.width<=0||V.height<=0?!1:V.x+V.width>this.x&&V.y+V.height>this.y&&V.x<this.x2&&V.y<this.y2}distSquare(V,St){if(this.containsPt(V,St))return 0;const Pt=tt(this,V,St);return Pt.has(B.TOP)?Pt.has(B.LEFT)?F(V,St,this.x,this.y):Pt.has(B.RIGHT)?F(V,St,this.x2,this.y):(this.y-St)*(this.y-St):Pt.has(B.BOTTOM)?Pt.has(B.LEFT)?F(V,St,this.x,this.y2):Pt.has(B.RIGHT)?F(V,St,this.x2,this.y2):(St-this.y2)*(St-this.y2):Pt.has(B.LEFT)?(this.x-V)*(this.x-V):Pt.has(B.RIGHT)?(V-this.x2)*(V-this.x2):0}}function Et(at){if(at.length===0)return null;const V=at[0],St=new nt(V.x,V.y,0,0);for(const Pt of at)St.addPoint(Pt);return St}class ot{constructor(V,St,Pt){this.cx=V,this.cy=St,this.radius=Pt}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return this.radius*2}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return this.radius*2}static from(V){return new ot(V.cx,V.cy,V.radius)}containsPt(V,St){return F(this.cx,this.cy,V,St)<this.radius*this.radius}distSquare(V,St){const Pt=F(this.cx,this.cy,V,St);if(Pt<this.radius*this.radius)return 0;const pt=Math.sqrt(Pt)-this.radius;return pt*pt}draw(V){V.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,Math.PI*2)}}class Ct{constructor(V,St=0,Pt=0,pt=0,mt=0,Lt=10,Ht=10,Dt=new Float32Array(Math.max(0,Lt*Ht)).fill(0)){this.pixelGroup=V,this.i=St,this.j=Pt,this.pixelX=pt,this.pixelY=mt,this.width=Lt,this.height=Ht,this.area=Dt}createSub(V,St){return new Ct(this.pixelGroup,V.x,V.y,St.x,St.y,V.width,V.height)}static fromPixelRegion(V,St){return new Ct(St,0,0,V.x,V.y,Math.ceil(V.width/St),Math.ceil(V.height/St))}copy(V,St){return new Ct(this.pixelGroup,this.scaleX(St.x),this.scaleY(St.y),St.x,St.y,V.width,V.height,V.area)}boundX(V){return V<this.i?this.i:V>=this.width?this.width-1:V}boundY(V){return V<this.j?this.j:V>=this.height?this.height-1:V}scaleX(V){return this.boundX(Math.floor((V-this.pixelX)/this.pixelGroup))}scaleY(V){return this.boundY(Math.floor((V-this.pixelY)/this.pixelGroup))}scale(V){const St=this.scaleX(V.x),Pt=this.scaleY(V.y),pt=this.boundX(Math.ceil((V.x+V.width-this.pixelX)/this.pixelGroup)),mt=this.boundY(Math.ceil((V.y+V.height-this.pixelY)/this.pixelGroup)),Lt=pt-St,Ht=mt-Pt;return new nt(St,Pt,Lt,Ht)}invertScaleX(V){return Math.round(V*this.pixelGroup+this.pixelX)}invertScaleY(V){return Math.round(V*this.pixelGroup+this.pixelY)}addPadding(V,St){const Pt=Math.ceil(St/this.pixelGroup),pt=this.boundX(V.x-Pt),mt=this.boundY(V.y-Pt),Lt=this.boundX(V.x2+Pt),Ht=this.boundY(V.y2+Pt),Dt=Lt-pt,ne=Ht-mt;return new nt(pt,mt,Dt,ne)}get(V,St){return V<0||St<0||V>=this.width||St>=this.height?Number.NaN:this.area[V+St*this.width]}inc(V,St,Pt){V<0||St<0||V>=this.width||St>=this.height||(this.area[V+St*this.width]+=Pt)}set(V,St,Pt){V<0||St<0||V>=this.width||St>=this.height||(this.area[V+St*this.width]=Pt)}incArea(V,St){if(V.width<=0||V.height<=0||St===0)return;const Pt=this.width,pt=V.width,mt=Math.max(0,V.i),Lt=Math.max(0,V.j),Ht=Math.min(V.i+V.width,Pt),Dt=Math.min(V.j+V.height,this.height);if(!(Dt<=0||Ht<=0||mt>=Pt||Dt>=this.height))for(let ne=Lt;ne<Dt;ne++){const _e=(ne-V.j)*pt,Me=ne*Pt;for(let Ae=mt;Ae<Ht;Ae++){const ze=V.area[Ae-V.i+_e];ze!==0&&(this.area[Ae+Me]+=St*ze)}}}fill(V){this.area.fill(V)}fillArea(V,St){const Pt=V.x+V.y*this.width;for(let pt=0;pt<V.height;pt++){const mt=Pt+pt*this.width;this.area.fill(St,mt,mt+V.width)}}fillHorizontalLine(V,St,Pt,pt){const mt=V+St*this.width;this.area.fill(pt,mt,mt+Pt)}fillVerticalLine(V,St,Pt,pt){const mt=V+St*this.width;for(let Lt=0;Lt<Pt;Lt++)this.area[mt+Lt*this.width]=pt}clear(){this.area.fill(0)}toString(){let V="";for(let St=0;St<this.height;St++){const Pt=St*this.width;for(let pt=0;pt<this.width;pt++){const mt=this.area[Pt+pt];V+=mt.toFixed(1).padStart(6),V+=" "}V+=`
|
|
|
`}return V}draw(V,St=!0){if(this.width<=0||this.height<=0)return;V.save(),St&&V.translate(this.pixelX,this.pixelY);const Pt=this.area.reduce((Lt,Ht)=>Math.min(Lt,Ht),Number.POSITIVE_INFINITY),pt=this.area.reduce((Lt,Ht)=>Math.max(Lt,Ht),Number.NEGATIVE_INFINITY),mt=Lt=>(Lt-Pt)/(pt-Pt);V.scale(this.pixelGroup,this.pixelGroup);for(let Lt=0;Lt<this.width;Lt++)for(let Ht=0;Ht<this.height;Ht++){const Dt=this.area[Lt+Ht*this.width];V.fillStyle=`rgba(0, 0, 0, ${mt(Dt)})`,V.fillRect(Lt,Ht,1,1)}V.restore()}drawThreshold(V,St,Pt=!0){if(!(this.width<=0||this.height<=0)){V.save(),Pt&&V.translate(this.pixelX,this.pixelY),V.scale(this.pixelGroup,this.pixelGroup);for(let pt=0;pt<this.width;pt++)for(let mt=0;mt<this.height;mt++){const Lt=this.area[pt+mt*this.width];V.fillStyle=Lt>St?"black":"white",V.fillRect(pt,mt,1,1)}V.restore()}}}function _t(at,V){const St=Pt=>({x:Pt.x-V,y:Pt.y-V,width:Pt.width+2*V,height:Pt.height+2*V});return Array.isArray(at)?at.map(St):St(at)}function dt(at,V,St){return Ot(Object.assign(k(at),{distSquare:(Pt,pt)=>m(at.x1,at.y1,at.x2,at.y2,Pt,pt)}),V,St)}function Ot(at,V,St){const Pt=_t(at,St),pt=V.scale(Pt),mt=V.createSub(pt,Pt);return wt(mt,V,St,(Lt,Ht)=>at.distSquare(Lt,Ht)),mt}function wt(at,V,St,Pt){const pt=St*St;for(let mt=0;mt<at.height;mt++)for(let Lt=0;Lt<at.width;Lt++){const Ht=V.invertScaleX(at.i+Lt),Dt=V.invertScaleY(at.j+mt),ne=Pt(Ht,Dt);if(ne===0){at.set(Lt,mt,pt);continue}if(ne<pt){const _e=St-Math.sqrt(ne);at.set(Lt,mt,_e*_e)}}return at}function Ft(at,V,St){const Pt=V.scale(at),pt=V.addPadding(Pt,St),mt=V.createSub(pt,{x:at.x-St,y:at.y-St}),Lt=Pt.x-pt.x,Ht=Pt.y-pt.y,Dt=pt.x2-Pt.x2,ne=pt.y2-Pt.y2,_e=pt.width-Lt-Dt,Me=pt.height-Ht-ne,Ae=St*St;mt.fillArea({x:Lt,y:Ht,width:_e+1,height:Me+1},Ae);const ze=[0],Ve=Math.max(Ht,Lt,Dt,ne);{const hn=V.invertScaleX(Pt.x+Pt.width/2);for(let En=1;En<Ve;En++){const Gn=V.invertScaleY(Pt.y-En),Tn=at.distSquare(hn,Gn);if(Tn<Ae){const Pn=St-Math.sqrt(Tn);ze.push(Pn*Pn)}else break}}const Je=[],pn=Math.max(Lt,Dt),jn=Math.max(Ht,Dt);for(let hn=1;hn<pn;hn++){const En=V.invertScaleX(Pt.x-hn),Gn=[];for(let Tn=1;Tn<jn;Tn++){const Pn=V.invertScaleY(Pt.y-Tn),Tr=at.distSquare(En,Pn);if(Tr<Ae){const wi=St-Math.sqrt(Tr);Gn.push(wi*wi)}else Gn.push(0)}Je.push(Gn)}for(let hn=1;hn<Math.min(Ht,ze.length);hn++){const En=ze[hn];mt.fillHorizontalLine(Lt,Ht-hn,_e+1,En)}for(let hn=1;hn<Math.min(ne,ze.length);hn++){const En=ze[hn];mt.fillHorizontalLine(Lt,Ht+Me+hn,_e+1,En)}for(let hn=1;hn<Math.min(Lt,ze.length);hn++){const En=ze[hn];mt.fillVerticalLine(Lt-hn,Ht,Me+1,En)}for(let hn=1;hn<Math.min(ne,ze.length);hn++){const En=ze[hn];mt.fillVerticalLine(Lt+_e+hn,Ht,Me+1,En)}for(let hn=1;hn<Lt;hn++){const En=Je[hn-1],Gn=Lt-hn;for(let Tn=1;Tn<Ht;Tn++)mt.set(Gn,Ht-Tn,En[Tn-1]);for(let Tn=1;Tn<ne;Tn++)mt.set(Gn,Ht+Me+Tn,En[Tn-1])}for(let hn=1;hn<Dt;hn++){const En=Je[hn-1],Gn=Lt+_e+hn;for(let Tn=1;Tn<Ht;Tn++)mt.set(Gn,Ht-Tn,En[Tn-1]);for(let Tn=1;Tn<ne;Tn++)mt.set(Gn,Ht+Me+Tn,En[Tn-1])}return mt}function jt(at,V,St,Pt){return{x:at,y:V,width:St,height:Pt}}function re(at,V,St){return{cx:at,cy:V,radius:St}}function Ee(at,V,St,Pt){return{x1:at,y1:V,x2:St,y2:Pt}}function et(at,V){return{x:at,y:V}}function ge(at,V,St,Pt){if(at.length===0)return[];const pt=bt(at);return pt.map((mt,Lt)=>{const Ht=pt.slice(0,Lt);return yt(V,mt,Ht,St,Pt)}).flat()}function yt(at,V,St,Pt,pt){const mt=et(V.cx,V.cy),Lt=rt(mt,St,at);if(Lt==null)return[];const Ht=new O(mt.x,mt.y,Lt.cx,Lt.cy),Dt=te(Ht,at,Pt,pt);return Xt(Dt,at)}function te(at,V,St,Pt){const pt=[],mt=[];mt.push(at);let Lt=!0;for(let Ht=0;Ht<St&≪Ht++)for(Lt=!1;!Lt&&mt.length>0;){const Dt=mt.pop(),ne=Gt(V,Dt),_e=ne?xt(Dt,ne):null;if(!ne||!_e||_e.count!==2){Lt||pt.push(Dt);continue}let Me=Pt,Ae=we(ne,Me,_e,!0),ze=be(Ae,mt)||be(Ae,pt),Ve=ye(Ae,V);for(;!ze&&Ve&&Me>=1;)Me/=1.5,Ae=we(ne,Me,_e,!0),ze=be(Ae,mt)||be(Ae,pt),Ve=ye(Ae,V);if(Ae&&!ze&&!Ve&&(mt.push(new O(Dt.x1,Dt.y1,Ae.x,Ae.y)),mt.push(new O(Ae.x,Ae.y,Dt.x2,Dt.y2)),Lt=!0),Lt)continue;Me=Pt,Ae=we(ne,Me,_e,!1);let Je=be(Ae,mt)||be(Ae,pt);for(Ve=ye(Ae,V);!Je&&Ve&&Me>=1;)Me/=1.5,Ae=we(ne,Me,_e,!1),Je=be(Ae,mt)||be(Ae,pt),Ve=ye(Ae,V);Ae&&!Je&&(mt.push(new O(Dt.x1,Dt.y1,Ae.x,Ae.y)),mt.push(new O(Ae.x,Ae.y,Dt.x2,Dt.y2)),Lt=!0),Lt||pt.push(Dt)}for(;mt.length>0;)pt.push(mt.pop());return pt}function Xt(at,V){const St=[];for(;at.length>0;){const Pt=at.pop();if(at.length===0){St.push(Pt);break}const pt=at.pop(),mt=new O(Pt.x1,Pt.y1,pt.x2,pt.y2);Gt(V,mt)?(St.push(Pt),at.push(pt)):at.push(mt)}return St}function rt(at,V,St){let Pt=Number.POSITIVE_INFINITY;return V.reduce((pt,mt)=>{const Lt=F(at.x,at.y,mt.cx,mt.cy);if(Lt>Pt)return pt;const Ht=new O(at.x,at.y,mt.cx,mt.cy),Dt=Kt(St,Ht);return Lt*(Dt+1)*(Dt+1)<Pt&&(pt=mt,Pt=Lt*(Dt+1)*(Dt+1)),pt},null)}function bt(at){if(at.length<2)return at;let V=0,St=0;return at.forEach(Pt=>{V+=Pt.cx,St+=Pt.cy}),V/=at.length,St/=at.length,at.map(Pt=>{const pt=V-Pt.cx,mt=St-Pt.cy,Lt=pt*pt+mt*mt;return[Pt,Lt]}).sort((Pt,pt)=>Pt[1]-pt[1]).map(Pt=>Pt[0])}function ye(at,V){return V.some(St=>St.containsPt(at.x,at.y))}function be(at,V){return V.some(St=>!!(R(St.x1,St.y1,at.x,at.y,.001)||R(St.x2,St.y2,at.x,at.y,.001)))}function Gt(at,V){let St=Number.POSITIVE_INFINITY,Pt=null;for(const pt of at){if(!st(pt,V))continue;const mt=Rt(pt,V);mt>=0&&mt<St&&(Pt=pt,St=mt)}return Pt}function Kt(at,V){return at.reduce((St,Pt)=>st(Pt,V)&&P(Pt,V)?St+1:St,0)}function we(at,V,St,Pt){const pt=St.top,mt=St.left,Lt=St.bottom,Ht=St.right;if(Pt){if(mt.state===b.POINT){if(pt.state===b.POINT)return et(at.x-V,at.y-V);if(Lt.state===b.POINT)return et(at.x-V,at.y2+V);const Ae=at.width*at.height;return at.width*((mt.y-at.y+(Ht.y-at.y))*.5)<Ae*.5?mt.y>Ht.y?et(at.x-V,at.y-V):et(at.x2+V,at.y-V):mt.y<Ht.y?et(at.x-V,at.y2+V):et(at.x2+V,at.y2+V)}if(Ht.state===b.POINT){if(pt.state===b.POINT)return et(at.x2+V,at.y-V);if(Lt.state===b.POINT)return et(at.x2+V,at.y2+V)}const _e=at.height*at.width;return at.height*((pt.x-at.x+(Ht.x-at.x))*.5)<_e*.5?pt.x>Lt.x?et(at.x-V,at.y-V):et(at.x-V,at.y2+V):pt.x<Lt.x?et(at.x2+V,at.y-V):et(at.x2+V,at.y2+V)}if(mt.state===b.POINT){if(pt.state===b.POINT)return et(at.x2+V,at.y2+V);if(Lt.state===b.POINT)return et(at.x2+V,at.y-V);const _e=at.height*at.width;return at.width*((mt.y-at.y+(Ht.y-at.y))*.5)<_e*.5?mt.y>Ht.y?et(at.x2+V,at.y2+V):et(at.x-V,at.y2+V):mt.y<Ht.y?et(at.x2+V,at.y-V):et(at.x-V,at.y-V)}if(Ht.state===b.POINT){if(pt.state===b.POINT)return et(at.x-V,at.y2+V);if(Lt.state===b.POINT)return et(at.x-V,at.y-V)}const Dt=at.height*at.width;return at.height*((pt.x-at.x+(Ht.x-at.x))*.5)<Dt*.5?pt.x>Lt.x?et(at.x2+V,at.y2+V):et(at.x2+V,at.y-V):pt.x<Lt.x?et(at.x-V,at.y2+V):et(at.x-V,at.y-V)}function Bt(at,V,St,Pt){if(!(at.closed?St<at.length:St<at.length-1))return!1;const mt=at.get(V),Lt=at.get(St+1);for(let Ht=V+1;Ht<=St;Ht++){const Dt=at.get(Ht);if(m(mt.x,mt.y,Lt.x,Lt.y,Dt.x,Dt.y)>Pt)return!1}return!0}function oe(at=0){return V=>{if(at<0||V.length<3)return V;const St=[];let Pt=0;const pt=at*at;for(;Pt<V.length;){let mt=Pt+1;for(;Bt(V,Pt,mt,pt);)mt++;St.push(V.get(Pt)),Pt=mt}return new ve(St)}}function ht(at,V){switch(at){case-2:return(((-V+3)*V-3)*V+1)/6;case-1:return((3*V-6)*V*V+4)/6;case 0:return(((-3*V+3)*V+3)*V+1)/6;case 1:return V*V*V/6;default:throw new Error("unknown error")}}function ut(at=6){function mt(Lt,Ht,Dt){let ne=0,_e=0;for(let Me=-2;Me<=1;Me++){const Ae=Lt.get(Ht+Me),ze=ht(Me,Dt);ne+=ze*Ae.x,_e+=ze*Ae.y}return{x:ne,y:_e}}return Lt=>{if(Lt.length<3)return Lt;const Ht=[],Dt=Lt.closed,ne=Lt.length+3-1+(Dt?0:2);Ht.push(mt(Lt,2-(Dt?0:2),0));for(let _e=2-(Dt?0:2);_e<ne;_e++)for(let Me=1;Me<=at;Me++)Ht.push(mt(Lt,_e,Me/at));return new ve(Ht)}}function Vt(at=8){return V=>{let St=at,Pt=V.length;if(St>1)for(Pt=Math.floor(V.length/St);Pt<3&&St>1;)St-=1,Pt=Math.floor(V.length/St);const pt=[];for(let mt=0,Lt=0;Lt<Pt;Lt++,mt+=St)pt.push(V.get(mt));return new ve(pt)}}class ve{constructor(V=[],St=!0){this.points=V,this.closed=St}get(V){const St=V,Pt=this.points.length;return V<0?this.closed?this.get(V+Pt):this.points[0]:V>=Pt?this.closed?this.get(V-Pt):this.points[Pt-1]:this.points[St]}get length(){return this.points.length}toString(V=1/0){const St=this.points;if(St.length===0)return"";const Pt=typeof V=="function"?V:L(V);let pt="M";for(const mt of St)pt+=`${Pt(mt.x)},${Pt(mt.y)} L`;return pt=pt.slice(0,-1),this.closed&&(pt+=" Z"),pt}draw(V){const St=this.points;if(St.length!==0){V.beginPath(),V.moveTo(St[0].x,St[0].y);for(const Pt of St)V.lineTo(Pt.x,Pt.y);this.closed&&V.closePath()}}sample(V){return Vt(V)(this)}simplify(V){return oe(V)(this)}bSplines(V){return ut(V)(this)}apply(V){return V(this)}containsElements(V){const St=Et(this.points);return St?V.every(Pt=>St.containsPt(Pt.cx,Pt.cy)&&this.withinArea(Pt.cx,Pt.cy)):!1}withinArea(V,St){if(this.length===0)return!1;let Pt=0;const pt=this.points[0],mt=new O(pt.x,pt.y,pt.x,pt.y);for(let Lt=1;Lt<this.points.length;Lt++){const Ht=this.points[Lt];mt.x1=mt.x2,mt.y1=mt.y2,mt.x2=Ht.x,mt.y2=Ht.y,mt.cuts(V,St)&&Pt++}return mt.x1=mt.x2,mt.y1=mt.y2,mt.x2=pt.x,mt.y2=pt.y,mt.cuts(V,St)&&Pt++,Pt%2===1}}class kt{constructor(V=0){this.count=0,this.arr=[],this.set=new Set,this.arr.length=V}add(V){this.set.add(`${V.x}x${V.y}`),this.arr[this.count++]=V}contains(V){return this.set.has(`${V.x}x${V.y}`)}isFirst(V){if(this.count===0)return!1;const St=this.arr[0];return St!=null&&St.x===V.x&&St.y===V.y}path(){return new ve(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(V){return this.arr[V]}get length(){return this.count}}const ee=0,me=1,Nt=2,Zt=3;function Yt(at,V){const St=(Math.floor(at.width)+Math.floor(at.height))*2,Pt=new kt(St);function pt(Dt,ne,_e,Me){const Ae=at.get(Dt,ne);return Number.isNaN(Ae)?Number.NaN:Ae>V?_e+Me:_e}function mt(Dt,ne){let _e=ee;return _e=pt(Dt,ne,_e,1),_e=pt(Dt+1,ne,_e,2),_e=pt(Dt,ne+1,_e,4),_e=pt(Dt+1,ne+1,_e,8),Number.isNaN(_e)?-1:_e}let Lt=me;function Ht(Dt,ne){let _e=Dt,Me=ne,Ae=at.invertScaleX(_e),ze=at.invertScaleY(Me);for(let Ve=0;Ve<at.width*at.height;Ve++){const Je={x:Ae,y:ze};if(Pt.contains(Je)){if(Pt.isFirst(Je))return!0}else Pt.add(Je);const pn=mt(_e,Me);switch(pn){case-1:return!0;case 0:case 3:case 2:case 7:Lt=Nt;break;case 12:case 14:case 4:Lt=Zt;break;case 6:Lt=Lt===ee?Zt:Nt;break;case 1:case 13:case 5:Lt=ee;break;case 9:Lt=Lt===Nt?ee:me;break;case 10:case 8:case 11:Lt=me;break;default:return console.warn("Marching squares invalid state: "+pn),!0}switch(Lt){case ee:Me--,ze-=at.pixelGroup;break;case me:Me++,ze+=at.pixelGroup;break;case Zt:_e--,Ae-=at.pixelGroup;break;case Nt:_e++,Ae+=at.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+pn),!0}}return!0}for(let Dt=0;Dt<at.width;Dt++)for(let ne=0;ne<at.height;ne++){if(at.get(Dt,ne)<=V)continue;const _e=mt(Dt,ne);if(!(_e<0||_e===15)&&Ht(Dt,ne))return Pt.path()}return null}const S={maxRoutingIterations:100,maxMarchingIterations:20,pixelGroup:4,edgeR0:10,edgeR1:20,nodeR0:15,nodeR1:50,morphBuffer:10,threshold:1,memberInfluenceFactor:1,edgeInfluenceFactor:1,nonMemberInfluenceFactor:-.8,virtualEdges:!0};function Y(at){return at!=null&&typeof at.radius=="number"}function At(at,V){if(Y(at)!==Y(V))return!1;if(Y(at)){const Pt=V;return at.cx===Pt.cx&&at.cy===Pt.cy&&at.radius===Pt.radius}const St=V;return at.x===St.x&&at.y===St.y&&at.width===St.width&&at.height===St.height}var ie;(function(at){at[at.MEMBERS=0]="MEMBERS",at[at.NON_MEMBERS=1]="NON_MEMBERS",at[at.EDGES=2]="EDGES"})(ie||(ie={}));class $t{constructor(V={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new nt(0,0,0,0),this.potentialArea=new Ct(1,0,0,0,0,0,0),this.o=Object.assign({},S,V)}pushMember(...V){if(V.length!==0){this.dirty.add(ie.MEMBERS);for(const St of V)this.members.push({raw:St,obj:Y(St)?ot.from(St):nt.from(St),area:null})}}removeMember(V){const St=this.members.findIndex(Pt=>At(Pt.raw,V));return St<0?!1:(this.members.splice(St,1),this.dirty.add(ie.MEMBERS),!0)}removeNonMember(V){const St=this.nonMembers.findIndex(Pt=>At(Pt.raw,V));return St<0?!1:(this.nonMembers.splice(St,1),this.dirty.add(ie.NON_MEMBERS),!0)}removeEdge(V){const St=this.edges.findIndex(Pt=>Pt.obj.equals(V));return St<0?!1:(this.edges.splice(St,1),this.dirty.add(ie.NON_MEMBERS),!0)}pushNonMember(...V){if(V.length!==0){this.dirty.add(ie.NON_MEMBERS);for(const St of V)this.nonMembers.push({raw:St,obj:Y(St)?ot.from(St):nt.from(St),area:null})}}pushEdge(...V){if(V.length!==0){this.dirty.add(ie.EDGES);for(const St of V)this.edges.push({raw:St,obj:O.from(St),area:null})}}update(){const V=this.dirty.has(ie.MEMBERS),St=this.dirty.has(ie.NON_MEMBERS);let Pt=this.dirty.has(ie.EDGES);this.dirty.clear();const pt=this.members.map(ne=>ne.obj);if(this.o.virtualEdges&&(V||St)){const ne=this.nonMembers.map(Ae=>Ae.obj),_e=ge(pt,ne,this.o.maxRoutingIterations,this.o.morphBuffer),Me=new Map(this.virtualEdges.map(Ae=>[Ae.obj.toString(),Ae.area]));this.virtualEdges=_e.map(Ae=>{var ze;return{raw:Ae,obj:Ae,area:(ze=Me.get(Ae.toString()))!==null&&ze!==void 0?ze:null}}),Pt=!0}let mt=!1;if(V||Pt){const ne=this.virtualEdges.concat(this.edges).map(ze=>ze.obj),_e=Ne(pt,ne),Me=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,Ae=nt.from(_t(_e,Me));Ae.equals(this.activeRegion)||(mt=!0,this.activeRegion=Ae)}if(mt){const ne=Math.ceil(this.activeRegion.width/this.o.pixelGroup),_e=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=Ct.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach(Me=>Me.area=null),this.nonMembers.forEach(Me=>Me.area=null),this.edges.forEach(Me=>Me.area=null),this.virtualEdges.forEach(Me=>Me.area=null)):(ne!==this.potentialArea.width||_e!==this.potentialArea.height)&&(this.potentialArea=Ct.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const Lt=new Map,Ht=ne=>{if(ne.area){const _e=`${ne.obj.width}x${ne.obj.height}x${ne.obj instanceof nt?"R":"C"}`;Lt.set(_e,ne.area)}},Dt=ne=>{if(ne.area)return;const _e=`${ne.obj.width}x${ne.obj.height}x${ne.obj instanceof nt?"R":"C"}`;if(Lt.has(_e)){const Ae=Lt.get(_e);ne.area=this.potentialArea.copy(Ae,{x:ne.obj.x-this.o.nodeR1,y:ne.obj.y-this.o.nodeR1});return}const Me=ne.obj instanceof nt?Ft(ne.obj,this.potentialArea,this.o.nodeR1):Ot(ne.obj,this.potentialArea,this.o.nodeR1);ne.area=Me,Lt.set(_e,Me)};this.members.forEach(Ht),this.nonMembers.forEach(Ht),this.members.forEach(Dt),this.nonMembers.forEach(ne=>{this.activeRegion.intersects(ne.obj)?Dt(ne):ne.area=null}),this.edges.forEach(ne=>{ne.area||(ne.area=dt(ne.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(ne=>{ne.area||(ne.area=dt(ne.obj,this.potentialArea,this.o.edgeR1))})}drawMembers(V){for(const St of this.members)St.obj.draw(V)}drawNonMembers(V){for(const St of this.nonMembers)St.obj.draw(V)}drawEdges(V){for(const St of this.edges)St.obj.draw(V)}drawPotentialArea(V,St=!0){this.potentialArea.draw(V,St)}compute(){if(this.members.length===0)return new ve([]);this.dirty.size>0&&this.update();const{o:V,potentialArea:St}=this,Pt=this.members.map(Ht=>Ht.area),pt=this.virtualEdges.concat(this.edges).map(Ht=>Ht.area),mt=this.nonMembers.filter(Ht=>Ht.area!=null).map(Ht=>Ht.area),Lt=this.members.map(Ht=>Ht.obj);return Oe(St,Pt,pt,mt,Ht=>Ht.containsElements(Lt),V)}}function Oe(at,V,St,Pt,pt,mt={}){const Lt=Object.assign({},S,mt);let Ht=Lt.threshold,Dt=Lt.memberInfluenceFactor,ne=Lt.edgeInfluenceFactor,_e=Lt.nonMemberInfluenceFactor;const Me=(Lt.nodeR0-Lt.nodeR1)*(Lt.nodeR0-Lt.nodeR1),Ae=(Lt.edgeR0-Lt.edgeR1)*(Lt.edgeR0-Lt.edgeR1);for(let ze=0;ze<Lt.maxMarchingIterations;ze++){if(at.clear(),Dt!==0){const Je=Dt/Me;for(const pn of V)at.incArea(pn,Je)}if(ne!==0){const Je=ne/Ae;for(const pn of St)at.incArea(pn,Je)}if(_e!==0){const Je=_e/Me;for(const pn of Pt)at.incArea(pn,Je)}const Ve=Yt(at,Ht);if(Ve&&pt(Ve))return Ve;if(Ht*=.95,ze<=Lt.maxMarchingIterations*.5)Dt*=1.2,ne*=1.2;else if(_e!==0&&Pt.length>0)_e*=.8;else break}return new ve([])}function Ne(at,V){if(at.length===0)return new nt(0,0,0,0);const St=nt.from(at[0]);for(const Pt of at)St.add(Pt);for(const Pt of V)St.add(k(Pt));return St}function Le(at,V=[],St=[],Pt={}){if(at.length===0)return new ve([]);const pt=new $t(Pt);return pt.pushMember(...at),pt.pushNonMember(...V),pt.pushEdge(...St),pt.compute()}},8874:function(q){"use strict";q.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},19818:function(q,J,g){var m=g(8874),F=g(86851),R=Object.hasOwnProperty,L=Object.create(null);for(var k in m)R.call(m,k)&&(L[m[k]]=k);var O=q.exports={to:{},get:{}};O.get=function(T){var _=T.substring(0,3).toLowerCase(),P,B;switch(_){case"hsl":P=O.get.hsl(T),B="hsl";break;case"hwb":P=O.get.hwb(T),B="hwb";break;default:P=O.get.rgb(T),B="rgb";break}return P?{model:B,value:P}:null},O.get.rgb=function(T){if(!T)return null;var _=/^#([a-f0-9]{3,4})$/i,P=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,B=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,tt=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,st=/^(\w+)$/,Rt=[0,0,0,1],xt,nt,Et;if(xt=T.match(P)){for(Et=xt[2],xt=xt[1],nt=0;nt<3;nt++){var ot=nt*2;Rt[nt]=parseInt(xt.slice(ot,ot+2),16)}Et&&(Rt[3]=parseInt(Et,16)/255)}else if(xt=T.match(_)){for(xt=xt[1],Et=xt[3],nt=0;nt<3;nt++)Rt[nt]=parseInt(xt[nt]+xt[nt],16);Et&&(Rt[3]=parseInt(Et+Et,16)/255)}else if(xt=T.match(B)){for(nt=0;nt<3;nt++)Rt[nt]=parseInt(xt[nt+1],0);xt[4]&&(xt[5]?Rt[3]=parseFloat(xt[4])*.01:Rt[3]=parseFloat(xt[4]))}else if(xt=T.match(tt)){for(nt=0;nt<3;nt++)Rt[nt]=Math.round(parseFloat(xt[nt+1])*2.55);xt[4]&&(xt[5]?Rt[3]=parseFloat(xt[4])*.01:Rt[3]=parseFloat(xt[4]))}else return(xt=T.match(st))?xt[1]==="transparent"?[0,0,0,0]:R.call(m,xt[1])?(Rt=m[xt[1]],Rt[3]=1,Rt):null:null;for(nt=0;nt<3;nt++)Rt[nt]=b(Rt[nt],0,255);return Rt[3]=b(Rt[3],0,1),Rt},O.get.hsl=function(T){if(!T)return null;var _=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,P=T.match(_);if(P){var B=parseFloat(P[4]),tt=(parseFloat(P[1])%360+360)%360,st=b(parseFloat(P[2]),0,100),Rt=b(parseFloat(P[3]),0,100),xt=b(isNaN(B)?1:B,0,1);return[tt,st,Rt,xt]}return null},O.get.hwb=function(T){if(!T)return null;var _=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,P=T.match(_);if(P){var B=parseFloat(P[4]),tt=(parseFloat(P[1])%360+360)%360,st=b(parseFloat(P[2]),0,100),Rt=b(parseFloat(P[3]),0,100),xt=b(isNaN(B)?1:B,0,1);return[tt,st,Rt,xt]}return null},O.to.hex=function(){var T=F(arguments);return"#"+E(T[0])+E(T[1])+E(T[2])+(T[3]<1?E(Math.round(T[3]*255)):"")},O.to.rgb=function(){var T=F(arguments);return T.length<4||T[3]===1?"rgb("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+")":"rgba("+Math.round(T[0])+", "+Math.round(T[1])+", "+Math.round(T[2])+", "+T[3]+")"},O.to.rgb.percent=function(){var T=F(arguments),_=Math.round(T[0]/255*100),P=Math.round(T[1]/255*100),B=Math.round(T[2]/255*100);return T.length<4||T[3]===1?"rgb("+_+"%, "+P+"%, "+B+"%)":"rgba("+_+"%, "+P+"%, "+B+"%, "+T[3]+")"},O.to.hsl=function(){var T=F(arguments);return T.length<4||T[3]===1?"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)":"hsla("+T[0]+", "+T[1]+"%, "+T[2]+"%, "+T[3]+")"},O.to.hwb=function(){var T=F(arguments),_="";return T.length>=4&&T[3]!==1&&(_=", "+T[3]),"hwb("+T[0]+", "+T[1]+"%, "+T[2]+"%"+_+")"},O.to.keyword=function(T){return L[T.slice(0,3)]};function b(T,_,P){return Math.min(Math.max(_,T),P)}function E(T){var _=Math.round(T).toString(16).toUpperCase();return _.length<2?"0"+_:_}},70681:function(q,J,g){q.exports={graphlib:g(70574),layout:g(98123),debug:g(27570),util:{time:g(11138).time,notime:g(11138).notime},version:g(88177)}},92188:function(q,J,g){"use strict";var m=g(38436),F=g(74079);q.exports={run:R,undo:k};function R(O){var b=O.graph().acyclicer==="greedy"?F(O,E(O)):L(O);m.forEach(b,function(T){var _=O.edge(T);O.removeEdge(T),_.forwardName=T.name,_.reversed=!0,O.setEdge(T.w,T.v,_,m.uniqueId("rev"))});function E(T){return function(_){return T.edge(_).weight}}}function L(O){var b=[],E={},T={};function _(P){m.has(T,P)||(T[P]=!0,E[P]=!0,m.forEach(O.outEdges(P),function(B){m.has(E,B.w)?b.push(B):_(B.w)}),delete E[P])}return m.forEach(O.nodes(),_),b}function k(O){m.forEach(O.edges(),function(b){var E=O.edge(b);if(E.reversed){O.removeEdge(b);var T=E.forwardName;delete E.reversed,delete E.forwardName,O.setEdge(b.w,b.v,E,T)}})}},61133:function(q,J,g){var m=g(38436),F=g(11138);q.exports=R;function R(k){function O(b){var E=k.children(b),T=k.node(b);if(E.length&&m.forEach(E,O),m.has(T,"minRank")){T.borderLeft=[],T.borderRight=[];for(var _=T.minRank,P=T.maxRank+1;_<P;++_)L(k,"borderLeft","_bl",b,T,_),L(k,"borderRight","_br",b,T,_)}}m.forEach(k.children(),O)}function L(k,O,b,E,T,_){var P={width:0,height:0,rank:_,borderType:O},B=T[O][_-1],tt=F.addDummyNode(k,"border",P,b);T[O][_]=tt,k.setParent(tt,E),B&&k.setEdge(B,tt,{weight:1})}},53258:function(q,J,g){"use strict";var m=g(38436);q.exports={adjust:F,undo:R};function F(_){var P=_.graph().rankdir.toLowerCase();(P==="lr"||P==="rl")&&L(_)}function R(_){var P=_.graph().rankdir.toLowerCase();(P==="bt"||P==="rl")&&O(_),(P==="lr"||P==="rl")&&(E(_),L(_))}function L(_){m.forEach(_.nodes(),function(P){k(_.node(P))}),m.forEach(_.edges(),function(P){k(_.edge(P))})}function k(_){var P=_.width;_.width=_.height,_.height=P}function O(_){m.forEach(_.nodes(),function(P){b(_.node(P))}),m.forEach(_.edges(),function(P){var B=_.edge(P);m.forEach(B.points,b),m.has(B,"y")&&b(B)})}function b(_){_.y=-_.y}function E(_){m.forEach(_.nodes(),function(P){T(_.node(P))}),m.forEach(_.edges(),function(P){var B=_.edge(P);m.forEach(B.points,T),m.has(B,"x")&&T(B)})}function T(_){var P=_.x;_.x=_.y,_.y=P}},77822:function(q){q.exports=J;function J(){var F={};F._next=F._prev=F,this._sentinel=F}J.prototype.dequeue=function(){var F=this._sentinel,R=F._prev;if(R!==F)return g(R),R},J.prototype.enqueue=function(F){var R=this._sentinel;F._prev&&F._next&&g(F),F._next=R._next,R._next._prev=F,R._next=F,F._prev=R},J.prototype.toString=function(){for(var F=[],R=this._sentinel,L=R._prev;L!==R;)F.push(JSON.stringify(L,m)),L=L._prev;return"["+F.join(", ")+"]"};function g(F){F._prev._next=F._next,F._next._prev=F._prev,delete F._next,delete F._prev}function m(F,R){if(F!=="_next"&&F!=="_prev")return R}},27570:function(q,J,g){var m=g(38436),F=g(11138),R=g(70574).Graph;q.exports={debugOrdering:L};function L(k){var O=F.buildLayerMatrix(k),b=new R({compound:!0,multigraph:!0}).setGraph({});return m.forEach(k.nodes(),function(E){b.setNode(E,{label:E}),b.setParent(E,"layer"+k.node(E).rank)}),m.forEach(k.edges(),function(E){b.setEdge(E.v,E.w,{},E.name)}),m.forEach(O,function(E,T){var _="layer"+T;b.setNode(_,{rank:"same"}),m.reduce(E,function(P,B){return b.setEdge(P,B,{style:"invis"}),B})}),b}},70574:function(q,J,g){var m;try{m=g(28282)}catch(F){}m||(m=window.graphlib),q.exports=m},74079:function(q,J,g){var m=g(38436),F=g(70574).Graph,R=g(77822);q.exports=k;var L=m.constant(1);function k(_,P){if(_.nodeCount()<=1)return[];var B=E(_,P||L),tt=O(B.graph,B.buckets,B.zeroIdx);return m.flatten(m.map(tt,function(st){return _.outEdges(st.v,st.w)}),!0)}function O(_,P,B){for(var tt=[],st=P[P.length-1],Rt=P[0],xt;_.nodeCount();){for(;xt=Rt.dequeue();)b(_,P,B,xt);for(;xt=st.dequeue();)b(_,P,B,xt);if(_.nodeCount()){for(var nt=P.length-2;nt>0;--nt)if(xt=P[nt].dequeue(),xt){tt=tt.concat(b(_,P,B,xt,!0));break}}}return tt}function b(_,P,B,tt,st){var Rt=st?[]:void 0;return m.forEach(_.inEdges(tt.v),function(xt){var nt=_.edge(xt),Et=_.node(xt.v);st&&Rt.push({v:xt.v,w:xt.w}),Et.out-=nt,T(P,B,Et)}),m.forEach(_.outEdges(tt.v),function(xt){var nt=_.edge(xt),Et=xt.w,ot=_.node(Et);ot.in-=nt,T(P,B,ot)}),_.removeNode(tt.v),Rt}function E(_,P){var B=new F,tt=0,st=0;m.forEach(_.nodes(),function(nt){B.setNode(nt,{v:nt,in:0,out:0})}),m.forEach(_.edges(),function(nt){var Et=B.edge(nt.v,nt.w)||0,ot=P(nt),Ct=Et+ot;B.setEdge(nt.v,nt.w,Ct),st=Math.max(st,B.node(nt.v).out+=ot),tt=Math.max(tt,B.node(nt.w).in+=ot)});var Rt=m.range(st+tt+3).map(function(){return new R}),xt=tt+1;return m.forEach(B.nodes(),function(nt){T(Rt,xt,B.node(nt))}),{graph:B,buckets:Rt,zeroIdx:xt}}function T(_,P,B){B.out?B.in?_[B.out-B.in+P].enqueue(B):_[_.length-1].enqueue(B):_[0].enqueue(B)}},98123:function(q,J,g){"use strict";var m=g(38436),F=g(92188),R=g(45995),L=g(78093),k=g(11138).normalizeRanks,O=g(24219),b=g(11138).removeEmptyRanks,E=g(72981),T=g(61133),_=g(53258),P=g(53408),B=g(17873),tt=g(11138),st=g(70574).Graph;q.exports=Rt;function Rt(Bt,oe){var ht=oe&&oe.debugTiming?tt.time:tt.notime;ht("layout",function(){var ut=ht(" buildLayoutGraph",function(){return jt(Bt)});ht(" runLayout",function(){xt(ut,ht)}),ht(" updateInputGraph",function(){nt(Bt,ut)})})}function xt(Bt,oe){oe(" makeSpaceForEdgeLabels",function(){re(Bt)}),oe(" removeSelfEdges",function(){ye(Bt)}),oe(" acyclic",function(){F.run(Bt)}),oe(" nestingGraph.run",function(){E.run(Bt)}),oe(" rank",function(){L(tt.asNonCompoundGraph(Bt))}),oe(" injectEdgeLabelProxies",function(){Ee(Bt)}),oe(" removeEmptyRanks",function(){b(Bt)}),oe(" nestingGraph.cleanup",function(){E.cleanup(Bt)}),oe(" normalizeRanks",function(){k(Bt)}),oe(" assignRankMinMax",function(){et(Bt)}),oe(" removeEdgeLabelProxies",function(){ge(Bt)}),oe(" normalize.run",function(){R.run(Bt)}),oe(" parentDummyChains",function(){O(Bt)}),oe(" addBorderSegments",function(){T(Bt)}),oe(" order",function(){P(Bt)}),oe(" insertSelfEdges",function(){be(Bt)}),oe(" adjustCoordinateSystem",function(){_.adjust(Bt)}),oe(" position",function(){B(Bt)}),oe(" positionSelfEdges",function(){Gt(Bt)}),oe(" removeBorderNodes",function(){bt(Bt)}),oe(" normalize.undo",function(){R.undo(Bt)}),oe(" fixupEdgeLabelCoords",function(){Xt(Bt)}),oe(" undoCoordinateSystem",function(){_.undo(Bt)}),oe(" translateGraph",function(){yt(Bt)}),oe(" assignNodeIntersects",function(){te(Bt)}),oe(" reversePoints",function(){rt(Bt)}),oe(" acyclic.undo",function(){F.undo(Bt)})}function nt(Bt,oe){m.forEach(Bt.nodes(),function(ht){var ut=Bt.node(ht),Vt=oe.node(ht);ut&&(ut.x=Vt.x,ut.y=Vt.y,oe.children(ht).length&&(ut.width=Vt.width,ut.height=Vt.height))}),m.forEach(Bt.edges(),function(ht){var ut=Bt.edge(ht),Vt=oe.edge(ht);ut.points=Vt.points,m.has(Vt,"x")&&(ut.x=Vt.x,ut.y=Vt.y)}),Bt.graph().width=oe.graph().width,Bt.graph().height=oe.graph().height}var Et=["nodesep","edgesep","ranksep","marginx","marginy"],ot={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ct=["acyclicer","ranker","rankdir","align"],_t=["width","height"],dt={width:0,height:0},Ot=["minlen","weight","width","height","labeloffset"],wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ft=["labelpos"];function jt(Bt){var oe=new st({multigraph:!0,compound:!0}),ht=we(Bt.graph());return oe.setGraph(m.merge({},ot,Kt(ht,Et),m.pick(ht,Ct))),m.forEach(Bt.nodes(),function(ut){var Vt=we(Bt.node(ut));oe.setNode(ut,m.defaults(Kt(Vt,_t),dt)),oe.setParent(ut,Bt.parent(ut))}),m.forEach(Bt.edges(),function(ut){var Vt=we(Bt.edge(ut));oe.setEdge(ut,m.merge({},wt,Kt(Vt,Ot),m.pick(Vt,Ft)))}),oe}function re(Bt){var oe=Bt.graph();oe.ranksep/=2,m.forEach(Bt.edges(),function(ht){var ut=Bt.edge(ht);ut.minlen*=2,ut.labelpos.toLowerCase()!=="c"&&(oe.rankdir==="TB"||oe.rankdir==="BT"?ut.width+=ut.labeloffset:ut.height+=ut.labeloffset)})}function Ee(Bt){m.forEach(Bt.edges(),function(oe){var ht=Bt.edge(oe);if(ht.width&&ht.height){var ut=Bt.node(oe.v),Vt=Bt.node(oe.w),ve={rank:(Vt.rank-ut.rank)/2+ut.rank,e:oe};tt.addDummyNode(Bt,"edge-proxy",ve,"_ep")}})}function et(Bt){var oe=0;m.forEach(Bt.nodes(),function(ht){var ut=Bt.node(ht);ut.borderTop&&(ut.minRank=Bt.node(ut.borderTop).rank,ut.maxRank=Bt.node(ut.borderBottom).rank,oe=m.max(oe,ut.maxRank))}),Bt.graph().maxRank=oe}function ge(Bt){m.forEach(Bt.nodes(),function(oe){var ht=Bt.node(oe);ht.dummy==="edge-proxy"&&(Bt.edge(ht.e).labelRank=ht.rank,Bt.removeNode(oe))})}function yt(Bt){var oe=Number.POSITIVE_INFINITY,ht=0,ut=Number.POSITIVE_INFINITY,Vt=0,ve=Bt.graph(),kt=ve.marginx||0,ee=ve.marginy||0;function me(Nt){var Zt=Nt.x,Yt=Nt.y,S=Nt.width,Y=Nt.height;oe=Math.min(oe,Zt-S/2),ht=Math.max(ht,Zt+S/2),ut=Math.min(ut,Yt-Y/2),Vt=Math.max(Vt,Yt+Y/2)}m.forEach(Bt.nodes(),function(Nt){me(Bt.node(Nt))}),m.forEach(Bt.edges(),function(Nt){var Zt=Bt.edge(Nt);m.has(Zt,"x")&&me(Zt)}),oe-=kt,ut-=ee,m.forEach(Bt.nodes(),function(Nt){var Zt=Bt.node(Nt);Zt.x-=oe,Zt.y-=ut}),m.forEach(Bt.edges(),function(Nt){var Zt=Bt.edge(Nt);m.forEach(Zt.points,function(Yt){Yt.x-=oe,Yt.y-=ut}),m.has(Zt,"x")&&(Zt.x-=oe),m.has(Zt,"y")&&(Zt.y-=ut)}),ve.width=ht-oe+kt,ve.height=Vt-ut+ee}function te(Bt){m.forEach(Bt.edges(),function(oe){var ht=Bt.edge(oe),ut=Bt.node(oe.v),Vt=Bt.node(oe.w),ve,kt;ht.points?(ve=ht.points[0],kt=ht.points[ht.points.length-1]):(ht.points=[],ve=Vt,kt=ut),ht.points.unshift(tt.intersectRect(ut,ve)),ht.points.push(tt.intersectRect(Vt,kt))})}function Xt(Bt){m.forEach(Bt.edges(),function(oe){var ht=Bt.edge(oe);if(m.has(ht,"x"))switch((ht.labelpos==="l"||ht.labelpos==="r")&&(ht.width-=ht.labeloffset),ht.labelpos){case"l":ht.x-=ht.width/2+ht.labeloffset;break;case"r":ht.x+=ht.width/2+ht.labeloffset;break}})}function rt(Bt){m.forEach(Bt.edges(),function(oe){var ht=Bt.edge(oe);ht.reversed&&ht.points.reverse()})}function bt(Bt){m.forEach(Bt.nodes(),function(oe){if(Bt.children(oe).length){var ht=Bt.node(oe),ut=Bt.node(ht.borderTop),Vt=Bt.node(ht.borderBottom),ve=Bt.node(m.last(ht.borderLeft)),kt=Bt.node(m.last(ht.borderRight));ht.width=Math.abs(kt.x-ve.x),ht.height=Math.abs(Vt.y-ut.y),ht.x=ve.x+ht.width/2,ht.y=ut.y+ht.height/2}}),m.forEach(Bt.nodes(),function(oe){Bt.node(oe).dummy==="border"&&Bt.removeNode(oe)})}function ye(Bt){m.forEach(Bt.edges(),function(oe){if(oe.v===oe.w){var ht=Bt.node(oe.v);ht.selfEdges||(ht.selfEdges=[]),ht.selfEdges.push({e:oe,label:Bt.edge(oe)}),Bt.removeEdge(oe)}})}function be(Bt){var oe=tt.buildLayerMatrix(Bt);m.forEach(oe,function(ht){var ut=0;m.forEach(ht,function(Vt,ve){var kt=Bt.node(Vt);kt.order=ve+ut,m.forEach(kt.selfEdges,function(ee){tt.addDummyNode(Bt,"selfedge",{width:ee.label.width,height:ee.label.height,rank:kt.rank,order:ve+ ++ut,e:ee.e,label:ee.label},"_se")}),delete kt.selfEdges})})}function Gt(Bt){m.forEach(Bt.nodes(),function(oe){var ht=Bt.node(oe);if(ht.dummy==="selfedge"){var ut=Bt.node(ht.e.v),Vt=ut.x+ut.width/2,ve=ut.y,kt=ht.x-Vt,ee=ut.height/2;Bt.setEdge(ht.e,ht.label),Bt.removeNode(oe),ht.label.points=[{x:Vt+2*kt/3,y:ve-ee},{x:Vt+5*kt/6,y:ve-ee},{x:Vt+kt,y:ve},{x:Vt+5*kt/6,y:ve+ee},{x:Vt+2*kt/3,y:ve+ee}],ht.label.x=ht.x,ht.label.y=ht.y}})}function Kt(Bt,oe){return m.mapValues(m.pick(Bt,oe),Number)}function we(Bt){var oe={};return m.forEach(Bt,function(ht,ut){oe[ut.toLowerCase()]=ht}),oe}},38436:function(q,J,g){var m;try{m={cloneDeep:g(50361),constant:g(75703),defaults:g(91747),each:g(85768),filter:g(63105),find:g(13311),flatten:g(85564),forEach:g(84486),forIn:g(62620),has:g(18721),isUndefined:g(52353),last:g(10928),map:g(35161),mapValues:g(8521),max:g(6162),merge:g(82492),min:g(53632),minBy:g(22762),now:g(7771),pick:g(78718),range:g(96026),reduce:g(54061),sortBy:g(89734),uniqueId:g(73955),values:g(52628),zipObject:g(7287)}}catch(F){}m||(m=window._),q.exports=m},72981:function(q,J,g){var m=g(38436),F=g(11138);q.exports={run:R,cleanup:b};function R(E){var T=F.addDummyNode(E,"root",{},"_root"),_=k(E),P=m.max(m.values(_))-1,B=2*P+1;E.graph().nestingRoot=T,m.forEach(E.edges(),function(st){E.edge(st).minlen*=B});var tt=O(E)+1;m.forEach(E.children(),function(st){L(E,T,B,tt,P,_,st)}),E.graph().nodeRankFactor=B}function L(E,T,_,P,B,tt,st){var Rt=E.children(st);if(!Rt.length){st!==T&&E.setEdge(T,st,{weight:0,minlen:_});return}var xt=F.addBorderNode(E,"_bt"),nt=F.addBorderNode(E,"_bb"),Et=E.node(st);E.setParent(xt,st),Et.borderTop=xt,E.setParent(nt,st),Et.borderBottom=nt,m.forEach(Rt,function(ot){L(E,T,_,P,B,tt,ot);var Ct=E.node(ot),_t=Ct.borderTop?Ct.borderTop:ot,dt=Ct.borderBottom?Ct.borderBottom:ot,Ot=Ct.borderTop?P:2*P,wt=_t!==dt?1:B-tt[st]+1;E.setEdge(xt,_t,{weight:Ot,minlen:wt,nestingEdge:!0}),E.setEdge(dt,nt,{weight:Ot,minlen:wt,nestingEdge:!0})}),E.parent(st)||E.setEdge(T,xt,{weight:0,minlen:B+tt[st]})}function k(E){var T={};function _(P,B){var tt=E.children(P);tt&&tt.length&&m.forEach(tt,function(st){_(st,B+1)}),T[P]=B}return m.forEach(E.children(),function(P){_(P,1)}),T}function O(E){return m.reduce(E.edges(),function(T,_){return T+E.edge(_).weight},0)}function b(E){var T=E.graph();E.removeNode(T.nestingRoot),delete T.nestingRoot,m.forEach(E.edges(),function(_){var P=E.edge(_);P.nestingEdge&&E.removeEdge(_)})}},45995:function(q,J,g){"use strict";var m=g(38436),F=g(11138);q.exports={run:R,undo:k};function R(O){O.graph().dummyChains=[],m.forEach(O.edges(),function(b){L(O,b)})}function L(O,b){var E=b.v,T=O.node(E).rank,_=b.w,P=O.node(_).rank,B=b.name,tt=O.edge(b),st=tt.labelRank;if(P!==T+1){O.removeEdge(b);var Rt,xt,nt;for(nt=0,++T;T<P;++nt,++T)tt.points=[],xt={width:0,height:0,edgeLabel:tt,edgeObj:b,rank:T},Rt=F.addDummyNode(O,"edge",xt,"_d"),T===st&&(xt.width=tt.width,xt.height=tt.height,xt.dummy="edge-label",xt.labelpos=tt.labelpos),O.setEdge(E,Rt,{weight:tt.weight},B),nt===0&&O.graph().dummyChains.push(Rt),E=Rt;O.setEdge(E,_,{weight:tt.weight},B)}}function k(O){m.forEach(O.graph().dummyChains,function(b){var E=O.node(b),T=E.edgeLabel,_;for(O.setEdge(E.edgeObj,T);E.dummy;)_=O.successors(b)[0],O.removeNode(b),T.points.push({x:E.x,y:E.y}),E.dummy==="edge-label"&&(T.x=E.x,T.y=E.y,T.width=E.width,T.height=E.height),b=_,E=O.node(b)})}},55093:function(q,J,g){var m=g(38436);q.exports=F;function F(R,L,k){var O={},b;m.forEach(k,function(E){for(var T=R.parent(E),_,P;T;){if(_=R.parent(T),_?(P=O[_],O[_]=T):(P=b,b=T),P&&P!==T){L.setEdge(P,T);return}T=_}})}},35439:function(q,J,g){var m=g(38436);q.exports=F;function F(R,L){return m.map(L,function(k){var O=R.inEdges(k);if(O.length){var b=m.reduce(O,function(E,T){var _=R.edge(T),P=R.node(T.v);return{sum:E.sum+_.weight*P.order,weight:E.weight+_.weight}},{sum:0,weight:0});return{v:k,barycenter:b.sum/b.weight,weight:b.weight}}else return{v:k}})}},23128:function(q,J,g){var m=g(38436),F=g(70574).Graph;q.exports=R;function R(k,O,b){var E=L(k),T=new F({compound:!0}).setGraph({root:E}).setDefaultNodeLabel(function(_){return k.node(_)});return m.forEach(k.nodes(),function(_){var P=k.node(_),B=k.parent(_);(P.rank===O||P.minRank<=O&&O<=P.maxRank)&&(T.setNode(_),T.setParent(_,B||E),m.forEach(k[b](_),function(tt){var st=tt.v===_?tt.w:tt.v,Rt=T.edge(st,_),xt=m.isUndefined(Rt)?0:Rt.weight;T.setEdge(st,_,{weight:k.edge(tt).weight+xt})}),m.has(P,"minRank")&&T.setNode(_,{borderLeft:P.borderLeft[O],borderRight:P.borderRight[O]}))}),T}function L(k){for(var O;k.hasNode(O=m.uniqueId("_root")););return O}},56630:function(q,J,g){"use strict";var m=g(38436);q.exports=F;function F(L,k){for(var O=0,b=1;b<k.length;++b)O+=R(L,k[b-1],k[b]);return O}function R(L,k,O){for(var b=m.zipObject(O,m.map(O,function(tt,st){return st})),E=m.flatten(m.map(k,function(tt){return m.sortBy(m.map(L.outEdges(tt),function(st){return{pos:b[st.w],weight:L.edge(st).weight}}),"pos")}),!0),T=1;T<O.length;)T<<=1;var _=2*T-1;T-=1;var P=m.map(new Array(_),function(){return 0}),B=0;return m.forEach(E.forEach(function(tt){var st=tt.pos+T;P[st]+=tt.weight;for(var Rt=0;st>0;)st%2&&(Rt+=P[st+1]),st=st-1>>1,P[st]+=tt.weight;B+=tt.weight*Rt})),B}},53408:function(q,J,g){"use strict";var m=g(38436),F=g(2588),R=g(56630),L=g(61026),k=g(23128),O=g(55093),b=g(70574).Graph,E=g(11138);q.exports=T;function T(tt){var st=E.maxRank(tt),Rt=_(tt,m.range(1,st+1),"inEdges"),xt=_(tt,m.range(st-1,-1,-1),"outEdges"),nt=F(tt);B(tt,nt);for(var Et=Number.POSITIVE_INFINITY,ot,Ct=0,_t=0;_t<4;++Ct,++_t){P(Ct%2?Rt:xt,Ct%4>=2),nt=E.buildLayerMatrix(tt);var dt=R(tt,nt);dt<Et&&(_t=0,ot=m.cloneDeep(nt),Et=dt)}B(tt,ot)}function _(tt,st,Rt){return m.map(st,function(xt){return k(tt,xt,Rt)})}function P(tt,st){var Rt=new b;m.forEach(tt,function(xt){var nt=xt.graph().root,Et=L(xt,nt,Rt,st);m.forEach(Et.vs,function(ot,Ct){xt.node(ot).order=Ct}),O(xt,Rt,Et.vs)})}function B(tt,st){m.forEach(st,function(Rt){m.forEach(Rt,function(xt,nt){tt.node(xt).order=nt})})}},2588:function(q,J,g){"use strict";var m=g(38436);q.exports=F;function F(R){var L={},k=m.filter(R.nodes(),function(_){return!R.children(_).length}),O=m.max(m.map(k,function(_){return R.node(_).rank})),b=m.map(m.range(O+1),function(){return[]});function E(_){if(!m.has(L,_)){L[_]=!0;var P=R.node(_);b[P.rank].push(_),m.forEach(R.successors(_),E)}}var T=m.sortBy(k,function(_){return R.node(_).rank});return m.forEach(T,E),b}},83678:function(q,J,g){"use strict";var m=g(38436);q.exports=F;function F(k,O){var b={};m.forEach(k,function(T,_){var P=b[T.v]={indegree:0,in:[],out:[],vs:[T.v],i:_};m.isUndefined(T.barycenter)||(P.barycenter=T.barycenter,P.weight=T.weight)}),m.forEach(O.edges(),function(T){var _=b[T.v],P=b[T.w];!m.isUndefined(_)&&!m.isUndefined(P)&&(P.indegree++,_.out.push(b[T.w]))});var E=m.filter(b,function(T){return!T.indegree});return R(E)}function R(k){var O=[];function b(_){return function(P){P.merged||(m.isUndefined(P.barycenter)||m.isUndefined(_.barycenter)||P.barycenter>=_.barycenter)&&L(_,P)}}function E(_){return function(P){P.in.push(_),--P.indegree===0&&k.push(P)}}for(;k.length;){var T=k.pop();O.push(T),m.forEach(T.in.reverse(),b(T)),m.forEach(T.out,E(T))}return m.map(m.filter(O,function(_){return!_.merged}),function(_){return m.pick(_,["vs","i","barycenter","weight"])})}function L(k,O){var b=0,E=0;k.weight&&(b+=k.barycenter*k.weight,E+=k.weight),O.weight&&(b+=O.barycenter*O.weight,E+=O.weight),k.vs=O.vs.concat(k.vs),k.barycenter=b/E,k.weight=E,k.i=Math.min(O.i,k.i),O.merged=!0}},61026:function(q,J,g){var m=g(38436),F=g(35439),R=g(83678),L=g(87304);q.exports=k;function k(E,T,_,P){var B=E.children(T),tt=E.node(T),st=tt?tt.borderLeft:void 0,Rt=tt?tt.borderRight:void 0,xt={};st&&(B=m.filter(B,function(dt){return dt!==st&&dt!==Rt}));var nt=F(E,B);m.forEach(nt,function(dt){if(E.children(dt.v).length){var Ot=k(E,dt.v,_,P);xt[dt.v]=Ot,m.has(Ot,"barycenter")&&b(dt,Ot)}});var Et=R(nt,_);O(Et,xt);var ot=L(Et,P);if(st&&(ot.vs=m.flatten([st,ot.vs,Rt],!0),E.predecessors(st).length)){var Ct=E.node(E.predecessors(st)[0]),_t=E.node(E.predecessors(Rt)[0]);m.has(ot,"barycenter")||(ot.barycenter=0,ot.weight=0),ot.barycenter=(ot.barycenter*ot.weight+Ct.order+_t.order)/(ot.weight+2),ot.weight+=2}return ot}function O(E,T){m.forEach(E,function(_){_.vs=m.flatten(_.vs.map(function(P){return T[P]?T[P].vs:P}),!0)})}function b(E,T){m.isUndefined(E.barycenter)?(E.barycenter=T.barycenter,E.weight=T.weight):(E.barycenter=(E.barycenter*E.weight+T.barycenter*T.weight)/(E.weight+T.weight),E.weight+=T.weight)}},87304:function(q,J,g){var m=g(38436),F=g(11138);q.exports=R;function R(O,b){var E=F.partition(O,function(xt){return m.has(xt,"barycenter")}),T=E.lhs,_=m.sortBy(E.rhs,function(xt){return-xt.i}),P=[],B=0,tt=0,st=0;T.sort(k(!!b)),st=L(P,_,st),m.forEach(T,function(xt){st+=xt.vs.length,P.push(xt.vs),B+=xt.barycenter*xt.weight,tt+=xt.weight,st=L(P,_,st)});var Rt={vs:m.flatten(P,!0)};return tt&&(Rt.barycenter=B/tt,Rt.weight=tt),Rt}function L(O,b,E){for(var T;b.length&&(T=m.last(b)).i<=E;)b.pop(),O.push(T.vs),E++;return E}function k(O){return function(b,E){return b.barycenter<E.barycenter?-1:b.barycenter>E.barycenter?1:O?E.i-b.i:b.i-E.i}}},24219:function(q,J,g){var m=g(38436);q.exports=F;function F(k){var O=L(k);m.forEach(k.graph().dummyChains,function(b){for(var E=k.node(b),T=E.edgeObj,_=R(k,O,T.v,T.w),P=_.path,B=_.lca,tt=0,st=P[tt],Rt=!0;b!==T.w;){if(E=k.node(b),Rt){for(;(st=P[tt])!==B&&k.node(st).maxRank<E.rank;)tt++;st===B&&(Rt=!1)}if(!Rt){for(;tt<P.length-1&&k.node(st=P[tt+1]).minRank<=E.rank;)tt++;st=P[tt]}k.setParent(b,st),b=k.successors(b)[0]}})}function R(k,O,b,E){var T=[],_=[],P=Math.min(O[b].low,O[E].low),B=Math.max(O[b].lim,O[E].lim),tt,st;tt=b;do tt=k.parent(tt),T.push(tt);while(tt&&(O[tt].low>P||B>O[tt].lim));for(st=tt,tt=E;(tt=k.parent(tt))!==st;)_.push(tt);return{path:T.concat(_.reverse()),lca:st}}function L(k){var O={},b=0;function E(T){var _=b;m.forEach(k.children(T),E),O[T]={low:_,lim:b++}}return m.forEach(k.children(),E),O}},3573:function(q,J,g){"use strict";var m=g(38436),F=g(70574).Graph,R=g(11138);q.exports={positionX:Rt,findType1Conflicts:L,findType2Conflicts:k,addConflict:b,hasConflict:E,verticalAlignment:T,horizontalCompaction:_,alignCoordinates:tt,findSmallestWidthAlignment:B,balance:st};function L(Et,ot){var Ct={};function _t(dt,Ot){var wt=0,Ft=0,jt=dt.length,re=m.last(Ot);return m.forEach(Ot,function(Ee,et){var ge=O(Et,Ee),yt=ge?Et.node(ge).order:jt;(ge||Ee===re)&&(m.forEach(Ot.slice(Ft,et+1),function(te){m.forEach(Et.predecessors(te),function(Xt){var rt=Et.node(Xt),bt=rt.order;(bt<wt||yt<bt)&&!(rt.dummy&&Et.node(te).dummy)&&b(Ct,Xt,te)})}),Ft=et+1,wt=yt)}),Ot}return m.reduce(ot,_t),Ct}function k(Et,ot){var Ct={};function _t(Ot,wt,Ft,jt,re){var Ee;m.forEach(m.range(wt,Ft),function(et){Ee=Ot[et],Et.node(Ee).dummy&&m.forEach(Et.predecessors(Ee),function(ge){var yt=Et.node(ge);yt.dummy&&(yt.order<jt||yt.order>re)&&b(Ct,ge,Ee)})})}function dt(Ot,wt){var Ft=-1,jt,re=0;return m.forEach(wt,function(Ee,et){if(Et.node(Ee).dummy==="border"){var ge=Et.predecessors(Ee);ge.length&&(jt=Et.node(ge[0]).order,_t(wt,re,et,Ft,jt),re=et,Ft=jt)}_t(wt,re,wt.length,jt,Ot.length)}),wt}return m.reduce(ot,dt),Ct}function O(Et,ot){if(Et.node(ot).dummy)return m.find(Et.predecessors(ot),function(Ct){return Et.node(Ct).dummy})}function b(Et,ot,Ct){if(ot>Ct){var _t=ot;ot=Ct,Ct=_t}var dt=Et[ot];dt||(Et[ot]=dt={}),dt[Ct]=!0}function E(Et,ot,Ct){if(ot>Ct){var _t=ot;ot=Ct,Ct=_t}return m.has(Et[ot],Ct)}function T(Et,ot,Ct,_t){var dt={},Ot={},wt={};return m.forEach(ot,function(Ft){m.forEach(Ft,function(jt,re){dt[jt]=jt,Ot[jt]=jt,wt[jt]=re})}),m.forEach(ot,function(Ft){var jt=-1;m.forEach(Ft,function(re){var Ee=_t(re);if(Ee.length){Ee=m.sortBy(Ee,function(Xt){return wt[Xt]});for(var et=(Ee.length-1)/2,ge=Math.floor(et),yt=Math.ceil(et);ge<=yt;++ge){var te=Ee[ge];Ot[re]===re&&jt<wt[te]&&!E(Ct,re,te)&&(Ot[te]=re,Ot[re]=dt[re]=dt[te],jt=wt[te])}}})}),{root:dt,align:Ot}}function _(Et,ot,Ct,_t,dt){var Ot={},wt=P(Et,ot,Ct,dt),Ft=dt?"borderLeft":"borderRight";function jt(et,ge){for(var yt=wt.nodes(),te=yt.pop(),Xt={};te;)Xt[te]?et(te):(Xt[te]=!0,yt.push(te),yt=yt.concat(ge(te))),te=yt.pop()}function re(et){Ot[et]=wt.inEdges(et).reduce(function(ge,yt){return Math.max(ge,Ot[yt.v]+wt.edge(yt))},0)}function Ee(et){var ge=wt.outEdges(et).reduce(function(te,Xt){return Math.min(te,Ot[Xt.w]-wt.edge(Xt))},Number.POSITIVE_INFINITY),yt=Et.node(et);ge!==Number.POSITIVE_INFINITY&&yt.borderType!==Ft&&(Ot[et]=Math.max(Ot[et],ge))}return jt(re,wt.predecessors.bind(wt)),jt(Ee,wt.successors.bind(wt)),m.forEach(_t,function(et){Ot[et]=Ot[Ct[et]]}),Ot}function P(Et,ot,Ct,_t){var dt=new F,Ot=Et.graph(),wt=xt(Ot.nodesep,Ot.edgesep,_t);return m.forEach(ot,function(Ft){var jt;m.forEach(Ft,function(re){var Ee=Ct[re];if(dt.setNode(Ee),jt){var et=Ct[jt],ge=dt.edge(et,Ee);dt.setEdge(et,Ee,Math.max(wt(Et,re,jt),ge||0))}jt=re})}),dt}function B(Et,ot){return m.minBy(m.values(ot),function(Ct){var _t=Number.NEGATIVE_INFINITY,dt=Number.POSITIVE_INFINITY;return m.forIn(Ct,function(Ot,wt){var Ft=nt(Et,wt)/2;_t=Math.max(Ot+Ft,_t),dt=Math.min(Ot-Ft,dt)}),_t-dt})}function tt(Et,ot){var Ct=m.values(ot),_t=m.min(Ct),dt=m.max(Ct);m.forEach(["u","d"],function(Ot){m.forEach(["l","r"],function(wt){var Ft=Ot+wt,jt=Et[Ft],re;if(jt!==ot){var Ee=m.values(jt);re=wt==="l"?_t-m.min(Ee):dt-m.max(Ee),re&&(Et[Ft]=m.mapValues(jt,function(et){return et+re}))}})})}function st(Et,ot){return m.mapValues(Et.ul,function(Ct,_t){if(ot)return Et[ot.toLowerCase()][_t];var dt=m.sortBy(m.map(Et,_t));return(dt[1]+dt[2])/2})}function Rt(Et){var ot=R.buildLayerMatrix(Et),Ct=m.merge(L(Et,ot),k(Et,ot)),_t={},dt;m.forEach(["u","d"],function(wt){dt=wt==="u"?ot:m.values(ot).reverse(),m.forEach(["l","r"],function(Ft){Ft==="r"&&(dt=m.map(dt,function(et){return m.values(et).reverse()}));var jt=(wt==="u"?Et.predecessors:Et.successors).bind(Et),re=T(Et,dt,Ct,jt),Ee=_(Et,dt,re.root,re.align,Ft==="r");Ft==="r"&&(Ee=m.mapValues(Ee,function(et){return-et})),_t[wt+Ft]=Ee})});var Ot=B(Et,_t);return tt(_t,Ot),st(_t,Et.graph().align)}function xt(Et,ot,Ct){return function(_t,dt,Ot){var wt=_t.node(dt),Ft=_t.node(Ot),jt=0,re;if(jt+=wt.width/2,m.has(wt,"labelpos"))switch(wt.labelpos.toLowerCase()){case"l":re=-wt.width/2;break;case"r":re=wt.width/2;break}if(re&&(jt+=Ct?re:-re),re=0,jt+=(wt.dummy?ot:Et)/2,jt+=(Ft.dummy?ot:Et)/2,jt+=Ft.width/2,m.has(Ft,"labelpos"))switch(Ft.labelpos.toLowerCase()){case"l":re=Ft.width/2;break;case"r":re=-Ft.width/2;break}return re&&(jt+=Ct?re:-re),re=0,jt}}function nt(Et,ot){return Et.node(ot).width}},17873:function(q,J,g){"use strict";var m=g(38436),F=g(11138),R=g(3573).positionX;q.exports=L;function L(O){O=F.asNonCompoundGraph(O),k(O),m.forEach(R(O),function(b,E){O.node(E).x=b})}function k(O){var b=F.buildLayerMatrix(O),E=O.graph().ranksep,T=0;m.forEach(b,function(_){var P=m.max(m.map(_,function(B){return O.node(B).height}));m.forEach(_,function(B){O.node(B).y=T+P/2}),T+=P+E})}},20300:function(q,J,g){"use strict";var m=g(38436),F=g(70574).Graph,R=g(76681).slack;q.exports=L;function L(E){var T=new F({directed:!1}),_=E.nodes()[0],P=E.nodeCount();T.setNode(_,{});for(var B,tt;k(T,E)<P;)B=O(T,E),tt=T.hasNode(B.v)?R(E,B):-R(E,B),b(T,E,tt);return T}function k(E,T){function _(P){m.forEach(T.nodeEdges(P),function(B){var tt=B.v,st=P===tt?B.w:tt;!E.hasNode(st)&&!R(T,B)&&(E.setNode(st,{}),E.setEdge(P,st,{}),_(st))})}return m.forEach(E.nodes(),_),E.nodeCount()}function O(E,T){return m.minBy(T.edges(),function(_){if(E.hasNode(_.v)!==E.hasNode(_.w))return R(T,_)})}function b(E,T,_){m.forEach(E.nodes(),function(P){T.node(P).rank+=_})}},78093:function(q,J,g){"use strict";var m=g(76681),F=m.longestPath,R=g(20300),L=g(42472);q.exports=k;function k(T){switch(T.graph().ranker){case"network-simplex":E(T);break;case"tight-tree":b(T);break;case"longest-path":O(T);break;default:E(T)}}var O=F;function b(T){F(T),R(T)}function E(T){L(T)}},42472:function(q,J,g){"use strict";var m=g(38436),F=g(20300),R=g(76681).slack,L=g(76681).longestPath,k=g(70574).alg.preorder,O=g(70574).alg.postorder,b=g(11138).simplify;q.exports=E,E.initLowLimValues=B,E.initCutValues=T,E.calcCutValue=P,E.leaveEdge=st,E.enterEdge=Rt,E.exchangeEdges=xt;function E(Ct){Ct=b(Ct),L(Ct);var _t=F(Ct);B(_t),T(_t,Ct);for(var dt,Ot;dt=st(_t);)Ot=Rt(_t,Ct,dt),xt(_t,Ct,dt,Ot)}function T(Ct,_t){var dt=O(Ct,Ct.nodes());dt=dt.slice(0,dt.length-1),m.forEach(dt,function(Ot){_(Ct,_t,Ot)})}function _(Ct,_t,dt){var Ot=Ct.node(dt),wt=Ot.parent;Ct.edge(dt,wt).cutvalue=P(Ct,_t,dt)}function P(Ct,_t,dt){var Ot=Ct.node(dt),wt=Ot.parent,Ft=!0,jt=_t.edge(dt,wt),re=0;return jt||(Ft=!1,jt=_t.edge(wt,dt)),re=jt.weight,m.forEach(_t.nodeEdges(dt),function(Ee){var et=Ee.v===dt,ge=et?Ee.w:Ee.v;if(ge!==wt){var yt=et===Ft,te=_t.edge(Ee).weight;if(re+=yt?te:-te,Et(Ct,dt,ge)){var Xt=Ct.edge(dt,ge).cutvalue;re+=yt?-Xt:Xt}}}),re}function B(Ct,_t){arguments.length<2&&(_t=Ct.nodes()[0]),tt(Ct,{},1,_t)}function tt(Ct,_t,dt,Ot,wt){var Ft=dt,jt=Ct.node(Ot);return _t[Ot]=!0,m.forEach(Ct.neighbors(Ot),function(re){m.has(_t,re)||(dt=tt(Ct,_t,dt,re,Ot))}),jt.low=Ft,jt.lim=dt++,wt?jt.parent=wt:delete jt.parent,dt}function st(Ct){return m.find(Ct.edges(),function(_t){return Ct.edge(_t).cutvalue<0})}function Rt(Ct,_t,dt){var Ot=dt.v,wt=dt.w;_t.hasEdge(Ot,wt)||(Ot=dt.w,wt=dt.v);var Ft=Ct.node(Ot),jt=Ct.node(wt),re=Ft,Ee=!1;Ft.lim>jt.lim&&(re=jt,Ee=!0);var et=m.filter(_t.edges(),function(ge){return Ee===ot(Ct,Ct.node(ge.v),re)&&Ee!==ot(Ct,Ct.node(ge.w),re)});return m.minBy(et,function(ge){return R(_t,ge)})}function xt(Ct,_t,dt,Ot){var wt=dt.v,Ft=dt.w;Ct.removeEdge(wt,Ft),Ct.setEdge(Ot.v,Ot.w,{}),B(Ct),T(Ct,_t),nt(Ct,_t)}function nt(Ct,_t){var dt=m.find(Ct.nodes(),function(wt){return!_t.node(wt).parent}),Ot=k(Ct,dt);Ot=Ot.slice(1),m.forEach(Ot,function(wt){var Ft=Ct.node(wt).parent,jt=_t.edge(wt,Ft),re=!1;jt||(jt=_t.edge(Ft,wt),re=!0),_t.node(wt).rank=_t.node(Ft).rank+(re?jt.minlen:-jt.minlen)})}function Et(Ct,_t,dt){return Ct.hasEdge(_t,dt)}function ot(Ct,_t,dt){return dt.low<=_t.lim&&_t.lim<=dt.lim}},76681:function(q,J,g){"use strict";var m=g(38436);q.exports={longestPath:F,slack:R};function F(L){var k={};function O(b){var E=L.node(b);if(m.has(k,b))return E.rank;k[b]=!0;var T=m.min(m.map(L.outEdges(b),function(_){return O(_.w)-L.edge(_).minlen}));return(T===Number.POSITIVE_INFINITY||T===void 0||T===null)&&(T=0),E.rank=T}m.forEach(L.sources(),O)}function R(L,k){return L.node(k.w).rank-L.node(k.v).rank-L.edge(k).minlen}},11138:function(q,J,g){"use strict";var m=g(38436),F=g(70574).Graph;q.exports={addDummyNode:R,simplify:L,asNonCompoundGraph:k,successorWeights:O,predecessorWeights:b,intersectRect:E,buildLayerMatrix:T,normalizeRanks:_,removeEmptyRanks:P,addBorderNode:B,maxRank:tt,partition:st,time:Rt,notime:xt};function R(nt,Et,ot,Ct){var _t;do _t=m.uniqueId(Ct);while(nt.hasNode(_t));return ot.dummy=Et,nt.setNode(_t,ot),_t}function L(nt){var Et=new F().setGraph(nt.graph());return m.forEach(nt.nodes(),function(ot){Et.setNode(ot,nt.node(ot))}),m.forEach(nt.edges(),function(ot){var Ct=Et.edge(ot.v,ot.w)||{weight:0,minlen:1},_t=nt.edge(ot);Et.setEdge(ot.v,ot.w,{weight:Ct.weight+_t.weight,minlen:Math.max(Ct.minlen,_t.minlen)})}),Et}function k(nt){var Et=new F({multigraph:nt.isMultigraph()}).setGraph(nt.graph());return m.forEach(nt.nodes(),function(ot){nt.children(ot).length||Et.setNode(ot,nt.node(ot))}),m.forEach(nt.edges(),function(ot){Et.setEdge(ot,nt.edge(ot))}),Et}function O(nt){var Et=m.map(nt.nodes(),function(ot){var Ct={};return m.forEach(nt.outEdges(ot),function(_t){Ct[_t.w]=(Ct[_t.w]||0)+nt.edge(_t).weight}),Ct});return m.zipObject(nt.nodes(),Et)}function b(nt){var Et=m.map(nt.nodes(),function(ot){var Ct={};return m.forEach(nt.inEdges(ot),function(_t){Ct[_t.v]=(Ct[_t.v]||0)+nt.edge(_t).weight}),Ct});return m.zipObject(nt.nodes(),Et)}function E(nt,Et){var ot=nt.x,Ct=nt.y,_t=Et.x-ot,dt=Et.y-Ct,Ot=nt.width/2,wt=nt.height/2;if(!_t&&!dt)throw new Error("Not possible to find intersection inside of the rectangle");var Ft,jt;return Math.abs(dt)*Ot>Math.abs(_t)*wt?(dt<0&&(wt=-wt),Ft=wt*_t/dt,jt=wt):(_t<0&&(Ot=-Ot),Ft=Ot,jt=Ot*dt/_t),{x:ot+Ft,y:Ct+jt}}function T(nt){var Et=m.map(m.range(tt(nt)+1),function(){return[]});return m.forEach(nt.nodes(),function(ot){var Ct=nt.node(ot),_t=Ct.rank;m.isUndefined(_t)||(Et[_t][Ct.order]=ot)}),Et}function _(nt){var Et=m.min(m.map(nt.nodes(),function(ot){return nt.node(ot).rank}));m.forEach(nt.nodes(),function(ot){var Ct=nt.node(ot);m.has(Ct,"rank")&&(Ct.rank-=Et)})}function P(nt){var Et=m.min(m.map(nt.nodes(),function(dt){return nt.node(dt).rank})),ot=[];m.forEach(nt.nodes(),function(dt){var Ot=nt.node(dt).rank-Et;ot[Ot]||(ot[Ot]=[]),ot[Ot].push(dt)});var Ct=0,_t=nt.graph().nodeRankFactor;m.forEach(ot,function(dt,Ot){m.isUndefined(dt)&&Ot%_t!==0?--Ct:Ct&&m.forEach(dt,function(wt){nt.node(wt).rank+=Ct})})}function B(nt,Et,ot,Ct){var _t={width:0,height:0};return arguments.length>=4&&(_t.rank=ot,_t.order=Ct),R(nt,"border",_t,Et)}function tt(nt){return m.max(m.map(nt.nodes(),function(Et){var ot=nt.node(Et).rank;if(!m.isUndefined(ot))return ot}))}function st(nt,Et){var ot={lhs:[],rhs:[]};return m.forEach(nt,function(Ct){Et(Ct)?ot.lhs.push(Ct):ot.rhs.push(Ct)}),ot}function Rt(nt,Et){var ot=m.now();try{return Et()}finally{console.log(nt+" time: "+(m.now()-ot)+"ms")}}function xt(nt,Et){return Et()}},88177:function(q){q.exports="0.8.5"},26729:function(q){"use strict";var J=Object.prototype.hasOwnProperty,g="~";function m(){}Object.create&&(m.prototype=Object.create(null),new m().__proto__||(g=!1));function F(O,b,E){this.fn=O,this.context=b,this.once=E||!1}function R(O,b,E,T,_){if(typeof E!="function")throw new TypeError("The listener must be a function");var P=new F(E,T||O,_),B=g?g+b:b;return O._events[B]?O._events[B].fn?O._events[B]=[O._events[B],P]:O._events[B].push(P):(O._events[B]=P,O._eventsCount++),O}function L(O,b){--O._eventsCount===0?O._events=new m:delete O._events[b]}function k(){this._events=new m,this._eventsCount=0}k.prototype.eventNames=function(){var b=[],E,T;if(this._eventsCount===0)return b;for(T in E=this._events)J.call(E,T)&&b.push(g?T.slice(1):T);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(E)):b},k.prototype.listeners=function(b){var E=g?g+b:b,T=this._events[E];if(!T)return[];if(T.fn)return[T.fn];for(var _=0,P=T.length,B=new Array(P);_<P;_++)B[_]=T[_].fn;return B},k.prototype.listenerCount=function(b){var E=g?g+b:b,T=this._events[E];return T?T.fn?1:T.length:0},k.prototype.emit=function(b,E,T,_,P,B){var tt=g?g+b:b;if(!this._events[tt])return!1;var st=this._events[tt],Rt=arguments.length,xt,nt;if(st.fn){switch(st.once&&this.removeListener(b,st.fn,void 0,!0),Rt){case 1:return st.fn.call(st.context),!0;case 2:return st.fn.call(st.context,E),!0;case 3:return st.fn.call(st.context,E,T),!0;case 4:return st.fn.call(st.context,E,T,_),!0;case 5:return st.fn.call(st.context,E,T,_,P),!0;case 6:return st.fn.call(st.context,E,T,_,P,B),!0}for(nt=1,xt=new Array(Rt-1);nt<Rt;nt++)xt[nt-1]=arguments[nt];st.fn.apply(st.context,xt)}else{var Et=st.length,ot;for(nt=0;nt<Et;nt++)switch(st[nt].once&&this.removeListener(b,st[nt].fn,void 0,!0),Rt){case 1:st[nt].fn.call(st[nt].context);break;case 2:st[nt].fn.call(st[nt].context,E);break;case 3:st[nt].fn.call(st[nt].context,E,T);break;case 4:st[nt].fn.call(st[nt].context,E,T,_);break;default:if(!xt)for(ot=1,xt=new Array(Rt-1);ot<Rt;ot++)xt[ot-1]=arguments[ot];st[nt].fn.apply(st[nt].context,xt)}}return!0},k.prototype.on=function(b,E,T){return R(this,b,E,T,!1)},k.prototype.once=function(b,E,T){return R(this,b,E,T,!0)},k.prototype.removeListener=function(b,E,T,_){var P=g?g+b:b;if(!this._events[P])return this;if(!E)return L(this,P),this;var B=this._events[P];if(B.fn)B.fn===E&&(!_||B.once)&&(!T||B.context===T)&&L(this,P);else{for(var tt=0,st=[],Rt=B.length;tt<Rt;tt++)(B[tt].fn!==E||_&&!B[tt].once||T&&B[tt].context!==T)&&st.push(B[tt]);st.length?this._events[P]=st.length===1?st[0]:st:L(this,P)}return this},k.prototype.removeAllListeners=function(b){var E;return b?(E=g?g+b:b,this._events[E]&&L(this,E)):(this._events=new m,this._eventsCount=0),this},k.prototype.off=k.prototype.removeListener,k.prototype.addListener=k.prototype.on,k.prefixed=g,k.EventEmitter=k,q.exports=k},49685:function(q,J,g){"use strict";g.d(J,{Ib:function(){return m},WT:function(){return F}});var m=1e-6,F=typeof Float32Array!="undefined"?Float32Array:Array,R=Math.random;function L(E){F=E}var k=Math.PI/180;function O(E){return E*k}function b(E,T){return Math.abs(E-T)<=m*Math.max(1,Math.abs(E),Math.abs(T))}Math.hypot||(Math.hypot=function(){for(var E=0,T=arguments.length;T--;)E+=arguments[T]*arguments[T];return Math.sqrt(E)})},35600:function(q,J,g){"use strict";g.d(J,{Ue:function(){return F},al:function(){return O},xO:function(){return R}});var m=g(49685);function F(){var rt=new m.WT(9);return m.WT!=Float32Array&&(rt[1]=0,rt[2]=0,rt[3]=0,rt[5]=0,rt[6]=0,rt[7]=0),rt[0]=1,rt[4]=1,rt[8]=1,rt}function R(rt,bt){return rt[0]=bt[0],rt[1]=bt[1],rt[2]=bt[2],rt[3]=bt[4],rt[4]=bt[5],rt[5]=bt[6],rt[6]=bt[8],rt[7]=bt[9],rt[8]=bt[10],rt}function L(rt){var bt=new glMatrix.ARRAY_TYPE(9);return bt[0]=rt[0],bt[1]=rt[1],bt[2]=rt[2],bt[3]=rt[3],bt[4]=rt[4],bt[5]=rt[5],bt[6]=rt[6],bt[7]=rt[7],bt[8]=rt[8],bt}function k(rt,bt){return rt[0]=bt[0],rt[1]=bt[1],rt[2]=bt[2],rt[3]=bt[3],rt[4]=bt[4],rt[5]=bt[5],rt[6]=bt[6],rt[7]=bt[7],rt[8]=bt[8],rt}function O(rt,bt,ye,be,Gt,Kt,we,Bt,oe){var ht=new m.WT(9);return ht[0]=rt,ht[1]=bt,ht[2]=ye,ht[3]=be,ht[4]=Gt,ht[5]=Kt,ht[6]=we,ht[7]=Bt,ht[8]=oe,ht}function b(rt,bt,ye,be,Gt,Kt,we,Bt,oe,ht){return rt[0]=bt,rt[1]=ye,rt[2]=be,rt[3]=Gt,rt[4]=Kt,rt[5]=we,rt[6]=Bt,rt[7]=oe,rt[8]=ht,rt}function E(rt){return rt[0]=1,rt[1]=0,rt[2]=0,rt[3]=0,rt[4]=1,rt[5]=0,rt[6]=0,rt[7]=0,rt[8]=1,rt}function T(rt,bt){if(rt===bt){var ye=bt[1],be=bt[2],Gt=bt[5];rt[1]=bt[3],rt[2]=bt[6],rt[3]=ye,rt[5]=bt[7],rt[6]=be,rt[7]=Gt}else rt[0]=bt[0],rt[1]=bt[3],rt[2]=bt[6],rt[3]=bt[1],rt[4]=bt[4],rt[5]=bt[7],rt[6]=bt[2],rt[7]=bt[5],rt[8]=bt[8];return rt}function _(rt,bt){var ye=bt[0],be=bt[1],Gt=bt[2],Kt=bt[3],we=bt[4],Bt=bt[5],oe=bt[6],ht=bt[7],ut=bt[8],Vt=ut*we-Bt*ht,ve=-ut*Kt+Bt*oe,kt=ht*Kt-we*oe,ee=ye*Vt+be*ve+Gt*kt;return ee?(ee=1/ee,rt[0]=Vt*ee,rt[1]=(-ut*be+Gt*ht)*ee,rt[2]=(Bt*be-Gt*we)*ee,rt[3]=ve*ee,rt[4]=(ut*ye-Gt*oe)*ee,rt[5]=(-Bt*ye+Gt*Kt)*ee,rt[6]=kt*ee,rt[7]=(-ht*ye+be*oe)*ee,rt[8]=(we*ye-be*Kt)*ee,rt):null}function P(rt,bt){var ye=bt[0],be=bt[1],Gt=bt[2],Kt=bt[3],we=bt[4],Bt=bt[5],oe=bt[6],ht=bt[7],ut=bt[8];return rt[0]=we*ut-Bt*ht,rt[1]=Gt*ht-be*ut,rt[2]=be*Bt-Gt*we,rt[3]=Bt*oe-Kt*ut,rt[4]=ye*ut-Gt*oe,rt[5]=Gt*Kt-ye*Bt,rt[6]=Kt*ht-we*oe,rt[7]=be*oe-ye*ht,rt[8]=ye*we-be*Kt,rt}function B(rt){var bt=rt[0],ye=rt[1],be=rt[2],Gt=rt[3],Kt=rt[4],we=rt[5],Bt=rt[6],oe=rt[7],ht=rt[8];return bt*(ht*Kt-we*oe)+ye*(-ht*Gt+we*Bt)+be*(oe*Gt-Kt*Bt)}function tt(rt,bt,ye){var be=bt[0],Gt=bt[1],Kt=bt[2],we=bt[3],Bt=bt[4],oe=bt[5],ht=bt[6],ut=bt[7],Vt=bt[8],ve=ye[0],kt=ye[1],ee=ye[2],me=ye[3],Nt=ye[4],Zt=ye[5],Yt=ye[6],S=ye[7],Y=ye[8];return rt[0]=ve*be+kt*we+ee*ht,rt[1]=ve*Gt+kt*Bt+ee*ut,rt[2]=ve*Kt+kt*oe+ee*Vt,rt[3]=me*be+Nt*we+Zt*ht,rt[4]=me*Gt+Nt*Bt+Zt*ut,rt[5]=me*Kt+Nt*oe+Zt*Vt,rt[6]=Yt*be+S*we+Y*ht,rt[7]=Yt*Gt+S*Bt+Y*ut,rt[8]=Yt*Kt+S*oe+Y*Vt,rt}function st(rt,bt,ye){var be=bt[0],Gt=bt[1],Kt=bt[2],we=bt[3],Bt=bt[4],oe=bt[5],ht=bt[6],ut=bt[7],Vt=bt[8],ve=ye[0],kt=ye[1];return rt[0]=be,rt[1]=Gt,rt[2]=Kt,rt[3]=we,rt[4]=Bt,rt[5]=oe,rt[6]=ve*be+kt*we+ht,rt[7]=ve*Gt+kt*Bt+ut,rt[8]=ve*Kt+kt*oe+Vt,rt}function Rt(rt,bt,ye){var be=bt[0],Gt=bt[1],Kt=bt[2],we=bt[3],Bt=bt[4],oe=bt[5],ht=bt[6],ut=bt[7],Vt=bt[8],ve=Math.sin(ye),kt=Math.cos(ye);return rt[0]=kt*be+ve*we,rt[1]=kt*Gt+ve*Bt,rt[2]=kt*Kt+ve*oe,rt[3]=kt*we-ve*be,rt[4]=kt*Bt-ve*Gt,rt[5]=kt*oe-ve*Kt,rt[6]=ht,rt[7]=ut,rt[8]=Vt,rt}function xt(rt,bt,ye){var be=ye[0],Gt=ye[1];return rt[0]=be*bt[0],rt[1]=be*bt[1],rt[2]=be*bt[2],rt[3]=Gt*bt[3],rt[4]=Gt*bt[4],rt[5]=Gt*bt[5],rt[6]=bt[6],rt[7]=bt[7],rt[8]=bt[8],rt}function nt(rt,bt){return rt[0]=1,rt[1]=0,rt[2]=0,rt[3]=0,rt[4]=1,rt[5]=0,rt[6]=bt[0],rt[7]=bt[1],rt[8]=1,rt}function Et(rt,bt){var ye=Math.sin(bt),be=Math.cos(bt);return rt[0]=be,rt[1]=ye,rt[2]=0,rt[3]=-ye,rt[4]=be,rt[5]=0,rt[6]=0,rt[7]=0,rt[8]=1,rt}function ot(rt,bt){return rt[0]=bt[0],rt[1]=0,rt[2]=0,rt[3]=0,rt[4]=bt[1],rt[5]=0,rt[6]=0,rt[7]=0,rt[8]=1,rt}function Ct(rt,bt){return rt[0]=bt[0],rt[1]=bt[1],rt[2]=0,rt[3]=bt[2],rt[4]=bt[3],rt[5]=0,rt[6]=bt[4],rt[7]=bt[5],rt[8]=1,rt}function _t(rt,bt){var ye=bt[0],be=bt[1],Gt=bt[2],Kt=bt[3],we=ye+ye,Bt=be+be,oe=Gt+Gt,ht=ye*we,ut=be*we,Vt=be*Bt,ve=Gt*we,kt=Gt*Bt,ee=Gt*oe,me=Kt*we,Nt=Kt*Bt,Zt=Kt*oe;return rt[0]=1-Vt-ee,rt[3]=ut-Zt,rt[6]=ve+Nt,rt[1]=ut+Zt,rt[4]=1-ht-ee,rt[7]=kt-me,rt[2]=ve-Nt,rt[5]=kt+me,rt[8]=1-ht-Vt,rt}function dt(rt,bt){var ye=bt[0],be=bt[1],Gt=bt[2],Kt=bt[3],we=bt[4],Bt=bt[5],oe=bt[6],ht=bt[7],ut=bt[8],Vt=bt[9],ve=bt[10],kt=bt[11],ee=bt[12],me=bt[13],Nt=bt[14],Zt=bt[15],Yt=ye*Bt-be*we,S=ye*oe-Gt*we,Y=ye*ht-Kt*we,At=be*oe-Gt*Bt,ie=be*ht-Kt*Bt,$t=Gt*ht-Kt*oe,Oe=ut*me-Vt*ee,Ne=ut*Nt-ve*ee,Le=ut*Zt-kt*ee,at=Vt*Nt-ve*me,V=Vt*Zt-kt*me,St=ve*Zt-kt*Nt,Pt=Yt*St-S*V+Y*at+At*Le-ie*Ne+$t*Oe;return Pt?(Pt=1/Pt,rt[0]=(Bt*St-oe*V+ht*at)*Pt,rt[1]=(oe*Le-we*St-ht*Ne)*Pt,rt[2]=(we*V-Bt*Le+ht*Oe)*Pt,rt[3]=(Gt*V-be*St-Kt*at)*Pt,rt[4]=(ye*St-Gt*Le+Kt*Ne)*Pt,rt[5]=(be*Le-ye*V-Kt*Oe)*Pt,rt[6]=(me*$t-Nt*ie+Zt*At)*Pt,rt[7]=(Nt*Y-ee*$t-Zt*S)*Pt,rt[8]=(ee*ie-me*Y+Zt*Yt)*Pt,rt):null}function Ot(rt,bt,ye){return rt[0]=2/bt,rt[1]=0,rt[2]=0,rt[3]=0,rt[4]=-2/ye,rt[5]=0,rt[6]=-1,rt[7]=1,rt[8]=1,rt}function wt(rt){return"mat3("+rt[0]+", "+rt[1]+", "+rt[2]+", "+rt[3]+", "+rt[4]+", "+rt[5]+", "+rt[6]+", "+rt[7]+", "+rt[8]+")"}function Ft(rt){return Math.hypot(rt[0],rt[1],rt[2],rt[3],rt[4],rt[5],rt[6],rt[7],rt[8])}function jt(rt,bt,ye){return rt[0]=bt[0]+ye[0],rt[1]=bt[1]+ye[1],rt[2]=bt[2]+ye[2],rt[3]=bt[3]+ye[3],rt[4]=bt[4]+ye[4],rt[5]=bt[5]+ye[5],rt[6]=bt[6]+ye[6],rt[7]=bt[7]+ye[7],rt[8]=bt[8]+ye[8],rt}function re(rt,bt,ye){return rt[0]=bt[0]-ye[0],rt[1]=bt[1]-ye[1],rt[2]=bt[2]-ye[2],rt[3]=bt[3]-ye[3],rt[4]=bt[4]-ye[4],rt[5]=bt[5]-ye[5],rt[6]=bt[6]-ye[6],rt[7]=bt[7]-ye[7],rt[8]=bt[8]-ye[8],rt}function Ee(rt,bt,ye){return rt[0]=bt[0]*ye,rt[1]=bt[1]*ye,rt[2]=bt[2]*ye,rt[3]=bt[3]*ye,rt[4]=bt[4]*ye,rt[5]=bt[5]*ye,rt[6]=bt[6]*ye,rt[7]=bt[7]*ye,rt[8]=bt[8]*ye,rt}function et(rt,bt,ye,be){return rt[0]=bt[0]+ye[0]*be,rt[1]=bt[1]+ye[1]*be,rt[2]=bt[2]+ye[2]*be,rt[3]=bt[3]+ye[3]*be,rt[4]=bt[4]+ye[4]*be,rt[5]=bt[5]+ye[5]*be,rt[6]=bt[6]+ye[6]*be,rt[7]=bt[7]+ye[7]*be,rt[8]=bt[8]+ye[8]*be,rt}function ge(rt,bt){return rt[0]===bt[0]&&rt[1]===bt[1]&&rt[2]===bt[2]&&rt[3]===bt[3]&&rt[4]===bt[4]&&rt[5]===bt[5]&&rt[6]===bt[6]&&rt[7]===bt[7]&&rt[8]===bt[8]}function yt(rt,bt){var ye=rt[0],be=rt[1],Gt=rt[2],Kt=rt[3],we=rt[4],Bt=rt[5],oe=rt[6],ht=rt[7],ut=rt[8],Vt=bt[0],ve=bt[1],kt=bt[2],ee=bt[3],me=bt[4],Nt=bt[5],Zt=bt[6],Yt=bt[7],S=bt[8];return Math.abs(ye-Vt)<=glMatrix.EPSILON*Math.max(1,Math.abs(ye),Math.abs(Vt))&&Math.abs(be-ve)<=glMatrix.EPSILON*Math.max(1,Math.abs(be),Math.abs(ve))&&Math.abs(Gt-kt)<=glMatrix.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(kt))&&Math.abs(Kt-ee)<=glMatrix.EPSILON*Math.max(1,Math.abs(Kt),Math.abs(ee))&&Math.abs(we-me)<=glMatrix.EPSILON*Math.max(1,Math.abs(we),Math.abs(me))&&Math.abs(Bt-Nt)<=glMatrix.EPSILON*Math.max(1,Math.abs(Bt),Math.abs(Nt))&&Math.abs(oe-Zt)<=glMatrix.EPSILON*Math.max(1,Math.abs(oe),Math.abs(Zt))&&Math.abs(ht-Yt)<=glMatrix.EPSILON*Math.max(1,Math.abs(ht),Math.abs(Yt))&&Math.abs(ut-S)<=glMatrix.EPSILON*Math.max(1,Math.abs(ut),Math.abs(S))}var te=null,Xt=null},85975:function(q,J,g){"use strict";g.r(J),g.d(J,{add:function(){return Vt},adjoint:function(){return _},clone:function(){return R},copy:function(){return L},create:function(){return F},determinant:function(){return P},equals:function(){return Nt},exactEquals:function(){return me},frob:function(){return ut},fromQuat:function(){return te},fromQuat2:function(){return jt},fromRotation:function(){return _t},fromRotationTranslation:function(){return Ft},fromRotationTranslationScale:function(){return ge},fromRotationTranslationScaleOrigin:function(){return yt},fromScaling:function(){return Ct},fromTranslation:function(){return ot},fromValues:function(){return k},fromXRotation:function(){return dt},fromYRotation:function(){return Ot},fromZRotation:function(){return wt},frustum:function(){return Xt},getRotation:function(){return et},getScaling:function(){return Ee},getTranslation:function(){return re},identity:function(){return b},invert:function(){return T},lookAt:function(){return Bt},mul:function(){return Zt},multiply:function(){return B},multiplyScalar:function(){return kt},multiplyScalarAndAdd:function(){return ee},ortho:function(){return Kt},orthoNO:function(){return Gt},orthoZO:function(){return we},perspective:function(){return bt},perspectiveFromFieldOfView:function(){return be},perspectiveNO:function(){return rt},perspectiveZO:function(){return ye},rotate:function(){return Rt},rotateX:function(){return xt},rotateY:function(){return nt},rotateZ:function(){return Et},scale:function(){return st},set:function(){return O},str:function(){return ht},sub:function(){return Yt},subtract:function(){return ve},targetTo:function(){return oe},translate:function(){return tt},transpose:function(){return E}});var m=g(49685);function F(){var S=new m.WT(16);return m.WT!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S}function R(S){var Y=new m.WT(16);return Y[0]=S[0],Y[1]=S[1],Y[2]=S[2],Y[3]=S[3],Y[4]=S[4],Y[5]=S[5],Y[6]=S[6],Y[7]=S[7],Y[8]=S[8],Y[9]=S[9],Y[10]=S[10],Y[11]=S[11],Y[12]=S[12],Y[13]=S[13],Y[14]=S[14],Y[15]=S[15],Y}function L(S,Y){return S[0]=Y[0],S[1]=Y[1],S[2]=Y[2],S[3]=Y[3],S[4]=Y[4],S[5]=Y[5],S[6]=Y[6],S[7]=Y[7],S[8]=Y[8],S[9]=Y[9],S[10]=Y[10],S[11]=Y[11],S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15],S}function k(S,Y,At,ie,$t,Oe,Ne,Le,at,V,St,Pt,pt,mt,Lt,Ht){var Dt=new m.WT(16);return Dt[0]=S,Dt[1]=Y,Dt[2]=At,Dt[3]=ie,Dt[4]=$t,Dt[5]=Oe,Dt[6]=Ne,Dt[7]=Le,Dt[8]=at,Dt[9]=V,Dt[10]=St,Dt[11]=Pt,Dt[12]=pt,Dt[13]=mt,Dt[14]=Lt,Dt[15]=Ht,Dt}function O(S,Y,At,ie,$t,Oe,Ne,Le,at,V,St,Pt,pt,mt,Lt,Ht,Dt){return S[0]=Y,S[1]=At,S[2]=ie,S[3]=$t,S[4]=Oe,S[5]=Ne,S[6]=Le,S[7]=at,S[8]=V,S[9]=St,S[10]=Pt,S[11]=pt,S[12]=mt,S[13]=Lt,S[14]=Ht,S[15]=Dt,S}function b(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function E(S,Y){if(S===Y){var At=Y[1],ie=Y[2],$t=Y[3],Oe=Y[6],Ne=Y[7],Le=Y[11];S[1]=Y[4],S[2]=Y[8],S[3]=Y[12],S[4]=At,S[6]=Y[9],S[7]=Y[13],S[8]=ie,S[9]=Oe,S[11]=Y[14],S[12]=$t,S[13]=Ne,S[14]=Le}else S[0]=Y[0],S[1]=Y[4],S[2]=Y[8],S[3]=Y[12],S[4]=Y[1],S[5]=Y[5],S[6]=Y[9],S[7]=Y[13],S[8]=Y[2],S[9]=Y[6],S[10]=Y[10],S[11]=Y[14],S[12]=Y[3],S[13]=Y[7],S[14]=Y[11],S[15]=Y[15];return S}function T(S,Y){var At=Y[0],ie=Y[1],$t=Y[2],Oe=Y[3],Ne=Y[4],Le=Y[5],at=Y[6],V=Y[7],St=Y[8],Pt=Y[9],pt=Y[10],mt=Y[11],Lt=Y[12],Ht=Y[13],Dt=Y[14],ne=Y[15],_e=At*Le-ie*Ne,Me=At*at-$t*Ne,Ae=At*V-Oe*Ne,ze=ie*at-$t*Le,Ve=ie*V-Oe*Le,Je=$t*V-Oe*at,pn=St*Ht-Pt*Lt,jn=St*Dt-pt*Lt,hn=St*ne-mt*Lt,En=Pt*Dt-pt*Ht,Gn=Pt*ne-mt*Ht,Tn=pt*ne-mt*Dt,Pn=_e*Tn-Me*Gn+Ae*En+ze*hn-Ve*jn+Je*pn;return Pn?(Pn=1/Pn,S[0]=(Le*Tn-at*Gn+V*En)*Pn,S[1]=($t*Gn-ie*Tn-Oe*En)*Pn,S[2]=(Ht*Je-Dt*Ve+ne*ze)*Pn,S[3]=(pt*Ve-Pt*Je-mt*ze)*Pn,S[4]=(at*hn-Ne*Tn-V*jn)*Pn,S[5]=(At*Tn-$t*hn+Oe*jn)*Pn,S[6]=(Dt*Ae-Lt*Je-ne*Me)*Pn,S[7]=(St*Je-pt*Ae+mt*Me)*Pn,S[8]=(Ne*Gn-Le*hn+V*pn)*Pn,S[9]=(ie*hn-At*Gn-Oe*pn)*Pn,S[10]=(Lt*Ve-Ht*Ae+ne*_e)*Pn,S[11]=(Pt*Ae-St*Ve-mt*_e)*Pn,S[12]=(Le*jn-Ne*En-at*pn)*Pn,S[13]=(At*En-ie*jn+$t*pn)*Pn,S[14]=(Ht*Me-Lt*ze-Dt*_e)*Pn,S[15]=(St*ze-Pt*Me+pt*_e)*Pn,S):null}function _(S,Y){var At=Y[0],ie=Y[1],$t=Y[2],Oe=Y[3],Ne=Y[4],Le=Y[5],at=Y[6],V=Y[7],St=Y[8],Pt=Y[9],pt=Y[10],mt=Y[11],Lt=Y[12],Ht=Y[13],Dt=Y[14],ne=Y[15];return S[0]=Le*(pt*ne-mt*Dt)-Pt*(at*ne-V*Dt)+Ht*(at*mt-V*pt),S[1]=-(ie*(pt*ne-mt*Dt)-Pt*($t*ne-Oe*Dt)+Ht*($t*mt-Oe*pt)),S[2]=ie*(at*ne-V*Dt)-Le*($t*ne-Oe*Dt)+Ht*($t*V-Oe*at),S[3]=-(ie*(at*mt-V*pt)-Le*($t*mt-Oe*pt)+Pt*($t*V-Oe*at)),S[4]=-(Ne*(pt*ne-mt*Dt)-St*(at*ne-V*Dt)+Lt*(at*mt-V*pt)),S[5]=At*(pt*ne-mt*Dt)-St*($t*ne-Oe*Dt)+Lt*($t*mt-Oe*pt),S[6]=-(At*(at*ne-V*Dt)-Ne*($t*ne-Oe*Dt)+Lt*($t*V-Oe*at)),S[7]=At*(at*mt-V*pt)-Ne*($t*mt-Oe*pt)+St*($t*V-Oe*at),S[8]=Ne*(Pt*ne-mt*Ht)-St*(Le*ne-V*Ht)+Lt*(Le*mt-V*Pt),S[9]=-(At*(Pt*ne-mt*Ht)-St*(ie*ne-Oe*Ht)+Lt*(ie*mt-Oe*Pt)),S[10]=At*(Le*ne-V*Ht)-Ne*(ie*ne-Oe*Ht)+Lt*(ie*V-Oe*Le),S[11]=-(At*(Le*mt-V*Pt)-Ne*(ie*mt-Oe*Pt)+St*(ie*V-Oe*Le)),S[12]=-(Ne*(Pt*Dt-pt*Ht)-St*(Le*Dt-at*Ht)+Lt*(Le*pt-at*Pt)),S[13]=At*(Pt*Dt-pt*Ht)-St*(ie*Dt-$t*Ht)+Lt*(ie*pt-$t*Pt),S[14]=-(At*(Le*Dt-at*Ht)-Ne*(ie*Dt-$t*Ht)+Lt*(ie*at-$t*Le)),S[15]=At*(Le*pt-at*Pt)-Ne*(ie*pt-$t*Pt)+St*(ie*at-$t*Le),S}function P(S){var Y=S[0],At=S[1],ie=S[2],$t=S[3],Oe=S[4],Ne=S[5],Le=S[6],at=S[7],V=S[8],St=S[9],Pt=S[10],pt=S[11],mt=S[12],Lt=S[13],Ht=S[14],Dt=S[15],ne=Y*Ne-At*Oe,_e=Y*Le-ie*Oe,Me=Y*at-$t*Oe,Ae=At*Le-ie*Ne,ze=At*at-$t*Ne,Ve=ie*at-$t*Le,Je=V*Lt-St*mt,pn=V*Ht-Pt*mt,jn=V*Dt-pt*mt,hn=St*Ht-Pt*Lt,En=St*Dt-pt*Lt,Gn=Pt*Dt-pt*Ht;return ne*Gn-_e*En+Me*hn+Ae*jn-ze*pn+Ve*Je}function B(S,Y,At){var ie=Y[0],$t=Y[1],Oe=Y[2],Ne=Y[3],Le=Y[4],at=Y[5],V=Y[6],St=Y[7],Pt=Y[8],pt=Y[9],mt=Y[10],Lt=Y[11],Ht=Y[12],Dt=Y[13],ne=Y[14],_e=Y[15],Me=At[0],Ae=At[1],ze=At[2],Ve=At[3];return S[0]=Me*ie+Ae*Le+ze*Pt+Ve*Ht,S[1]=Me*$t+Ae*at+ze*pt+Ve*Dt,S[2]=Me*Oe+Ae*V+ze*mt+Ve*ne,S[3]=Me*Ne+Ae*St+ze*Lt+Ve*_e,Me=At[4],Ae=At[5],ze=At[6],Ve=At[7],S[4]=Me*ie+Ae*Le+ze*Pt+Ve*Ht,S[5]=Me*$t+Ae*at+ze*pt+Ve*Dt,S[6]=Me*Oe+Ae*V+ze*mt+Ve*ne,S[7]=Me*Ne+Ae*St+ze*Lt+Ve*_e,Me=At[8],Ae=At[9],ze=At[10],Ve=At[11],S[8]=Me*ie+Ae*Le+ze*Pt+Ve*Ht,S[9]=Me*$t+Ae*at+ze*pt+Ve*Dt,S[10]=Me*Oe+Ae*V+ze*mt+Ve*ne,S[11]=Me*Ne+Ae*St+ze*Lt+Ve*_e,Me=At[12],Ae=At[13],ze=At[14],Ve=At[15],S[12]=Me*ie+Ae*Le+ze*Pt+Ve*Ht,S[13]=Me*$t+Ae*at+ze*pt+Ve*Dt,S[14]=Me*Oe+Ae*V+ze*mt+Ve*ne,S[15]=Me*Ne+Ae*St+ze*Lt+Ve*_e,S}function tt(S,Y,At){var ie=At[0],$t=At[1],Oe=At[2],Ne,Le,at,V,St,Pt,pt,mt,Lt,Ht,Dt,ne;return Y===S?(S[12]=Y[0]*ie+Y[4]*$t+Y[8]*Oe+Y[12],S[13]=Y[1]*ie+Y[5]*$t+Y[9]*Oe+Y[13],S[14]=Y[2]*ie+Y[6]*$t+Y[10]*Oe+Y[14],S[15]=Y[3]*ie+Y[7]*$t+Y[11]*Oe+Y[15]):(Ne=Y[0],Le=Y[1],at=Y[2],V=Y[3],St=Y[4],Pt=Y[5],pt=Y[6],mt=Y[7],Lt=Y[8],Ht=Y[9],Dt=Y[10],ne=Y[11],S[0]=Ne,S[1]=Le,S[2]=at,S[3]=V,S[4]=St,S[5]=Pt,S[6]=pt,S[7]=mt,S[8]=Lt,S[9]=Ht,S[10]=Dt,S[11]=ne,S[12]=Ne*ie+St*$t+Lt*Oe+Y[12],S[13]=Le*ie+Pt*$t+Ht*Oe+Y[13],S[14]=at*ie+pt*$t+Dt*Oe+Y[14],S[15]=V*ie+mt*$t+ne*Oe+Y[15]),S}function st(S,Y,At){var ie=At[0],$t=At[1],Oe=At[2];return S[0]=Y[0]*ie,S[1]=Y[1]*ie,S[2]=Y[2]*ie,S[3]=Y[3]*ie,S[4]=Y[4]*$t,S[5]=Y[5]*$t,S[6]=Y[6]*$t,S[7]=Y[7]*$t,S[8]=Y[8]*Oe,S[9]=Y[9]*Oe,S[10]=Y[10]*Oe,S[11]=Y[11]*Oe,S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15],S}function Rt(S,Y,At,ie){var $t=ie[0],Oe=ie[1],Ne=ie[2],Le=Math.hypot($t,Oe,Ne),at,V,St,Pt,pt,mt,Lt,Ht,Dt,ne,_e,Me,Ae,ze,Ve,Je,pn,jn,hn,En,Gn,Tn,Pn,Tr;return Le<m.Ib?null:(Le=1/Le,$t*=Le,Oe*=Le,Ne*=Le,at=Math.sin(At),V=Math.cos(At),St=1-V,Pt=Y[0],pt=Y[1],mt=Y[2],Lt=Y[3],Ht=Y[4],Dt=Y[5],ne=Y[6],_e=Y[7],Me=Y[8],Ae=Y[9],ze=Y[10],Ve=Y[11],Je=$t*$t*St+V,pn=Oe*$t*St+Ne*at,jn=Ne*$t*St-Oe*at,hn=$t*Oe*St-Ne*at,En=Oe*Oe*St+V,Gn=Ne*Oe*St+$t*at,Tn=$t*Ne*St+Oe*at,Pn=Oe*Ne*St-$t*at,Tr=Ne*Ne*St+V,S[0]=Pt*Je+Ht*pn+Me*jn,S[1]=pt*Je+Dt*pn+Ae*jn,S[2]=mt*Je+ne*pn+ze*jn,S[3]=Lt*Je+_e*pn+Ve*jn,S[4]=Pt*hn+Ht*En+Me*Gn,S[5]=pt*hn+Dt*En+Ae*Gn,S[6]=mt*hn+ne*En+ze*Gn,S[7]=Lt*hn+_e*En+Ve*Gn,S[8]=Pt*Tn+Ht*Pn+Me*Tr,S[9]=pt*Tn+Dt*Pn+Ae*Tr,S[10]=mt*Tn+ne*Pn+ze*Tr,S[11]=Lt*Tn+_e*Pn+Ve*Tr,Y!==S&&(S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15]),S)}function xt(S,Y,At){var ie=Math.sin(At),$t=Math.cos(At),Oe=Y[4],Ne=Y[5],Le=Y[6],at=Y[7],V=Y[8],St=Y[9],Pt=Y[10],pt=Y[11];return Y!==S&&(S[0]=Y[0],S[1]=Y[1],S[2]=Y[2],S[3]=Y[3],S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15]),S[4]=Oe*$t+V*ie,S[5]=Ne*$t+St*ie,S[6]=Le*$t+Pt*ie,S[7]=at*$t+pt*ie,S[8]=V*$t-Oe*ie,S[9]=St*$t-Ne*ie,S[10]=Pt*$t-Le*ie,S[11]=pt*$t-at*ie,S}function nt(S,Y,At){var ie=Math.sin(At),$t=Math.cos(At),Oe=Y[0],Ne=Y[1],Le=Y[2],at=Y[3],V=Y[8],St=Y[9],Pt=Y[10],pt=Y[11];return Y!==S&&(S[4]=Y[4],S[5]=Y[5],S[6]=Y[6],S[7]=Y[7],S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15]),S[0]=Oe*$t-V*ie,S[1]=Ne*$t-St*ie,S[2]=Le*$t-Pt*ie,S[3]=at*$t-pt*ie,S[8]=Oe*ie+V*$t,S[9]=Ne*ie+St*$t,S[10]=Le*ie+Pt*$t,S[11]=at*ie+pt*$t,S}function Et(S,Y,At){var ie=Math.sin(At),$t=Math.cos(At),Oe=Y[0],Ne=Y[1],Le=Y[2],at=Y[3],V=Y[4],St=Y[5],Pt=Y[6],pt=Y[7];return Y!==S&&(S[8]=Y[8],S[9]=Y[9],S[10]=Y[10],S[11]=Y[11],S[12]=Y[12],S[13]=Y[13],S[14]=Y[14],S[15]=Y[15]),S[0]=Oe*$t+V*ie,S[1]=Ne*$t+St*ie,S[2]=Le*$t+Pt*ie,S[3]=at*$t+pt*ie,S[4]=V*$t-Oe*ie,S[5]=St*$t-Ne*ie,S[6]=Pt*$t-Le*ie,S[7]=pt*$t-at*ie,S}function ot(S,Y){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=Y[0],S[13]=Y[1],S[14]=Y[2],S[15]=1,S}function Ct(S,Y){return S[0]=Y[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=Y[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function _t(S,Y,At){var ie=At[0],$t=At[1],Oe=At[2],Ne=Math.hypot(ie,$t,Oe),Le,at,V;return Ne<m.Ib?null:(Ne=1/Ne,ie*=Ne,$t*=Ne,Oe*=Ne,Le=Math.sin(Y),at=Math.cos(Y),V=1-at,S[0]=ie*ie*V+at,S[1]=$t*ie*V+Oe*Le,S[2]=Oe*ie*V-$t*Le,S[3]=0,S[4]=ie*$t*V-Oe*Le,S[5]=$t*$t*V+at,S[6]=Oe*$t*V+ie*Le,S[7]=0,S[8]=ie*Oe*V+$t*Le,S[9]=$t*Oe*V-ie*Le,S[10]=Oe*Oe*V+at,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S)}function dt(S,Y){var At=Math.sin(Y),ie=Math.cos(Y);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=ie,S[6]=At,S[7]=0,S[8]=0,S[9]=-At,S[10]=ie,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function Ot(S,Y){var At=Math.sin(Y),ie=Math.cos(Y);return S[0]=ie,S[1]=0,S[2]=-At,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=At,S[9]=0,S[10]=ie,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function wt(S,Y){var At=Math.sin(Y),ie=Math.cos(Y);return S[0]=ie,S[1]=At,S[2]=0,S[3]=0,S[4]=-At,S[5]=ie,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function Ft(S,Y,At){var ie=Y[0],$t=Y[1],Oe=Y[2],Ne=Y[3],Le=ie+ie,at=$t+$t,V=Oe+Oe,St=ie*Le,Pt=ie*at,pt=ie*V,mt=$t*at,Lt=$t*V,Ht=Oe*V,Dt=Ne*Le,ne=Ne*at,_e=Ne*V;return S[0]=1-(mt+Ht),S[1]=Pt+_e,S[2]=pt-ne,S[3]=0,S[4]=Pt-_e,S[5]=1-(St+Ht),S[6]=Lt+Dt,S[7]=0,S[8]=pt+ne,S[9]=Lt-Dt,S[10]=1-(St+mt),S[11]=0,S[12]=At[0],S[13]=At[1],S[14]=At[2],S[15]=1,S}function jt(S,Y){var At=new m.WT(3),ie=-Y[0],$t=-Y[1],Oe=-Y[2],Ne=Y[3],Le=Y[4],at=Y[5],V=Y[6],St=Y[7],Pt=ie*ie+$t*$t+Oe*Oe+Ne*Ne;return Pt>0?(At[0]=(Le*Ne+St*ie+at*Oe-V*$t)*2/Pt,At[1]=(at*Ne+St*$t+V*ie-Le*Oe)*2/Pt,At[2]=(V*Ne+St*Oe+Le*$t-at*ie)*2/Pt):(At[0]=(Le*Ne+St*ie+at*Oe-V*$t)*2,At[1]=(at*Ne+St*$t+V*ie-Le*Oe)*2,At[2]=(V*Ne+St*Oe+Le*$t-at*ie)*2),Ft(S,Y,At),S}function re(S,Y){return S[0]=Y[12],S[1]=Y[13],S[2]=Y[14],S}function Ee(S,Y){var At=Y[0],ie=Y[1],$t=Y[2],Oe=Y[4],Ne=Y[5],Le=Y[6],at=Y[8],V=Y[9],St=Y[10];return S[0]=Math.hypot(At,ie,$t),S[1]=Math.hypot(Oe,Ne,Le),S[2]=Math.hypot(at,V,St),S}function et(S,Y){var At=new m.WT(3);Ee(At,Y);var ie=1/At[0],$t=1/At[1],Oe=1/At[2],Ne=Y[0]*ie,Le=Y[1]*$t,at=Y[2]*Oe,V=Y[4]*ie,St=Y[5]*$t,Pt=Y[6]*Oe,pt=Y[8]*ie,mt=Y[9]*$t,Lt=Y[10]*Oe,Ht=Ne+St+Lt,Dt=0;return Ht>0?(Dt=Math.sqrt(Ht+1)*2,S[3]=.25*Dt,S[0]=(Pt-mt)/Dt,S[1]=(pt-at)/Dt,S[2]=(Le-V)/Dt):Ne>St&&Ne>Lt?(Dt=Math.sqrt(1+Ne-St-Lt)*2,S[3]=(Pt-mt)/Dt,S[0]=.25*Dt,S[1]=(Le+V)/Dt,S[2]=(pt+at)/Dt):St>Lt?(Dt=Math.sqrt(1+St-Ne-Lt)*2,S[3]=(pt-at)/Dt,S[0]=(Le+V)/Dt,S[1]=.25*Dt,S[2]=(Pt+mt)/Dt):(Dt=Math.sqrt(1+Lt-Ne-St)*2,S[3]=(Le-V)/Dt,S[0]=(pt+at)/Dt,S[1]=(Pt+mt)/Dt,S[2]=.25*Dt),S}function ge(S,Y,At,ie){var $t=Y[0],Oe=Y[1],Ne=Y[2],Le=Y[3],at=$t+$t,V=Oe+Oe,St=Ne+Ne,Pt=$t*at,pt=$t*V,mt=$t*St,Lt=Oe*V,Ht=Oe*St,Dt=Ne*St,ne=Le*at,_e=Le*V,Me=Le*St,Ae=ie[0],ze=ie[1],Ve=ie[2];return S[0]=(1-(Lt+Dt))*Ae,S[1]=(pt+Me)*Ae,S[2]=(mt-_e)*Ae,S[3]=0,S[4]=(pt-Me)*ze,S[5]=(1-(Pt+Dt))*ze,S[6]=(Ht+ne)*ze,S[7]=0,S[8]=(mt+_e)*Ve,S[9]=(Ht-ne)*Ve,S[10]=(1-(Pt+Lt))*Ve,S[11]=0,S[12]=At[0],S[13]=At[1],S[14]=At[2],S[15]=1,S}function yt(S,Y,At,ie,$t){var Oe=Y[0],Ne=Y[1],Le=Y[2],at=Y[3],V=Oe+Oe,St=Ne+Ne,Pt=Le+Le,pt=Oe*V,mt=Oe*St,Lt=Oe*Pt,Ht=Ne*St,Dt=Ne*Pt,ne=Le*Pt,_e=at*V,Me=at*St,Ae=at*Pt,ze=ie[0],Ve=ie[1],Je=ie[2],pn=$t[0],jn=$t[1],hn=$t[2],En=(1-(Ht+ne))*ze,Gn=(mt+Ae)*ze,Tn=(Lt-Me)*ze,Pn=(mt-Ae)*Ve,Tr=(1-(pt+ne))*Ve,wi=(Dt+_e)*Ve,Vr=(Lt+Me)*Je,Ga=(Dt-_e)*Je,Wa=(1-(pt+Ht))*Je;return S[0]=En,S[1]=Gn,S[2]=Tn,S[3]=0,S[4]=Pn,S[5]=Tr,S[6]=wi,S[7]=0,S[8]=Vr,S[9]=Ga,S[10]=Wa,S[11]=0,S[12]=At[0]+pn-(En*pn+Pn*jn+Vr*hn),S[13]=At[1]+jn-(Gn*pn+Tr*jn+Ga*hn),S[14]=At[2]+hn-(Tn*pn+wi*jn+Wa*hn),S[15]=1,S}function te(S,Y){var At=Y[0],ie=Y[1],$t=Y[2],Oe=Y[3],Ne=At+At,Le=ie+ie,at=$t+$t,V=At*Ne,St=ie*Ne,Pt=ie*Le,pt=$t*Ne,mt=$t*Le,Lt=$t*at,Ht=Oe*Ne,Dt=Oe*Le,ne=Oe*at;return S[0]=1-Pt-Lt,S[1]=St+ne,S[2]=pt-Dt,S[3]=0,S[4]=St-ne,S[5]=1-V-Lt,S[6]=mt+Ht,S[7]=0,S[8]=pt+Dt,S[9]=mt-Ht,S[10]=1-V-Pt,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function Xt(S,Y,At,ie,$t,Oe,Ne){var Le=1/(At-Y),at=1/($t-ie),V=1/(Oe-Ne);return S[0]=Oe*2*Le,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Oe*2*at,S[6]=0,S[7]=0,S[8]=(At+Y)*Le,S[9]=($t+ie)*at,S[10]=(Ne+Oe)*V,S[11]=-1,S[12]=0,S[13]=0,S[14]=Ne*Oe*2*V,S[15]=0,S}function rt(S,Y,At,ie,$t){var Oe=1/Math.tan(Y/2),Ne;return S[0]=Oe/At,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Oe,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,$t!=null&&$t!==1/0?(Ne=1/(ie-$t),S[10]=($t+ie)*Ne,S[14]=2*$t*ie*Ne):(S[10]=-1,S[14]=-2*ie),S}var bt=rt;function ye(S,Y,At,ie,$t){var Oe=1/Math.tan(Y/2),Ne;return S[0]=Oe/At,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Oe,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,$t!=null&&$t!==1/0?(Ne=1/(ie-$t),S[10]=$t*Ne,S[14]=$t*ie*Ne):(S[10]=-1,S[14]=-ie),S}function be(S,Y,At,ie){var $t=Math.tan(Y.upDegrees*Math.PI/180),Oe=Math.tan(Y.downDegrees*Math.PI/180),Ne=Math.tan(Y.leftDegrees*Math.PI/180),Le=Math.tan(Y.rightDegrees*Math.PI/180),at=2/(Ne+Le),V=2/($t+Oe);return S[0]=at,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=V,S[6]=0,S[7]=0,S[8]=-((Ne-Le)*at*.5),S[9]=($t-Oe)*V*.5,S[10]=ie/(At-ie),S[11]=-1,S[12]=0,S[13]=0,S[14]=ie*At/(At-ie),S[15]=0,S}function Gt(S,Y,At,ie,$t,Oe,Ne){var Le=1/(Y-At),at=1/(ie-$t),V=1/(Oe-Ne);return S[0]=-2*Le,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*at,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*V,S[11]=0,S[12]=(Y+At)*Le,S[13]=($t+ie)*at,S[14]=(Ne+Oe)*V,S[15]=1,S}var Kt=Gt;function we(S,Y,At,ie,$t,Oe,Ne){var Le=1/(Y-At),at=1/(ie-$t),V=1/(Oe-Ne);return S[0]=-2*Le,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*at,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=V,S[11]=0,S[12]=(Y+At)*Le,S[13]=($t+ie)*at,S[14]=Oe*V,S[15]=1,S}function Bt(S,Y,At,ie){var $t,Oe,Ne,Le,at,V,St,Pt,pt,mt,Lt=Y[0],Ht=Y[1],Dt=Y[2],ne=ie[0],_e=ie[1],Me=ie[2],Ae=At[0],ze=At[1],Ve=At[2];return Math.abs(Lt-Ae)<m.Ib&&Math.abs(Ht-ze)<m.Ib&&Math.abs(Dt-Ve)<m.Ib?b(S):(St=Lt-Ae,Pt=Ht-ze,pt=Dt-Ve,mt=1/Math.hypot(St,Pt,pt),St*=mt,Pt*=mt,pt*=mt,$t=_e*pt-Me*Pt,Oe=Me*St-ne*pt,Ne=ne*Pt-_e*St,mt=Math.hypot($t,Oe,Ne),mt?(mt=1/mt,$t*=mt,Oe*=mt,Ne*=mt):($t=0,Oe=0,Ne=0),Le=Pt*Ne-pt*Oe,at=pt*$t-St*Ne,V=St*Oe-Pt*$t,mt=Math.hypot(Le,at,V),mt?(mt=1/mt,Le*=mt,at*=mt,V*=mt):(Le=0,at=0,V=0),S[0]=$t,S[1]=Le,S[2]=St,S[3]=0,S[4]=Oe,S[5]=at,S[6]=Pt,S[7]=0,S[8]=Ne,S[9]=V,S[10]=pt,S[11]=0,S[12]=-($t*Lt+Oe*Ht+Ne*Dt),S[13]=-(Le*Lt+at*Ht+V*Dt),S[14]=-(St*Lt+Pt*Ht+pt*Dt),S[15]=1,S)}function oe(S,Y,At,ie){var $t=Y[0],Oe=Y[1],Ne=Y[2],Le=ie[0],at=ie[1],V=ie[2],St=$t-At[0],Pt=Oe-At[1],pt=Ne-At[2],mt=St*St+Pt*Pt+pt*pt;mt>0&&(mt=1/Math.sqrt(mt),St*=mt,Pt*=mt,pt*=mt);var Lt=at*pt-V*Pt,Ht=V*St-Le*pt,Dt=Le*Pt-at*St;return mt=Lt*Lt+Ht*Ht+Dt*Dt,mt>0&&(mt=1/Math.sqrt(mt),Lt*=mt,Ht*=mt,Dt*=mt),S[0]=Lt,S[1]=Ht,S[2]=Dt,S[3]=0,S[4]=Pt*Dt-pt*Ht,S[5]=pt*Lt-St*Dt,S[6]=St*Ht-Pt*Lt,S[7]=0,S[8]=St,S[9]=Pt,S[10]=pt,S[11]=0,S[12]=$t,S[13]=Oe,S[14]=Ne,S[15]=1,S}function ht(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")"}function ut(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15])}function Vt(S,Y,At){return S[0]=Y[0]+At[0],S[1]=Y[1]+At[1],S[2]=Y[2]+At[2],S[3]=Y[3]+At[3],S[4]=Y[4]+At[4],S[5]=Y[5]+At[5],S[6]=Y[6]+At[6],S[7]=Y[7]+At[7],S[8]=Y[8]+At[8],S[9]=Y[9]+At[9],S[10]=Y[10]+At[10],S[11]=Y[11]+At[11],S[12]=Y[12]+At[12],S[13]=Y[13]+At[13],S[14]=Y[14]+At[14],S[15]=Y[15]+At[15],S}function ve(S,Y,At){return S[0]=Y[0]-At[0],S[1]=Y[1]-At[1],S[2]=Y[2]-At[2],S[3]=Y[3]-At[3],S[4]=Y[4]-At[4],S[5]=Y[5]-At[5],S[6]=Y[6]-At[6],S[7]=Y[7]-At[7],S[8]=Y[8]-At[8],S[9]=Y[9]-At[9],S[10]=Y[10]-At[10],S[11]=Y[11]-At[11],S[12]=Y[12]-At[12],S[13]=Y[13]-At[13],S[14]=Y[14]-At[14],S[15]=Y[15]-At[15],S}function kt(S,Y,At){return S[0]=Y[0]*At,S[1]=Y[1]*At,S[2]=Y[2]*At,S[3]=Y[3]*At,S[4]=Y[4]*At,S[5]=Y[5]*At,S[6]=Y[6]*At,S[7]=Y[7]*At,S[8]=Y[8]*At,S[9]=Y[9]*At,S[10]=Y[10]*At,S[11]=Y[11]*At,S[12]=Y[12]*At,S[13]=Y[13]*At,S[14]=Y[14]*At,S[15]=Y[15]*At,S}function ee(S,Y,At,ie){return S[0]=Y[0]+At[0]*ie,S[1]=Y[1]+At[1]*ie,S[2]=Y[2]+At[2]*ie,S[3]=Y[3]+At[3]*ie,S[4]=Y[4]+At[4]*ie,S[5]=Y[5]+At[5]*ie,S[6]=Y[6]+At[6]*ie,S[7]=Y[7]+At[7]*ie,S[8]=Y[8]+At[8]*ie,S[9]=Y[9]+At[9]*ie,S[10]=Y[10]+At[10]*ie,S[11]=Y[11]+At[11]*ie,S[12]=Y[12]+At[12]*ie,S[13]=Y[13]+At[13]*ie,S[14]=Y[14]+At[14]*ie,S[15]=Y[15]+At[15]*ie,S}function me(S,Y){return S[0]===Y[0]&&S[1]===Y[1]&&S[2]===Y[2]&&S[3]===Y[3]&&S[4]===Y[4]&&S[5]===Y[5]&&S[6]===Y[6]&&S[7]===Y[7]&&S[8]===Y[8]&&S[9]===Y[9]&&S[10]===Y[10]&&S[11]===Y[11]&&S[12]===Y[12]&&S[13]===Y[13]&&S[14]===Y[14]&&S[15]===Y[15]}function Nt(S,Y){var At=S[0],ie=S[1],$t=S[2],Oe=S[3],Ne=S[4],Le=S[5],at=S[6],V=S[7],St=S[8],Pt=S[9],pt=S[10],mt=S[11],Lt=S[12],Ht=S[13],Dt=S[14],ne=S[15],_e=Y[0],Me=Y[1],Ae=Y[2],ze=Y[3],Ve=Y[4],Je=Y[5],pn=Y[6],jn=Y[7],hn=Y[8],En=Y[9],Gn=Y[10],Tn=Y[11],Pn=Y[12],Tr=Y[13],wi=Y[14],Vr=Y[15];return Math.abs(At-_e)<=m.Ib*Math.max(1,Math.abs(At),Math.abs(_e))&&Math.abs(ie-Me)<=m.Ib*Math.max(1,Math.abs(ie),Math.abs(Me))&&Math.abs($t-Ae)<=m.Ib*Math.max(1,Math.abs($t),Math.abs(Ae))&&Math.abs(Oe-ze)<=m.Ib*Math.max(1,Math.abs(Oe),Math.abs(ze))&&Math.abs(Ne-Ve)<=m.Ib*Math.max(1,Math.abs(Ne),Math.abs(Ve))&&Math.abs(Le-Je)<=m.Ib*Math.max(1,Math.abs(Le),Math.abs(Je))&&Math.abs(at-pn)<=m.Ib*Math.max(1,Math.abs(at),Math.abs(pn))&&Math.abs(V-jn)<=m.Ib*Math.max(1,Math.abs(V),Math.abs(jn))&&Math.abs(St-hn)<=m.Ib*Math.max(1,Math.abs(St),Math.abs(hn))&&Math.abs(Pt-En)<=m.Ib*Math.max(1,Math.abs(Pt),Math.abs(En))&&Math.abs(pt-Gn)<=m.Ib*Math.max(1,Math.abs(pt),Math.abs(Gn))&&Math.abs(mt-Tn)<=m.Ib*Math.max(1,Math.abs(mt),Math.abs(Tn))&&Math.abs(Lt-Pn)<=m.Ib*Math.max(1,Math.abs(Lt),Math.abs(Pn))&&Math.abs(Ht-Tr)<=m.Ib*Math.max(1,Math.abs(Ht),Math.abs(Tr))&&Math.abs(Dt-wi)<=m.Ib*Math.max(1,Math.abs(Dt),Math.abs(wi))&&Math.abs(ne-Vr)<=m.Ib*Math.max(1,Math.abs(ne),Math.abs(Vr))}var Zt=B,Yt=ve},32945:function(q,J,g){"use strict";g.d(J,{Fv:function(){return Gt},JG:function(){return re},Jp:function(){return _},Su:function(){return Ot},U_:function(){return Ct},Ue:function(){return k},al:function(){return jt},dC:function(){return ge},t8:function(){return Ee},yY:function(){return b}});var m=g(49685),F=g(35600),R=g(33983),L=g(98333);function k(){var ut=new m.WT(4);return m.WT!=Float32Array&&(ut[0]=0,ut[1]=0,ut[2]=0),ut[3]=1,ut}function O(ut){return ut[0]=0,ut[1]=0,ut[2]=0,ut[3]=1,ut}function b(ut,Vt,ve){ve=ve*.5;var kt=Math.sin(ve);return ut[0]=kt*Vt[0],ut[1]=kt*Vt[1],ut[2]=kt*Vt[2],ut[3]=Math.cos(ve),ut}function E(ut,Vt){var ve=Math.acos(Vt[3])*2,kt=Math.sin(ve/2);return kt>glMatrix.EPSILON?(ut[0]=Vt[0]/kt,ut[1]=Vt[1]/kt,ut[2]=Vt[2]/kt):(ut[0]=1,ut[1]=0,ut[2]=0),ve}function T(ut,Vt){var ve=te(ut,Vt);return Math.acos(2*ve*ve-1)}function _(ut,Vt,ve){var kt=Vt[0],ee=Vt[1],me=Vt[2],Nt=Vt[3],Zt=ve[0],Yt=ve[1],S=ve[2],Y=ve[3];return ut[0]=kt*Y+Nt*Zt+ee*S-me*Yt,ut[1]=ee*Y+Nt*Yt+me*Zt-kt*S,ut[2]=me*Y+Nt*S+kt*Yt-ee*Zt,ut[3]=Nt*Y-kt*Zt-ee*Yt-me*S,ut}function P(ut,Vt,ve){ve*=.5;var kt=Vt[0],ee=Vt[1],me=Vt[2],Nt=Vt[3],Zt=Math.sin(ve),Yt=Math.cos(ve);return ut[0]=kt*Yt+Nt*Zt,ut[1]=ee*Yt+me*Zt,ut[2]=me*Yt-ee*Zt,ut[3]=Nt*Yt-kt*Zt,ut}function B(ut,Vt,ve){ve*=.5;var kt=Vt[0],ee=Vt[1],me=Vt[2],Nt=Vt[3],Zt=Math.sin(ve),Yt=Math.cos(ve);return ut[0]=kt*Yt-me*Zt,ut[1]=ee*Yt+Nt*Zt,ut[2]=me*Yt+kt*Zt,ut[3]=Nt*Yt-ee*Zt,ut}function tt(ut,Vt,ve){ve*=.5;var kt=Vt[0],ee=Vt[1],me=Vt[2],Nt=Vt[3],Zt=Math.sin(ve),Yt=Math.cos(ve);return ut[0]=kt*Yt+ee*Zt,ut[1]=ee*Yt-kt*Zt,ut[2]=me*Yt+Nt*Zt,ut[3]=Nt*Yt-me*Zt,ut}function st(ut,Vt){var ve=Vt[0],kt=Vt[1],ee=Vt[2];return ut[0]=ve,ut[1]=kt,ut[2]=ee,ut[3]=Math.sqrt(Math.abs(1-ve*ve-kt*kt-ee*ee)),ut}function Rt(ut,Vt){var ve=Vt[0],kt=Vt[1],ee=Vt[2],me=Vt[3],Nt=Math.sqrt(ve*ve+kt*kt+ee*ee),Zt=Math.exp(me),Yt=Nt>0?Zt*Math.sin(Nt)/Nt:0;return ut[0]=ve*Yt,ut[1]=kt*Yt,ut[2]=ee*Yt,ut[3]=Zt*Math.cos(Nt),ut}function xt(ut,Vt){var ve=Vt[0],kt=Vt[1],ee=Vt[2],me=Vt[3],Nt=Math.sqrt(ve*ve+kt*kt+ee*ee),Zt=Nt>0?Math.atan2(Nt,me)/Nt:0;return ut[0]=ve*Zt,ut[1]=kt*Zt,ut[2]=ee*Zt,ut[3]=.5*Math.log(ve*ve+kt*kt+ee*ee+me*me),ut}function nt(ut,Vt,ve){return xt(ut,Vt),yt(ut,ut,ve),Rt(ut,ut),ut}function Et(ut,Vt,ve,kt){var ee=Vt[0],me=Vt[1],Nt=Vt[2],Zt=Vt[3],Yt=ve[0],S=ve[1],Y=ve[2],At=ve[3],ie,$t,Oe,Ne,Le;return $t=ee*Yt+me*S+Nt*Y+Zt*At,$t<0&&($t=-$t,Yt=-Yt,S=-S,Y=-Y,At=-At),1-$t>m.Ib?(ie=Math.acos($t),Oe=Math.sin(ie),Ne=Math.sin((1-kt)*ie)/Oe,Le=Math.sin(kt*ie)/Oe):(Ne=1-kt,Le=kt),ut[0]=Ne*ee+Le*Yt,ut[1]=Ne*me+Le*S,ut[2]=Ne*Nt+Le*Y,ut[3]=Ne*Zt+Le*At,ut}function ot(ut){var Vt=glMatrix.RANDOM(),ve=glMatrix.RANDOM(),kt=glMatrix.RANDOM(),ee=Math.sqrt(1-Vt),me=Math.sqrt(Vt);return ut[0]=ee*Math.sin(2*Math.PI*ve),ut[1]=ee*Math.cos(2*Math.PI*ve),ut[2]=me*Math.sin(2*Math.PI*kt),ut[3]=me*Math.cos(2*Math.PI*kt),ut}function Ct(ut,Vt){var ve=Vt[0],kt=Vt[1],ee=Vt[2],me=Vt[3],Nt=ve*ve+kt*kt+ee*ee+me*me,Zt=Nt?1/Nt:0;return ut[0]=-ve*Zt,ut[1]=-kt*Zt,ut[2]=-ee*Zt,ut[3]=me*Zt,ut}function _t(ut,Vt){return ut[0]=-Vt[0],ut[1]=-Vt[1],ut[2]=-Vt[2],ut[3]=Vt[3],ut}function dt(ut,Vt){var ve=Vt[0]+Vt[4]+Vt[8],kt;if(ve>0)kt=Math.sqrt(ve+1),ut[3]=.5*kt,kt=.5/kt,ut[0]=(Vt[5]-Vt[7])*kt,ut[1]=(Vt[6]-Vt[2])*kt,ut[2]=(Vt[1]-Vt[3])*kt;else{var ee=0;Vt[4]>Vt[0]&&(ee=1),Vt[8]>Vt[ee*3+ee]&&(ee=2);var me=(ee+1)%3,Nt=(ee+2)%3;kt=Math.sqrt(Vt[ee*3+ee]-Vt[me*3+me]-Vt[Nt*3+Nt]+1),ut[ee]=.5*kt,kt=.5/kt,ut[3]=(Vt[me*3+Nt]-Vt[Nt*3+me])*kt,ut[me]=(Vt[me*3+ee]+Vt[ee*3+me])*kt,ut[Nt]=(Vt[Nt*3+ee]+Vt[ee*3+Nt])*kt}return ut}function Ot(ut,Vt,ve,kt){var ee=.5*Math.PI/180;Vt*=ee,ve*=ee,kt*=ee;var me=Math.sin(Vt),Nt=Math.cos(Vt),Zt=Math.sin(ve),Yt=Math.cos(ve),S=Math.sin(kt),Y=Math.cos(kt);return ut[0]=me*Yt*Y-Nt*Zt*S,ut[1]=Nt*Zt*Y+me*Yt*S,ut[2]=Nt*Yt*S-me*Zt*Y,ut[3]=Nt*Yt*Y+me*Zt*S,ut}function wt(ut){return"quat("+ut[0]+", "+ut[1]+", "+ut[2]+", "+ut[3]+")"}var Ft=L.d9,jt=L.al,re=L.JG,Ee=L.t8,et=L.IH,ge=_,yt=L.bA,te=L.AK,Xt=L.t7,rt=L.kE,bt=null,ye=L.we,be=null,Gt=L.Fv,Kt=L.I6,we=L.fS,Bt=function(){var ut=R.Ue(),Vt=R.al(1,0,0),ve=R.al(0,1,0);return function(kt,ee,me){var Nt=R.AK(ee,me);return Nt<-.999999?(R.kC(ut,Vt,ee),R.Zh(ut)<1e-6&&R.kC(ut,ve,ee),R.Fv(ut,ut),b(kt,ut,Math.PI),kt):Nt>.999999?(kt[0]=0,kt[1]=0,kt[2]=0,kt[3]=1,kt):(R.kC(ut,ee,me),kt[0]=ut[0],kt[1]=ut[1],kt[2]=ut[2],kt[3]=1+Nt,Gt(kt,kt))}}(),oe=function(){var ut=k(),Vt=k();return function(ve,kt,ee,me,Nt,Zt){return Et(ut,kt,Nt,Zt),Et(Vt,ee,me,Zt),Et(ve,ut,Vt,2*Zt*(1-Zt)),ve}}(),ht=function(){var ut=F.Ue();return function(Vt,ve,kt,ee){return ut[0]=kt[0],ut[3]=kt[1],ut[6]=kt[2],ut[1]=ee[0],ut[4]=ee[1],ut[7]=ee[2],ut[2]=-ve[0],ut[5]=-ve[1],ut[8]=-ve[2],Gt(Vt,dt(Vt,ut))}}()},31437:function(q,J,g){"use strict";g.d(J,{AK:function(){return Ft},Fv:function(){return wt},I6:function(){return be},JG:function(){return k},Ue:function(){return F},t8:function(){return O}});var m=g(49685);function F(){var kt=new m.WT(2);return m.WT!=Float32Array&&(kt[0]=0,kt[1]=0),kt}function R(kt){var ee=new glMatrix.ARRAY_TYPE(2);return ee[0]=kt[0],ee[1]=kt[1],ee}function L(kt,ee){var me=new glMatrix.ARRAY_TYPE(2);return me[0]=kt,me[1]=ee,me}function k(kt,ee){return kt[0]=ee[0],kt[1]=ee[1],kt}function O(kt,ee,me){return kt[0]=ee,kt[1]=me,kt}function b(kt,ee,me){return kt[0]=ee[0]+me[0],kt[1]=ee[1]+me[1],kt}function E(kt,ee,me){return kt[0]=ee[0]-me[0],kt[1]=ee[1]-me[1],kt}function T(kt,ee,me){return kt[0]=ee[0]*me[0],kt[1]=ee[1]*me[1],kt}function _(kt,ee,me){return kt[0]=ee[0]/me[0],kt[1]=ee[1]/me[1],kt}function P(kt,ee){return kt[0]=Math.ceil(ee[0]),kt[1]=Math.ceil(ee[1]),kt}function B(kt,ee){return kt[0]=Math.floor(ee[0]),kt[1]=Math.floor(ee[1]),kt}function tt(kt,ee,me){return kt[0]=Math.min(ee[0],me[0]),kt[1]=Math.min(ee[1],me[1]),kt}function st(kt,ee,me){return kt[0]=Math.max(ee[0],me[0]),kt[1]=Math.max(ee[1],me[1]),kt}function Rt(kt,ee){return kt[0]=Math.round(ee[0]),kt[1]=Math.round(ee[1]),kt}function xt(kt,ee,me){return kt[0]=ee[0]*me,kt[1]=ee[1]*me,kt}function nt(kt,ee,me,Nt){return kt[0]=ee[0]+me[0]*Nt,kt[1]=ee[1]+me[1]*Nt,kt}function Et(kt,ee){var me=ee[0]-kt[0],Nt=ee[1]-kt[1];return Math.hypot(me,Nt)}function ot(kt,ee){var me=ee[0]-kt[0],Nt=ee[1]-kt[1];return me*me+Nt*Nt}function Ct(kt){var ee=kt[0],me=kt[1];return Math.hypot(ee,me)}function _t(kt){var ee=kt[0],me=kt[1];return ee*ee+me*me}function dt(kt,ee){return kt[0]=-ee[0],kt[1]=-ee[1],kt}function Ot(kt,ee){return kt[0]=1/ee[0],kt[1]=1/ee[1],kt}function wt(kt,ee){var me=ee[0],Nt=ee[1],Zt=me*me+Nt*Nt;return Zt>0&&(Zt=1/Math.sqrt(Zt)),kt[0]=ee[0]*Zt,kt[1]=ee[1]*Zt,kt}function Ft(kt,ee){return kt[0]*ee[0]+kt[1]*ee[1]}function jt(kt,ee,me){var Nt=ee[0]*me[1]-ee[1]*me[0];return kt[0]=kt[1]=0,kt[2]=Nt,kt}function re(kt,ee,me,Nt){var Zt=ee[0],Yt=ee[1];return kt[0]=Zt+Nt*(me[0]-Zt),kt[1]=Yt+Nt*(me[1]-Yt),kt}function Ee(kt,ee){ee=ee||1;var me=glMatrix.RANDOM()*2*Math.PI;return kt[0]=Math.cos(me)*ee,kt[1]=Math.sin(me)*ee,kt}function et(kt,ee,me){var Nt=ee[0],Zt=ee[1];return kt[0]=me[0]*Nt+me[2]*Zt,kt[1]=me[1]*Nt+me[3]*Zt,kt}function ge(kt,ee,me){var Nt=ee[0],Zt=ee[1];return kt[0]=me[0]*Nt+me[2]*Zt+me[4],kt[1]=me[1]*Nt+me[3]*Zt+me[5],kt}function yt(kt,ee,me){var Nt=ee[0],Zt=ee[1];return kt[0]=me[0]*Nt+me[3]*Zt+me[6],kt[1]=me[1]*Nt+me[4]*Zt+me[7],kt}function te(kt,ee,me){var Nt=ee[0],Zt=ee[1];return kt[0]=me[0]*Nt+me[4]*Zt+me[12],kt[1]=me[1]*Nt+me[5]*Zt+me[13],kt}function Xt(kt,ee,me,Nt){var Zt=ee[0]-me[0],Yt=ee[1]-me[1],S=Math.sin(Nt),Y=Math.cos(Nt);return kt[0]=Zt*Y-Yt*S+me[0],kt[1]=Zt*S+Yt*Y+me[1],kt}function rt(kt,ee){var me=kt[0],Nt=kt[1],Zt=ee[0],Yt=ee[1],S=Math.sqrt(me*me+Nt*Nt)*Math.sqrt(Zt*Zt+Yt*Yt),Y=S&&(me*Zt+Nt*Yt)/S;return Math.acos(Math.min(Math.max(Y,-1),1))}function bt(kt){return kt[0]=0,kt[1]=0,kt}function ye(kt){return"vec2("+kt[0]+", "+kt[1]+")"}function be(kt,ee){return kt[0]===ee[0]&&kt[1]===ee[1]}function Gt(kt,ee){var me=kt[0],Nt=kt[1],Zt=ee[0],Yt=ee[1];return Math.abs(me-Zt)<=glMatrix.EPSILON*Math.max(1,Math.abs(me),Math.abs(Zt))&&Math.abs(Nt-Yt)<=glMatrix.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(Yt))}var Kt=null,we=null,Bt=null,oe=null,ht=null,ut=null,Vt=null,ve=function(){var kt=F();return function(ee,me,Nt,Zt,Yt,S){var Y,At;for(me||(me=2),Nt||(Nt=0),Zt?At=Math.min(Zt*me+Nt,ee.length):At=ee.length,Y=Nt;Y<At;Y+=me)kt[0]=ee[Y],kt[1]=ee[Y+1],Yt(kt,kt,S),ee[Y]=kt[0],ee[Y+1]=kt[1];return ee}}()},33983:function(q,J,g){"use strict";g.d(J,{$X:function(){return T},AK:function(){return Ft},Fp:function(){return Rt},Fv:function(){return wt},IH:function(){return E},JG:function(){return O},Jp:function(){return _},TK:function(){return Vt},Ue:function(){return F},VC:function(){return Xt},VV:function(){return st},Zh:function(){return kt},al:function(){return k},bA:function(){return nt},d9:function(){return R},fF:function(){return yt},fS:function(){return Bt},kC:function(){return jt},kE:function(){return L},kK:function(){return te},lu:function(){return oe},t7:function(){return re},t8:function(){return b}});var m=g(49685);function F(){var Nt=new m.WT(3);return m.WT!=Float32Array&&(Nt[0]=0,Nt[1]=0,Nt[2]=0),Nt}function R(Nt){var Zt=new m.WT(3);return Zt[0]=Nt[0],Zt[1]=Nt[1],Zt[2]=Nt[2],Zt}function L(Nt){var Zt=Nt[0],Yt=Nt[1],S=Nt[2];return Math.hypot(Zt,Yt,S)}function k(Nt,Zt,Yt){var S=new m.WT(3);return S[0]=Nt,S[1]=Zt,S[2]=Yt,S}function O(Nt,Zt){return Nt[0]=Zt[0],Nt[1]=Zt[1],Nt[2]=Zt[2],Nt}function b(Nt,Zt,Yt,S){return Nt[0]=Zt,Nt[1]=Yt,Nt[2]=S,Nt}function E(Nt,Zt,Yt){return Nt[0]=Zt[0]+Yt[0],Nt[1]=Zt[1]+Yt[1],Nt[2]=Zt[2]+Yt[2],Nt}function T(Nt,Zt,Yt){return Nt[0]=Zt[0]-Yt[0],Nt[1]=Zt[1]-Yt[1],Nt[2]=Zt[2]-Yt[2],Nt}function _(Nt,Zt,Yt){return Nt[0]=Zt[0]*Yt[0],Nt[1]=Zt[1]*Yt[1],Nt[2]=Zt[2]*Yt[2],Nt}function P(Nt,Zt,Yt){return Nt[0]=Zt[0]/Yt[0],Nt[1]=Zt[1]/Yt[1],Nt[2]=Zt[2]/Yt[2],Nt}function B(Nt,Zt){return Nt[0]=Math.ceil(Zt[0]),Nt[1]=Math.ceil(Zt[1]),Nt[2]=Math.ceil(Zt[2]),Nt}function tt(Nt,Zt){return Nt[0]=Math.floor(Zt[0]),Nt[1]=Math.floor(Zt[1]),Nt[2]=Math.floor(Zt[2]),Nt}function st(Nt,Zt,Yt){return Nt[0]=Math.min(Zt[0],Yt[0]),Nt[1]=Math.min(Zt[1],Yt[1]),Nt[2]=Math.min(Zt[2],Yt[2]),Nt}function Rt(Nt,Zt,Yt){return Nt[0]=Math.max(Zt[0],Yt[0]),Nt[1]=Math.max(Zt[1],Yt[1]),Nt[2]=Math.max(Zt[2],Yt[2]),Nt}function xt(Nt,Zt){return Nt[0]=Math.round(Zt[0]),Nt[1]=Math.round(Zt[1]),Nt[2]=Math.round(Zt[2]),Nt}function nt(Nt,Zt,Yt){return Nt[0]=Zt[0]*Yt,Nt[1]=Zt[1]*Yt,Nt[2]=Zt[2]*Yt,Nt}function Et(Nt,Zt,Yt,S){return Nt[0]=Zt[0]+Yt[0]*S,Nt[1]=Zt[1]+Yt[1]*S,Nt[2]=Zt[2]+Yt[2]*S,Nt}function ot(Nt,Zt){var Yt=Zt[0]-Nt[0],S=Zt[1]-Nt[1],Y=Zt[2]-Nt[2];return Math.hypot(Yt,S,Y)}function Ct(Nt,Zt){var Yt=Zt[0]-Nt[0],S=Zt[1]-Nt[1],Y=Zt[2]-Nt[2];return Yt*Yt+S*S+Y*Y}function _t(Nt){var Zt=Nt[0],Yt=Nt[1],S=Nt[2];return Zt*Zt+Yt*Yt+S*S}function dt(Nt,Zt){return Nt[0]=-Zt[0],Nt[1]=-Zt[1],Nt[2]=-Zt[2],Nt}function Ot(Nt,Zt){return Nt[0]=1/Zt[0],Nt[1]=1/Zt[1],Nt[2]=1/Zt[2],Nt}function wt(Nt,Zt){var Yt=Zt[0],S=Zt[1],Y=Zt[2],At=Yt*Yt+S*S+Y*Y;return At>0&&(At=1/Math.sqrt(At)),Nt[0]=Zt[0]*At,Nt[1]=Zt[1]*At,Nt[2]=Zt[2]*At,Nt}function Ft(Nt,Zt){return Nt[0]*Zt[0]+Nt[1]*Zt[1]+Nt[2]*Zt[2]}function jt(Nt,Zt,Yt){var S=Zt[0],Y=Zt[1],At=Zt[2],ie=Yt[0],$t=Yt[1],Oe=Yt[2];return Nt[0]=Y*Oe-At*$t,Nt[1]=At*ie-S*Oe,Nt[2]=S*$t-Y*ie,Nt}function re(Nt,Zt,Yt,S){var Y=Zt[0],At=Zt[1],ie=Zt[2];return Nt[0]=Y+S*(Yt[0]-Y),Nt[1]=At+S*(Yt[1]-At),Nt[2]=ie+S*(Yt[2]-ie),Nt}function Ee(Nt,Zt,Yt,S,Y,At){var ie=At*At,$t=ie*(2*At-3)+1,Oe=ie*(At-2)+At,Ne=ie*(At-1),Le=ie*(3-2*At);return Nt[0]=Zt[0]*$t+Yt[0]*Oe+S[0]*Ne+Y[0]*Le,Nt[1]=Zt[1]*$t+Yt[1]*Oe+S[1]*Ne+Y[1]*Le,Nt[2]=Zt[2]*$t+Yt[2]*Oe+S[2]*Ne+Y[2]*Le,Nt}function et(Nt,Zt,Yt,S,Y,At){var ie=1-At,$t=ie*ie,Oe=At*At,Ne=$t*ie,Le=3*At*$t,at=3*Oe*ie,V=Oe*At;return Nt[0]=Zt[0]*Ne+Yt[0]*Le+S[0]*at+Y[0]*V,Nt[1]=Zt[1]*Ne+Yt[1]*Le+S[1]*at+Y[1]*V,Nt[2]=Zt[2]*Ne+Yt[2]*Le+S[2]*at+Y[2]*V,Nt}function ge(Nt,Zt){Zt=Zt||1;var Yt=glMatrix.RANDOM()*2*Math.PI,S=glMatrix.RANDOM()*2-1,Y=Math.sqrt(1-S*S)*Zt;return Nt[0]=Math.cos(Yt)*Y,Nt[1]=Math.sin(Yt)*Y,Nt[2]=S*Zt,Nt}function yt(Nt,Zt,Yt){var S=Zt[0],Y=Zt[1],At=Zt[2],ie=Yt[3]*S+Yt[7]*Y+Yt[11]*At+Yt[15];return ie=ie||1,Nt[0]=(Yt[0]*S+Yt[4]*Y+Yt[8]*At+Yt[12])/ie,Nt[1]=(Yt[1]*S+Yt[5]*Y+Yt[9]*At+Yt[13])/ie,Nt[2]=(Yt[2]*S+Yt[6]*Y+Yt[10]*At+Yt[14])/ie,Nt}function te(Nt,Zt,Yt){var S=Zt[0],Y=Zt[1],At=Zt[2];return Nt[0]=S*Yt[0]+Y*Yt[3]+At*Yt[6],Nt[1]=S*Yt[1]+Y*Yt[4]+At*Yt[7],Nt[2]=S*Yt[2]+Y*Yt[5]+At*Yt[8],Nt}function Xt(Nt,Zt,Yt){var S=Yt[0],Y=Yt[1],At=Yt[2],ie=Yt[3],$t=Zt[0],Oe=Zt[1],Ne=Zt[2],Le=Y*Ne-At*Oe,at=At*$t-S*Ne,V=S*Oe-Y*$t,St=Y*V-At*at,Pt=At*Le-S*V,pt=S*at-Y*Le,mt=ie*2;return Le*=mt,at*=mt,V*=mt,St*=2,Pt*=2,pt*=2,Nt[0]=$t+Le+St,Nt[1]=Oe+at+Pt,Nt[2]=Ne+V+pt,Nt}function rt(Nt,Zt,Yt,S){var Y=[],At=[];return Y[0]=Zt[0]-Yt[0],Y[1]=Zt[1]-Yt[1],Y[2]=Zt[2]-Yt[2],At[0]=Y[0],At[1]=Y[1]*Math.cos(S)-Y[2]*Math.sin(S),At[2]=Y[1]*Math.sin(S)+Y[2]*Math.cos(S),Nt[0]=At[0]+Yt[0],Nt[1]=At[1]+Yt[1],Nt[2]=At[2]+Yt[2],Nt}function bt(Nt,Zt,Yt,S){var Y=[],At=[];return Y[0]=Zt[0]-Yt[0],Y[1]=Zt[1]-Yt[1],Y[2]=Zt[2]-Yt[2],At[0]=Y[2]*Math.sin(S)+Y[0]*Math.cos(S),At[1]=Y[1],At[2]=Y[2]*Math.cos(S)-Y[0]*Math.sin(S),Nt[0]=At[0]+Yt[0],Nt[1]=At[1]+Yt[1],Nt[2]=At[2]+Yt[2],Nt}function ye(Nt,Zt,Yt,S){var Y=[],At=[];return Y[0]=Zt[0]-Yt[0],Y[1]=Zt[1]-Yt[1],Y[2]=Zt[2]-Yt[2],At[0]=Y[0]*Math.cos(S)-Y[1]*Math.sin(S),At[1]=Y[0]*Math.sin(S)+Y[1]*Math.cos(S),At[2]=Y[2],Nt[0]=At[0]+Yt[0],Nt[1]=At[1]+Yt[1],Nt[2]=At[2]+Yt[2],Nt}function be(Nt,Zt){var Yt=Nt[0],S=Nt[1],Y=Nt[2],At=Zt[0],ie=Zt[1],$t=Zt[2],Oe=Math.sqrt(Yt*Yt+S*S+Y*Y),Ne=Math.sqrt(At*At+ie*ie+$t*$t),Le=Oe*Ne,at=Le&&Ft(Nt,Zt)/Le;return Math.acos(Math.min(Math.max(at,-1),1))}function Gt(Nt){return Nt[0]=0,Nt[1]=0,Nt[2]=0,Nt}function Kt(Nt){return"vec3("+Nt[0]+", "+Nt[1]+", "+Nt[2]+")"}function we(Nt,Zt){return Nt[0]===Zt[0]&&Nt[1]===Zt[1]&&Nt[2]===Zt[2]}function Bt(Nt,Zt){var Yt=Nt[0],S=Nt[1],Y=Nt[2],At=Zt[0],ie=Zt[1],$t=Zt[2];return Math.abs(Yt-At)<=m.Ib*Math.max(1,Math.abs(Yt),Math.abs(At))&&Math.abs(S-ie)<=m.Ib*Math.max(1,Math.abs(S),Math.abs(ie))&&Math.abs(Y-$t)<=m.Ib*Math.max(1,Math.abs(Y),Math.abs($t))}var oe=T,ht=null,ut=null,Vt=ot,ve=null,kt=L,ee=null,me=function(){var Nt=F();return function(Zt,Yt,S,Y,At,ie){var $t,Oe;for(Yt||(Yt=3),S||(S=0),Y?Oe=Math.min(Y*Yt+S,Zt.length):Oe=Zt.length,$t=S;$t<Oe;$t+=Yt)Nt[0]=Zt[$t],Nt[1]=Zt[$t+1],Nt[2]=Zt[$t+2],At(Nt,Nt,ie),Zt[$t]=Nt[0],Zt[$t+1]=Nt[1],Zt[$t+2]=Nt[2];return Zt}}()},98333:function(q,J,g){"use strict";g.d(J,{AK:function(){return Ft},Fv:function(){return wt},I6:function(){return Xt},IH:function(){return b},JG:function(){return k},Ue:function(){return F},al:function(){return L},bA:function(){return xt},d9:function(){return R},fF:function(){return et},fS:function(){return rt},kE:function(){return Ct},t7:function(){return re},t8:function(){return O},we:function(){return _t}});var m=g(49685);function F(){var ht=new m.WT(4);return m.WT!=Float32Array&&(ht[0]=0,ht[1]=0,ht[2]=0,ht[3]=0),ht}function R(ht){var ut=new m.WT(4);return ut[0]=ht[0],ut[1]=ht[1],ut[2]=ht[2],ut[3]=ht[3],ut}function L(ht,ut,Vt,ve){var kt=new m.WT(4);return kt[0]=ht,kt[1]=ut,kt[2]=Vt,kt[3]=ve,kt}function k(ht,ut){return ht[0]=ut[0],ht[1]=ut[1],ht[2]=ut[2],ht[3]=ut[3],ht}function O(ht,ut,Vt,ve,kt){return ht[0]=ut,ht[1]=Vt,ht[2]=ve,ht[3]=kt,ht}function b(ht,ut,Vt){return ht[0]=ut[0]+Vt[0],ht[1]=ut[1]+Vt[1],ht[2]=ut[2]+Vt[2],ht[3]=ut[3]+Vt[3],ht}function E(ht,ut,Vt){return ht[0]=ut[0]-Vt[0],ht[1]=ut[1]-Vt[1],ht[2]=ut[2]-Vt[2],ht[3]=ut[3]-Vt[3],ht}function T(ht,ut,Vt){return ht[0]=ut[0]*Vt[0],ht[1]=ut[1]*Vt[1],ht[2]=ut[2]*Vt[2],ht[3]=ut[3]*Vt[3],ht}function _(ht,ut,Vt){return ht[0]=ut[0]/Vt[0],ht[1]=ut[1]/Vt[1],ht[2]=ut[2]/Vt[2],ht[3]=ut[3]/Vt[3],ht}function P(ht,ut){return ht[0]=Math.ceil(ut[0]),ht[1]=Math.ceil(ut[1]),ht[2]=Math.ceil(ut[2]),ht[3]=Math.ceil(ut[3]),ht}function B(ht,ut){return ht[0]=Math.floor(ut[0]),ht[1]=Math.floor(ut[1]),ht[2]=Math.floor(ut[2]),ht[3]=Math.floor(ut[3]),ht}function tt(ht,ut,Vt){return ht[0]=Math.min(ut[0],Vt[0]),ht[1]=Math.min(ut[1],Vt[1]),ht[2]=Math.min(ut[2],Vt[2]),ht[3]=Math.min(ut[3],Vt[3]),ht}function st(ht,ut,Vt){return ht[0]=Math.max(ut[0],Vt[0]),ht[1]=Math.max(ut[1],Vt[1]),ht[2]=Math.max(ut[2],Vt[2]),ht[3]=Math.max(ut[3],Vt[3]),ht}function Rt(ht,ut){return ht[0]=Math.round(ut[0]),ht[1]=Math.round(ut[1]),ht[2]=Math.round(ut[2]),ht[3]=Math.round(ut[3]),ht}function xt(ht,ut,Vt){return ht[0]=ut[0]*Vt,ht[1]=ut[1]*Vt,ht[2]=ut[2]*Vt,ht[3]=ut[3]*Vt,ht}function nt(ht,ut,Vt,ve){return ht[0]=ut[0]+Vt[0]*ve,ht[1]=ut[1]+Vt[1]*ve,ht[2]=ut[2]+Vt[2]*ve,ht[3]=ut[3]+Vt[3]*ve,ht}function Et(ht,ut){var Vt=ut[0]-ht[0],ve=ut[1]-ht[1],kt=ut[2]-ht[2],ee=ut[3]-ht[3];return Math.hypot(Vt,ve,kt,ee)}function ot(ht,ut){var Vt=ut[0]-ht[0],ve=ut[1]-ht[1],kt=ut[2]-ht[2],ee=ut[3]-ht[3];return Vt*Vt+ve*ve+kt*kt+ee*ee}function Ct(ht){var ut=ht[0],Vt=ht[1],ve=ht[2],kt=ht[3];return Math.hypot(ut,Vt,ve,kt)}function _t(ht){var ut=ht[0],Vt=ht[1],ve=ht[2],kt=ht[3];return ut*ut+Vt*Vt+ve*ve+kt*kt}function dt(ht,ut){return ht[0]=-ut[0],ht[1]=-ut[1],ht[2]=-ut[2],ht[3]=-ut[3],ht}function Ot(ht,ut){return ht[0]=1/ut[0],ht[1]=1/ut[1],ht[2]=1/ut[2],ht[3]=1/ut[3],ht}function wt(ht,ut){var Vt=ut[0],ve=ut[1],kt=ut[2],ee=ut[3],me=Vt*Vt+ve*ve+kt*kt+ee*ee;return me>0&&(me=1/Math.sqrt(me)),ht[0]=Vt*me,ht[1]=ve*me,ht[2]=kt*me,ht[3]=ee*me,ht}function Ft(ht,ut){return ht[0]*ut[0]+ht[1]*ut[1]+ht[2]*ut[2]+ht[3]*ut[3]}function jt(ht,ut,Vt,ve){var kt=Vt[0]*ve[1]-Vt[1]*ve[0],ee=Vt[0]*ve[2]-Vt[2]*ve[0],me=Vt[0]*ve[3]-Vt[3]*ve[0],Nt=Vt[1]*ve[2]-Vt[2]*ve[1],Zt=Vt[1]*ve[3]-Vt[3]*ve[1],Yt=Vt[2]*ve[3]-Vt[3]*ve[2],S=ut[0],Y=ut[1],At=ut[2],ie=ut[3];return ht[0]=Y*Yt-At*Zt+ie*Nt,ht[1]=-(S*Yt)+At*me-ie*ee,ht[2]=S*Zt-Y*me+ie*kt,ht[3]=-(S*Nt)+Y*ee-At*kt,ht}function re(ht,ut,Vt,ve){var kt=ut[0],ee=ut[1],me=ut[2],Nt=ut[3];return ht[0]=kt+ve*(Vt[0]-kt),ht[1]=ee+ve*(Vt[1]-ee),ht[2]=me+ve*(Vt[2]-me),ht[3]=Nt+ve*(Vt[3]-Nt),ht}function Ee(ht,ut){ut=ut||1;var Vt,ve,kt,ee,me,Nt;do Vt=glMatrix.RANDOM()*2-1,ve=glMatrix.RANDOM()*2-1,me=Vt*Vt+ve*ve;while(me>=1);do kt=glMatrix.RANDOM()*2-1,ee=glMatrix.RANDOM()*2-1,Nt=kt*kt+ee*ee;while(Nt>=1);var Zt=Math.sqrt((1-me)/Nt);return ht[0]=ut*Vt,ht[1]=ut*ve,ht[2]=ut*kt*Zt,ht[3]=ut*ee*Zt,ht}function et(ht,ut,Vt){var ve=ut[0],kt=ut[1],ee=ut[2],me=ut[3];return ht[0]=Vt[0]*ve+Vt[4]*kt+Vt[8]*ee+Vt[12]*me,ht[1]=Vt[1]*ve+Vt[5]*kt+Vt[9]*ee+Vt[13]*me,ht[2]=Vt[2]*ve+Vt[6]*kt+Vt[10]*ee+Vt[14]*me,ht[3]=Vt[3]*ve+Vt[7]*kt+Vt[11]*ee+Vt[15]*me,ht}function ge(ht,ut,Vt){var ve=ut[0],kt=ut[1],ee=ut[2],me=Vt[0],Nt=Vt[1],Zt=Vt[2],Yt=Vt[3],S=Yt*ve+Nt*ee-Zt*kt,Y=Yt*kt+Zt*ve-me*ee,At=Yt*ee+me*kt-Nt*ve,ie=-me*ve-Nt*kt-Zt*ee;return ht[0]=S*Yt+ie*-me+Y*-Zt-At*-Nt,ht[1]=Y*Yt+ie*-Nt+At*-me-S*-Zt,ht[2]=At*Yt+ie*-Zt+S*-Nt-Y*-me,ht[3]=ut[3],ht}function yt(ht){return ht[0]=0,ht[1]=0,ht[2]=0,ht[3]=0,ht}function te(ht){return"vec4("+ht[0]+", "+ht[1]+", "+ht[2]+", "+ht[3]+")"}function Xt(ht,ut){return ht[0]===ut[0]&&ht[1]===ut[1]&&ht[2]===ut[2]&&ht[3]===ut[3]}function rt(ht,ut){var Vt=ht[0],ve=ht[1],kt=ht[2],ee=ht[3],me=ut[0],Nt=ut[1],Zt=ut[2],Yt=ut[3];return Math.abs(Vt-me)<=m.Ib*Math.max(1,Math.abs(Vt),Math.abs(me))&&Math.abs(ve-Nt)<=m.Ib*Math.max(1,Math.abs(ve),Math.abs(Nt))&&Math.abs(kt-Zt)<=m.Ib*Math.max(1,Math.abs(kt),Math.abs(Zt))&&Math.abs(ee-Yt)<=m.Ib*Math.max(1,Math.abs(ee),Math.abs(Yt))}var bt=null,ye=null,be=null,Gt=null,Kt=null,we=null,Bt=null,oe=function(){var ht=F();return function(ut,Vt,ve,kt,ee,me){var Nt,Zt;for(Vt||(Vt=4),ve||(ve=0),kt?Zt=Math.min(kt*Vt+ve,ut.length):Zt=ut.length,Nt=ve;Nt<Zt;Nt+=Vt)ht[0]=ut[Nt],ht[1]=ut[Nt+1],ht[2]=ut[Nt+2],ht[3]=ut[Nt+3],ee(ht,ht,me),ut[Nt]=ht[0],ut[Nt+1]=ht[1],ut[Nt+2]=ht[2],ut[Nt+3]=ht[3];return ut}}()},28282:function(q,J,g){var m=g(82354);q.exports={Graph:m.Graph,json:g(28974),alg:g(12440),version:m.version}},2842:function(q,J,g){var m=g(89126);q.exports=F;function F(R){var L={},k=[],O;function b(E){m.has(L,E)||(L[E]=!0,O.push(E),m.each(R.successors(E),b),m.each(R.predecessors(E),b))}return m.each(R.nodes(),function(E){O=[],b(E),O.length&&k.push(O)}),k}},53984:function(q,J,g){var m=g(89126);q.exports=F;function F(L,k,O){m.isArray(k)||(k=[k]);var b=(L.isDirected()?L.successors:L.neighbors).bind(L),E=[],T={};return m.each(k,function(_){if(!L.hasNode(_))throw new Error("Graph does not have node: "+_);R(L,_,O==="post",T,b,E)}),E}function R(L,k,O,b,E,T){m.has(b,k)||(b[k]=!0,O||T.push(k),m.each(E(k),function(_){R(L,_,O,b,E,T)}),O&&T.push(k))}},84847:function(q,J,g){var m=g(63763),F=g(89126);q.exports=R;function R(L,k,O){return F.transform(L.nodes(),function(b,E){b[E]=m(L,E,k,O)},{})}},63763:function(q,J,g){var m=g(89126),F=g(75639);q.exports=L;var R=m.constant(1);function L(O,b,E,T){return k(O,String(b),E||R,T||function(_){return O.outEdges(_)})}function k(O,b,E,T){var _={},P=new F,B,tt,st=function(Rt){var xt=Rt.v!==B?Rt.v:Rt.w,nt=_[xt],Et=E(Rt),ot=tt.distance+Et;if(Et<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Rt+" Weight: "+Et);ot<nt.distance&&(nt.distance=ot,nt.predecessor=B,P.decrease(xt,ot))};for(O.nodes().forEach(function(Rt){var xt=Rt===b?0:Number.POSITIVE_INFINITY;_[Rt]={distance:xt},P.add(Rt,xt)});P.size()>0&&(B=P.removeMin(),tt=_[B],tt.distance!==Number.POSITIVE_INFINITY);)T(B).forEach(st);return _}},9096:function(q,J,g){var m=g(89126),F=g(5023);q.exports=R;function R(L){return m.filter(F(L),function(k){return k.length>1||k.length===1&&L.hasEdge(k[0],k[0])})}},38924:function(q,J,g){var m=g(89126);q.exports=R;var F=m.constant(1);function R(k,O,b){return L(k,O||F,b||function(E){return k.outEdges(E)})}function L(k,O,b){var E={},T=k.nodes();return T.forEach(function(_){E[_]={},E[_][_]={distance:0},T.forEach(function(P){_!==P&&(E[_][P]={distance:Number.POSITIVE_INFINITY})}),b(_).forEach(function(P){var B=P.v===_?P.w:P.v,tt=O(P);E[_][B]={distance:tt,predecessor:_}})}),T.forEach(function(_){var P=E[_];T.forEach(function(B){var tt=E[B];T.forEach(function(st){var Rt=tt[_],xt=P[st],nt=tt[st],Et=Rt.distance+xt.distance;Et<nt.distance&&(nt.distance=Et,nt.predecessor=xt.predecessor)})})}),E}},12440:function(q,J,g){q.exports={components:g(2842),dijkstra:g(63763),dijkstraAll:g(84847),findCycles:g(9096),floydWarshall:g(38924),isAcyclic:g(62707),postorder:g(58828),preorder:g(92648),prim:g(80514),tarjan:g(5023),topsort:g(2166)}},62707:function(q,J,g){var m=g(2166);q.exports=F;function F(R){try{m(R)}catch(L){if(L instanceof m.CycleException)return!1;throw L}return!0}},58828:function(q,J,g){var m=g(53984);q.exports=F;function F(R,L){return m(R,L,"post")}},92648:function(q,J,g){var m=g(53984);q.exports=F;function F(R,L){return m(R,L,"pre")}},80514:function(q,J,g){var m=g(89126),F=g(30771),R=g(75639);q.exports=L;function L(k,O){var b=new F,E={},T=new R,_;function P(tt){var st=tt.v===_?tt.w:tt.v,Rt=T.priority(st);if(Rt!==void 0){var xt=O(tt);xt<Rt&&(E[st]=_,T.decrease(st,xt))}}if(k.nodeCount()===0)return b;m.each(k.nodes(),function(tt){T.add(tt,Number.POSITIVE_INFINITY),b.setNode(tt)}),T.decrease(k.nodes()[0],0);for(var B=!1;T.size()>0;){if(_=T.removeMin(),m.has(E,_))b.setEdge(_,E[_]);else{if(B)throw new Error("Input graph is not connected: "+k);B=!0}k.nodeEdges(_).forEach(P)}return b}},5023:function(q,J,g){var m=g(89126);q.exports=F;function F(R){var L=0,k=[],O={},b=[];function E(T){var _=O[T]={onStack:!0,lowlink:L,index:L++};if(k.push(T),R.successors(T).forEach(function(tt){m.has(O,tt)?O[tt].onStack&&(_.lowlink=Math.min(_.lowlink,O[tt].index)):(E(tt),_.lowlink=Math.min(_.lowlink,O[tt].lowlink))}),_.lowlink===_.index){var P=[],B;do B=k.pop(),O[B].onStack=!1,P.push(B);while(T!==B);b.push(P)}}return R.nodes().forEach(function(T){m.has(O,T)||E(T)}),b}},2166:function(q,J,g){var m=g(89126);q.exports=F,F.CycleException=R;function F(L){var k={},O={},b=[];function E(T){if(m.has(O,T))throw new R;m.has(k,T)||(O[T]=!0,k[T]=!0,m.each(L.predecessors(T),E),delete O[T],b.push(T))}if(m.each(L.sinks(),E),m.size(k)!==L.nodeCount())throw new R;return b}function R(){}R.prototype=new Error},75639:function(q,J,g){var m=g(89126);q.exports=F;function F(){this._arr=[],this._keyIndices={}}F.prototype.size=function(){return this._arr.length},F.prototype.keys=function(){return this._arr.map(function(R){return R.key})},F.prototype.has=function(R){return m.has(this._keyIndices,R)},F.prototype.priority=function(R){var L=this._keyIndices[R];if(L!==void 0)return this._arr[L].priority},F.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},F.prototype.add=function(R,L){var k=this._keyIndices;if(R=String(R),!m.has(k,R)){var O=this._arr,b=O.length;return k[R]=b,O.push({key:R,priority:L}),this._decrease(b),!0}return!1},F.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var R=this._arr.pop();return delete this._keyIndices[R.key],this._heapify(0),R.key},F.prototype.decrease=function(R,L){var k=this._keyIndices[R];if(L>this._arr[k].priority)throw new Error("New priority is greater than current priority. Key: "+R+" Old: "+this._arr[k].priority+" New: "+L);this._arr[k].priority=L,this._decrease(k)},F.prototype._heapify=function(R){var L=this._arr,k=2*R,O=k+1,b=R;k<L.length&&(b=L[k].priority<L[b].priority?k:b,O<L.length&&(b=L[O].priority<L[b].priority?O:b),b!==R&&(this._swap(R,b),this._heapify(b)))},F.prototype._decrease=function(R){for(var L=this._arr,k=L[R].priority,O;R!==0&&(O=R>>1,!(L[O].priority<k));)this._swap(R,O),R=O},F.prototype._swap=function(R,L){var k=this._arr,O=this._keyIndices,b=k[R],E=k[L];k[R]=E,k[L]=b,O[E.key]=R,O[b.key]=L}},30771:function(q,J,g){"use strict";var m=g(89126);q.exports=k;var F="\0",R="\0",L="";function k(P){this._isDirected=m.has(P,"directed")?P.directed:!0,this._isMultigraph=m.has(P,"multigraph")?P.multigraph:!1,this._isCompound=m.has(P,"compound")?P.compound:!1,this._label=void 0,this._defaultNodeLabelFn=m.constant(void 0),this._defaultEdgeLabelFn=m.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[R]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}k.prototype._nodeCount=0,k.prototype._edgeCount=0,k.prototype.isDirected=function(){return this._isDirected},k.prototype.isMultigraph=function(){return this._isMultigraph},k.prototype.isCompound=function(){return this._isCompound},k.prototype.setGraph=function(P){return this._label=P,this},k.prototype.graph=function(){return this._label},k.prototype.setDefaultNodeLabel=function(P){return m.isFunction(P)||(P=m.constant(P)),this._defaultNodeLabelFn=P,this},k.prototype.nodeCount=function(){return this._nodeCount},k.prototype.nodes=function(){return m.keys(this._nodes)},k.prototype.sources=function(){var P=this;return m.filter(this.nodes(),function(B){return m.isEmpty(P._in[B])})},k.prototype.sinks=function(){var P=this;return m.filter(this.nodes(),function(B){return m.isEmpty(P._out[B])})},k.prototype.setNodes=function(P,B){var tt=arguments,st=this;return m.each(P,function(Rt){tt.length>1?st.setNode(Rt,B):st.setNode(Rt)}),this},k.prototype.setNode=function(P,B){return m.has(this._nodes,P)?(arguments.length>1&&(this._nodes[P]=B),this):(this._nodes[P]=arguments.length>1?B:this._defaultNodeLabelFn(P),this._isCompound&&(this._parent[P]=R,this._children[P]={},this._children[R][P]=!0),this._in[P]={},this._preds[P]={},this._out[P]={},this._sucs[P]={},++this._nodeCount,this)},k.prototype.node=function(P){return this._nodes[P]},k.prototype.hasNode=function(P){return m.has(this._nodes,P)},k.prototype.removeNode=function(P){var B=this;if(m.has(this._nodes,P)){var tt=function(st){B.removeEdge(B._edgeObjs[st])};delete this._nodes[P],this._isCompound&&(this._removeFromParentsChildList(P),delete this._parent[P],m.each(this.children(P),function(st){B.setParent(st)}),delete this._children[P]),m.each(m.keys(this._in[P]),tt),delete this._in[P],delete this._preds[P],m.each(m.keys(this._out[P]),tt),delete this._out[P],delete this._sucs[P],--this._nodeCount}return this},k.prototype.setParent=function(P,B){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(m.isUndefined(B))B=R;else{B+="";for(var tt=B;!m.isUndefined(tt);tt=this.parent(tt))if(tt===P)throw new Error("Setting "+B+" as parent of "+P+" would create a cycle");this.setNode(B)}return this.setNode(P),this._removeFromParentsChildList(P),this._parent[P]=B,this._children[B][P]=!0,this},k.prototype._removeFromParentsChildList=function(P){delete this._children[this._parent[P]][P]},k.prototype.parent=function(P){if(this._isCompound){var B=this._parent[P];if(B!==R)return B}},k.prototype.children=function(P){if(m.isUndefined(P)&&(P=R),this._isCompound){var B=this._children[P];if(B)return m.keys(B)}else{if(P===R)return this.nodes();if(this.hasNode(P))return[]}},k.prototype.predecessors=function(P){var B=this._preds[P];if(B)return m.keys(B)},k.prototype.successors=function(P){var B=this._sucs[P];if(B)return m.keys(B)},k.prototype.neighbors=function(P){var B=this.predecessors(P);if(B)return m.union(B,this.successors(P))},k.prototype.isLeaf=function(P){var B;return this.isDirected()?B=this.successors(P):B=this.neighbors(P),B.length===0},k.prototype.filterNodes=function(P){var B=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});B.setGraph(this.graph());var tt=this;m.each(this._nodes,function(xt,nt){P(nt)&&B.setNode(nt,xt)}),m.each(this._edgeObjs,function(xt){B.hasNode(xt.v)&&B.hasNode(xt.w)&&B.setEdge(xt,tt.edge(xt))});var st={};function Rt(xt){var nt=tt.parent(xt);return nt===void 0||B.hasNode(nt)?(st[xt]=nt,nt):nt in st?st[nt]:Rt(nt)}return this._isCompound&&m.each(B.nodes(),function(xt){B.setParent(xt,Rt(xt))}),B},k.prototype.setDefaultEdgeLabel=function(P){return m.isFunction(P)||(P=m.constant(P)),this._defaultEdgeLabelFn=P,this},k.prototype.edgeCount=function(){return this._edgeCount},k.prototype.edges=function(){return m.values(this._edgeObjs)},k.prototype.setPath=function(P,B){var tt=this,st=arguments;return m.reduce(P,function(Rt,xt){return st.length>1?tt.setEdge(Rt,xt,B):tt.setEdge(Rt,xt),xt}),this},k.prototype.setEdge=function(){var P,B,tt,st,Rt=!1,xt=arguments[0];typeof xt=="object"&&xt!==null&&"v"in xt?(P=xt.v,B=xt.w,tt=xt.name,arguments.length===2&&(st=arguments[1],Rt=!0)):(P=xt,B=arguments[1],tt=arguments[3],arguments.length>2&&(st=arguments[2],Rt=!0)),P=""+P,B=""+B,m.isUndefined(tt)||(tt=""+tt);var nt=E(this._isDirected,P,B,tt);if(m.has(this._edgeLabels,nt))return Rt&&(this._edgeLabels[nt]=st),this;if(!m.isUndefined(tt)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(P),this.setNode(B),this._edgeLabels[nt]=Rt?st:this._defaultEdgeLabelFn(P,B,tt);var Et=T(this._isDirected,P,B,tt);return P=Et.v,B=Et.w,Object.freeze(Et),this._edgeObjs[nt]=Et,O(this._preds[B],P),O(this._sucs[P],B),this._in[B][nt]=Et,this._out[P][nt]=Et,this._edgeCount++,this},k.prototype.edge=function(P,B,tt){var st=arguments.length===1?_(this._isDirected,arguments[0]):E(this._isDirected,P,B,tt);return this._edgeLabels[st]},k.prototype.hasEdge=function(P,B,tt){var st=arguments.length===1?_(this._isDirected,arguments[0]):E(this._isDirected,P,B,tt);return m.has(this._edgeLabels,st)},k.prototype.removeEdge=function(P,B,tt){var st=arguments.length===1?_(this._isDirected,arguments[0]):E(this._isDirected,P,B,tt),Rt=this._edgeObjs[st];return Rt&&(P=Rt.v,B=Rt.w,delete this._edgeLabels[st],delete this._edgeObjs[st],b(this._preds[B],P),b(this._sucs[P],B),delete this._in[B][st],delete this._out[P][st],this._edgeCount--),this},k.prototype.inEdges=function(P,B){var tt=this._in[P];if(tt){var st=m.values(tt);return B?m.filter(st,function(Rt){return Rt.v===B}):st}},k.prototype.outEdges=function(P,B){var tt=this._out[P];if(tt){var st=m.values(tt);return B?m.filter(st,function(Rt){return Rt.w===B}):st}},k.prototype.nodeEdges=function(P,B){var tt=this.inEdges(P,B);if(tt)return tt.concat(this.outEdges(P,B))};function O(P,B){P[B]?P[B]++:P[B]=1}function b(P,B){--P[B]||delete P[B]}function E(P,B,tt,st){var Rt=""+B,xt=""+tt;if(!P&&Rt>xt){var nt=Rt;Rt=xt,xt=nt}return Rt+L+xt+L+(m.isUndefined(st)?F:st)}function T(P,B,tt,st){var Rt=""+B,xt=""+tt;if(!P&&Rt>xt){var nt=Rt;Rt=xt,xt=nt}var Et={v:Rt,w:xt};return st&&(Et.name=st),Et}function _(P,B){return E(P,B.v,B.w,B.name)}},82354:function(q,J,g){q.exports={Graph:g(30771),version:g(49631)}},28974:function(q,J,g){var m=g(89126),F=g(30771);q.exports={write:R,read:O};function R(b){var E={options:{directed:b.isDirected(),multigraph:b.isMultigraph(),compound:b.isCompound()},nodes:L(b),edges:k(b)};return m.isUndefined(b.graph())||(E.value=m.clone(b.graph())),E}function L(b){return m.map(b.nodes(),function(E){var T=b.node(E),_=b.parent(E),P={v:E};return m.isUndefined(T)||(P.value=T),m.isUndefined(_)||(P.parent=_),P})}function k(b){return m.map(b.edges(),function(E){var T=b.edge(E),_={v:E.v,w:E.w};return m.isUndefined(E.name)||(_.name=E.name),m.isUndefined(T)||(_.value=T),_})}function O(b){var E=new F(b.options).setGraph(b.value);return m.each(b.nodes,function(T){E.setNode(T.v,T.value),T.parent&&E.setParent(T.v,T.parent)}),m.each(b.edges,function(T){E.setEdge({v:T.v,w:T.w,name:T.name},T.value)}),E}},89126:function(q,J,g){var m;try{m={clone:g(66678),constant:g(75703),each:g(85768),filter:g(63105),has:g(18721),isArray:g(1469),isEmpty:g(58367),isFunction:g(23560),isUndefined:g(52353),keys:g(3674),map:g(35161),reduce:g(54061),size:g(84238),transform:g(68718),union:g(93386),values:g(52628)}}catch(F){}m||(m=window._),q.exports=m},49631:function(q){q.exports="2.1.8"},80817:function(q){function J(R,L,k){return(L[0]-R[0])*(k[1]-R[1])-(L[1]-R[1])*(k[0]-R[0])}function g(R){const L=[];for(let k=0;k<R.length;k++){for(;L.length>=2&&J(L[L.length-2],L[L.length-1],R[k])<=0;)L.pop();L.push(R[k])}return L.pop(),L}function m(R){const L=R.reverse(),k=[];for(let O=0;O<L.length;O++){for(;k.length>=2&&J(k[k.length-2],k[k.length-1],L[O])<=0;)k.pop();k.push(L[O])}return k.pop(),k}function F(R){const L=g(R),O=m(R).concat(L);return O.push(R[0]),O}q.exports=F},63652:function(q){q.exports={toXy:function(J,g){return g===void 0?J.slice():J.map(function(m){return new Function("pt","return [pt"+g[0]+",pt"+g[1]+"];")(m)})},fromXy:function(J,g){return g===void 0?J.slice():J.map(function(m){return new Function("pt","const o = {}; o"+g[0]+"= pt[0]; o"+g[1]+"= pt[1]; return o;")(m)})}}},58867:function(q){function J(m,F){this._cells=[],this._cellSize=F,this._reverseCellSize=1/F;for(let R=0;R<m.length;R++){const L=m[R],k=this.coordToCellNum(L[0]),O=this.coordToCellNum(L[1]);if(this._cells[k])this._cells[k][O]?this._cells[k][O].push(L):this._cells[k][O]=[L];else{const b=[];b[O]=[L],this._cells[k]=b}}}J.prototype={cellPoints:function(m,F){return this._cells[m]!==void 0&&this._cells[m][F]!==void 0?this._cells[m][F]:[]},rangePoints:function(m){const F=this.coordToCellNum(m[0]),R=this.coordToCellNum(m[1]),L=this.coordToCellNum(m[2]),k=this.coordToCellNum(m[3]),O=[];for(let b=F;b<=L;b++)for(let E=R;E<=k;E++)for(let T=0;T<this.cellPoints(b,E).length;T++)O.push(this.cellPoints(b,E)[T]);return O},removePoint:function(m){const F=this.coordToCellNum(m[0]),R=this.coordToCellNum(m[1]),L=this._cells[F][R];let k;for(let O=0;O<L.length;O++)if(L[O][0]===m[0]&&L[O][1]===m[1]){k=O;break}return L.splice(k,1),L},trunc:Math.trunc||function(m){return m-m%1},coordToCellNum:function(m){return this.trunc(m*this._reverseCellSize)},extendBbox:function(m,F){return[m[0]-F*this._cellSize,m[1]-F*this._cellSize,m[2]+F*this._cellSize,m[3]+F*this._cellSize]}};function g(m,F){return new J(m,F)}q.exports=g},1344:function(q,J,g){"use strict";const m=g(77444),F=g(58867),R=g(63652),L=g(80817);function k(nt){const Et=[nt[0]];let ot=nt[0];for(let Ct=1;Ct<nt.length;Ct++){const _t=nt[Ct];(ot[0]!==_t[0]||ot[1]!==_t[1])&&Et.push(_t),ot=_t}return Et}function O(nt){return nt.sort(function(Et,ot){return Et[0]-ot[0]||Et[1]-ot[1]})}function b(nt,Et){return Math.pow(Et[0]-nt[0],2)+Math.pow(Et[1]-nt[1],2)}function E(nt,Et,ot){const Ct=[Et[0]-nt[0],Et[1]-nt[1]],_t=[ot[0]-nt[0],ot[1]-nt[1]],dt=b(nt,Et),Ot=b(nt,ot);return(Ct[0]*_t[0]+Ct[1]*_t[1])/Math.sqrt(dt*Ot)}function T(nt,Et){for(let ot=0;ot<Et.length-1;ot++){const Ct=[Et[ot],Et[ot+1]];if(!(nt[0][0]===Ct[0][0]&&nt[0][1]===Ct[0][1]||nt[0][0]===Ct[1][0]&&nt[0][1]===Ct[1][1])&&m(nt,Ct))return!0}return!1}function _(nt){let Et=1/0,ot=1/0,Ct=-1/0,_t=-1/0;for(let dt=nt.length-1;dt>=0;dt--)nt[dt][0]<Et&&(Et=nt[dt][0]),nt[dt][1]<ot&&(ot=nt[dt][1]),nt[dt][0]>Ct&&(Ct=nt[dt][0]),nt[dt][1]>_t&&(_t=nt[dt][1]);return[Ct-Et,_t-ot]}function P(nt){return[Math.min(nt[0][0],nt[1][0]),Math.min(nt[0][1],nt[1][1]),Math.max(nt[0][0],nt[1][0]),Math.max(nt[0][1],nt[1][1])]}function B(nt,Et,ot){let Ct=null,_t=Rt,dt=Rt,Ot,wt;for(let Ft=0;Ft<Et.length;Ft++)Ot=E(nt[0],nt[1],Et[Ft]),wt=E(nt[1],nt[0],Et[Ft]),Ot>_t&&wt>dt&&!T([nt[0],Et[Ft]],ot)&&!T([nt[1],Et[Ft]],ot)&&(_t=Ot,dt=wt,Ct=Et[Ft]);return Ct}function tt(nt,Et,ot,Ct,_t){let dt=!1;for(let Ot=0;Ot<nt.length-1;Ot++){const wt=[nt[Ot],nt[Ot+1]],Ft=wt[0][0]+","+wt[0][1]+","+wt[1][0]+","+wt[1][1];if(b(wt[0],wt[1])<Et||_t.has(Ft))continue;let jt=0,re=P(wt),Ee,et,ge;do re=Ct.extendBbox(re,jt),Ee=re[2]-re[0],et=re[3]-re[1],ge=B(wt,Ct.rangePoints(re),nt),jt++;while(ge===null&&(ot[0]>Ee||ot[1]>et));Ee>=ot[0]&&et>=ot[1]&&_t.add(Ft),ge!==null&&(nt.splice(Ot+1,0,ge),Ct.removePoint(ge),dt=!0)}return dt?tt(nt,Et,ot,Ct,_t):nt}function st(nt,Et,ot){let Ct=Et||20;const _t=k(O(R.toXy(nt,ot)));if(_t.length<4){const Ee=_t.concat([_t[0]]);return ot?R.fromXy(Ee,ot):Ee}const dt=_(_t),Ot=[dt[0]*xt,dt[1]*xt],wt=L(_t),Ft=_t.filter(function(Ee){return wt.indexOf(Ee)<0}),jt=Math.ceil(1/(_t.length/(dt[0]*dt[1]))),re=tt(wt,Math.pow(Ct,2),Ot,F(Ft,jt),new Set);return ot?R.fromXy(re,ot):re}const Rt=Math.cos(90/(180/Math.PI)),xt=.6;q.exports=st},77444:function(q){function J(m,F,R,L,k,O){const b=(O-F)*(R-m)-(L-F)*(k-m);return b>0?!0:!(b<0)}function g(m,F){const R=m[0][0],L=m[0][1],k=m[1][0],O=m[1][1],b=F[0][0],E=F[0][1],T=F[1][0],_=F[1][1];return J(R,L,b,E,T,_)!==J(k,O,b,E,T,_)&&J(R,L,k,O,b,E)!==J(R,L,k,O,T,_)}q.exports=g},44091:function(q,J,g){"use strict";g.r(J),g.d(J,{isAnyArray:function(){return F}});const m=Object.prototype.toString;function F(R){const L=m.call(R);return L.endsWith("Array]")&&!L.includes("Big")}},18552:function(q,J,g){var m=g(10852),F=g(55639),R=m(F,"DataView");q.exports=R},53818:function(q,J,g){var m=g(10852),F=g(55639),R=m(F,"Promise");q.exports=R},58525:function(q,J,g){var m=g(10852),F=g(55639),R=m(F,"Set");q.exports=R},88668:function(q,J,g){var m=g(83369),F=g(90619),R=g(72385);function L(k){var O=-1,b=k==null?0:k.length;for(this.__data__=new m;++O<b;)this.add(k[O])}L.prototype.add=L.prototype.push=F,L.prototype.has=R,q.exports=L},70577:function(q,J,g){var m=g(10852),F=g(55639),R=m(F,"WeakMap");q.exports=R},77412:function(q){function J(g,m){for(var F=-1,R=g==null?0:g.length;++F<R&&m(g[F],F,g)!==!1;);return g}q.exports=J},34963:function(q){function J(g,m){for(var F=-1,R=g==null?0:g.length,L=0,k=[];++F<R;){var O=g[F];m(O,F,g)&&(k[L++]=O)}return k}q.exports=J},47443:function(q,J,g){var m=g(42118);function F(R,L){var k=R==null?0:R.length;return!!k&&m(R,L,0)>-1}q.exports=F},1196:function(q){function J(g,m,F){for(var R=-1,L=g==null?0:g.length;++R<L;)if(F(m,g[R]))return!0;return!1}q.exports=J},29932:function(q){function J(g,m){for(var F=-1,R=g==null?0:g.length,L=Array(R);++F<R;)L[F]=m(g[F],F,g);return L}q.exports=J},62488:function(q){function J(g,m){for(var F=-1,R=m.length,L=g.length;++F<R;)g[L+F]=m[F];return g}q.exports=J},62663:function(q){function J(g,m,F,R){var L=-1,k=g==null?0:g.length;for(R&&k&&(F=g[++L]);++L<k;)F=m(F,g[L],L,g);return F}q.exports=J},82908:function(q){function J(g,m){for(var F=-1,R=g==null?0:g.length;++F<R;)if(m(g[F],F,g))return!0;return!1}q.exports=J},48983:function(q,J,g){var m=g(40371),F=m("length");q.exports=F},44037:function(q,J,g){var m=g(98363),F=g(3674);function R(L,k){return L&&m(k,F(k),L)}q.exports=R},63886:function(q,J,g){var m=g(98363),F=g(81704);function R(L,k){return L&&m(k,F(k),L)}q.exports=R},85990:function(q,J,g){var m=g(46384),F=g(77412),R=g(34865),L=g(44037),k=g(63886),O=g(64626),b=g(278),E=g(18805),T=g(1911),_=g(58234),P=g(46904),B=g(64160),tt=g(43824),st=g(29148),Rt=g(38517),xt=g(1469),nt=g(44144),Et=g(56688),ot=g(13218),Ct=g(72928),_t=g(3674),dt=g(81704),Ot=1,wt=2,Ft=4,jt="[object Arguments]",re="[object Array]",Ee="[object Boolean]",et="[object Date]",ge="[object Error]",yt="[object Function]",te="[object GeneratorFunction]",Xt="[object Map]",rt="[object Number]",bt="[object Object]",ye="[object RegExp]",be="[object Set]",Gt="[object String]",Kt="[object Symbol]",we="[object WeakMap]",Bt="[object ArrayBuffer]",oe="[object DataView]",ht="[object Float32Array]",ut="[object Float64Array]",Vt="[object Int8Array]",ve="[object Int16Array]",kt="[object Int32Array]",ee="[object Uint8Array]",me="[object Uint8ClampedArray]",Nt="[object Uint16Array]",Zt="[object Uint32Array]",Yt={};Yt[jt]=Yt[re]=Yt[Bt]=Yt[oe]=Yt[Ee]=Yt[et]=Yt[ht]=Yt[ut]=Yt[Vt]=Yt[ve]=Yt[kt]=Yt[Xt]=Yt[rt]=Yt[bt]=Yt[ye]=Yt[be]=Yt[Gt]=Yt[Kt]=Yt[ee]=Yt[me]=Yt[Nt]=Yt[Zt]=!0,Yt[ge]=Yt[yt]=Yt[we]=!1;function S(Y,At,ie,$t,Oe,Ne){var Le,at=At&Ot,V=At&wt,St=At&Ft;if(ie&&(Le=Oe?ie(Y,$t,Oe,Ne):ie(Y)),Le!==void 0)return Le;if(!ot(Y))return Y;var Pt=xt(Y);if(Pt){if(Le=tt(Y),!at)return b(Y,Le)}else{var pt=B(Y),mt=pt==yt||pt==te;if(nt(Y))return O(Y,at);if(pt==bt||pt==jt||mt&&!Oe){if(Le=V||mt?{}:Rt(Y),!at)return V?T(Y,k(Le,Y)):E(Y,L(Le,Y))}else{if(!Yt[pt])return Oe?Y:{};Le=st(Y,pt,at)}}Ne||(Ne=new m);var Lt=Ne.get(Y);if(Lt)return Lt;Ne.set(Y,Le),Ct(Y)?Y.forEach(function(ne){Le.add(S(ne,At,ie,ne,Y,Ne))}):Et(Y)&&Y.forEach(function(ne,_e){Le.set(_e,S(ne,At,ie,_e,Y,Ne))});var Ht=St?V?P:_:V?dt:_t,Dt=Pt?void 0:Ht(Y);return F(Dt||Y,function(ne,_e){Dt&&(_e=ne,ne=Y[_e]),R(Le,_e,S(ne,At,ie,_e,Y,Ne))}),Le}q.exports=S},89881:function(q,J,g){var m=g(47816),F=g(99291),R=F(m);q.exports=R},56029:function(q,J,g){var m=g(33448);function F(R,L,k){for(var O=-1,b=R.length;++O<b;){var E=R[O],T=L(E);if(T!=null&&(_===void 0?T===T&&!m(T):k(T,_)))var _=T,P=E}return P}q.exports=F},80760:function(q,J,g){var m=g(89881);function F(R,L){var k=[];return m(R,function(O,b,E){L(O,b,E)&&k.push(O)}),k}q.exports=F},41848:function(q){function J(g,m,F,R){for(var L=g.length,k=F+(R?1:-1);R?k--:++k<L;)if(m(g[k],k,g))return k;return-1}q.exports=J},21078:function(q,J,g){var m=g(62488),F=g(37285);function R(L,k,O,b,E){var T=-1,_=L.length;for(O||(O=F),E||(E=[]);++T<_;){var P=L[T];k>0&&O(P)?k>1?R(P,k-1,O,b,E):m(E,P):b||(E[E.length]=P)}return E}q.exports=R},47816:function(q,J,g){var m=g(28483),F=g(3674);function R(L,k){return L&&m(L,k,F)}q.exports=R},97786:function(q,J,g){var m=g(71811),F=g(40327);function R(L,k){k=m(k,L);for(var O=0,b=k.length;L!=null&&O<b;)L=L[F(k[O++])];return O&&O==b?L:void 0}q.exports=R},64055:function(q,J,g){var m=g(62488),F=g(1469);function R(L,k,O){var b=k(L);return F(L)?b:m(b,O(L))}q.exports=R},53325:function(q){function J(g,m){return g>m}q.exports=J},78565:function(q){var J=Object.prototype,g=J.hasOwnProperty;function m(F,R){return F!=null&&g.call(F,R)}q.exports=m},13:function(q){function J(g,m){return g!=null&&m in Object(g)}q.exports=J},42118:function(q,J,g){var m=g(41848),F=g(62722),R=g(42351);function L(k,O,b){return O===O?R(k,O,b):m(k,F,b)}q.exports=L},90939:function(q,J,g){var m=g(2492),F=g(37005);function R(L,k,O,b,E){return L===k?!0:L==null||k==null||!F(L)&&!F(k)?L!==L&&k!==k:m(L,k,O,b,R,E)}q.exports=R},2492:function(q,J,g){var m=g(46384),F=g(67114),R=g(18351),L=g(16096),k=g(64160),O=g(1469),b=g(44144),E=g(36719),T=1,_="[object Arguments]",P="[object Array]",B="[object Object]",tt=Object.prototype,st=tt.hasOwnProperty;function Rt(xt,nt,Et,ot,Ct,_t){var dt=O(xt),Ot=O(nt),wt=dt?P:k(xt),Ft=Ot?P:k(nt);wt=wt==_?B:wt,Ft=Ft==_?B:Ft;var jt=wt==B,re=Ft==B,Ee=wt==Ft;if(Ee&&b(xt)){if(!b(nt))return!1;dt=!0,jt=!1}if(Ee&&!jt)return _t||(_t=new m),dt||E(xt)?F(xt,nt,Et,ot,Ct,_t):R(xt,nt,wt,Et,ot,Ct,_t);if(!(Et&T)){var et=jt&&st.call(xt,"__wrapped__"),ge=re&&st.call(nt,"__wrapped__");if(et||ge){var yt=et?xt.value():xt,te=ge?nt.value():nt;return _t||(_t=new m),Ct(yt,te,Et,ot,_t)}}return Ee?(_t||(_t=new m),L(xt,nt,Et,ot,Ct,_t)):!1}q.exports=Rt},25588:function(q,J,g){var m=g(64160),F=g(37005),R="[object Map]";function L(k){return F(k)&&m(k)==R}q.exports=L},2958:function(q,J,g){var m=g(46384),F=g(90939),R=1,L=2;function k(O,b,E,T){var _=E.length,P=_,B=!T;if(O==null)return!P;for(O=Object(O);_--;){var tt=E[_];if(B&&tt[2]?tt[1]!==O[tt[0]]:!(tt[0]in O))return!1}for(;++_<P;){tt=E[_];var st=tt[0],Rt=O[st],xt=tt[1];if(B&&tt[2]){if(Rt===void 0&&!(st in O))return!1}else{var nt=new m;if(T)var Et=T(Rt,xt,st,O,b,nt);if(!(Et===void 0?F(xt,Rt,R|L,T,nt):Et))return!1}}return!0}q.exports=k},62722:function(q){function J(g){return g!==g}q.exports=J},29221:function(q,J,g){var m=g(64160),F=g(37005),R="[object Set]";function L(k){return F(k)&&m(k)==R}q.exports=L},67206:function(q,J,g){var m=g(91573),F=g(16432),R=g(6557),L=g(1469),k=g(39601);function O(b){return typeof b=="function"?b:b==null?R:typeof b=="object"?L(b)?F(b[0],b[1]):m(b):k(b)}q.exports=O},280:function(q,J,g){var m=g(25726),F=g(86916),R=Object.prototype,L=R.hasOwnProperty;function k(O){if(!m(O))return F(O);var b=[];for(var E in Object(O))L.call(O,E)&&E!="constructor"&&b.push(E);return b}q.exports=k},70433:function(q){function J(g,m){return g<m}q.exports=J},69199:function(q,J,g){var m=g(89881),F=g(98612);function R(L,k){var O=-1,b=F(L)?Array(L.length):[];return m(L,function(E,T,_){b[++O]=k(E,T,_)}),b}q.exports=R},91573:function(q,J,g){var m=g(2958),F=g(1499),R=g(42634);function L(k){var O=F(k);return O.length==1&&O[0][2]?R(O[0][0],O[0][1]):function(b){return b===k||m(b,k,O)}}q.exports=L},16432:function(q,J,g){var m=g(90939),F=g(27361),R=g(79095),L=g(15403),k=g(89162),O=g(42634),b=g(40327),E=1,T=2;function _(P,B){return L(P)&&k(B)?O(b(P),B):function(tt){var st=F(tt,P);return st===void 0&&st===B?R(tt,P):m(B,st,E|T)}}q.exports=_},82689:function(q,J,g){var m=g(29932),F=g(97786),R=g(67206),L=g(69199),k=g(63922),O=g(7518),b=g(85022),E=g(6557),T=g(1469);function _(P,B,tt){B.length?B=m(B,function(xt){return T(xt)?function(nt){return F(nt,xt.length===1?xt[0]:xt)}:xt}):B=[E];var st=-1;B=m(B,O(R));var Rt=L(P,function(xt,nt,Et){var ot=m(B,function(Ct){return Ct(xt)});return{criteria:ot,index:++st,value:xt}});return k(Rt,function(xt,nt){return b(xt,nt,tt)})}q.exports=_},25970:function(q,J,g){var m=g(63012),F=g(79095);function R(L,k){return m(L,k,function(O,b){return F(L,b)})}q.exports=R},63012:function(q,J,g){var m=g(97786),F=g(10611),R=g(71811);function L(k,O,b){for(var E=-1,T=O.length,_={};++E<T;){var P=O[E],B=m(k,P);b(B,P)&&F(_,R(P,k),B)}return _}q.exports=L},40371:function(q){function J(g){return function(m){return m==null?void 0:m[g]}}q.exports=J},79152:function(q,J,g){var m=g(97786);function F(R){return function(L){return m(L,R)}}q.exports=F},40098:function(q){var J=Math.ceil,g=Math.max;function m(F,R,L,k){for(var O=-1,b=g(J((R-F)/(L||1)),0),E=Array(b);b--;)E[k?b:++O]=F,F+=L;return E}q.exports=m},10107:function(q){function J(g,m,F,R,L){return L(g,function(k,O,b){F=R?(R=!1,k):m(F,k,O,b)}),F}q.exports=J},10611:function(q,J,g){var m=g(34865),F=g(71811),R=g(65776),L=g(13218),k=g(40327);function O(b,E,T,_){if(!L(b))return b;E=F(E,b);for(var P=-1,B=E.length,tt=B-1,st=b;st!=null&&++P<B;){var Rt=k(E[P]),xt=T;if(Rt==="__proto__"||Rt==="constructor"||Rt==="prototype")return b;if(P!=tt){var nt=st[Rt];xt=_?_(nt,Rt,st):void 0,xt===void 0&&(xt=L(nt)?nt:R(E[P+1])?[]:{})}m(st,Rt,xt),st=st[Rt]}return b}q.exports=O},63922:function(q){function J(g,m){var F=g.length;for(g.sort(m);F--;)g[F]=g[F].value;return g}q.exports=J},80531:function(q,J,g){var m=g(62705),F=g(29932),R=g(1469),L=g(33448),k=1/0,O=m?m.prototype:void 0,b=O?O.toString:void 0;function E(T){if(typeof T=="string")return T;if(R(T))return F(T,E)+"";if(L(T))return b?b.call(T):"";var _=T+"";return _=="0"&&1/T==-k?"-0":_}q.exports=E},27561:function(q,J,g){var m=g(67990),F=/^\s+/;function R(L){return L&&L.slice(0,m(L)+1).replace(F,"")}q.exports=R},45652:function(q,J,g){var m=g(88668),F=g(47443),R=g(1196),L=g(74757),k=g(23593),O=g(21814),b=200;function E(T,_,P){var B=-1,tt=F,st=T.length,Rt=!0,xt=[],nt=xt;if(P)Rt=!1,tt=R;else if(st>=b){var Et=_?null:k(T);if(Et)return O(Et);Rt=!1,tt=L,nt=new m}else nt=_?[]:xt;t:for(;++B<st;){var ot=T[B],Ct=_?_(ot):ot;if(ot=P||ot!==0?ot:0,Rt&&Ct===Ct){for(var _t=nt.length;_t--;)if(nt[_t]===Ct)continue t;_&&nt.push(Ct),xt.push(ot)}else tt(nt,Ct,P)||(nt!==xt&&nt.push(Ct),xt.push(ot))}return xt}q.exports=E},47415:function(q,J,g){var m=g(29932);function F(R,L){return m(L,function(k){return R[k]})}q.exports=F},1757:function(q){function J(g,m,F){for(var R=-1,L=g.length,k=m.length,O={};++R<L;){var b=R<k?m[R]:void 0;F(O,g[R],b)}return O}q.exports=J},74757:function(q){function J(g,m){return g.has(m)}q.exports=J},54290:function(q,J,g){var m=g(6557);function F(R){return typeof R=="function"?R:m}q.exports=F},71811:function(q,J,g){var m=g(1469),F=g(15403),R=g(55514),L=g(79833);function k(O,b){return m(O)?O:F(O,b)?[O]:R(L(O))}q.exports=k},57157:function(q,J,g){var m=g(74318);function F(R,L){var k=L?m(R.buffer):R.buffer;return new R.constructor(k,R.byteOffset,R.byteLength)}q.exports=F},93147:function(q){var J=/\w*$/;function g(m){var F=new m.constructor(m.source,J.exec(m));return F.lastIndex=m.lastIndex,F}q.exports=g},40419:function(q,J,g){var m=g(62705),F=m?m.prototype:void 0,R=F?F.valueOf:void 0;function L(k){return R?Object(R.call(k)):{}}q.exports=L},26393:function(q,J,g){var m=g(33448);function F(R,L){if(R!==L){var k=R!==void 0,O=R===null,b=R===R,E=m(R),T=L!==void 0,_=L===null,P=L===L,B=m(L);if(!_&&!B&&!E&&R>L||E&&T&&P&&!_&&!B||O&&T&&P||!k&&P||!b)return 1;if(!O&&!E&&!B&&R<L||B&&k&&b&&!O&&!E||_&&k&&b||!T&&b||!P)return-1}return 0}q.exports=F},85022:function(q,J,g){var m=g(26393);function F(R,L,k){for(var O=-1,b=R.criteria,E=L.criteria,T=b.length,_=k.length;++O<T;){var P=m(b[O],E[O]);if(P){if(O>=_)return P;var B=k[O];return P*(B=="desc"?-1:1)}}return R.index-L.index}q.exports=F},18805:function(q,J,g){var m=g(98363),F=g(99551);function R(L,k){return m(L,F(L),k)}q.exports=R},1911:function(q,J,g){var m=g(98363),F=g(51442);function R(L,k){return m(L,F(L),k)}q.exports=R},99291:function(q,J,g){var m=g(98612);function F(R,L){return function(k,O){if(k==null)return k;if(!m(k))return R(k,O);for(var b=k.length,E=L?b:-1,T=Object(k);(L?E--:++E<b)&&O(T[E],E,T)!==!1;);return k}}q.exports=F},67740:function(q,J,g){var m=g(67206),F=g(98612),R=g(3674);function L(k){return function(O,b,E){var T=Object(O);if(!F(O)){var _=m(b,3);O=R(O),b=function(B){return _(T[B],B,T)}}var P=k(O,b,E);return P>-1?T[_?O[P]:P]:void 0}}q.exports=L},47445:function(q,J,g){var m=g(40098),F=g(16612),R=g(18601);function L(k){return function(O,b,E){return E&&typeof E!="number"&&F(O,b,E)&&(b=E=void 0),O=R(O),b===void 0?(b=O,O=0):b=R(b),E=E===void 0?O<b?1:-1:R(E),m(O,b,E,k)}}q.exports=L},23593:function(q,J,g){var m=g(58525),F=g(50308),R=g(21814),L=1/0,k=m&&1/R(new m([,-0]))[1]==L?function(O){return new m(O)}:F;q.exports=k},67114:function(q,J,g){var m=g(88668),F=g(82908),R=g(74757),L=1,k=2;function O(b,E,T,_,P,B){var tt=T&L,st=b.length,Rt=E.length;if(st!=Rt&&!(tt&&Rt>st))return!1;var xt=B.get(b),nt=B.get(E);if(xt&&nt)return xt==E&&nt==b;var Et=-1,ot=!0,Ct=T&k?new m:void 0;for(B.set(b,E),B.set(E,b);++Et<st;){var _t=b[Et],dt=E[Et];if(_)var Ot=tt?_(dt,_t,Et,E,b,B):_(_t,dt,Et,b,E,B);if(Ot!==void 0){if(Ot)continue;ot=!1;break}if(Ct){if(!F(E,function(wt,Ft){if(!R(Ct,Ft)&&(_t===wt||P(_t,wt,T,_,B)))return Ct.push(Ft)})){ot=!1;break}}else if(!(_t===dt||P(_t,dt,T,_,B))){ot=!1;break}}return B.delete(b),B.delete(E),ot}q.exports=O},18351:function(q,J,g){var m=g(62705),F=g(11149),R=g(77813),L=g(67114),k=g(68776),O=g(21814),b=1,E=2,T="[object Boolean]",_="[object Date]",P="[object Error]",B="[object Map]",tt="[object Number]",st="[object RegExp]",Rt="[object Set]",xt="[object String]",nt="[object Symbol]",Et="[object ArrayBuffer]",ot="[object DataView]",Ct=m?m.prototype:void 0,_t=Ct?Ct.valueOf:void 0;function dt(Ot,wt,Ft,jt,re,Ee,et){switch(Ft){case ot:if(Ot.byteLength!=wt.byteLength||Ot.byteOffset!=wt.byteOffset)return!1;Ot=Ot.buffer,wt=wt.buffer;case Et:return!(Ot.byteLength!=wt.byteLength||!Ee(new F(Ot),new F(wt)));case T:case _:case tt:return R(+Ot,+wt);case P:return Ot.name==wt.name&&Ot.message==wt.message;case st:case xt:return Ot==wt+"";case B:var ge=k;case Rt:var yt=jt&b;if(ge||(ge=O),Ot.size!=wt.size&&!yt)return!1;var te=et.get(Ot);if(te)return te==wt;jt|=E,et.set(Ot,wt);var Xt=L(ge(Ot),ge(wt),jt,re,Ee,et);return et.delete(Ot),Xt;case nt:if(_t)return _t.call(Ot)==_t.call(wt)}return!1}q.exports=dt},16096:function(q,J,g){var m=g(58234),F=1,R=Object.prototype,L=R.hasOwnProperty;function k(O,b,E,T,_,P){var B=E&F,tt=m(O),st=tt.length,Rt=m(b),xt=Rt.length;if(st!=xt&&!B)return!1;for(var nt=st;nt--;){var Et=tt[nt];if(!(B?Et in b:L.call(b,Et)))return!1}var ot=P.get(O),Ct=P.get(b);if(ot&&Ct)return ot==b&&Ct==O;var _t=!0;P.set(O,b),P.set(b,O);for(var dt=B;++nt<st;){Et=tt[nt];var Ot=O[Et],wt=b[Et];if(T)var Ft=B?T(wt,Ot,Et,b,O,P):T(Ot,wt,Et,O,b,P);if(!(Ft===void 0?Ot===wt||_(Ot,wt,E,T,P):Ft)){_t=!1;break}dt||(dt=Et=="constructor")}if(_t&&!dt){var jt=O.constructor,re=b.constructor;jt!=re&&"constructor"in O&&"constructor"in b&&!(typeof jt=="function"&&jt instanceof jt&&typeof re=="function"&&re instanceof re)&&(_t=!1)}return P.delete(O),P.delete(b),_t}q.exports=k},99021:function(q,J,g){var m=g(85564),F=g(45357),R=g(30061);function L(k){return R(F(k,void 0,m),k+"")}q.exports=L},58234:function(q,J,g){var m=g(64055),F=g(99551),R=g(3674);function L(k){return m(k,R,F)}q.exports=L},46904:function(q,J,g){var m=g(64055),F=g(51442),R=g(81704);function L(k){return m(k,R,F)}q.exports=L},1499:function(q,J,g){var m=g(89162),F=g(3674);function R(L){for(var k=F(L),O=k.length;O--;){var b=k[O],E=L[b];k[O]=[b,E,m(E)]}return k}q.exports=R},99551:function(q,J,g){var m=g(34963),F=g(70479),R=Object.prototype,L=R.propertyIsEnumerable,k=Object.getOwnPropertySymbols,O=k?function(b){return b==null?[]:(b=Object(b),m(k(b),function(E){return L.call(b,E)}))}:F;q.exports=O},51442:function(q,J,g){var m=g(62488),F=g(85924),R=g(99551),L=g(70479),k=Object.getOwnPropertySymbols,O=k?function(b){for(var E=[];b;)m(E,R(b)),b=F(b);return E}:L;q.exports=O},64160:function(q,J,g){var m=g(18552),F=g(57071),R=g(53818),L=g(58525),k=g(70577),O=g(44239),b=g(80346),E="[object Map]",T="[object Object]",_="[object Promise]",P="[object Set]",B="[object WeakMap]",tt="[object DataView]",st=b(m),Rt=b(F),xt=b(R),nt=b(L),Et=b(k),ot=O;(m&&ot(new m(new ArrayBuffer(1)))!=tt||F&&ot(new F)!=E||R&&ot(R.resolve())!=_||L&&ot(new L)!=P||k&&ot(new k)!=B)&&(ot=function(Ct){var _t=O(Ct),dt=_t==T?Ct.constructor:void 0,Ot=dt?b(dt):"";if(Ot)switch(Ot){case st:return tt;case Rt:return E;case xt:return _;case nt:return P;case Et:return B}return _t}),q.exports=ot},222:function(q,J,g){var m=g(71811),F=g(35694),R=g(1469),L=g(65776),k=g(41780),O=g(40327);function b(E,T,_){T=m(T,E);for(var P=-1,B=T.length,tt=!1;++P<B;){var st=O(T[P]);if(!(tt=E!=null&&_(E,st)))break;E=E[st]}return tt||++P!=B?tt:(B=E==null?0:E.length,!!B&&k(B)&&L(st,B)&&(R(E)||F(E)))}q.exports=b},62689:function(q){var J="\\ud800-\\udfff",g="\\u0300-\\u036f",m="\\ufe20-\\ufe2f",F="\\u20d0-\\u20ff",R=g+m+F,L="\\ufe0e\\ufe0f",k="\\u200d",O=RegExp("["+k+J+R+L+"]");function b(E){return O.test(E)}q.exports=b},43824:function(q){var J=Object.prototype,g=J.hasOwnProperty;function m(F){var R=F.length,L=new F.constructor(R);return R&&typeof F[0]=="string"&&g.call(F,"index")&&(L.index=F.index,L.input=F.input),L}q.exports=m},29148:function(q,J,g){var m=g(74318),F=g(57157),R=g(93147),L=g(40419),k=g(77133),O="[object Boolean]",b="[object Date]",E="[object Map]",T="[object Number]",_="[object RegExp]",P="[object Set]",B="[object String]",tt="[object Symbol]",st="[object ArrayBuffer]",Rt="[object DataView]",xt="[object Float32Array]",nt="[object Float64Array]",Et="[object Int8Array]",ot="[object Int16Array]",Ct="[object Int32Array]",_t="[object Uint8Array]",dt="[object Uint8ClampedArray]",Ot="[object Uint16Array]",wt="[object Uint32Array]";function Ft(jt,re,Ee){var et=jt.constructor;switch(re){case st:return m(jt);case O:case b:return new et(+jt);case Rt:return F(jt,Ee);case xt:case nt:case Et:case ot:case Ct:case _t:case dt:case Ot:case wt:return k(jt,Ee);case E:return new et;case T:case B:return new et(jt);case _:return R(jt);case P:return new et;case tt:return L(jt)}}q.exports=Ft},37285:function(q,J,g){var m=g(62705),F=g(35694),R=g(1469),L=m?m.isConcatSpreadable:void 0;function k(O){return R(O)||F(O)||!!(L&&O&&O[L])}q.exports=k},15403:function(q,J,g){var m=g(1469),F=g(33448),R=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,L=/^\w*$/;function k(O,b){if(m(O))return!1;var E=typeof O;return E=="number"||E=="symbol"||E=="boolean"||O==null||F(O)?!0:L.test(O)||!R.test(O)||b!=null&&O in Object(b)}q.exports=k},89162:function(q,J,g){var m=g(13218);function F(R){return R===R&&!m(R)}q.exports=F},68776:function(q){function J(g){var m=-1,F=Array(g.size);return g.forEach(function(R,L){F[++m]=[L,R]}),F}q.exports=J},42634:function(q){function J(g,m){return function(F){return F==null?!1:F[g]===m&&(m!==void 0||g in Object(F))}}q.exports=J},24523:function(q,J,g){var m=g(88306),F=500;function R(L){var k=m(L,function(b){return O.size===F&&O.clear(),b}),O=k.cache;return k}q.exports=R},86916:function(q,J,g){var m=g(5569),F=m(Object.keys,Object);q.exports=F},90619:function(q){var J="__lodash_hash_undefined__";function g(m){return this.__data__.set(m,J),this}q.exports=g},72385:function(q){function J(g){return this.__data__.has(g)}q.exports=J},21814:function(q){function J(g){var m=-1,F=Array(g.size);return g.forEach(function(R){F[++m]=R}),F}q.exports=J},42351:function(q){function J(g,m,F){for(var R=F-1,L=g.length;++R<L;)if(g[R]===m)return R;return-1}q.exports=J},88016:function(q,J,g){var m=g(48983),F=g(62689),R=g(21903);function L(k){return F(k)?R(k):m(k)}q.exports=L},55514:function(q,J,g){var m=g(24523),F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R=/\\(\\)?/g,L=m(function(k){var O=[];return k.charCodeAt(0)===46&&O.push(""),k.replace(F,function(b,E,T,_){O.push(T?_.replace(R,"$1"):E||b)}),O});q.exports=L},40327:function(q,J,g){var m=g(33448),F=1/0;function R(L){if(typeof L=="string"||m(L))return L;var k=L+"";return k=="0"&&1/L==-F?"-0":k}q.exports=R},67990:function(q){var J=/\s/;function g(m){for(var F=m.length;F--&&J.test(m.charAt(F)););return F}q.exports=g},21903:function(q){var J="\\ud800-\\udfff",g="\\u0300-\\u036f",m="\\ufe20-\\ufe2f",F="\\u20d0-\\u20ff",R=g+m+F,L="\\ufe0e\\ufe0f",k="["+J+"]",O="["+R+"]",b="\\ud83c[\\udffb-\\udfff]",E="(?:"+O+"|"+b+")",T="[^"+J+"]",_="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",B="\\u200d",tt=E+"?",st="["+L+"]?",Rt="(?:"+B+"(?:"+[T,_,P].join("|")+")"+st+tt+")*",xt=st+tt+Rt,nt="(?:"+[T+O+"?",O,_,P,k].join("|")+")",Et=RegExp(b+"(?="+b+")|"+nt+xt,"g");function ot(Ct){for(var _t=Et.lastIndex=0;Et.test(Ct);)++_t;return _t}q.exports=ot},66678:function(q,J,g){var m=g(85990),F=4;function R(L){return m(L,F)}q.exports=R},50361:function(q,J,g){var m=g(85990),F=1,R=4;function L(k){return m(k,F|R)}q.exports=L},91747:function(q,J,g){var m=g(18460),F=g(77813),R=g(16612),L=g(81704),k=Object.prototype,O=k.hasOwnProperty,b=m(function(E,T){E=Object(E);var _=-1,P=T.length,B=P>2?T[2]:void 0;for(B&&R(T[0],T[1],B)&&(P=1);++_<P;)for(var tt=T[_],st=L(tt),Rt=-1,xt=st.length;++Rt<xt;){var nt=st[Rt],Et=E[nt];(Et===void 0||F(Et,k[nt])&&!O.call(E,nt))&&(E[nt]=tt[nt])}return E});q.exports=b},85768:function(q,J,g){q.exports=g(84486)},63105:function(q,J,g){var m=g(34963),F=g(80760),R=g(67206),L=g(1469);function k(O,b){var E=L(O)?m:F;return E(O,R(b,3))}q.exports=k},13311:function(q,J,g){var m=g(67740),F=g(30998),R=m(F);q.exports=R},30998:function(q,J,g){var m=g(41848),F=g(67206),R=g(40554),L=Math.max;function k(O,b,E){var T=O==null?0:O.length;if(!T)return-1;var _=E==null?0:R(E);return _<0&&(_=L(T+_,0)),m(O,F(b,3),_)}q.exports=k},85564:function(q,J,g){var m=g(21078);function F(R){var L=R==null?0:R.length;return L?m(R,1):[]}q.exports=F},84486:function(q,J,g){var m=g(77412),F=g(89881),R=g(54290),L=g(1469);function k(O,b){var E=L(O)?m:F;return E(O,R(b))}q.exports=k},62620:function(q,J,g){var m=g(28483),F=g(54290),R=g(81704);function L(k,O){return k==null?k:m(k,F(O),R)}q.exports=L},27361:function(q,J,g){var m=g(97786);function F(R,L,k){var O=R==null?void 0:m(R,L);return O===void 0?k:O}q.exports=F},18721:function(q,J,g){var m=g(78565),F=g(222);function R(L,k){return L!=null&&F(L,k,m)}q.exports=R},79095:function(q,J,g){var m=g(13),F=g(222);function R(L,k){return L!=null&&F(L,k,m)}q.exports=R},58367:function(q,J,g){var m=g(280),F=g(64160),R=g(35694),L=g(1469),k=g(98612),O=g(44144),b=g(25726),E=g(36719),T="[object Map]",_="[object Set]",P=Object.prototype,B=P.hasOwnProperty;function tt(st){if(st==null)return!0;if(k(st)&&(L(st)||typeof st=="string"||typeof st.splice=="function"||O(st)||E(st)||R(st)))return!st.length;var Rt=F(st);if(Rt==T||Rt==_)return!st.size;if(b(st))return!m(st).length;for(var xt in st)if(B.call(st,xt))return!1;return!0}q.exports=tt},56688:function(q,J,g){var m=g(25588),F=g(7518),R=g(31167),L=R&&R.isMap,k=L?F(L):m;q.exports=k},72928:function(q,J,g){var m=g(29221),F=g(7518),R=g(31167),L=R&&R.isSet,k=L?F(L):m;q.exports=k},47037:function(q,J,g){var m=g(44239),F=g(1469),R=g(37005),L="[object String]";function k(O){return typeof O=="string"||!F(O)&&R(O)&&m(O)==L}q.exports=k},33448:function(q,J,g){var m=g(44239),F=g(37005),R="[object Symbol]";function L(k){return typeof k=="symbol"||F(k)&&m(k)==R}q.exports=L},52353:function(q){function J(g){return g===void 0}q.exports=J},3674:function(q,J,g){var m=g(14636),F=g(280),R=g(98612);function L(k){return R(k)?m(k):F(k)}q.exports=L},10928:function(q){function J(g){var m=g==null?0:g.length;return m?g[m-1]:void 0}q.exports=J},35161:function(q,J,g){var m=g(29932),F=g(67206),R=g(69199),L=g(1469);function k(O,b){var E=L(O)?m:R;return E(O,F(b,3))}q.exports=k},8521:function(q,J,g){var m=g(89465),F=g(47816),R=g(67206);function L(k,O){var b={};return O=R(O,3),F(k,function(E,T,_){m(b,T,O(E,T,_))}),b}q.exports=L},6162:function(q,J,g){var m=g(56029),F=g(53325),R=g(6557);function L(k){return k&&k.length?m(k,R,F):void 0}q.exports=L},88306:function(q,J,g){var m=g(83369),F="Expected a function";function R(L,k){if(typeof L!="function"||k!=null&&typeof k!="function")throw new TypeError(F);var O=function(){var b=arguments,E=k?k.apply(this,b):b[0],T=O.cache;if(T.has(E))return T.get(E);var _=L.apply(this,b);return O.cache=T.set(E,_)||T,_};return O.cache=new(R.Cache||m),O}R.Cache=m,q.exports=R},53632:function(q,J,g){var m=g(56029),F=g(70433),R=g(6557);function L(k){return k&&k.length?m(k,R,F):void 0}q.exports=L},22762:function(q,J,g){var m=g(56029),F=g(67206),R=g(70433);function L(k,O){return k&&k.length?m(k,F(O,2),R):void 0}q.exports=L},50308:function(q){function J(){}q.exports=J},7771:function(q,J,g){var m=g(55639),F=function(){return m.Date.now()};q.exports=F},78718:function(q,J,g){var m=g(25970),F=g(99021),R=F(function(L,k){return L==null?{}:m(L,k)});q.exports=R},39601:function(q,J,g){var m=g(40371),F=g(79152),R=g(15403),L=g(40327);function k(O){return R(O)?m(L(O)):F(O)}q.exports=k},96026:function(q,J,g){var m=g(47445),F=m();q.exports=F},54061:function(q,J,g){var m=g(62663),F=g(89881),R=g(67206),L=g(10107),k=g(1469);function O(b,E,T){var _=k(b)?m:L,P=arguments.length<3;return _(b,R(E,4),T,P,F)}q.exports=O},84238:function(q,J,g){var m=g(280),F=g(64160),R=g(98612),L=g(47037),k=g(88016),O="[object Map]",b="[object Set]";function E(T){if(T==null)return 0;if(R(T))return L(T)?k(T):T.length;var _=F(T);return _==O||_==b?T.size:m(T).length}q.exports=E},89734:function(q,J,g){var m=g(21078),F=g(82689),R=g(18460),L=g(16612),k=R(function(O,b){if(O==null)return[];var E=b.length;return E>1&&L(O,b[0],b[1])?b=[]:E>2&&L(b[0],b[1],b[2])&&(b=[b[0]]),F(O,m(b,1),[])});q.exports=k},70479:function(q){function J(){return[]}q.exports=J},18601:function(q,J,g){var m=g(14841),F=1/0,R=17976931348623157e292;function L(k){if(!k)return k===0?k:0;if(k=m(k),k===F||k===-F){var O=k<0?-1:1;return O*R}return k===k?k:0}q.exports=L},40554:function(q,J,g){var m=g(18601);function F(R){var L=m(R),k=L%1;return L===L?k?L-k:L:0}q.exports=F},14841:function(q,J,g){var m=g(27561),F=g(13218),R=g(33448),L=NaN,k=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,b=/^0o[0-7]+$/i,E=parseInt;function T(_){if(typeof _=="number")return _;if(R(_))return L;if(F(_)){var P=typeof _.valueOf=="function"?_.valueOf():_;_=F(P)?P+"":P}if(typeof _!="string")return _===0?_:+_;_=m(_);var B=O.test(_);return B||b.test(_)?E(_.slice(2),B?2:8):k.test(_)?L:+_}q.exports=T},79833:function(q,J,g){var m=g(80531);function F(R){return R==null?"":m(R)}q.exports=F},68718:function(q,J,g){var m=g(77412),F=g(3118),R=g(47816),L=g(67206),k=g(85924),O=g(1469),b=g(44144),E=g(23560),T=g(13218),_=g(36719);function P(B,tt,st){var Rt=O(B),xt=Rt||b(B)||_(B);if(tt=L(tt,4),st==null){var nt=B&&B.constructor;xt?st=Rt?new nt:[]:T(B)?st=E(nt)?F(k(B)):{}:st={}}return(xt?m:R)(B,function(Et,ot,Ct){return tt(st,Et,ot,Ct)}),st}q.exports=P},93386:function(q,J,g){var m=g(21078),F=g(18460),R=g(45652),L=g(29246),k=F(function(O){return R(m(O,1,L,!0))});q.exports=k},73955:function(q,J,g){var m=g(79833),F=0;function R(L){var k=++F;return m(L)+k}q.exports=R},52628:function(q,J,g){var m=g(47415),F=g(3674);function R(L){return L==null?[]:m(L,F(L))}q.exports=R},7287:function(q,J,g){var m=g(34865),F=g(1757);function R(L,k){return F(L||[],k||[],m)}q.exports=R},75823:function(q,J,g){"use strict";g.r(J),g.d(J,{default:function(){return L}});var m=g(44091);function F(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,m.isAnyArray)(k))throw new TypeError("input must be an array");if(k.length===0)throw new TypeError("input must not be empty");var b=O.fromIndex,E=b===void 0?0:b,T=O.toIndex,_=T===void 0?k.length:T;if(E<0||E>=k.length||!Number.isInteger(E))throw new Error("fromIndex must be a positive integer smaller than length");if(_<=E||_>k.length||!Number.isInteger(_))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var P=k[E],B=E+1;B<_;B++)k[B]>P&&(P=k[B]);return P}function R(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,m.isAnyArray)(k))throw new TypeError("input must be an array");if(k.length===0)throw new TypeError("input must not be empty");var b=O.fromIndex,E=b===void 0?0:b,T=O.toIndex,_=T===void 0?k.length:T;if(E<0||E>=k.length||!Number.isInteger(E))throw new Error("fromIndex must be a positive integer smaller than length");if(_<=E||_>k.length||!Number.isInteger(_))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var P=k[E],B=E+1;B<_;B++)k[B]<P&&(P=k[B]);return P}function L(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,m.isAnyArray)(k)){if(k.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var b;if(O.output!==void 0){if(!(0,m.isAnyArray)(O.output))throw new TypeError("output option must be an array if specified");b=O.output}else b=new Array(k.length);var E=R(k),T=F(k);if(E===T)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var _=O.min,P=_===void 0?O.autoMinMax?E:0:_,B=O.max,tt=B===void 0?O.autoMinMax?T:1:B;if(P>=tt)throw new RangeError("min option must be smaller than max option");for(var st=(tt-P)/(T-E),Rt=0;Rt<k.length;Rt++)b[Rt]=(k[Rt]-E)*st+P;return b}},86851:function(q,J,g){"use strict";var m=g(89594),F=Array.prototype.concat,R=Array.prototype.slice,L=q.exports=function(O){for(var b=[],E=0,T=O.length;E<T;E++){var _=O[E];m(_)?b=F.call(b,R.call(_)):b.push(_)}return b};L.wrap=function(k){return function(){return k(L(arguments))}}},89594:function(q){q.exports=function(g){return!g||typeof g=="string"?!1:g instanceof Array||Array.isArray(g)||g.length>=0&&(g.splice instanceof Function||Object.getOwnPropertyDescriptor(g,g.length-1)&&g.constructor.name!=="String")}},99755:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABSCAYAAADKMvPcAAAAAXNSR0IArs4c6QAAFkdJREFUeF7NXXlsHNd5/2Z3Z3e5S3J5LClREklJlGxZtmzJUVo0boEICdI2BYICrQQ0PaJaV2JZSOO6NtC/+EfbFC36T902QBpFllxbDYXayFH1MArXQRugKIIojmQ7kSlKpMX7Wh6z3B3uvuJ7b76ZNzNvDl6ulqZI7szOfO/3ft/93lgDz+vP2ZuFHsh37YSOhkZIJ7zHN+NvHQAMMKEOrD4O8+YirCw0wNj9E9qJ2lqv389YoqP8/Z3bkoXmgpZPt+q6loa0Rtcxwy4YcBDl87/wXRMqwOr3K/OVCbN8/1zb0ZL3PPvGjDHtCvzX/r3Q1WQAfpmA9xP/bu4LRdOtrxzogN8MUuxOZXyxmimP/L52bCXqjv1sIN0De3b1mvkWTU9rhomSkrRRUqshs+8pDdk5E+UE0HUdCpDjv9+oTc3+XsMTQ7KsHFAE8zL898ECNGenoQQlG1BZyKghxjsuBEQ4gQOJoqGA+F3Ed0yAH+oj989rx8aDrvg37H/aHzGbesu6ppVMw5ZXkECgYWOi5EMEoNIFhKQosZA6ZwGKsnbpObhZG536QsPRYZKVA/rX7D/62iHfMgYlwG8EFL8/CoaK2dahCAUOaJf1832YmD+pPTXoBfVvjbe7e1OtndNgAH1zAkgMVWIYqGhRbBWQyoCinEU9Bz1QgHZoYO/lpn9yTjvK76D1s+/mdkPLI8NQgmGYBsFQ0+IozfRmqr0koCkU32aoLgDtgSL/OVKdXP585hPvE6hfK7+1e3uyvR1lxYnnspqmzVBOLElU+lUJGT8YBqb7mA2oJS+yEwHt04tQWl1c+O3Ckdsc0L9g1/tqUG8ZhGkOqGCnV3U2D1BSIT4cDigOC1VeAItAclB1AeoNY2TsxfxnRr86/73Wnlxx7xgYXE78KdQdJ9/kSMpSqsG0QPINxwMsHhc+yAU6gYqyFnUEU3x3QzP75dy+H2maxrQ/Zf/y+ATM6ggoqbsDZzy7uK6zLDDJopJzEmovwMTvJkixm0sjg9sbO/YsQjXJzZKJ7HQmnkMp/pNefoYhe2UnEyi3Gcxcbke5iUIbKgA9oBdhyJj52Ysdv7io/XH1n568q89qpO7k3dcFUpwP2aP2Dk14UbSo3EZZgCJrESqUC0EkMPFvLmsMp8PJZoEpyBcAWEwzQHKi2vdBkQNaSlTvPd98dFr7QzbwsfdhzGancEVb+FIA6iiWmP2cqUNBF8Di3wgBykUenUwSv1QMQPGcWMzEs2I4Lx6hmKj2OejRC3BIL0K+3lA53fbETe08e+XJ2zChOer+UYAZ7BBIpdC+oq0iNuE4bVZScLRmMEMcURx2WrYVQzuUiwBFtd9RbxaAnmXffPI2zHJARTi/Ra8AZvqGaNkvglJWTwrj7EtFORfu+Gg8ER49dODSZ63zUHMKus7tPKp8MZmtfLnt4ze1U+zykTswldhSQF3CKpwF2TVuEGXl9IOgtpkK5ln3JGcdaDdD1dy6rsvrSzEp6NwxHdALsCvbtvJs0+Fb2in2jSN3YH7rAF0jM4P1Iyjk8Yc29rREsjPMZkrX9U2OlTVZgKLK70w0rjzX/nO3tDPs0uEPYIaHI5uu8hFg0mHOnjgqF8Nh8AmJ64RCwiMxsX5VlxmPNp57er3oAHqyeunwPX2LALW9sNvHuhSb/xEEqCLgDok1bQgiHQyCHpFyEpghpkMAKmJRm6FPs4tPDMFcatMZGoOdwmHETP/W7NHX64TCWOl2cP8PgPoH5aiMZPCVhtM/MPdpfvZuPNZ0201ZVqFV7jtglCxUXmLoaXb58UGY0jeVoQp2knBC5Cib6XcI8cCMUOO4GuHRBnFVf3SiBrTy948PpkubA2iEV3XNbxwn5MuEFIC5HFCECQm1m/4owg+hM608W+J1hxz05SSGnmWXDt2GmXQchgbPf1hIExwj+jU9Ss39IZK3IqSyHsEaEcfpuWNjOYrI8XKj5eUzTSvPtR++pZ2sXDp0L60GlG4nV6194YSPRWr1sAdqMVMmKP1uvxfDAZFDQxm9KqlSUQJCKb93FmzT4JQEXSJZWqEE9BS78tgdmMx4GSoEFV+5atLMpFMzddBW8d6NSieCb+YDj8Cy/9ASANShqtVqtUYjBQUhtKqC5Fc+ki1T1eq5ZOO0vlqr8o+jCPxeIbJYotCp3jP5x/GfPMCyUWkwNdZW1WqanKVRO8TH0FOVbzx2Jz3vApTAxHy10dTrVX3bzR9q50KtXjCS8Y583Pir7pVqtdNQNgbd3hULJ9jbQRvWZiZ+9p2OU4vx7rK+sz7509eK5SzrdcqFpiCaHNiTyp9hLz/6AUxnZYaSwRWNs6zxz9pX3lufKPE/9bmpi00TubmHsKWBMyf+VYRdJgCqGsaAbSxf/07rF34U/y7rO7Of9SfeHj54hPfZrEK2wEjKlGxAKy8/ei8tAKXGHFXPsZKyHVrqZWi+dU07IVRqi16fW764YxYqXVjzVBW5KezCOiSykxp6zbXG2y+1f3Zhi8Tilz07+2bh/uLSPixwi2agmGoBqJUpEaDn2DcPDsFsgxdQwU5smGEronk1CdkZHUxTh5Tdyw8eBNa0Q17cSCFsGbacX4aFFS03Xy+13odFbToAUMrPHVWzZGON9Tqk5nS9oaxDWYtjO72S2bYU7U0O7SaAmauz5WWAWm0xs5hibaPl5ST2sdyASoE9AXqaXXlkGCZzKoYKQIsWqKLNKyzHWl7q2BHnWW5r2J3MmIBikwwdgmjmWdV93SlI+yRcgwfAU0WHwIQx04BhE/tYom29LkBlGyqaZYKt6AQIToV1i6gYuYfoCC0E5W1hC0xZ5bmqe6pHvLhr9capj4/FXvqiOyknPkbFSkw2gMFBFKCibMK+yyqvYOhZdunAXZjJywyVvTyt6PDBSYZEEjAss/AyRhh37KmLvjr110lgb0zqzqOFnvDWM3dQwkl5c233PaOCeOds4RQRUEs+q12NMlNPA69Gk8pzea1p5bkuEdgfGE27AcVLC1sl0ita3ZExswwrbdyeBZbcQvghgU+evGLWNEMX6kVmAK/AT7WZqY5Dian4M6MnGYc0Iv1VG6u0eFtyuyZUOUsrqzWN1F9ur7vDJgnQp9nFhz+EuUZvkw6FxC8EMw/J+XYwRq5p/Zvu6XFd1a8sXGydqRu9Fa2acHW1AsAh1UZWZrWM0VrO3r3WfaK8Fsse99zjkwONE4uwp8LMtB0jW006NDPYqHMx9Ay7/NA9mGpSqTyC2W5ma0/pf/ROv6bV4wqxnvOemnppR1mvd4ng2Un5VL0gco1c1Yu5d69pWwMmjePXh95oma6ZfRTY22ETb9JZxREnsPcD6qziKEAnFIxvaWc+ksB+Vq88JBZ+kdKrXB/ZzxxsSzXW/7H1Nz+SwP4Hw08cQbMke3nOUAKUbOg5dmn/ECw0j/F1TcJKcNtkiqUmPdBhfk37/DvrYd1aPnO8NNBWYqU9TmgSkCmRh+chUwG2FfI/7teO8RrDVr0u3L6eGUnXHyNPT/dRAnpy5dL+0Ywf0KJZEC1S6IIE1Ef/TPuNsa0SGO3omaVvHRirreRwqU3YciC+AMJapYe2qwFS83/S8infssfNlPXZ8bf3TFQW25zQSVxdLBpDlS/CTi0rvPwp9sq+cZgtiJV3FkNNEYZgUI9rdzB4zkCqnKhoq5lMGjJKadXvuk6tAOCHK/gTKrgknC1ABeZWzYYJbVEXAXQIoLYzcOqQyNJmlqqa9VQFJcikQ+SI5VLR41dhoVKBMmOsnNTSU5XFLAX3aI7IwtNyIV5gJkDPspf77kOpxQbUFCovqtEivaOlhRQ+BS8aCFpr5J8BVGgeg2ImgmtTEUwpuPd/QrRNeNJh2S6eFqNZ0gt2aBdYC42gLFlrCizQVoqgXmRJ7uBeyOGKQ9MWQ8+uvNx3P1NqwQFRcYQSf8rnaTUcBc+hgAYKLjkYa5YpsEdVotXIOBDlgiCr6EtJh2CHtfJZFxmcCPW8r7UlyrQskk+4FdBz+SyHROZIhJRC5Q/kCtBJDP0Se3XvMEy3IkvwAuQKKHB1gmchdHQ13BlQGPA8sLfA44EzpnuujQcSMJ5ekCvp4HVRAtMrXQCYvvTTfR7JJuf0fKGavVRIoOQsdChAJzH0NLuyZwzm2mSG4lCICQSs/XdgoytYeCq94bXksVC2RHGncqGvxUyZdwQbTbA3i49nksKZS3VPOxW267TutU2coXoAoGI7jXiR0DKwtIxPrdVulQ42WfJARLuDcmf/ZpjgdjNl7k4G74XRuo+iGCImWAG7JzXGMcjAyrqHQvPVd1am1JnGXP7RW9oX2dXdIzDZ7rWh1NYX+bEOmWRiKccS1Xolqh7q97Led4SXB0hkdFYGU6vVodGsmbqLoQpm0oAICmJoBjJG3VytZALiD/fkZn1zzd+xZKINUsm0zmpVUyuvmrmalsgQ0fiHJefoA/Q8e7X3LpSKY6YIm9BWyNUmtJwNK3DvP5ufn45wlOs+/Mm3+lPLB4oPr6RqWTIDYWuPZPuey2Qm/739t0bWffOID2KMfOzda33lhGgiykUbjDZ8gJ4qv9o7niwV5UxJ7MsQhZF2lqlez1z4yVYJTNf91MLl9qXK8m5h/MMMhuOEeMG7C25cW8eWxrWM5/jIQMP0kn5Qlo3CNwJ0V7pp5VlU+bPscs+kudzBvbwVsNgxFhSgg2XLr2aefnctAqznXGzSLULSyuWDthYKZefhCuRge6q1frHzs1ufy/f3J278zi8csdszcl9e13m1ybahz7Cr3aPmXKcLUBP4PhwM7Luhtf5Lev2d9WxsXQuwJ5cGtk+VzZ28++rZcyQ7A6zR2gE1FKDM0j/9u85j2OLfsteF29ebx7XkfpF6ikyJmx1ebdL5Uhyboc8YV7tHU25AaRcG3ykGRWhmueW76buDX9+i3vyFmevNtVpl7z3NSPL9R1Y86kZIsJMCarE5rAA7k9kqtMIHz2mf2JJ6aP/QUHYpObpvtFrJYLZEsnkBtRl6mv3DrmlzYZsd2OtihxuygNJOBBXrfllIsbxVeCYzt8Y8hJwkD0cqepXNmGVtAsraoDltN8IowfCGKbaztOqQCCiuHkY7ljVTLM/7SmGveNJiXFzRdVaqGjC5Wk4MG6JRh9mSC1BsI+eEytsM/SIb2DlulrbzXN7OlNy7xbBIItJPquOj0PGECxoe9WfQblNnUbBTxMK+hQ7WDJIERe5hRQMRf6JdRRX0QRri4AJlk/pJqOY8lzesbZBeledxaM6xoc+yqzs+NJe6BKAiEnRUy9l2jbkzDYZDGbmk2iuuJ72z7KTcoPOnn/7A3snlnU23GGCvr84QHPxTqimah4KZos4gXtzLc4YKQG2GPr18dces7gZUfEB8UZ7sgBmiVpEg+0GlYgMVRew4NGDDAA2HPwyA5LPy+cBNhyFJAoEjsnNMjZGC4ifP5a2Jp5+kOTag6OWxOEKZ0tnlV7om9ZUdVDqTAxZyA2IdiOMUYu3YIIJGFSKsJW1i5t13tw2uRHZKiZ1Jp8mnk5xJc2oIqrKiwmSFpJ6OdE7iKnt5KWwa2D5llnZyo+uqlbsFo4WtfjE879hChdhYhV1zv+VWRfeVFBIoNGPjBRJhbny23Jpl0g5SeRvQL7PXto2ay7vCAI3aoMrnLKCH7jf8UevrreMWvYhljhsMmsAQR6mYZOUkKR2YLIFjIILDpqXXtpXSXkCl20WorD2M2MwMYq7/ni6VVUUVLtkCrhtgP51rh43Va0aEpaValeyUnGrT4uudM5mF7mETH48h1coDZ8vDOes8j4HwEzPCMXBBPfeMd82IEC4EUNtfB4ZW8pQ6YJL9VtrQC2ygY9w0ehBQ53ETqghNbT1jq3qcHRjC8tthCf2ptIeRE2QBrQDLNVGhYEoCWcyUV/QrAT3LvlucM2Z6qUlnczSOqtureaMcUMhxgk8JpId9bpKEJxdxVT3UbnoZGsOGnmevt88ZC7sH6XlNyv3TG2Bn3NhUGpi4W5hN3AQ1l8nnU0i6N82goyviVHmNvScOPb/wevtc0gLUWp/pvr7fq0baNrrAGsD0WysFoFGOz2awW0IZlvh2U3ZIXtUQRsgpMEup51dKA20TKWMPFkeo3ucA6g8uYj9ZJnT7odqzBjIzhvmxiBPIbN+1I22nzQrrFzdrAwH9Evtea8koYSs5EtD4+9AjVFKxdTpUK1zqGWav1abJvnYsx+hFWgbSY0P5pgWPyv8Be6Nl0jD6/IAGsTO+g1HFCrZt9NhMRy39Jsbt99VX9W5RVEIbGR4FEUFWeSkOlQrMdhz6InuzMGJM7iNA8aOqOYql6pGhjF/VQ+2xy2b6LaHDvGCNsFU9EMwwWxl0zLKhUj3UBvQCu968YMztxwIvX0ooEcB2FJsZHknqGw/MGOYjTkIQGB7JtlJ2jWHvSy0Qbz30Bfbtpglj6aFBqTjiunecHD0uMwOD7CA1lxmiUHXPff3WLqpu4NhEd5hGghLA8nnid+6UpHqozdAXpr7dNJFzAJUXanEB44Qqa3zMhd9fSmC5QA+z12GrSiRWhzJTBZwKZH88agPqdUrPTA40LufhYVR550GscZ8sE8UAtc2MdkBrY6baKMSVTRW8e4H2MzWw2vQ8+7f8lFE64AU0cntKXDW3WK6yTi41i83M4PaLzyYHslM+oFJrWTNUzlDKlKwWiK3y/eyt7JAx9ShVm2ing7ASIZ418rkh7rqmn3PrCI8CJtGR1LpmqEf3jssbEpGdk8/zT4DNUMspFSFdfr73yXc13Lo8ahw6fNuc1cSGAff6O2XUt0Z2ulVSYRfjslNx33is9NpFFYiyw/CC6bb63nooLmdsyqbnX9h2aJDvLD658NqB0fpynnbbBoTO4u24YEog+Rgk38DHpgBHpPDosqVT1VOd26jY5o0JvDrkBV3+21pwIS0WSzYnBvtbj8xzQH93/Ep+Lrv68BSs8Kduh2pMnPTNuoBbucKACok1Q6KM+OwM89xes+aeJifMcdMC/8LFtrjIYlcmV+rv/tgHeBd77/vxyUvbp9OrO90LDaRZ8zw5Uc1iqxQch3UbUHM//GGPenMzi1oYjkNUHZftqHukCCQPmaxtibu0bLUwXHmv/5jYK+V6mMDx2YHCXHWuZzFZS+NtnI6fNIsK+op+tqeCGQcwF/toiYV4k/+rUHNnimV++sOzULO1zoOcLjp/RgFfWNGebZ6Z+d+RkWsnnP9DhO/pDOikfry4p3VxFfIsUUuximmdE3MfkktY/2ph5Vis/UtGHdJstZbjk2mB7fWvYu2qsGGJVKKerIGhJeurfPVy5P+fYZ1ISh9r1JN10FLV1qbC3Nd3HHUtbPYxdOO32/gVfvX29cxKcmm3gcvEPY8col44bi3Pa5mpo3s//eFWb+pd64hiPD9krZfc+Pm4DPvXhl7vmanXinJHhq+q1nVIm9m7bzzy6ZmN32nzr/BAAorDRNPzg8HHDxqwmhGlQwFmkTXMX96/tXs7NwLzAwsoDur4rX9tMzKre2jFMIYpzT3dN1/S9lt7NjYy9K357AMNKP6/koaG3zpCgHYmM7W/3PXUja2BYnOu+kADikO8MPb9DnM5qWUSZS2Xblr96q6ffyBtJ03H/wHu5An4eGwyKAAAAABJRU5ErkJggg=="},92691:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABUCAYAAAB9czKDAAAAAXNSR0IArs4c6QAAD9VJREFUeF7tXWtsHFcVPrO7s4/Zlx9rx27IuiUkTeqEqk8VQYQqVYgfBYlSWS0tFQikAEKV2n8gEP7Bjz6iSK1KRalQW0RbCBIqlUBFqOIHCUIlTR8kbY1jx02J7cRO7F17Z707uzvo3MfszO7szJ19WdHuJI7t7J07957vnsc995wzErR46bouLbz7YjIg+aL+YCyglbb8LXbZ4dvDALAFAPjd/mr8CUAoKOuqulGRwaddVtWNfV/4zkYrA5aavfmTfx6N+IZ2p6PD10YBJAk0DfAP4Bd+6+Ald7Bv566rT5Zl/FkG0AuV7KWza2N/mjkvTU9XvA6tKQBmTj6X2jF+S1qTSpKmZgA0FTRQAUGwUL/DQDSerIlQbETtBU0GAoCsgCwrAHISCvk1bfT9K2ekqamyFxA8A3Dm77+Ije69ea+Wz0qaugqahl8q+aIA4OWB8tiUU6fmNisZvUxLrG1zoNC7zADISgrwq5RfV1MH7/lQ7Om0lWcAzp/944EASCE1swSaugQq4YAMaLWrn4+CExXHLYhLc4QhZGm43h37tFsEjcYry2y9IAcgJyRBVpIgJ8dBSY5DZmlufuLQD9ZEQfAEwEfHH48nxib3qpnzgF8GAETu14gfpxHUThjZmdxfT6bmwaADMNOxcV/s+USuuy8U0orpAOQEzgFyKg1ywL85cuM3ZzoCwNzJ59KBYGgkk5ljAKxS+W+IHjZpQlDRIYhIcufV7eVJrpxg6cydbZEfCAegGEqmIRDfWdl52/3viI7JEwfMv/fr6yv5tRgCoGWWQNVQ/FBK+wO+YiAQUIuaLIVCIdHnAxQAgDfHn/HC3/nPNj156L2mQ96xtx64WYrGKxQK4K8UQmVJD/O5oyKmAIyDktoH48PZ09Kehx1mUJ2UJwBmT/3yhlLuUoQDQBQvV0igrB164M/z4pS/elueevW+awKFrXHO/UQMoS4gAOyGnCzN7rnj4azIDD0B8MG/nzpQ2lgKqcgBxAKiqx9ZMCLH1m/92u/nRB56tbeZOfa9nRUtO6apKH4zKIQAFOQCCkBC8s8N3vnIusg8vQFw4skDpcJyiChhFeW/Rswxwn6RkcwtX372rMhDr/Y2Z197dJem50e1DNIAxTBZhSAnU6Ak0wCKPD9x6EdClpAnAGbfOjqZXVsIawiAhg9HY0ABRRkHX3Q0e9OXnpy92okrMv65v/0srRc2R1AP0o0oIQRZiMgBoMnzE3d3BIDHJvNri2GDA4j8TxL7NxIfy97wxZ/3BACL/3gsrWZyI7gQURR3HYBM5jyAmiG+HwpAGpTkjo39h6b/K7KCrvY2828emfCXMil11Q6ANICmdJ4DCOshAMQGToMS3rGx/64+AF0TQQgAcoDCAeghDlh888iE1pADuqQDKAeg8kclnAa55zhATamr1Bzvug6gfqDeBYByQD0ACprj3bKCDADQDE32FgdsHwDHH5vM56gZ2gcAOYB6hC0b0j4HdN7IrXIAmuNLxCVDPQLjgC7pzm3E+hxA0OUAaIwD+gB0ftFbnmAFgB7JGi7pPgd0Hg17DkBvaLLDVlBfBNmIoBoOQG8odMoZ1wegHoDMEjtEpu7oDivho5P53EKNGUq9ob20E7aIIDwTwJgoYAB0lgP6ANRbQTQwgRzIsIP5DoqgPgAGAHk1Rc4DajgAvQJa53RAH4A6DthOEUQDlHpUB2wnB5CYIHTDmo4ke04JbycA6IQi0QAMAIyH6W0AaFglj4rorA5YXwijB5AcRPQBoEqYW0EsLGUbAMDzgLGN/Xf9uCcO5RfffGYC8ldSxC1PlHA3OSC3ENZW0QVr5oBeA+DIBOTVKgA8LqgbHFDCnXAdAKgDdvUQB9gDoKArotP7gNI6uiKsHEDC8XpKBG0rABeoL4iHJpKwlHGQ470TF4S+IC6CIEODlI0Y2VSHd8IWDsCQSBYVHI6NqaFwdFkNxn1xiAMkyF9yZR0CtfWYphsefGrZGlc8Fql+xv43w9okYgr7rBqEzH9KlqN19/FO14DGzA6U6ttcYY0GSgXL/anBuL6Cn11agUpR1SV/YEd548qgcTbeLQA+Pn50Ul2v4QDmhCIeURKiOE6cUiQ5iKf8NDgjaZzR5XSo0mrSUpMHNpiGi7lwuOJRBPOwRAxQ6xYAs8ePTpY4AGwfwBPVSEwMIX6SxIvyHCo3UtpnhjVJpLrbvIPV6A6SC4HpWEhwND0xP4J8qTSzjYfpd1IEWTiAAMDsX5IvmwQgxGe5s2xQjqRkeWSEUURyylw4SqgPNqCmuI9wgUoDk9ETQBI0WJLK9gFAKM0SljFXBBOX6f81uuw/MZOkEV+YcnTtOie0sEGyJomQ3spG4QK+dVQsG5RxQ7U6AM2TIOcBXecAg1Y4VJZD6wIAmT/NaaCX7eo3wYTqBGSoyHK5DJCNyrES3lbQykaCSUj268Vy0Sdr/phWyYdoyQQRtrJfJgxq0wB5Ki0dMO262v/2AGDkBrusdiMP2Jkz7EhBICVlAWSIKvLZ3VN/qLGVrHdh8ZAPXvrGDT4tH+bJ48Yi56DzRdM8PtWH8j67zwG0RgTXA25q07s65IKC12RIwrAyMDM69eym27NmXvnWvkouF63mMJtWahtHTObEwewmACRHjIdlu1HDURu43UzSoNl5axJ8keFSJJZYiUnh3EZY9/n8IUlSg5LPvyXl8kUpoBf9uq+UrGxkY8Rby0zEWhnnvBhqlUJ9awtHcabmJQu6pwM4BzQmYrOrvtqjFQB66E0LY9AqJVTv8DIJxERE0xBtdQ6ASReIj8dZpDLfm3Xi3eeADgNAWJsrdWrmGiUBFNxncAC4LkQbHSu2sM0SL6PD9JQY8WutgupdtnqEQ0DWAStXQDgAOpMjxvcBZCeIZWpU+wIdlGytb7EMS4RkoiPBORBK/U6bb5QMO71av4isWDdpJ/C5E1+Q8RlmaIcAOHviqQOwuUoStXmSnpipV5WrvNiLwHyNJoYlxPUBFz2WBcsULatbZJTPqdsb2C+O1gCiC4TGhqbRPzY/IFiyxlOi9rm3nhgrr2XkcvFyRa8UdRVZvoUL17H4RVvjv3l/0H7ceYBIMKBjpJplZGSceCf/Lv7U2paNxiwFgpIUS0iR2A5JzUiru6YezYs8xRMAIh3223ijQB8Ab/Rqe+s+AG0nqbcO+wB4o1fbW/cBaDtJvXXoGYBzb70wlhz+9EgwFPZpuRzocqXh8Z+3odi0LuL/BV27cW/h2kXrDYJBgGIRSsXs5sBn7xauHOYJgMVTL08kd92cMmrkGO5YJ7eih01ZO72UgiT1MDrnHk2FXDfOv31x+I4H/ycyBGEAZv/128TI+Gf2UOKjz4VWS+Eu99Y2MiJDdZm/py48kJ2vrUZnF+SsAq+q01ALRPQLp5dPT05NER52uoQAQB/72swbB8v6lsyrRJEjObL9N69+syfRwyRtRtgWQM3eEGOYdFzN7MidCEkr6VJ/FSRToFW0zZHbplzrhwoBsHjypbQcHR6hsZAsMBfPQ0m9aPthuRPQvKTcW/OniLc0jcvl4KVV3xUZExdB3GOLEXLqeVeXhCsAs395OjRw7bWTWvaiVAUAD6X5YYzpeLEtMtzKOe0guHMf7k8Q42VWypgDkEpDQBnUojd/9T+SJDU0VFwBWHz/lX0AehTjYHg0sCF+LIu/3vtJptaGYz8ricTIYceXRj9ucr3u5uozHZ/OvbYsRhQdc6Gythr5/AMfNxJfjgAsnnwuJUd3TpDCRKReNK8SaFr9doPloRptdUu7qTOmCBs0sxDfrKpEunWsQV3DQdwrynKG5cSn9MzS0kfXfOWwreeyIQC6fsy/8kH0YGlrxc8BoCdO/EzcLvyDzoYopDaII3fh4K4ZCK1rIzCaAMAKr5P+wqopeDZAK+liAadyKLQ1fPu9Z+ywbgjApXde3iP55QQSv1702MkVk3XRBrHjvJ7NhG988GMhfgtj8iwCjVLGKYBUGpRUGvTs+oXYnd9ergXBFoC1d14YKIVHdhOxQ8QPFT28VnSdYGc0QGuCxEkSm7h5+S++8jlMDfQP10HmBSsocszN6O1edA97w4bBBWnQ46OVuVPLp289fNiyFOoAQJv/0unXD5aLazKpCMWKk5LzVv6OmJpJbB/h66lZt+qbXAj1atdd3FlAM5mlkKKFnHyafyNx6D5LGlcdAMTmDyZGSIFuYvlgSa4Gb8ggstW0Xltkc7FTZPeVaFhfTRK/ntTeeNK4n59jE12QpmGLamZ+4NADRl1pCwCzs0+HBjRm8xuih5ZjMcSOWdywNya1Y1cpNkUX4ruGO4rJn/qxiI2utndzTBMgCOP1ewMLAItv/24/QFnR8A0ZmAdGwq+pz8cq92ksjmHtiM3LwboW6cCZCHU2vllsi3RfF0DmZOm4d1jVG3gcjRYRC99PpaGoly8Pfu7+BezFAGD5xG9G/UNDu8w2P40ss5qvjmvQ1vfS2J5xFybuE3W1llh8UdVr6Px6lebWenWctgobxTRXyFjic2yXrsClGenGh3IEgDPHpoMjk7dPljYu+KjJycJOzFEPpGfBVWhHN04IYpkwWdHgxT31FogYEPatqmOuG715RyygvzyDY4TEMDeFiQsqodBW/PZ7zxAAVt47dj1IEKuufpb9zXZTEoAq++IZLSKVo2SW9N/tujr+9JxpZvgw8++Ck5aKJUnSKwmtXIqbE1kgieIoTfRBOZv/mALw4V9voXKfeztR7qPokUGqyOsHD7/WE68mEaStp2bLz3/3uoqqDhnyw7Q3qMQTBQLApXdfvSl/ZYGJH/ZaDnKHAnJo4PL++18kCqN/eafA8vM/vM6vbQ1ZXnjEnHX+wR0UgMUTz0xom+baB3T187yvYDixEvAN0LeGJpP0m/ex9MYdzFUmqVtSRS4kSmpmGI0ZHipv+IlSadgqRj8hAODu99wbP91b2Lgc47WQCQPwiF8eEs6jkquHcFclUd1NCbEtoe3k2SkhcdlnaLg8JnPTN46wjauSgkB8cHXw6z+hOoCCMO079/ransLmSoy6HXjjJGAKKs2ArKaferYI2gaV1UnQtm4FrCCRZ1FXCE1pJUQneQr4MzPnMbE9FL0y8NCRc9ifZSNGXs782vcnttTscNVu5q9s5d9rSe9g5omM2K2Ni6nY3oXQuDezV8P1mSSdlYOAx7aM+LIMvkj84vCDTxgRE7be0E+OPTK0CbmdoBWMkBsS/075wrodMCW+1R40Ge0tuQJ2uzXXKbUW3+9xdbe+pPhLratBCz5/IC/FlAtDU49bkgwbngdMT0/77tlzMRkJa1FtS7e8ppy+WzFM/haKNFWUv2+x4A9I+HORpZCStzaG+e8h9trI6gskeTs3RuCfN/c2SNHeWTvHt0BW30PpNpZg0F/WpNKWpqqZaw7/yvZE7P8Vipiu8V4ihQAAAABJRU5ErkJggg=="},46016:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAYAAABVVmH3AAAAAXNSR0IArs4c6QAAIABJREFUeF7tfXuwJFd53+/0Y3p65r53V8vu6slDKAghg4SE3kgCSwjjOCSlKuwKxIaUE7tC4nJRJtiFbxWOE5yKqxLsuMDBGMlAkHAcwBAS7AjbvFYsK7FiV4+VWImVFkm7e++dVz/Oo7/U1z09t6enZ6Z3JcgfydRu3ZmefpzzO7/v933nO48R+P+vWggcJfLC57FvEGCXA/i2Az828C2AKEHfBn545UV4TAhBfENR664/gZOOETV3DbASGCwqwqLvoZ0YNKSBIxzYQsKBDUoIyrKhJEHZAbSyEDVdbIaEzQtX0Mkr9mIU+b5j1GxbeJlN2J0YrCY2ElJIDIAk/Ze9yMCCA+EQQtPA/TdcIDb/rwFLRN5WhJfoBLsswk4Q2lqDwIXnsnLpkX4mrYfvAZicDAaCT3FESg4hDIQGSNjoJ4QNO8EzF52D588G6MPHaS3SuNh2sCfWIKWRCAuGy8fvidIGToHlolkCFv/3GnBAiJ5/Bf73TxRYIrIj4Fylcb6KcA5x4RhIg0TzewM2I1I2EhMBNkAMFtnpcQzBTi3NmAxQB4BkYAUsh48LWImBxYALCzqx8SxCnHjlefjRPJAfPE77jMErAaxECobBlBpGJUiMgpGERCRIlAJx40sbZBkI14GADdu14DRtuK0mvv8TAfZ5ooWGwiVWgr1Gwo6BxLZTBjA7UyZYNkykQQ6lhU6iFNEMUMXMzVg7ehkNoQWEw2gCgsEUTspcSySwLAcWg50I2CnoCZS28ITcgyeuFEIV73XgBO1EgsuExopUMIpgtIBOFEygkOgYxthIkgSJVClb0/9FKbA9WC0bTtNFo+3h9I8VWCJa6ir8vSTGPrApZSCmYNoEE+oM4CEDUhNjs2dmjABlc1egIhKRznwDA5qaI7NTQzTclMmWcCFS8zQZsA0LduLAshM4FrPOwpOnNY76Gg3LxattYHcOaGygKYGOE5hIwuRgMlOZoTmYatjQsQRZAsITEG4TdqsBz3cR/liAZf0MFF4jNc4zGsayoTXBEJsVYIhSMBPbQRKwWRESBi9MRTUrvGRGDNGUw2P8mQ+JTFdHJGZQNSBcF/xGRALCNrBcF4IS2JYLyxOwVZKBLACL9ZmZnfqeBCZMYLSEJgM9ICSxRGIlSLS1raWCWSvRtRrouAmCTY0FinEus5fBbdgpsI2VNuIXFVgiEp0YL1UGl7KFEqAVGzEDSjDMCtvJGMqsTEHM3qeaVQa0yFJV+DB6OwQ6Za+A0Gob9MSC5TpAEsOymb0WLKsBhslpZBLBoHIhWDMTEtB9CcOAMjuTITtTYgr0mg6ef8cV2BBCjKKBj/4t7bEMLuglGfhNC5bfgrvURvSiAXuCqOVHuBoJlhlQTdCkoROCDhUMV4CZmrKPgcwdQEGrcvCmATqUh4y2mfaOXmXgmUF8QqrDFizHBVLGssMj2Hl0kUYgFpJBkAGaWgq/mBkSGzvbeOZtV4pgXOGzT587RJec3MIOI6ClBDUaqdW4q8DGiwJsENA+beG1UsLmOJMIipmaAEbKzPRTL5qBm4I6BkoBpSo2ngmgIw0sPIBBZmfHrOb3+d/UQtgZ2SD+OwLPwcYS8Myd1wpWp6mvP/8OXddNYIUB1IBALgDfhbu0gKdfELBs+psSlwngpcxOxYBqaGJQKW3F2YBWmTczccxnD5lZg6U5jWc1GgObsrnwnNzDG3ZCDYgG4cl3XieenwXqVw/QctfC63shZF9BhTESvpaBXW7i0FkDy6B2Fa5OFHZHGZiK2cqAxir9zGY1Yug80y1WdMS6wpsz0du6DC8/hyWj5cD2mnB8G0//g9eKJ6eB+z8fp1d3etjTDRBHYRrKJZTAai9B/NPX41tnBex9RM4VEa6RCmsJQeagyiFLWU8LzmmmFk5l2RCduZJRxfBpllBu3ZJO58A6LlyOR1sOnr/jMny/3LFYJ7Ku+j7e1FEw3QHiWEPHBGoQ7MU2tn7pDeLIGQPLoL62jxsVYYEsSKmhpMyYmrBzOhMdnWH2JTUYk4cz1eGZ1lCgJLFXt2E1Xbg+B/pNNDwHp2+9GAeK4H7pIF1gHLyqFyDaCCCjYeTXdOD4Dh5+z7XizJwXm38vwvWxwiqDGkZQJoE0zNQM0GQYvoxZ0LxQqa7pvhiAVpA2syiV9vlFw4HdsmEza9tNuJ4Lr+ni+JsuEYf4NMbgS9/DG0MNdzNAPJCQLAN8bctD8s+uwXe4EWozNtXUEFdJjd2JhZhBTRKoFNRkGE6Vvf2c2LMuoMXzpknDGGCF+HZCrwtNXnaS6VfMWA+WTXCWm3AcN2Vtw7Pw6O2Xisf/1yO0N5K4vBtBdmLE7F/SDgLBbrVw4p9fk+lybWA3+nSZSXCRIkipIBnUKElDqyRRhfgv160z8OJ1HFve6xoDas4zpoFaBWjeYMw824JgcInBdeB4rLmcuTI4pAUuijT8QQgVKigpYBIB0UxgbZ7GgfU7hawN7GBAe3oGV5GGlGz6CWTMmsp96cxRbfehK5xObVAKCL8YZl/W6SqtnSYNbgLLZ+YCTtuB02jC4U4D96Olhu5oaGlgDMevMaxGC6f+5U3iaN6Ycxl74gS1nGW80cSAsRAHMjV/xaDGQ0dVLvDM0KiKZVMALVa6CPSE2XNkXhX7Fs2+gr4TDrKEsmtn4AqC7TRg2RYsNvuYe2gGJg5AnF3zBRz7Ihx47ytEXBvYjZBuiCWWJCGWCkpLqDhJdSWNUXPhn2XOdbX0x8HS1OxLwFcyuVSB/BwGl8MwDv6TLAcMxfnjYXaLv1tZxMavXC8eLbTjbI3dDOnCQOEyoxAzW+MgTadpk4VVo+zTNIa+mIDWarhizSpCuWlmP4/tNneJLQh7mK5k82ddZbAXbVi2xMH33rHN1pkae/gwNdbOxa2cb45DSC0QG5mFVZwBmrCskieeyuQqsy+BMNPsy+CVPtfV0XKjTwW98AU7tfyja8FqO7DdFp59303iWLkYUzX2mU16LWnsjQWiiGO1JJUAkwxBrdPFnMWyMwW+CrB5GlkFVhWgdUAtnsMAew7sBVeZi7bcB+68Mx1+G3tVAstDKeEmbuawClYKrIolDCeEixFAbW8/rYtZPl7h2MrPmArWHOdVF9D55ynOnAuvCXvVAf3aLVmHoBawT27R6yDxkjhBrGPEQ7YmHAWMJKBG8F9mWRVLp5r98EGVma5CLYr3nJCnGefVcWDTmMwObdFR9oLnNnwnPParN7WOzwWWw6ukiZs5+A0lYm0goyRja3pxWUurWFbQzLEK1NThOmZfRyPr6m25cfN7s8mbZDSgOYzpXLiJshZ92E1PNHZ4oPdc53y9zNoJKXh6ky6PFPZqBlUg7kloBpVkjeT0DCc0pskFKkzoZAWVzuacOo1TbnS+JmH9tEGxwWOWjYuRwOLMlUkUpXEbD//Yymo1XWvR042dbXhtzzn6C68TTxVZOwYs5wOePInbeCS1ZxArk/ayTBQP2VqMw6v642X2lj6XzXYsbq0b5NfR0jrnVOmGDYvNfMnBsffdJp5f/zKda2zsiwNFyrgJg8u3Tru8Duy1lnAWPXhtH9EvXeV+cyqwx0/RPqlweWQQSQ6vBtA9Zuv2+H6t8aZKyTgDllZ6+5LgTdXIOedNM3sGlP8v+Nj6jVuyYJ/zrt5X1BVBAqsbuQnHrxlzgaYLu+kIe7WNxkoTzRU4f1scyhlj7A9O0VWxxGpoEIVRxladpEPWLwzQCm0+I/2ry8Ap0ccEOUuWlIdPyz70+TfjwTt52sfw9R/+hs4bDHB+SEr3wtTXpKxt2LBaTVgrlnBX2vCabfPUe65oPp5fNwKWE9jnP4uf7hvEWqYJbMnj64aHdqc4rDFyTEvVzZCMounU8dKV5/DBgoycKZMZVA72PUfbCTmH1+8Q3WK5PnqA3F4PV3f62mxpMjzizN/zdY0E1oIn3KUW3F0LjnrPNeIbE8A+eZL2DDR+SsWIujrtEGieWjMWt9Z1TjVDsZLVjuozK603xr45TK5yTmXg2fyb7OGBE+9/s/hhEdT8/Ue+SZds9vWO0wHpiFlrg7iMzNrFFuwlT6ROTCjnW796s+jzdSPGPvEsXRZIcHowlhGkNtDRcCJC2WzHnE6hJNMko46HHoFcx+zrnFOy//FLhjRnc/Zgtdvo/8Z1ODJt0twf7KeLN3p6d7dPkuUgGoZgzFoOu1Y84bY8eEu+88REovvICboxSuCqAeRAQIZx5rQqh1WqmDtF3+YF+HW1tgr4s5aP3LOTshcWXaUsHFq/mWcpTb7uPkB7eqG+9NQA8ZYk1QtgpMk6SgyssGEtN4TDTuycVef0L18pHhoxloich57Gm8MY8UCnYZZmp8WzO6qEv1ihOsBP3GN4oI7J12VyOZSbKjNDQFhXFywlfMf9/vtuE4MqUD/+CC1aA31dL4DeGiA+HZEMojQXm+QYsBysNISz2ERjxYP69VuzsCuVAp5oqwivDw3iIIIMYmhtMpF+Mcy+qpK1gXjBZp9Blt0m6+dzz4klAL77+PrN4lQVqOv3kXPpMm7ajE2jE1DcjRFvBJROl8qlIGWtgfBbsHc0RWNt0XEH9+Fr6+siSYE9coIuCDReyRebADHPvONoYF6YVRlv1gGizjkVrVH5vNJ5U88Zao5ru1ajqSzPcp9bf8v0CRn3HFTXBEqs9RVJHuLu9iE3NaUykHZzh9EOy4Hvwt7ZEs6Kj+aq7xz8lRuGU+UPPkWvijlFGCGOAdmL07Gs0cVjplyKAUffzfPQVYI4OaIyGoousmg2WEVGjnNPpXfjbmh2B9ZDjj09z+399q14eJqzuufb8asiy37ZICK5lTIVqqMytqZxbKlADOxSU7hrbTTW2s4T/+oG8cOUsYeeoisijZWORjyIoHSUjmdNDBDO09tZujYvSz8k1BgydZzTVJkptTjnALgbutR25SWbOFSVQ+VL/vwI7QkG5vUDlUYAcktCbsWkBqyt0WhC9Fg5XRc26+xyG+45i+b4r93Q/EEK7LeO09VygHasU43VoRkydlqWanjbeR6/jo5WnTMTrCnRR3bNkKGFVuIjaSfAhrXaBCVN96H1m0VUpav3HKYFE5qb+hq0EVDcZ1AlKXZYDGye6SoTzHMyB7bURGN11fnRB24Qj6XA3v8MXRv04HVCyFhDKTO9G1sn8Vw1gDcVrHkSUqEJU5lcApRlwLZUCuqyD8Bzj6wPA/gysPcQ2eY7+o1dEs1AUtwJILcGUBthQVcLFxXLwMD6Puwdjmgse8npD97uHU6B/cZjdGNgYA0iyAFPx+SIoNwVreia1mHWbBC2S3o2jmmMpSPzcQsRQMZUlxdeWOFj67cvb1QxlY996kG6Ko7NOf2hrvZ60Kfktq5OlTmVWcRyC/ZOXzRWm9T94O2N72WMPUY3dSKIrQhShhmw02LVCZ3NZaHiyXU08myBH4GaWn/moIr34srySOqCD7tF7pPrbxXPTgP17u9Er9TkXBxpkhtd1lRIdlaprupqXS36hCKwOxedwW/eKg6mwP7NY3TjIILoh5CsrzwZoXhhhTWOlXGe1o4wr2v2tXU0K8a2tm5fOIoAYJ79N2/1x5LQxcJ/+iHaLSNzdaRInuxB9mPIriLdDdM1XvnqnTHTKpOBLIilFuw1T7gvWaTBB9/ceCAD9nG6dhDAZWBZCnS2SGziVcmuOmDNOefMgC+GUGz2k6XKQXXs5PS/u307lVeu0KcO0WpicO1gYKgjKd7ieDWA7qlMV4sdgZGlVtTFGcayuxeEe47vdNffIrIZ3X99mK7iBbcMbJczWnp7xKBSR3PnO4NZVYyvY/ZV52wDv/1gVZ7eMoyJ0zwpZ6xsd+NDP4PHp8Wqf/ZtWhKeub4fQHQlxd0QaqMPyaAO8k5AoSVmES0HdseCcHe3ks0P5c7rr4/S6wY9LHYiKJ6dnAP749TI0b3nNc7Q2KHypOskS/NbMKguwVp0k60P/aw3WoldZuoXD1BrS+DGQBu7F5LkCKAzgOKeVTDsBExjaBXRRsA2hXvOonPyd94iHk0Z+9WH6bIowo6tLNzSgxJj6+ptHbDqnLNd+DwUqTb5YsPnoHpN6n74rY1HpjH1E/dR013UNw6McAd9Upsx4l4I3SHSHK/Gua7WkMKcxQwsa+yOpnD3rpkT628adhD+7mG6eCPGPl6o0C8wtq72na3ZV8pMmV4lb191DWfyhQNrqeX2fvct07uqPBrQTlKm+v2QZFdCDiTUKVUAtU5YWTqHgW21tL3Ldxurrfjov3/rwrMpY79yhPYMJC7hLhzPJ9AmnZ81MbujjjTMBKuW2W9392Zq8vBBzNQcVO9+PMKZpUm3C3AHIH4QN4ShWQgiUhsy9SdpWDWLqeUyVGmt5ShrueXau3zR2LPmHOROSAosa452cc1AIhpEmRQkJWDPJiKoYvxsB5Z/O11HR6Cl4/uwGkOmem/BI+uF5ZhFcHlY/zPfxXWBMqvM1BzUvibT68JoGxTF40SqQ6I8IvEc11pb0M7OpmjsPtT8u1HaMAX3IXrjRgwe01GDsJArqGj+OqFYWUtnevtCC0wwpPj84Zf8h5nKoLYt6rYONR6dxlQG9VP71dURWbvyFCCbf87U/owcwMiBlcxwvIwK7YZrr3rC2eEr84f/qLWfTx+NeX3+IbqyG8CPePmigWE5mFrJGSY9dk0BiAnpHC2Izbz9XLMfVm4MVNfd+vDPbu/DUiUBd+2XV6rE2ttTFG+FUL2h+Xf6maMqJlYq61s6uP0xe8f6apGwdvpwz9lhn/6Dt3mPjAH7pQfp4k6APaHkhG7arR2fAzv1AVl16gOan51N16nqNY2xfRhlFUOq1Pz9ZPN37/COzto149Pfpdf0pbkw1CQ3A8iBgtqMSc0DtXoW+LZMZbXN5MoxEO2GsHe14exc9B//j39fPDcG7F88QCuRxk/1AkiODOJhyHU2Zl/lwMaODW860+wLDM2ZmE+SsJru6d+/DU/MAvVP748vVYn98mDIVE4BnuZeVUgmZ2o9v5GBuE2fgv4roMly5AtrzReN2G7uv7dq1cxnv0PX9TTQD6H7JQdWR8xnRwR5AXOzH5+sNcv7cpKDp6s3mrBalJz6vZ/zfjAL1LsPyssjaV0YaciNXjoKIDtyNqjp8yutcrvc6Smlc2wH1toC66sjP3ln47s5CcamGH3xAF3yrMGudJl4BJPLwUz9m6u3bO/bLX6mLC2C2m64z/zeHeLpKi3lY+yo7n5AXRFLax+D2pUkN3ps/lA5U+v1/8ssZcy3h3jyNmB99Rxh7fLh7myJ4x+70x9N+BgD9i8P0epGH6/psh5pGGbtpNMZb9kq0LMHDws3FKwq91TW5fK98nH7lg8s2O6xf3uHODkL1LsewBukNOcwqCd7lAb/DGoQUdJV6Ty0sdi8zNKxEYhRVregAqW3DOxKW6Q9Lu00789lYExj8xb/zP14QyeGtRlmOQOeYTeuj9tVm+vJp4A65pwmy50e4TEq1lTfQ9JuuUc//GbRmQZqGvwf1NeGUqymieoIahaos5cobTspVeFginVmfV1aEM6uRbt399u97xfLNzHx+E/up/MiiQu5B5bLQRmI6YBus3T7nG0trRs55KAuLrl6ReGR9bdVbx3CFbnnMDXCUF8XK7GYg5qGVBK6E1HCI6tFplY746KOuigDWlVfzsFyNLDmwVlZ8h+56+3i9Exg19fJOvc2XDMIQJsKWsU1Yr0xVc+95pkDyhXIx+kXPETKdh/5SGn9VLHwnFBpLOvrewPhc/CfM5VBTceqNJIc1PpmP6mlxWfmIDeJ59IK65wWqc/+4/bBsjVVrpq5az9dtCGxLxg6sXxOaLXeqtHQSB7bVRUkPTYs1TQHlvamiHcCcrdOxHj83oplPvm9eUS139fXSSkaOai8IntLw3QLoFbLzrinH5V7hiMuyiHHrk1HWGsLcNZW/MfvfvvkNieVwN53HzkPC1wzCKFPM2sLnYWJqKSOc5oCaH6v1PNzoN3kPQLdZz7yD6d7fr7mowdouUm4NlDG7gxIcTJli7upkvQgzsapmKmTLM2bZRvYOktCy43D2sps3bng6Ht+3j1YeznSpw/QzkGIV58OIHlxR5RGB+wzt5PNeUD3wkKx7Qm87KRMHDzxR7+wsjnNSfHxT+6nHQbmmtgA00ANSwmVsSil0GuaN4mkyidwJJCzdYetH73rXUtj2pqXfYKxHAve8yCu3RqgkWbWYyjeNDHKV40M9TR7aLFHcqbd2iGoPJTiuPGOVTw6bSJFXtiPf532km2ukAmSTkQqHfuXUOlwypCpZVC3wanv7adFQXyc2er5wtrn293PvtN7eBoJJoD9wmE6vx/hVZ0AERd8QyodaXe4xuvMkiWVmjx0UGz6nPZbqqGn3Nif/IZ8lXLsl4cSelOSDEMoBnWLzT9Cwmm/Me8/mhVTALRitslUiyvIV04fZitHAqttiAt3+w/McqwTy5E+/xBu3QpgbfBoQpoJglaRGg4DF6SgnJGao6M5yAwod035Tlbb/eF/njHeP9RT1yNcpYzZGcRQmyoL/Dd60IOE9FYvi1q2vX+un9vNOqJDHedUhfTwVgsNYS+3YS86+OG972o9M0uyxoD90hG6YBDg1d0E0amBjgeBo4JIJbzGqczVOjFpuYw5S5d9N45dHP3YjPiUC80jqdrRb5CRaHY1FHdRexF4zF9vJRlTTYGpk2Y/2befcL6lOcBVVsYkqCsBExrL5va5Q7ilF2lnIJ240+FurTIBb3oAGL65Jlij0KtO6w+fknt9Nv2FZnJqx895x6Zl+/OC/fG36VyLzOt4T9meIh5G0cxUHvfnGJUzVKOBv+JkuJFHmh/oV4di254jL0suAcsLpAdPtr73tfXqafXFRhkx9s++F5xrK//yQYJoo6tlRzoqiDMJ0Ik+YVt+30BdzMAamW4NOrY/YTGQGT1gWHIek+JllL7nHvvDUg+lzBBu4Lv2y8uUsF8aaKhekIZQsqehTwXQ3O+vBnW6c5oWN6fPnmH6/JU/jAIWFxzRpM6RL7x7V2+WBEww9r89SNf3Y90+HaTDwSok0hzj+Z6b2E08wIsfPvBXtFtLdRHvhRLobC5+8SFleeDP6XooG1Z72T36Rz8jZoZS64epcUGkr9ZKrHVjqL4ilTupzZAMmz6DOopRx5jKZj+JUiWoM8As1icPrdo+rNVl/7F77xRTJ9WVwU4Ze9f3qN1U5o1bimJeHTKQxPsTkMUbKCI5+Tt3NJ/IL/zNL9EFcaz3hknWDx9Lw1XIQzou1YTVEMLZueacXjsXx4qb0uT3/cQDtAKFN4TSNJipuZ5udKH7uZ4moHC45LK4aq7cETgTHS26uuJ7BpX/L7d5dMA/9pmfz0YG6r5SYD/3IF3akzivG+h0XmiXeM9xwCNh77ac75b3O/mtL0avUMbexTNH8unjuVmVycB7ZfP09GVXOEseGqtt3onNec5J8OS7rxepWf2Xb9AFwsLlIZmkH6U9Kd3hnlQ3m0eVZ/zDsbRfBsO8hEmVk50HDidYWAK4d7W45B//wjvEiXnXVDL2Mwfp1n6grdMxGFilLErcWFjLK073/beIw1U3/e2v0vm9gT63H2bglhPIeYVYClou7GVLOIuLcBYaaCy4wvVtOLZjb8RKhRDWPt4WJTf9Uxz0RzCZnqqkr91kWwzHh0YqtX14sMzkyUAsH73armFu/k0PYsU3x/7inYsztzudBrj4+Ndp0fXMDZshxZ0IEY+185wCX/DUb+coLy+fdvEHPk+7exoXdSKV6u34pgnZVekCYILV8GAt8XRyF47nw/Et3uxOpNs5x4p49w6dh1J97klFSPqF7FRxAK92V3SOlpaBzkFdajlYWnI5CVRbUycY+18fopd1A/3yToB4qwMZs8PnuUi8K9r97v3TxuvzG/36F2lnINXLeT7pYDjvafSQwpIdnk7e5p3XhLAXmrB93jN7uEFuyF3mGAmzNCQyW5EaBv3uMOOfITRvHm5V+JTr7fhw4CRVGFTbEdaOBdJLCy12VOma2LN9iT/9Ll0RhXotdVoDqIBlIBHW2pLT+cCbxJFpN07X8n8N58dS793oAjytPC5NfywCwcxl7eIIoZnuKix4Q/J0w3IepVCCkkiCWE9ZVsZ6UhXMO9sQqlyf3Enx2NWqqzvN1cWjs9KVdYEWn9ivbhjEaJwcIO4p4m1KqCWE015wnvytW8VEt40z9lEXL1NCn9cZACdZlwdQveEUyPJUnbIGckV4xzXHy1KFvFmgSRxix5R1TbONFuowNGdjdvJ2lXMTL5t6+XjO0uUmkee2jn/5F6dPp68LaH6e+MS36c2nBtps9BEHw2igxVq46Bz51zdkcScH7X/yAPZ4hPOFZXZHESgwWUjEE3Z5dQmPgrImTluyUyxYcfpjjsk2oGfvnOpWvshSr2FtNqLjT/2P975itC9h3fvMOk98/Bvqp5/Plt7IPv/ODwB2MqvLzrMLFDu27a00LbMLFmz+6RJtwYQx8cQ53Y94rJ5DI9JsxkVQyabQsYWjNBp8vJx9ygAd51B5JWGJiKN6VMWtVZUsx6gcQuVD1m3fiXzLfeq//6LYejGALN9D/PF+uuVkR5tTARRHBPyjDCwFTRfOkg+3acO2LWEREYUKFAOal9zHhgFGwh48BZVAPKnCst2YBJ7+9DuQJoDvvLe/00oW9mqpmtzpYO3k3K5OcseUm/38XtMI6CmamzuoWTq64CUhifbTX3k3Nuf9qM8LAVz8p2/Kq7b6wt8aAsskshsQS65weFtl3m2SBASvreWENy/8YEA5OaMMpYtAeDUQ/+yJsd0Td78dz5YLzFLyrrt6a+R5e7rStJV2wPFpzvDpyelx3ZzVry+DkAf5ZAleRIw2WZ2m7z3342LoBGM/sp8u2urqCza3stXNXNl0+6MGBPuXdDNaTsRoIElYWyndzSe/UcOFJOU+17PxXB0L1Ju/AAABOklEQVRv+i++fNTbPL13bUDOjlibNkcFzGKTUOrA8vtOG10d0+rhGAabNx/nv1niRKS7FrsNu++76nTwVPtUnYzUC2HoBLAcNvl/pa7aCIWzKUnlXp1bnH9GZFTRgvmxydugvorjH33ynYv8+ysTs7/rFPKKj5J7sTVYi22nHQnRTqCbscw6DXlPTsf8MzRDuSgMBjn8o1LD13DGDDUoiVqu3ZNCdpaWljp1GrpOOc/mnLRwv/9N8jcH8uW9rrXEixyYRflruHty+tG23cCR4aa17G/MS1KfTWFYMu68F030+wtd13KsSNjkCIeMcITk300DqAHjpD/mQEaJRDWarXCXRPiJf4L4bBv4bMo675qxEYT3/+XWahA1d1LLc2VfIkoodnUS+w0/jjex9bFfHv+BsXk3/3/5+/8DKIf6sstcS3AAAAAASUVORK5CYII="},37426:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAEKNJREFUeF7tnAuQFdWZx/+nH/c1M84MyAzOIBpjBYRgNujWqMFE86AUNYpbRGMqmlTMEtmEGC2yZrfUcTdhw6KbJyYQNUIFycbEVMgTDBoRMwQzBAyia5AFBKI4w7zuq1/nbJ1+3Nu3b9/b3ffeGZDNqbIGb58+ffp3/v2d7/vO6SaIWD71ezYpl0OLoCJhyIgzBtFsQrMasv+Ut+o64FvH82PFdvg1qh10rqxa/7D/lPbHOV+ErgGaQDHa1YKBxz9CfKtHRFS1Ognb2CeeZglqYLouoCUK4EYMQM1teBRQbaANAiomcWDbx8hQWCa11AsFfNGPmChNwmwiQHZLuC6lcmlV63HQE2HDDNNGlAETxrC37w6SqwVmmHNCAb95C+vWCaZOmNlooHmKKgoiYXD7J8mBMPBqqRMInDFGbtyEd4sxkKrAgyCFsfMRTEAU1ZaBqdJXQsHObMee8bLngcC57VZVzA6cp6oBDzMhBpmQeo/7zOiV7kmn2Ne/mIzUouCgcwKBL3qStcoU53o7J4sYeuyDZH/QBU7m4z2PsFkwkCz00b5JXcTB/sVkYDz6Hgx8K5uCHKZ7L35KAP8umwURSe/srYs42r+Y/PWEAP/4JtaRB870XtzQMPTE1W9xhXPg1KVwO46IE7zedxs5cvIA1wADpxZwt8k8uYDb/rPwN+A1PQCBNnzhJtYhaUWT4ijhVAGueUwKp2gQvL77RJmUvwGvScgVTwqtcK9beEoq3L5JI3aCFc5cJsUZulMOuEtRJxb4E6yDxcrdwvECzhhLAJgKoBmADCDwKaz1odeqtC0DrNZ2AegAMgCOEULG3O0E3sxCP+AaIMiNdQt5zgZAB4BuTQMbHIRycEjRaK6uGy9llohHZ5hXop2TALraidx1eiwmy5A4dABHCCGUNxQNuDufIWPolw0MfBhjnQCmvXJAzaz8njY0eDxdg8KainD482EXQ8sG3mclqqKcKvYj7a7FBexfJLmJ6VqGLPt022kXz42fBuA4IVYGMrAjBYV7E1ANBG6bkVmvHFCzd60YOh5NUu7aJw9wp1eLb5ZbPnBhvB3Aq4SQ4XDAiWXDS5hTDP3yHxoT2jPGztY0tC/pzRytTdm8d42H7UArqDyCwt0yWH1fbGp7e0wnhLx0sgCfc+h1GLff90aNGToXbH6nzUA9ZsT7hNUL/K7PNLfOnYVWALtCAVdthZd0pLEKn/uHl5SxFd8cjpCD9kC2QTfCbjca+I1XSKnrFyROB/DiSQO8b6cyuvJ7w6OV7bcPYA/kYNgV2jA9uMqlXoUv+pCUXHRNYgqAvdGBF7cYNNKGzzWBb9CqAA8/lRbNSSXA1doqh3/igLtnTbGhk2ZdwP3tdRG2bruF83taYgveJzR1dcXiMYD8dRDqM8+PZH/+rJTLZLLmKEgFN7AI/sQA96wp8hWfBnopkYBXnhDLIU9qayI3XSWmLnpXvKm9yYxcy4qmwfjDXiW7/ql05tA+anihTzxwvTw9ezID54q+5MJm+cOXJ5tmdiMly8HxhjMK+w6p+Wf20PTGzUa+ODKW2kXFFQRVsfs88HGPanQbbgN3W5SGA9+rjH51zUhJ3iGc1S5V9Y1XxJLz57U2d7YjFu58/1oZDfq2PyqZB/9bH7PSIlZ2RJQc6NUjzZqBz3+CdcCl8IInIGJoS+MCn7l9ezH61TXHIgJ3wY7x8D2F1XfKU6Z1xuqC7dxjVgP93PKBNwaGkoYDvajyiQTO1zQTJwp4qefhTIhoSsHQcoTqIB9+b3P8ip5E6tzp4JnHyOWNIai/2a5kN242snmVMUnmCTSvWZlo4MDQlo81LLSPoHAf4DZsrnAaAzE0QnSSE5YsnJS8vgfNGQ2sLQWhGnmeoeT//eUo1DsezA2LMmOCCsb/IpOFxP+WmJWJAu6sijQY+NZdytgDj45U8MPL/emisjkFrm5CaCxrwqZyylT6LR8SUtdfGk9e25sfuepSErtqjpCY/TaZp0wL5cgwjCd3qfkntlDlnpuEJsbAvrjWGBE0MFHLMEECE02VTzRwj1sYoxg5LY5D7s63n2PnrvvLteT9qeUdxTz305fhfAu4Hjrw8QdeVLehp8glc4n8lVvibV/bqKR/3geNGiBnT4HwnllxKZlQSf9+pu/eD13QGbtgJhHv+Wi85ck/KdkHN9LMiQO+jnVALHcLS5CG2TvIT6iwRXn7rcDWXcroisdGI06ajrpz5oTpNieGnCJxHWTpIqHp2p5Y8s1h0J0HoW7fqxpHjjOqKMD0DpDzz4qLl8yA3N0B6eXDUJd9Oz+SZoyWA+feScblqYyXSXEBD9r6W+uO1nqBc+xFk9JEqAyi5fMCk5Pk7GlEXH+7mY8OLKt+pYxt2JTNy4kEFbQsEzXG5GSSTqwNt4HXCjPMnvLtt9Wq8JQJkXsnlsJLbbhOFCEmJ8jmf0tMln1jzNIx+NL3laHf76GaoOWYnExQc9IseCnWjFka/NizqGco6wp85q9jHZrLpBTaDto+bJsQp37ZgLl+ePY2oC/QpFhw/YoFHOATpSETQnU+cfJ/pwjTQX7wBbHtbd2lk6W3HU3TsOBu4029mjkpizYnCngQbNdecS4sX9j2AX6MK7wUeGW4XlAObOv3oh3nwPkA6IQI738nif37J8y1xYrlJ33IfPPHuYwg5ZjATQlLUq5ugLuElv02cyolqz4TATwkbI/AS2/UNSD8QBE4D6OjF8ekmCq3/XAO21I5IbKSF5be0JZceBF8R/LP+1X1jjV0RNUYkxio5YNnTXPC2yy4hBOq8CDQQSbEx7Y4TTrAl68dK9NPNPwuO64T0nVWSlxypdD8251MeWo3M3pmE+nG95HkOZ0xkadnXzsO/amdirLu6Zzyzu4E+ex1QurxZ2h6xytprWi/be/E7sjE2HAa4BZ6YEadYC3gGF2+dqAO4ClQPUuQskL8ZTc1N3/gwniTDBD+XuePn0Pm4U2KWrLLRAEEkbGr302kf7pOaEmlZHMu+NM+Nfef6/Xh0WMZcy/JxCuc4syoEAvK9ObRfWx6/cAtS8HNSVwmZMU/Jttm+eRRshrYtt2quuJnLKfqYJ+9Mh5///lITGkrD/uHMtD+5eu5wUNH0yX58QlTeCN8cF+7rgHblwJbdyhjKzeMRbThNmhT2ZYvvvafJ0+a1lk9NfuNjUg/96pi/OgLcb6SXrFkNBhLv5Y99vrBDHUmztIU7ThMmpetYs1Cs7nEX1J83xy1VqlCF6f685/B1OjAS2FzD2Xp9ammq3tQ1Rvh5mXhcmVoZCSPH97Telp3m/3qeoVe7z2k5pat0I5bGUPuimdcOfFxAB6aXh0VGWNzt+xQ0is3GJEUbtlsS9kc+Ia7k5M72v2X0ZzuDWdBr703P8z//9ufTzTPmVb9aeADdM0Xs0eLAZA7vP9/AtwBzW/Xgc1dwM1fTnaGiSgXfHlkeHAkTn/xr4k2P/vt1c5da/Jv7noprbmzhtWW2+qKNOsQbuhToyrcBM6L7ZFQM7pMkmceSPLdt4HlvnXK2PP/C/0X94bLsXzl4fzAs3uo6lZ5lPXNSGuagb1vQIVqwAtwvdexYXNTwhcbeDp22zfMzTaBZf0WNbdzP9Mf+HTc+jJGQLnv0fzgc/1pVaZJWlj9ibC+GRn4NatZalDEFEGAqBowk/KFPrrWtiv1u6yK54cdt2Py1t3K2MpHy224L3BzvrSX1OzFBp6oeu7+Nr6dLLD0vQx132HoH/+gf+TpbcABXlyMSLHSybN6qjYS8PnrWNNoDjMkAaRaAop3slbXsZ+7hbuVsRUPhYw0U06W0EpSOTmT392fOD1EUhB8lefV11TjvXPCLTZ/6bv5wf4XqWoBzzDTRSzxVhoEvLeXCZunYZbB4P/qQMhwPyho6r/TBv5YAHDHj3SZEyv3TQQmgzxye6J1xrTqXoojjOFhGFMCXEJel3s1N9x9fIBJCcMK98cR+HseZl06xRllz2gQ6KDjnsehUcCnnk7Ezy2Ip7omQyTQyvZNSrLMeNfMRKUGuD0aXbPq8zpm9zRgNA9j7a/zmT2vMU0Gs/PjfsD5Gf4q5x5LKJNy5a9YfOg1zGaCz66lal/ziQibV3/BV+HVU7SFRQfX6o654GAkCJVg5sG9zyUx/N8XMuvy10GkOAMUCCIYX+dU9TwTaYLKZo48y+QET9mOE/CLH2LnUuaKMCOC9LXpFdY+OfBtf1TS//F4+MDHDdyy4YpAbdgxiRC+YOw3e3KY/He+pskHhNvKnJEncSSgiXEWVxSoImOCDsbrSibsHJNZggqSlbItt+HVFR64P3zeetauZXFOSYcjAA+y2d7jT90KZEaQX7IqG+kDX+Y6pivvzZXKQZsKNxQTYkHldmYw2KlSIOhxEzbhoM31Te+WCe+kWRk4P2K/XMXTI7vLVHBZL5OyUzGbiOYrb2WuRzVPpSJoVzt+de6/Crh8OugNywePKVoy1NtrBYXrOYJksrC85pgHU+GV9l1VoO6oH8hDYnHKvRILNivsT6m8AlTZU/lOb3tHZ2eMEULK34C45CF2lsFQ9GeDlN2A4zPPAH56C9D3ZzVz7w/C703xha7nCfgnUJKAA7/4pFqkiZQoDqonCydK1ioPB23FG1mYwLmHYh/zX3LzB37zDa2p6y5LTAZwgBAyWKJwnhnMxTDDrewwqo1iryt5PEvnAbfNA55+QUn/16PptCJXV3pxLdPJGjpK5wvKxa8qVY6CXKRtxQvN1jU5bAs0//8sOHhFTbJUYX3TMiGla5zlwD/50damKy4W22VZHiWE7DMH2+kQfxP44ocwk/EQrl7VekYgyKY7fbjzcuDWHmA4A2P/UVU5PBDTRkejvQms2EZb1xQft5B7Ie5SuW2JFj2alpjbu8lDlr3tFNvkk3BnB5Gnd8bj7daWaZ6ZPEgI4a+DF4Ff+gibouaL37YKA6mmOj4nuX+aewbA1d4zvdRPrqxU60ihjRArTJXacnYYFKJV+x9holefNp137Ute9DVVcMFqJgsEswW9mIwPghkUxvuaGc/k6buFwlWHR/DemzWvW83OBX3x0yYT6vu1Pt+57ZyEIzuWIeh9UoMQ4jv5O8DfLhloq3ovDTQzYeaFege0UfdS1g4DPU/Bnv415amloKfQNCnzHmTtGnCO3w0yHbooIc8/URz42WGPOQxlecO0y3sZtW1XZ8P2u6y/BoggIaXR8gCKGhjIryIHwwD21iEXrWLnMYKUF7jIcGzHEhyu9GjUcrG32jnc1L68B7MYgeQ1Y+f9HV7oXxxd5eSCb7GZTHR/GcDCQsbx65RvFfDcc2v5PGZTHq96TGp3J1480EuCA1fPzZILVrNWZuDckt/5OzwEVBBwXNMRudFKb9RVf8Ha07MQlUNUKW20ygneQ4xAEIA2qpQvUhgGhpU15NVahONMmmcwA13exyZo4go6HmbiCvKGwrQRxiPyhRPkCPg0rEvIXXsp/ufxjxCjZuD8xL9fxaYaOrrrukGP21fWoQAfvFA/CEQDjzvXrJYjcuroFLk5DH+p1UMxTbUbCjcvqorpoBX2ati9qlnZQaA8o13tOmGejCDlhznu8KEy3rxrEg739lrfrqq1lIW/vYwJP/kOWomOJqr555TN3xOlySHmqlueNOL5NxSSd4GTgsdHC6zP796nUuB5FSoULs9AJQHZGQqG61G1e3D+Dy50RqLE9NSOAAAAAElFTkSuQmCC"},19150:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABGCAYAAAA3mEEuAAAAAXNSR0IArs4c6QAAEaRJREFUeF7dnHuQHMV5wL+v57Fv3UvHoUMCvYUNBpMirsiOsMSpXEiOcABLgAAXkkicwoQ4xFUJdipWGYfghMTP2I4jYqPEIUiAFQEWyIV0Fc4KihzAkiPkQgJ0Euhxx2n3HvuYR3+pnt3Zm92d3Z2ZnQ0i84dutTvzdff36+/7ur/uHoSQL9q7WYZz+7oBzE6QIApIMpiEoRSjA4DikCT+H9ZlyxZ/mcQBmQ6mmQVFTsPa584hIoVVlJuccBQEAESEsH1FHyjKhQCGFHqlnYoKXXhJYD2wJhWAxYbx9l3j7So6FBC0ba0EkZF5wLGjXRWFdoHwY1UavY0bBk+3o40tg7AsYeeKBW2D4EdRQTXkpwxMHsf1T48GLarec62D+PeBPuB8dtgVq5DnR1HNKtKqLI4EBj+MGwbzzYry83tLIGjvchnScDkAhhsT2umG7GDfChAJ03jLnmN+FN3s3tZAPPWJCwD1Oc0KCfR7K4qqV2BYMoWcyxcdxKt/EJZEaBHEwGJAngqk6HYrq1q+rTJhEWGorxAdxo27RsJqe4sgVlwJCHJYlQlFQW6VCUPx1XKZchZv3X0irLYHBmGNlnZc+xuhVMQ5UQtbaWHLsxusYxrvDC9OBAch5g7K6IdDASGEtENh7ZBp11WiDN4xeDSs9r83IISCZKUAnAqA3ASTK8CkOHCThdUwS06YIKpHcu9rEKbI4RgjEIuN4OpdBafSafNmBosOdICSnwXAYy0BCRNA2RWV8ly27PctCBPy0EPHcEXjiVAxZzXQD0AX+oLRDuU7IVRXxqAM3vV+c03IcqB1/xrXbTe9KpfEjL3gc8YeNoxGE8v3HQjhjnqM15pZghsgenJgPpi8qym8sGfiXuYcPkDQtrUqnBuZAUoMoVeewjVPZ6vb1P5greNpXLfn7abKdLmBfroqAuOFy4A1WM8I2woauSNnHT2AsABMjfSDgT3WOopdV6QMzOh90+kh2gtCFJyM/qo6MPuBQtuWLwSok15vBwSvMhuAsBbH3tw3C8DoLXeiarkc0/jZ6XlIm0GwHK574bAfxVffS9tW9QLkL6743quy/BTs1725gLDWZSbSfUDUB3LVUNytzh0zD+O67TlRzfaBsBqGabyhtdkn/cuqGaDmF5XnBWFkT+sB8gPYAcIaes/fNxN0fRZIpZSPF7CcjuNnB621jfaCkHAUb9pz3E/HrLGIrZ9IQFS/NPQJmj3hCwrWoAxs2nsMtq7sBo79gKbqarUNk4zsJP7eC2fCB1HdC5g8jp/+2estgdi2sgN0c2FFsGtFYPWzfqygMlgXQLY2FERrquPFGqyHPIAgIrHYIyi7px1GRxkc+ovFDXUiqzos+0ZrCyhDX+uB7PFeX7rXswCZU/VzHJ4V5avU4s2+ZDcAQURxABCLPckA1Th/HhEwhvcCvLwFQM/U1iuoJbi10Fa+DcKzFuqAIKJZANCvT6WN9JkDWeP0QS2XHXHfzxMFEAmhvGZUxZmoi60Wa1bQTPeYVGvcdWUU5VSXWdny+Mx5UqznciV5ydIYZDMIQw8BjL4coMd61mjABKMLCCLqBoB5E28PTRze9ZmMmc5STiOERLEyTvMQ35e+Bvt38YGJ++tcwszA+mf6ymvc82Bh+tE45PU65VSlClM9V0qzV/5dp5rsVmDHnQDZ0DdfBARg66AKBBGJ2H6ZNnZU+8U//Xa5tqGBiE8z8KN8J7QiiOK/XkFYHahzLltw0096YfQQwu77fXRxj7e25OJqQfQBwOxX/u1Tp3In9xt2FQSIZLnrT1fMt0W0G0SDpLn4qXvpVxIzr7w5BTtuKwVxj0pudltLEITwWhDzdH2q48A3F7zjLDunELpF7DIIB6QEJMCyoKrL6ZJaswZhCTF3V9YEhDp3tTL3uq/3wNADAMf2NlNv4999jYqaFVULYtHkuWORg4987GzoIErOPQiEypDiPTY42yAYMbkLF971Uh/s/xbAkR3NtFP/91AhuFvEYm1yWPnF9z9SsT3Ej0UwLe7aW+NxMbLyHpRr44IdE6oifbW266gvdBDBMbo8WWsRLYAo+ie3EZNQXV6uhFCrzmJPjyq58jDZTtZbz5dHSHVA1HFLzq9bsginFYS1J6qMpN0gSsHZtoSiQmOYnDWXpWZ/VInGZzOMdzPKjvF89iQffWPIkLPD1uqdlYrMFVFEOxKUzzQ5W/F/ASJUK3AKazMIVrICAaAQ7WL9v/kn8RkLr42qidnOYyYVzdOmTuqFEz/Pnxl6MMuNvGUdFpSKDy4aaRcIL6t0QQGVZbcIouyGLK9U6ZpsCEyPYf/H/yjWeen6lBLv9LxNRs+mefrQ1snMf33bsouowsgViAcAtp4Cu6aWh6d1SLULhA1GQBBWgHIM+1dv6UhevCzwthht+MXciWfunpgy8+QKo10gQh8ZNUgEKiFahD1ackKYe/OOLrXrA5Gglms/p505pJ14cn2azDzVWEeDUVL1T74tot2WYFcwbBDCCgSIAkXY/Ou+l0ouWtlgrNkYjz7yuqn0Liqft5g8uit3ZvcfTpCJZRiNwoaboXgG0S5rqNfksEAwRYxoEhaEhBzDzsXrohdc+0BnUEvQDv1Y006+YiZXPVyhz5HB+zPjh58pkJqnbK4qbjgKq+cHm4JohwV4SY2HAiIh5g5xZBpHpsQwkeK48NbBHkhcFGibvn54h0kvPqTBkuuZuvyLFW5NT79lntj2yTEyGAk3xRVWMapqFojeUxCNIIcGQo5jUiu6pFlXb4r2Lv2zYKdKR18j7ak/0DVukHrZDUxd9oWaYe74f3x1fPTIY4WsUSBuYkUAP29BNHMNLYNQCC1rEC5Jj6EUMVnfmq0dyTkfDRagf7LJmDr9OimqyWHuJ5k68MUaENqJfYW3d941kTOQVKZxO3g3a6s163fLNbXDHYnC/MhtBYSVeS25paTMUaIIYxGVzd9wYCYo7vmmhso6vJNr+x42gSPpoIPStQTUtT+s3BFhNTBLpx/52FiWaZyMAongbbuoZjBqQPhRVjPh9u9BJoCtg0hAUiPUohGW5CZLphbIfXc8L1b4/F3ZDMATt+haPksgGcVc00XLmXrdX7rOwE88OpA2Jk8ZHCXuHNI2K7QCxKEWsq/1Cgo62vIMwmVhyJq8JRIgc5OJkZJckKXUvKVq7/VbmscHsVQZnzndnAPfNbVXHjet2CAh4dUbZeWqjXWD/fgzG8bHTr6q84LGs8p0rHhPQQSxBN/ziDogmFKMDymKMIkpUmretZGZq7/T+HTp8H7QX/gqKWv+BmHmpQDZDGjbPq0VrQFJvfR3Jbcg7VTyxHOfnxw7ulfjqHOOGvfqntpiEUGtwNmgVi1CgLDiQzTCEgVFkrs+qPauf2JG3Z753z8kePVHBJyRvmQNKtfcx+DwdlP7+Td14AZB/xWorvn7aOWrZ2qlTTx+y0R24jU9WxAgiu7JS5z4fw1CpghLRlQmaYaUSHXJvZv2ubomXSxNDj7ILYVzgygWIfXWnYr21MaCln6Hq1KEcO2jMaWjv+mOjvEffXw8nztnmlw2s6i/NyDCDPQtWURp6CqTyZKRCEuwlCRxJneufTyl9C6ssyvwKOnP/bFJ2XFuBeVF16H22rOm5ZKW3a+oS66vmx4vD0pGjvL0U7dPEudmtjDBs8i412Fs2SKGQlgqFRUStTWoIOoPRsMtWI3DVztAdCy7L6Z+6LbaYaddlew7pD15jwbGKNdMnUATI6QrMfmp7zebj1kSpl7eqpsHvpvLl0BwZJx7nE+EAqI6JhBl4O69x+AHK3rAlPoBeNPOVEOlJRAaoYgRRYvoZAkmWxYR61mkJG/+53hDP58+yief2JQnrltD1ei6x2JK5yUe1ip00B6/I5tJv2UIizD5pHmuNLHzFSNasQgXEPi54mFGa1v+RS/2gmbOAvT4ghghL6G+iXc9PyZkWH6ZiNzXrBuMmkSwlpkqSVpKiscliZkozxz4chQW/07DXJP+5l5j/GdfKkQW3ygnl3/B00xc5KHyQ3+dz1POzHHTNLlhBgrWQUDUiwlEGRuE3dPLB1U06gNqcmZcyMXor/De4jHnlkCIWbUYvgqriMkxGeM9cnLdY1FQOhoG3snBBwuRq+5UvQRoPTsKhe0b85Q9ZeSJm5wbVqCuC6K8nDftCFiqtJ0mCAghxg2GC4gykH/4fQWMty4Echzdqp6Bi7Mj90yfHQkMQswjBIjeiMqYJktMYXIUYxLr+5CSWP0dFZRGLtOZI24Qz3QdtJ/eo2kjBw0ibubINHOazk3VMEWaY6qU/CtLcIEgfvMNwsscoQGIMpBvrYoATvUDl7rL5zuEWgr0Lnx++TDiZm7fGwiEc2ZtFAypOzKDiTgRRSYhkyR14YCsXvMlBZTA60MitwT6nq8YheEhC4KwBnvEJAK168w6LBD1rMDZZzyAcLgsFc6OFSe8CXPK7e1nvkFYPUzMrDWyArawikREtYJ2lMUlFDCQSWr3AglXPqQoHWKnv88rcwr0PX9uFM4cMUUuxbYG0nTudEtWBtYork00unxZhNd5gg8QzeoXKEYUQUynwQWIJFdZXLgoJkkxlIogSGJAEsOrbpeUD98mebIOcbjkl1u59uoTJmCOa4bJiZtmnhmcuFKMDdV5pjpW4Gy8ZxBeIRRHODXB2ovC690T0CKKIMR2Sm0qwiQyLauIRxQrXlguSpEtEKo4rC7FES9ZypQ51zDoXYSgdCLEO6x8E+hp0keOgHLyJa6/8Z+kFbLWuoRmSJzQ4JZb0gyeswL0dJAur0eEAcLLsma1Bs8LEKUDLPbikOWeJEJJUyQBI6oqDLVpGOJNyMgIldJrjHWTsCaWy0i6poOCjItsLCErQhAwmM5FfokMpIrY4AGCp2DtxxLKjv98sAgnCHvNWhYhVGWMuGUZqCosyotWgcQZMBnFtFtjZP2tuIQiJCSNMwJTJ2EJeVayCK1oCTkFyV4Q8mMNDUF4GR3V8yXnjUVYI4DSBgIBQY9hwoYR4YyRwjokFZFkpnGTRSQF0RBuSuz8UEEFzcpyWJeEROJ9qjKjgqmTygyeN5FEcLYgGEikFFfl/EJoCiKoYzcwjfe2dpjfWbQdIxZOnTsZ++UjV1uHr+2r6YmhEgirsaUtNUwvWkZMJtRIYTEpgihmmZKCUUZYMDjWTKdlVgKhkwAApkZiwpYzC0QtWEKZszi+teH5C2DobwGOPOtvXbkeKIPO4L2DJ4NyrH7OBnEJgN6z7+E5FYKbnqFzgLDPQdiWgRJhXI5gQUAxOIr/g7AQYRVVF4mD4yajPORB9HoyNAuAsIRItSWIZz3GBruYzivWRy4Y+HIXPHs/wKn94YDIq2/ifcU8URiXDUK8E2n+G0NfGzn90tfLr1r2A8K2Cmvvqx6zVvBQJ0RhETKhOMErPguLsE7zlo705kulkbAKYQ0ChuWKxObjHEQDuiOncvpv2tKRnPVbMXj0Bmui2PKF4h1UXQf9vAisWZk2CPF3ia5PRV/9x4+c1rPvWlNvLyCqz87Ze2DFAZNYLA7CVVmfozFAnaM4nC0AOSsmer/o5YJJpAqAxUxsKPNpBbb86BU3Ri4e+Ksu2L8F4OV/baYPb7+TchY/F947X0WhZYUQkeijH9D1NB/e+8DYmYM/LgQB4TwlVPwcQ+tgvF7cKV6EUtleoWPR88W3zv5qAQjgiqxnYqXTpB+8MQWjxwCevTscl2SAAWP0P7h5sHz61hu9xndV9kwiobO51oFmfcqYfPe4TpQrJ6bcRKGmT8uosyxkDVt1x31h1LyuDBXUVK+kJi8UuS60gvPQ98JxSWJkN0P+NX5m91TYTagNnOItkwA9ACA2E9d/KUp1TfQpCbLjDdYivMya/C9yuSpEvHtjdBjg2G6A4dKrH1rVnLCEXOoN/NOdE62Kcu3QYQqlbWuTkDk3BxTTW9rVC5sgFQxbrkhbZ3rfwc3by1OfINVq9EzTnRNBCqSn18ThbL4TkEeBuAJiyGr5pyDSWnwmSJmKYgLpOkRiU5BMZnBd+wDYrftf5H4s7DrfhR4AAAAASUVORK5CYII="},55303:function(q){"use strict";q.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAFIpJREFUeF7VnHt0HNV9x3/33pnZl6SVJXltyw9kGyMjBztgNwk05diFHmJIk7QElYQmYBxIUx9oCOSc0D8a9eQP2rTp6Ukf5NGWJqchB7vlD5pwTpwmuAnBGGJjbPzCdg0SRpK1eqz2OXNn7u25Mzs7M7szOyN5ZZT5w5K1d+7M/dzffO/v97u/WQS/wccAH2rLlUudhJAOpKO4zoHJTKkgrE1vS70/uw8NGotteGix3VDY/QzxIfydfL5LQtIyGkNxmcq+p2CNGIYOl9b3wKUDaEgP6/dKff4bA3wrf1DOQk+PXjQyTEGShVkGoEGorBZIAyYxnI116eMn0ZB2pcAGXWfRA+/lQ0mlUsmoxOiSgSDBt2bTAdbtalGbEASEA7DpnpIxfrh3qPRegV+UwDnnaC38ZVpTS8s4xm1uOAI2pQKpv5T4wXbOt86REJnFenz8XPfDs1ca/KICvp0PSW+D1k01I2MgXXHDM0HXrDtcShqlxpkge9IULJclWRs/1f74FEKIXwn4iwJ4Hx+Ka1DOANBuThH2WKlbQgQRU7Pnat117c0nxD5kYIxTjvilvhOl7IEdC7vAvmfAhWysh690aMAyBrAOc/i1BbARaNRF0tuPA7XGtw6226oRR4wTyKIp+dK5DQ+rC2HxVxz4XXwv+QW80g0AGQw85gZh/e6F7RUC96TU46i2bPBaGnpoOrH2hGFCphO8e/zY8s8WWwn+igG/mn8zVoK3MkChh8tCNlyHB1IjcFO75+CR1C+S9ZMavOA2ShYBXIxRMn5szRdmWqHzCw78av5QRwWkjAE4HWgpAVJSWyjnBdv7tJjT2ESyHCnyXx8UXVE1DS59Zv2fZIcQYvO1+gUBLqLBb4HaDVDJIMDxpjcXsAh6hCAkuAnTbceV9NF0+08RF2OscgNJeKJ9Fb50GH0+8M6CxtxS4AN8SMlBKQOg9TAgJJIV1A3U6/5VrdR3WC5LDJGksAU5kufjuoa4MuKEc86mlkN87MDaXZVIYxXnRW3YrJ1IIuXV4jIds85Aj62+gyi6HSF09w/taz6NGSRZ0xbgSkax7DrYnngAAAhFOd7RMXYyM1gI4zlv4MKtWwV/3sVM/5kkwy7U8LnPQD3WHajbdZ5MmHWH6XbESW0IvHwMiBGpmAQYe63vvlzQAjtn4EKfvwfaUgraMgN4UAQSzr+ZlMzR6mwbdl/U1u1WW3fDtXzcUMyhwhJo7NTKzzZEsHMCvpI/3g2grmKApHCiTVo0te5mYXs0Tfcukk1sIsz7qcmRNRZLSnz6CzAQBFiVSuTi8c33TNs0IgNfwR+9CgB6Lgu0fdcBemoOpum6HxTcNMqMT7jjvfUoklUHvCGl0ETOahejAHGITb628e63hcxEAt7Hv9ipAlnfGtheOA1hTpgL2CSStHtunk2cXz4m2LLrJtsDyTEgrMgTJ9cPDkcC3ssf7eEAwsLnfzTxt2uPapj7V3tC6tXa9f9armSeXkndPQQ+KWGLcf0ahVHxeP+nT0cCfhe/i/wS1vQjgMS8iAfcnAdJRD31Xt8n79J0wRXWHaTp/nLlOJjeSfVbqD335roO4kTtbMfnD64eLEcCLjrayr8tj8L5dRwMz4ZApAlo4pGYj78cpN0uCLZfZl7QJ9/i0Vs/qOIajgftO3G+1l3XV5huu8aKOONxLI19vP/uMTsdEBm4uEHhe/fBI8s1CitAJtHObSIlNSsJ0+0GKWmE4GuJbqqtWCQ99xEuWYizd08NfGbUfRuh0ATkeiu+Hf5BeUMdWYVirDPYwiN4FE00uzacMIuqQWjm/oUsbPYgqvrvPAfR0gc1BnXGhZl88eSmwbGmwKuAlwFAFwiPpkXhfyTpaVEjMe5hmoP99DQ8WToCJTu+b+jfaxQ+K4JzRrNF0vyMawCK4r5EKHDOuVgU1wJAYqQwrb6dm9YuieoOsdZoavOnwdlKcCZc07znxKzEoU9ToPVt7V48Q4g2I104gTd0ZOQ1bW2xLC3BY7n9cIh6nmzvOtCg3dF0W2g0wiSrsdx4u7G0u8zZisjAOecietw0Q4vwxK9+Mfm9068E1HCkAFKNA+dSHdxqEy7RKnQn3cKJ/be6fux+VfF5sENU+yTEZ/pQ11rp7zbe2rkstUT+aPZpOE+zrgs2Sl5UjwRznUnAJ+QcGz+8zUrRXn/6h71zBb4OANIfefY/xl7PjdQqlbhaDzIAuGjnOxELCDyCwXe1daADv7N76QjkyGB2H1B7799l1bYD1Bw4AMFYZ1i5tOzC+Yn6zeb+0z/sRS4LF30ZQRrOORfP+qZnh89O7/nZf+bd42gEDgCpRrJmu4jARTte8bFyz/lJgIbJdu5sLgHBvf0fin2t/+auB7I/hhfosNWJy430XSRdbTg2vffxT6793ETQbo9t4c7kyWAw8F80OeciR3LV7p8+N/r8Oyc8inbZwIU8mCBdGdwq2AboCwQ8gWV05qOPLP+X0hH4q9yhhnxNkGUjQKqRTI59esWbU0NoqOm2mltS7P6aARdiv2L5t/72HRSjnoKYKwrcNmB7gppYuN00qqUf3rkn8ys6Qh7LvlB7TILCdgKkDJiNvbFq93TUjWMBXK9JitVzM+C9FGD5mqeeGKmXxdYBt3uuWnqQrIhmcwAumkeBfnDnnqVH6Zj0Z9n9ZpzqjTktQIyxYjuD0cPrP5+LsDx4mjiSUo2a5SsB3GOh1n94TVLmAVyc0iIrdwMX3bqtG2FplhXZ2JmNuz3r11ygOxbueD8GCdbwy7ZwC66zcHJVttxBty6L34sA9W5hqqrvLMC1dA+8HIGCn8XbwB/L7q/1oCMyk1QSY60o9rGAkxXufH7rgAuKdR6J44enYHWM4xWdK7EYuIG9buUFqrKp/Ky1TqQAWNWC13d04TRucwIlF7VT46OsHJM5lJ0q4yjg3XNz1CUpEpenukh+7ODqL821m8Dp9gMeJ3DxVb/QnnMeaOHuKzh6XqVtexumZafMOfjHm29L375yY3szQ3ynWNS+dPD53OuVd4xd/b8Ve6jvgx0pWQ4sqygBZY++/OPpn2cvUDf4udASwEd5wfiUcuTsOXR7pLrBG1/amyi00bh7iyxoXCZwjXgizRYCr142larJSFKV0Y5118j/dvPHMxGeepihReOZkTeK96++ocNMz4Ycpwrj6t2/3DtTMXQu7Bwxy5uKCv3ELXt6MqlUHiF0Iexa2y88FR9VyQrEWRdmaOLkpnurznvwmX7A5yUp/hbuBZ5KpSAhyeiBjZuTX7zuw0vCBjSfz4WVb9//3axqGNwNvZXAB07sVRgu9gKgbntVxWo48J1nn4+NVEr9iDOP5SgSeffwwJ2N6dm5S4oDPCnJiEsy6iYS2n3dDYkvbNi2UMD57/38+5NUV5kNvcxkDlCKZOXNLHw7f0GaunhxOS1rGY6wJ+EWBlxMEjGgHwBcaTbL8SRENhI5eubgTYM1uzA7nx/wFIiFUlh33OBYicXx7ms3xx96301NcuTzsW3rHAqUf+zAD6byOmY5VuCVqqULaYli5X7AhzjHz5z6zjKUUJYxA/msITJgVQ+UlK2//rZM5XQ/R9gvAVp1PpGmaKtOH962zYzgLxu4sPBERxp1KnF817oNiUcGbgyukp0/bxP4H7y4b6aMwcgLKy8K6DovzwO4yPlvOPdUDyHGCsSaLCBUBsz8gW9/4QVpIjNxDTb84i5bWazwilO19Mkb/uiMyMPMH7i5YMoomZbRkhjDaXkJ/tg16+KPrLeAf/fc65Xj+Xe5hDEiCHke011rrpcHOpfWasS/f+ENejz/LgPZ9VRSDQzO+eeuukG0JRSAD770TK6CuZEvzLI8xaxi5OcMfPPw0zM6La/ktZcBmm+VBQG/7tgPlgDIIsPqc3hjWcS52jW15PSBHTv0ywJuWrcko1gsjpfGEbl19UD8y9d+0Hx9JEcpLwLllHqzguJWlibTyD3MHC3BDPXmcOxR9FbbCuD3HNw3W6EVY1LX2KyuMk3DrMyqPn3I0/Prj+zpeZ1O4Icn/4eE14k7dxcEXFxuy9G9KxmG5d5Le63bMKiR6Vx6+sDaHWaFbUuApxOYtCud+NbVa2vAT85MGCNawXTdMBIT6wziA50Zkpad7OGxXJaPa4W6bBwFqgH8dqYPp2VZvJ/J7zny3GxFV43JwqwFXMKsXNDNhTPsqEWao07yyvflrIZ9yWANF9K05di+Po7kLic7YydbrSoBhcO5w9sGa7mZ1gLP9Ma//P6bTQv/1/PH1BOFUW7KiawA0XXzp6FTdP/qLdK16Z6azPz7W0eNs+ok0ygAkWQuSIvtJiJJfNeaTdJAypKU+w79Vz5HVaOsCR2fYdOGIVI1bO7Am204ez9rZuFinKK49dljAxs4gjZnAi3tRpyPHNvyh5fcxtAy4CmeJLes36B8ZcEWzVYBfzH4YagrpbB2bYIt3O5ILKBTXdMbOdKr3ooMksSyrw3c+Xb9xVoGXEjKTT3LY1+9Ybu5aJYo5TVddhsNpUjosvtGcpTCDC3V8vCyLPxr6+iVk+biKiz8/iPPzU6XCsyycJVNGwVeKei8PofvR9SRlADgLilxL3kGkydObhoMjTRF8DOsVjZipkuIQ+H1zXe96ZdLXzDg3zh5qPyWkWOMYiSKBwxKkRJTgAFG9/b2K1s6e2teypMXjtD/y2eZUZUTXZY4qNYe9q61W+XrOzOSreGleuCGzu0wv5mONwXuU6xk20hU4OLaAyf2tskUX7VkS/eZA2iH7zdYtBT4B3ozytfe97tm4DNBS+ySpjHk9lLMUciwQUkRd/4kS0v8YrHIZRksy3Zt8vWlOklSlk0LF4tm64E3ltnV7UtGsnB7ssVC2myXqKXAt3RnlK9vtYC3+vAAF8FPoSopl2PhATWPllnUtsnmBDxs3C0Gnla+vnXnggGveSmBwINfNTq4c5e5xfbYqEvDm0iJ7XEYDBYhcMCkPd2J+9vSyjdvWnjgRV1j+bzGcpLKRHjvaPgcgIdZd1XWDLJYgEMKRFgvIs30FQAu6gMfOPKT2RzRjKII7XWN5agN3PFqgh5py8InpcdE4NPUsi1BsdeR9xS4ezB2HuWKAj/xk9lSqchmtLIhgFOxXWda+FyBe4MbbzDubAKL8S4u4CKXknYsfH2yXf7nD9+xYPnw+1/5UUHVNSMIuFkhEHC8/IkHe0wLHxahvbcixVN5VVfYaWgwcXJbuB8etljan89p0Wyw8CpwK3mVJOk4kf5p2x2dS5NWsNLK4+jMhPE3bx0q5nRHUmwLj7IDYQIvCUnxBj4e9D716osKuNjp6Uk72cKkkiBrEt3yHX3rYjLCIo2CMIjUrAwi66zrlgUKH3xzeilKgiyyinCqNCGyirX5Eb9JEnChoww4n+Uq++n429pUKW+IXIq5aLo0fL7AfYVlMVu42PFJSp1oSZzhdHoJTsYSpB2w1NGmEFniJEaSGLBhklfMxJWOzIy3LMO6VBe6b+UA+fu3XjWmNLUWymtV8AZnXOTDxU8dY6NSKbE8BaNkFNi0Vjaojq3Q3tD5fIB7M9Ze3XaeTBkMjS4eSbGAOzs+3XEgCSVBYnKMtMsKQVjCiThCSDdwLWNoArc2GnpiMTRetL4PwMwSVg+NakCqwHXGuMoMljMoE/pd0jVWKGhs1nQJrQ1lE3hIvdvLt3klxaviQd80tMiAi0IU9yZEexyRNimNOxUgmEg4QSRs7fhgxJD4KSSluqsTA5CotQEiDpE5wa4cisFlrsuM67zCixWDM0NnJYMyW07Uos4ryvyAu0N38+I+2m0trBQWkYZbxT+iHoWnrV17RYnjdkXBkqTglGRgLMlYRhgJ6OI9E1kTwGNgYAt0rArfqcqxElZCj1RVBZ3LnMqM00qZU2ZwAVtIib2JjA2Zm3v2c7Rwy7qDZMQ2ARk4MmhPNv/mgR3Rvw8lzFG4DC/FAi6qsey6lFiM4TjuQLJi4A7chhimSMEYyZggoeTmMLEFXRzMtHjnwNySFRWsKaCmf10BAVtjBhewxU9RJiFAm3IS8bAl5XHbSwl5jZBTg/Z0db9pb41FvExoMxt4YH14UA9W2ZtVY2gGQULPUymIGQwzIqE4kVAikQBGNKRUYTMsIfGqBTPrDa0XrMS/jV+nUzH/hpnCK1AGEdiIv6hM59hQTNg16w4dotXg5dseXPpqaZL8hQm82Yu4FCQdymoMzp3cNNjy76q1gQe+AdEcuPP6iZAWAV9EnpxoKAlJENWwTJWQWNCSyWStcDNGnJdqjWqwQmIyF79romjTNQvlqmRgRVg1mKDFPUUr/7HuXkz+yZ0PLXs6exq+kT0SALxavGPIkxvO0pF9gwvzVdg2cOsdn7PHp/e8+KNINdKews5aUaeMxOs/TtlyChLErp61JsAEYMqK41ZwjQq/kbt/io9LZQCsON7LXCC7DeWPr9oce+K6W5b86fCL8GJp1HeRFFVSFOjwiU2DUxEfmnk1q2ko53w9Bej4xPP7Ro+Mnwv9ovPmlbT2vYhFta5m3JXQi4t3M5NJKEEJxBNhWa71NpC9Dy/CdRSTOcfVnzPUfGKiLJSivy7Sjv731k/1jFGdDA5Xa8PrvBJJIllcyr5rvwI4L5IRT3IDF8/UwLSm8a++9LOpfReONi3pbQDuMDZ/q31eqyN3Km3tP5m5j6QzA0zTEFYULn6638FyxmK1reVMQnzvGztXkb++/tbOVakl8uD5/XC+5H2ThEh4lpRiFw9v+/3wOouIQMOaebwEzrkYkXgTOT5cmKqcmZnRJqaLRnV9C+vL//OYeIu5/l1PVyleDECv+9xTqFf9j65hJCkKr2/rd9GueAL3JTrlq9u6YiWg8PjoIThUyppSYhAwMFMme9rSE632QKIAasiucc5F4sl+114MNzADF+UC71WbUVqC/blheDJ7HPJMrwBIeWIk83ded0fucr5Z83LH0xRm9YsOFg3wfQDov8f3x0fYZAJUSSrrREK6JiGZSFQHwiQwFGroZUwoJxLlpTJVtP6CXbl6ubBacf7/A7kxJfsyNujOAAAAAElFTkSuQmCC"},94660:function(q,J){"use strict";var g={value:()=>{}};function m(){for(var O=0,b=arguments.length,E={},T;O<b;++O){if(!(T=arguments[O]+"")||T in E||/[\s.]/.test(T))throw new Error("illegal type: "+T);E[T]=[]}return new F(E)}function F(O){this._=O}function R(O,b){return O.trim().split(/^|\s+/).map(function(E){var T="",_=E.indexOf(".");if(_>=0&&(T=E.slice(_+1),E=E.slice(0,_)),E&&!b.hasOwnProperty(E))throw new Error("unknown type: "+E);return{type:E,name:T}})}F.prototype=m.prototype={constructor:F,on:function(O,b){var E=this._,T=R(O+"",E),_,P=-1,B=T.length;if(arguments.length<2){for(;++P<B;)if((_=(O=T[P]).type)&&(_=L(E[_],O.name)))return _;return}if(b!=null&&typeof b!="function")throw new Error("invalid callback: "+b);for(;++P<B;)if(_=(O=T[P]).type)E[_]=k(E[_],O.name,b);else if(b==null)for(_ in E)E[_]=k(E[_],O.name,null);return this},copy:function(){var O={},b=this._;for(var E in b)O[E]=b[E].slice();return new F(O)},call:function(O,b){if((_=arguments.length-2)>0)for(var E=new Array(_),T=0,_,P;T<_;++T)E[T]=arguments[T+2];if(!this._.hasOwnProperty(O))throw new Error("unknown type: "+O);for(P=this._[O],T=0,_=P.length;T<_;++T)P[T].value.apply(b,E)},apply:function(O,b,E){if(!this._.hasOwnProperty(O))throw new Error("unknown type: "+O);for(var T=this._[O],_=0,P=T.length;_<P;++_)T[_].value.apply(b,E)}};function L(O,b){for(var E=0,T=O.length,_;E<T;++E)if((_=O[E]).name===b)return _.value}function k(O,b,E){for(var T=0,_=O.length;T<_;++T)if(O[T].name===b){O[T]=g,O=O.slice(0,T).concat(O.slice(T+1));break}return E!=null&&O.push({name:b,value:E}),O}J.Z=m},92770:function(q,J,g){"use strict";g.d(J,{Sc:function(){return Ft},y3:function(){return _}});var m=g(48202);const F=m.XA,R=m.a_,L=m.yQ,k=m.Hs,O=m.Ec,b=m.dx,E=m.LU,T=m.Rm,_=m.y3,P=m.qK,B=m.pb,tt=m.j,st=m.sO,Rt=m.BZ,xt=m.EK,nt=m.Db,Et=m.Fx,ot=m.tU,Ct=m.Ym,_t=m.rs,dt=m.QR,Ot=m.TB,wt=m.oH,Ft=m.Sc,jt=m.BN,re=m.it,Ee=m.$r,et=m.QM,ge=m.AV;var yt=(m.y3,m.y3);const te=m.GH,Xt=m.SO,rt=m.uZ,bt=m.yU,ye=m.F1,be=m.re},54375:function(q,J,g){"use strict";g.d(J,{Ud:function(){return st},Yy:function(){return R}});const m=Symbol("Comlink.proxy"),F=Symbol("Comlink.endpoint"),R=Symbol("Comlink.releaseProxy"),L=Symbol("Comlink.finalizer"),k=Symbol("Comlink.thrown"),O=te=>typeof te=="object"&&te!==null||typeof te=="function",b={canHandle:te=>O(te)&&te[m],serialize(te){const{port1:Xt,port2:rt}=new MessageChannel;return P(te,Xt),[rt,[rt]]},deserialize(te){return te.start(),st(te)}},E={canHandle:te=>O(te)&&k in te,serialize({value:te}){let Xt;return te instanceof Error?Xt={isError:!0,value:{message:te.message,name:te.name,stack:te.stack}}:Xt={isError:!1,value:te},[Xt,[]]},deserialize(te){throw te.isError?Object.assign(new Error(te.value.message),te.value):te.value}},T=new Map([["proxy",b],["throw",E]]);function _(te,Xt){for(const rt of te)if(Xt===rt||rt==="*"||rt instanceof RegExp&&rt.test(Xt))return!0;return!1}function P(te,Xt=globalThis,rt=["*"]){Xt.addEventListener("message",function bt(ye){if(!ye||!ye.data)return;if(!_(rt,ye.origin)){console.warn(`Invalid origin '${ye.origin}' for comlink proxy`);return}const{id:be,type:Gt,path:Kt}=Object.assign({path:[]},ye.data),we=(ye.data.argumentList||[]).map(et);let Bt;try{const oe=Kt.slice(0,-1).reduce((ut,Vt)=>ut[Vt],te),ht=Kt.reduce((ut,Vt)=>ut[Vt],te);switch(Gt){case"GET":Bt=ht;break;case"SET":oe[Kt.slice(-1)[0]]=et(ye.data.value),Bt=!0;break;case"APPLY":Bt=ht.apply(oe,we);break;case"CONSTRUCT":{const ut=new ht(...we);Bt=jt(ut)}break;case"ENDPOINT":{const{port1:ut,port2:Vt}=new MessageChannel;P(te,Vt),Bt=Ft(ut,[ut])}break;case"RELEASE":Bt=void 0;break;default:return}}catch(oe){Bt={value:oe,[k]:0}}Promise.resolve(Bt).catch(oe=>({value:oe,[k]:0})).then(oe=>{const[ht,ut]=Ee(oe);Xt.postMessage(Object.assign(Object.assign({},ht),{id:be}),ut),Gt==="RELEASE"&&(Xt.removeEventListener("message",bt),tt(Xt),L in te&&typeof te[L]=="function"&&te[L]())}).catch(oe=>{const[ht,ut]=Ee({value:new TypeError("Unserializable return value"),[k]:0});Xt.postMessage(Object.assign(Object.assign({},ht),{id:be}),ut)})}),Xt.start&&Xt.start()}function B(te){return te.constructor.name==="MessagePort"}function tt(te){B(te)&&te.close()}function st(te,Xt){return _t(te,[],Xt)}function Rt(te){if(te)throw new Error("Proxy has been released and is not useable")}function xt(te){return ge(te,{type:"RELEASE"}).then(()=>{tt(te)})}const nt=new WeakMap,Et="FinalizationRegistry"in globalThis&&new FinalizationRegistry(te=>{const Xt=(nt.get(te)||0)-1;nt.set(te,Xt),Xt===0&&xt(te)});function ot(te,Xt){const rt=(nt.get(Xt)||0)+1;nt.set(Xt,rt),Et&&Et.register(te,Xt,te)}function Ct(te){Et&&Et.unregister(te)}function _t(te,Xt=[],rt=function(){}){let bt=!1;const ye=new Proxy(rt,{get(be,Gt){if(Rt(bt),Gt===R)return()=>{Ct(ye),xt(te),bt=!0};if(Gt==="then"){if(Xt.length===0)return{then:()=>ye};const Kt=ge(te,{type:"GET",path:Xt.map(we=>we.toString())}).then(et);return Kt.then.bind(Kt)}return _t(te,[...Xt,Gt])},set(be,Gt,Kt){Rt(bt);const[we,Bt]=Ee(Kt);return ge(te,{type:"SET",path:[...Xt,Gt].map(oe=>oe.toString()),value:we},Bt).then(et)},apply(be,Gt,Kt){Rt(bt);const we=Xt[Xt.length-1];if(we===F)return ge(te,{type:"ENDPOINT"}).then(et);if(we==="bind")return _t(te,Xt.slice(0,-1));const[Bt,oe]=Ot(Kt);return ge(te,{type:"APPLY",path:Xt.map(ht=>ht.toString()),argumentList:Bt},oe).then(et)},construct(be,Gt){Rt(bt);const[Kt,we]=Ot(Gt);return ge(te,{type:"CONSTRUCT",path:Xt.map(Bt=>Bt.toString()),argumentList:Kt},we).then(et)}});return ot(ye,te),ye}function dt(te){return Array.prototype.concat.apply([],te)}function Ot(te){const Xt=te.map(Ee);return[Xt.map(rt=>rt[0]),dt(Xt.map(rt=>rt[1]))]}const wt=new WeakMap;function Ft(te,Xt){return wt.set(te,Xt),te}function jt(te){return Object.assign(te,{[m]:!0})}function re(te,Xt=globalThis,rt="*"){return{postMessage:(bt,ye)=>te.postMessage(bt,rt,ye),addEventListener:Xt.addEventListener.bind(Xt),removeEventListener:Xt.removeEventListener.bind(Xt)}}function Ee(te){for(const[Xt,rt]of T)if(rt.canHandle(te)){const[bt,ye]=rt.serialize(te);return[{type:"HANDLER",name:Xt,value:bt},ye]}return[{type:"RAW",value:te},wt.get(te)||[]]}function et(te){switch(te.type){case"HANDLER":return T.get(te.name).deserialize(te.value);case"RAW":return te.value}}function ge(te,Xt,rt){return new Promise(bt=>{const ye=yt();te.addEventListener("message",function be(Gt){!Gt.data||!Gt.data.id||Gt.data.id!==ye||(te.removeEventListener("message",be),bt(Gt.data))}),te.start&&te.start(),te.postMessage(Object.assign({id:ye},Xt),rt)})}function yt(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}},45736:function(q,J,g){"use strict";g.d(J,{HT:function(){return Rt}});var m=0,F=0,R=0,L=1e3,k,O,b=0,E=0,T=0,_=typeof performance=="object"&&performance.now?performance:Date,P=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_t){setTimeout(_t,17)};function B(){return E||(P(tt),E=_.now()+T)}function tt(){E=0}function st(){this._call=this._time=this._next=null}st.prototype=Rt.prototype={constructor:st,restart:function(_t,dt,Ot){if(typeof _t!="function")throw new TypeError("callback is not a function");Ot=(Ot==null?B():+Ot)+(dt==null?0:+dt),!this._next&&O!==this&&(O?O._next=this:k=this,O=this),this._call=_t,this._time=Ot,Ct()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ct())}};function Rt(_t,dt,Ot){var wt=new st;return wt.restart(_t,dt,Ot),wt}function xt(){B(),++m;for(var _t=k,dt;_t;)(dt=E-_t._time)>=0&&_t._call.call(void 0,dt),_t=_t._next;--m}function nt(){E=(b=_.now())+T,m=F=0;try{xt()}finally{m=0,ot(),E=0}}function Et(){var _t=_.now(),dt=_t-b;dt>L&&(T-=dt,b=_t)}function ot(){for(var _t,dt=k,Ot,wt=1/0;dt;)dt._call?(wt>dt._time&&(wt=dt._time),_t=dt,dt=dt._next):(Ot=dt._next,dt._next=null,dt=_t?_t._next=Ot:k=Ot);O=_t,Ct(wt)}function Ct(_t){if(!m){F&&(F=clearTimeout(F));var dt=_t-E;dt>24?(_t<1/0&&(F=setTimeout(nt,_t-_.now()-T)),R&&(R=clearInterval(R))):(R||(b=_.now(),R=setInterval(Et,L)),m=1,P(nt))}}},46846:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F,R){var L,k=1;F==null&&(F=0),R==null&&(R=0);function O(){var b,E=L.length,T,_=0,P=0;for(b=0;b<E;++b)T=L[b],_+=T.x,P+=T.y;for(_=(_/E-F)*k,P=(P/E-R)*k,b=0;b<E;++b)T=L[b],T.x-=_,T.y-=P}return O.initialize=function(b){L=b},O.x=function(b){return arguments.length?(F=+b,O):F},O.y=function(b){return arguments.length?(R=+b,O):R},O.strength=function(b){return arguments.length?(k=+b,O):k},O}},89281:function(q,J,g){"use strict";g.d(J,{Z:function(){return O}});var m=g(46632),F=g(13548),R=g(79778);function L(b){return b.x+b.vx}function k(b){return b.y+b.vy}function O(b){var E,T,_,P=1,B=1;typeof b!="function"&&(b=(0,F.Z)(b==null?1:+b));function tt(){for(var xt,nt=E.length,Et,ot,Ct,_t,dt,Ot,wt=0;wt<B;++wt)for(Et=(0,m.Z)(E,L,k).visitAfter(st),xt=0;xt<nt;++xt)ot=E[xt],dt=T[ot.index],Ot=dt*dt,Ct=ot.x+ot.vx,_t=ot.y+ot.vy,Et.visit(Ft);function Ft(jt,re,Ee,et,ge){var yt=jt.data,te=jt.r,Xt=dt+te;if(yt){if(yt.index>ot.index){var rt=Ct-yt.x-yt.vx,bt=_t-yt.y-yt.vy,ye=rt*rt+bt*bt;ye<Xt*Xt&&(rt===0&&(rt=(0,R.Z)(_),ye+=rt*rt),bt===0&&(bt=(0,R.Z)(_),ye+=bt*bt),ye=(Xt-(ye=Math.sqrt(ye)))/ye*P,ot.vx+=(rt*=ye)*(Xt=(te*=te)/(Ot+te)),ot.vy+=(bt*=ye)*Xt,yt.vx-=rt*(Xt=1-Xt),yt.vy-=bt*Xt)}return}return re>Ct+Xt||et<Ct-Xt||Ee>_t+Xt||ge<_t-Xt}}function st(xt){if(xt.data)return xt.r=T[xt.data.index];for(var nt=xt.r=0;nt<4;++nt)xt[nt]&&xt[nt].r>xt.r&&(xt.r=xt[nt].r)}function Rt(){if(E){var xt,nt=E.length,Et;for(T=new Array(nt),xt=0;xt<nt;++xt)Et=E[xt],T[Et.index]=+b(Et,xt,E)}}return tt.initialize=function(xt,nt){E=xt,_=nt,Rt()},tt.iterations=function(xt){return arguments.length?(B=+xt,tt):B},tt.strength=function(xt){return arguments.length?(P=+xt,tt):P},tt.radius=function(xt){return arguments.length?(b=typeof xt=="function"?xt:(0,F.Z)(+xt),Rt(),tt):b},tt}},13548:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return function(){return F}}},79778:function(q,J,g){"use strict";g.d(J,{Z:function(){return m}});function m(F){return(F()-.5)*1e-6}},3168:function(q,J,g){"use strict";g.d(J,{Z:function(){return L}});const m=1664525,F=1013904223,R=4294967296;function L(){let k=1;return()=>(k=(m*k+F)%R)/R}},56561:function(q,J,g){"use strict";g.d(J,{Z:function(){return k}});var m=g(13548),F=g(79778);function R(O){return O.index}function L(O,b){var E=O.get(b);if(!E)throw new Error("node not found: "+b);return E}function k(O){var b=R,E=nt,T,_=(0,m.Z)(30),P,B,tt,st,Rt,xt=1;O==null&&(O=[]);function nt(dt){return 1/Math.min(tt[dt.source.index],tt[dt.target.index])}function Et(dt){for(var Ot=0,wt=O.length;Ot<xt;++Ot)for(var Ft=0,jt,re,Ee,et,ge,yt,te;Ft<wt;++Ft)jt=O[Ft],re=jt.source,Ee=jt.target,et=Ee.x+Ee.vx-re.x-re.vx||(0,F.Z)(Rt),ge=Ee.y+Ee.vy-re.y-re.vy||(0,F.Z)(Rt),yt=Math.sqrt(et*et+ge*ge),yt=(yt-P[Ft])/yt*dt*T[Ft],et*=yt,ge*=yt,Ee.vx-=et*(te=st[Ft]),Ee.vy-=ge*te,re.vx+=et*(te=1-te),re.vy+=ge*te}function ot(){if(B){var dt,Ot=B.length,wt=O.length,Ft=new Map(B.map((re,Ee)=>[b(re,Ee,B),re])),jt;for(dt=0,tt=new Array(Ot);dt<wt;++dt)jt=O[dt],jt.index=dt,typeof jt.source!="object"&&(jt.source=L(Ft,jt.source)),typeof jt.target!="object"&&(jt.target=L(Ft,jt.target)),tt[jt.source.index]=(tt[jt.source.index]||0)+1,tt[jt.target.index]=(tt[jt.target.index]||0)+1;for(dt=0,st=new Array(wt);dt<wt;++dt)jt=O[dt],st[dt]=tt[jt.source.index]/(tt[jt.source.index]+tt[jt.target.index]);T=new Array(wt),Ct(),P=new Array(wt),_t()}}function Ct(){if(B)for(var dt=0,Ot=O.length;dt<Ot;++dt)T[dt]=+E(O[dt],dt,O)}function _t(){if(B)for(var dt=0,Ot=O.length;dt<Ot;++dt)P[dt]=+_(O[dt],dt,O)}return Et.initialize=function(dt,Ot){B=dt,Rt=Ot,ot()},Et.links=function(dt){return arguments.length?(O=dt,ot(),Et):O},Et.id=function(dt){return arguments.length?(b=dt,Et):b},Et.iterations=function(dt){return arguments.length?(xt=+dt,Et):xt},Et.strength=function(dt){return arguments.length?(E=typeof dt=="function"?dt:(0,m.Z)(+dt),Ct(),Et):E},Et.distance=function(dt){return arguments.length?(_=typeof dt=="function"?dt:(0,m.Z)(+dt),_t(),Et):_},Et}},65475:function(q,J,g){"use strict";g.d(J,{Z:function(){return k}});var m=g(46632),F=g(13548),R=g(79778),L=g(80616);function k(){var O,b,E,T,_=(0,F.Z)(-30),P,B=1,tt=1/0,st=.81;function Rt(ot){var Ct,_t=O.length,dt=(0,m.Z)(O,L.x,L.y).visitAfter(nt);for(T=ot,Ct=0;Ct<_t;++Ct)b=O[Ct],dt.visit(Et)}function xt(){if(O){var ot,Ct=O.length,_t;for(P=new Array(Ct),ot=0;ot<Ct;++ot)_t=O[ot],P[_t.index]=+_(_t,ot,O)}}function nt(ot){var Ct=0,_t,dt,Ot=0,wt,Ft,jt;if(ot.length){for(wt=Ft=jt=0;jt<4;++jt)(_t=ot[jt])&&(dt=Math.abs(_t.value))&&(Ct+=_t.value,Ot+=dt,wt+=dt*_t.x,Ft+=dt*_t.y);ot.x=wt/Ot,ot.y=Ft/Ot}else{_t=ot,_t.x=_t.data.x,_t.y=_t.data.y;do Ct+=P[_t.data.index];while(_t=_t.next)}ot.value=Ct}function Et(ot,Ct,_t,dt){if(!ot.value)return!0;var Ot=ot.x-b.x,wt=ot.y-b.y,Ft=dt-Ct,jt=Ot*Ot+wt*wt;if(Ft*Ft/st<jt)return jt<tt&&(Ot===0&&(Ot=(0,R.Z)(E),jt+=Ot*Ot),wt===0&&(wt=(0,R.Z)(E),jt+=wt*wt),jt<B&&(jt=Math.sqrt(B*jt)),b.vx+=Ot*ot.value*T/jt,b.vy+=wt*ot.value*T/jt),!0;if(ot.length||jt>=tt)return;(ot.data!==b||ot.next)&&(Ot===0&&(Ot=(0,R.Z)(E),jt+=Ot*Ot),wt===0&&(wt=(0,R.Z)(E),jt+=wt*wt),jt<B&&(jt=Math.sqrt(B*jt)));do ot.data!==b&&(Ft=P[ot.data.index]*T/jt,b.vx+=Ot*Ft,b.vy+=wt*Ft);while(ot=ot.next)}return Rt.initialize=function(ot,Ct){O=ot,E=Ct,xt()},Rt.strength=function(ot){return arguments.length?(_=typeof ot=="function"?ot:(0,F.Z)(+ot),xt(),Rt):_},Rt.distanceMin=function(ot){return arguments.length?(B=ot*ot,Rt):Math.sqrt(B)},Rt.distanceMax=function(ot){return arguments.length?(tt=ot*ot,Rt):Math.sqrt(tt)},Rt.theta=function(ot){return arguments.length?(st=ot*ot,Rt):Math.sqrt(st)},Rt}},61217:function(q,J,g){"use strict";g.d(J,{Z:function(){return F}});var m=g(13548);function F(R,L,k){var O,b=(0,m.Z)(.1),E,T;typeof R!="function"&&(R=(0,m.Z)(+R)),L==null&&(L=0),k==null&&(k=0);function _(B){for(var tt=0,st=O.length;tt<st;++tt){var Rt=O[tt],xt=Rt.x-L||1e-6,nt=Rt.y-k||1e-6,Et=Math.sqrt(xt*xt+nt*nt),ot=(T[tt]-Et)*E[tt]*B/Et;Rt.vx+=xt*ot,Rt.vy+=nt*ot}}function P(){if(O){var B,tt=O.length;for(E=new Array(tt),T=new Array(tt),B=0;B<tt;++B)T[B]=+R(O[B],B,O),E[B]=isNaN(T[B])?0:+b(O[B],B,O)}}return _.initialize=function(B){O=B,P()},_.strength=function(B){return arguments.length?(b=typeof B=="function"?B:(0,m.Z)(+B),P(),_):b},_.radius=function(B){return arguments.length?(R=typeof B=="function"?B:(0,m.Z)(+B),P(),_):R},_.x=function(B){return arguments.length?(L=+B,_):L},_.y=function(B){return arguments.length?(k=+B,_):k},_}},80616:function(q,J,g){"use strict";g.d(J,{Z:function(){return E},x:function(){return L},y:function(){return k}});var m=g(94660),F=g(45736),R=g(3168);function L(T){return T.x}function k(T){return T.y}var O=10,b=Math.PI*(3-Math.sqrt(5));function E(T){var _,P=1,B=.001,tt=1-Math.pow(B,1/300),st=0,Rt=.6,xt=new Map,nt=(0,F.HT)(Ct),Et=(0,m.Z)("tick","end"),ot=(0,R.Z)();T==null&&(T=[]);function Ct(){_t(),Et.call("tick",_),P<B&&(nt.stop(),Et.call("end",_))}function _t(wt){var Ft,jt=T.length,re;wt===void 0&&(wt=1);for(var Ee=0;Ee<wt;++Ee)for(P+=(st-P)*tt,xt.forEach(function(et){et(P)}),Ft=0;Ft<jt;++Ft)re=T[Ft],re.fx==null?re.x+=re.vx*=Rt:(re.x=re.fx,re.vx=0),re.fy==null?re.y+=re.vy*=Rt:(re.y=re.fy,re.vy=0);return _}function dt(){for(var wt=0,Ft=T.length,jt;wt<Ft;++wt){if(jt=T[wt],jt.index=wt,jt.fx!=null&&(jt.x=jt.fx),jt.fy!=null&&(jt.y=jt.fy),isNaN(jt.x)||isNaN(jt.y)){var re=O*Math.sqrt(.5+wt),Ee=wt*b;jt.x=re*Math.cos(Ee),jt.y=re*Math.sin(Ee)}(isNaN(jt.vx)||isNaN(jt.vy))&&(jt.vx=jt.vy=0)}}function Ot(wt){return wt.initialize&&wt.initialize(T,ot),wt}return dt(),_={tick:_t,restart:function(){return nt.restart(Ct),_},stop:function(){return nt.stop(),_},nodes:function(wt){return arguments.length?(T=wt,dt(),xt.forEach(Ot),_):T},alpha:function(wt){return arguments.length?(P=+wt,_):P},alphaMin:function(wt){return arguments.length?(B=+wt,_):B},alphaDecay:function(wt){return arguments.length?(tt=+wt,_):+tt},alphaTarget:function(wt){return arguments.length?(st=+wt,_):st},velocityDecay:function(wt){return arguments.length?(Rt=1-wt,_):1-Rt},randomSource:function(wt){return arguments.length?(ot=wt,xt.forEach(Ot),_):ot},force:function(wt,Ft){return arguments.length>1?(Ft==null?xt.delete(wt):xt.set(wt,Ot(Ft)),_):xt.get(wt)},find:function(wt,Ft,jt){var re=0,Ee=T.length,et,ge,yt,te,Xt;for(jt==null?jt=1/0:jt*=jt,re=0;re<Ee;++re)te=T[re],et=wt-te.x,ge=Ft-te.y,yt=et*et+ge*ge,yt<jt&&(Xt=te,jt=yt);return Xt},on:function(wt,Ft){return arguments.length>1?(Et.on(wt,Ft),_):Et.on(wt)}}}},70341:function(q,J,g){"use strict";g.d(J,{Z:function(){return F}});var m=g(13548);function F(R){var L=(0,m.Z)(.1),k,O,b;typeof R!="function"&&(R=(0,m.Z)(R==null?0:+R));function E(_){for(var P=0,B=k.length,tt;P<B;++P)tt=k[P],tt.vx+=(b[P]-tt.x)*O[P]*_}function T(){if(k){var _,P=k.length;for(O=new Array(P),b=new Array(P),_=0;_<P;++_)O[_]=isNaN(b[_]=+R(k[_],_,k))?0:+L(k[_],_,k)}}return E.initialize=function(_){k=_,T()},E.strength=function(_){return arguments.length?(L=typeof _=="function"?_:(0,m.Z)(+_),T(),E):L},E.x=function(_){return arguments.length?(R=typeof _=="function"?_:(0,m.Z)(+_),T(),E):R},E}},12688:function(q,J,g){"use strict";g.d(J,{Z:function(){return F}});var m=g(13548);function F(R){var L=(0,m.Z)(.1),k,O,b;typeof R!="function"&&(R=(0,m.Z)(R==null?0:+R));function E(_){for(var P=0,B=k.length,tt;P<B;++P)tt=k[P],tt.vy+=(b[P]-tt.y)*O[P]*_}function T(){if(k){var _,P=k.length;for(O=new Array(P),b=new Array(P),_=0;_<P;++_)O[_]=isNaN(b[_]=+R(k[_],_,k))?0:+L(k[_],_,k)}}return E.initialize=function(_){k=_,T()},E.strength=function(_){return arguments.length?(L=typeof _=="function"?_:(0,m.Z)(+_),T(),E):L},E.y=function(_){return arguments.length?(R=typeof _=="function"?_:(0,m.Z)(+_),T(),E):R},E}},54146:function(q,J,g){"use strict";var m=g(26729);J.Z=m},97582:function(q,J,g){"use strict";g.d(J,{CR:function(){return nt},Jh:function(){return tt},Q_:function(){return ge},XA:function(){return xt},ZT:function(){return F},_T:function(){return L},ev:function(){return Ct},mG:function(){return B},pi:function(){return R}});var m=function(Gt,Kt){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(we,Bt){we.__proto__=Bt}||function(we,Bt){for(var oe in Bt)Object.prototype.hasOwnProperty.call(Bt,oe)&&(we[oe]=Bt[oe])},m(Gt,Kt)};function F(Gt,Kt){if(typeof Kt!="function"&&Kt!==null)throw new TypeError("Class extends value "+String(Kt)+" is not a constructor or null");m(Gt,Kt);function we(){this.constructor=Gt}Gt.prototype=Kt===null?Object.create(Kt):(we.prototype=Kt.prototype,new we)}var R=function(){return R=Object.assign||function(Kt){for(var we,Bt=1,oe=arguments.length;Bt<oe;Bt++){we=arguments[Bt];for(var ht in we)Object.prototype.hasOwnProperty.call(we,ht)&&(Kt[ht]=we[ht])}return Kt},R.apply(this,arguments)};function L(Gt,Kt){var we={};for(var Bt in Gt)Object.prototype.hasOwnProperty.call(Gt,Bt)&&Kt.indexOf(Bt)<0&&(we[Bt]=Gt[Bt]);if(Gt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,Bt=Object.getOwnPropertySymbols(Gt);oe<Bt.length;oe++)Kt.indexOf(Bt[oe])<0&&Object.prototype.propertyIsEnumerable.call(Gt,Bt[oe])&&(we[Bt[oe]]=Gt[Bt[oe]]);return we}function k(Gt,Kt,we,Bt){var oe=arguments.length,ht=oe<3?Kt:Bt===null?Bt=Object.getOwnPropertyDescriptor(Kt,we):Bt,ut;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ht=Reflect.decorate(Gt,Kt,we,Bt);else for(var Vt=Gt.length-1;Vt>=0;Vt--)(ut=Gt[Vt])&&(ht=(oe<3?ut(ht):oe>3?ut(Kt,we,ht):ut(Kt,we))||ht);return oe>3&&ht&&Object.defineProperty(Kt,we,ht),ht}function O(Gt,Kt){return function(we,Bt){Kt(we,Bt,Gt)}}function b(Gt,Kt,we,Bt,oe,ht){function ut(At){if(At!==void 0&&typeof At!="function")throw new TypeError("Function expected");return At}for(var Vt=Bt.kind,ve=Vt==="getter"?"get":Vt==="setter"?"set":"value",kt=!Kt&&Gt?Bt.static?Gt:Gt.prototype:null,ee=Kt||(kt?Object.getOwnPropertyDescriptor(kt,Bt.name):{}),me,Nt=!1,Zt=we.length-1;Zt>=0;Zt--){var Yt={};for(var S in Bt)Yt[S]=S==="access"?{}:Bt[S];for(var S in Bt.access)Yt.access[S]=Bt.access[S];Yt.addInitializer=function(At){if(Nt)throw new TypeError("Cannot add initializers after decoration has completed");ht.push(ut(At||null))};var Y=(0,we[Zt])(Vt==="accessor"?{get:ee.get,set:ee.set}:ee[ve],Yt);if(Vt==="accessor"){if(Y===void 0)continue;if(Y===null||typeof Y!="object")throw new TypeError("Object expected");(me=ut(Y.get))&&(ee.get=me),(me=ut(Y.set))&&(ee.set=me),(me=ut(Y.init))&&oe.unshift(me)}else(me=ut(Y))&&(Vt==="field"?oe.unshift(me):ee[ve]=me)}kt&&Object.defineProperty(kt,Bt.name,ee),Nt=!0}function E(Gt,Kt,we){for(var Bt=arguments.length>2,oe=0;oe<Kt.length;oe++)we=Bt?Kt[oe].call(Gt,we):Kt[oe].call(Gt);return Bt?we:void 0}function T(Gt){return typeof Gt=="symbol"?Gt:"".concat(Gt)}function _(Gt,Kt,we){return typeof Kt=="symbol"&&(Kt=Kt.description?"[".concat(Kt.description,"]"):""),Object.defineProperty(Gt,"name",{configurable:!0,value:we?"".concat(we," ",Kt):Kt})}function P(Gt,Kt){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Gt,Kt)}function B(Gt,Kt,we,Bt){function oe(ht){return ht instanceof we?ht:new we(function(ut){ut(ht)})}return new(we||(we=Promise))(function(ht,ut){function Vt(ee){try{kt(Bt.next(ee))}catch(me){ut(me)}}function ve(ee){try{kt(Bt.throw(ee))}catch(me){ut(me)}}function kt(ee){ee.done?ht(ee.value):oe(ee.value).then(Vt,ve)}kt((Bt=Bt.apply(Gt,Kt||[])).next())})}function tt(Gt,Kt){var we={label:0,sent:function(){if(ht[0]&1)throw ht[1];return ht[1]},trys:[],ops:[]},Bt,oe,ht,ut=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return ut.next=Vt(0),ut.throw=Vt(1),ut.return=Vt(2),typeof Symbol=="function"&&(ut[Symbol.iterator]=function(){return this}),ut;function Vt(kt){return function(ee){return ve([kt,ee])}}function ve(kt){if(Bt)throw new TypeError("Generator is already executing.");for(;ut&&(ut=0,kt[0]&&(we=0)),we;)try{if(Bt=1,oe&&(ht=kt[0]&2?oe.return:kt[0]?oe.throw||((ht=oe.return)&&ht.call(oe),0):oe.next)&&!(ht=ht.call(oe,kt[1])).done)return ht;switch(oe=0,ht&&(kt=[kt[0]&2,ht.value]),kt[0]){case 0:case 1:ht=kt;break;case 4:return we.label++,{value:kt[1],done:!1};case 5:we.label++,oe=kt[1],kt=[0];continue;case 7:kt=we.ops.pop(),we.trys.pop();continue;default:if(ht=we.trys,!(ht=ht.length>0&&ht[ht.length-1])&&(kt[0]===6||kt[0]===2)){we=0;continue}if(kt[0]===3&&(!ht||kt[1]>ht[0]&&kt[1]<ht[3])){we.label=kt[1];break}if(kt[0]===6&&we.label<ht[1]){we.label=ht[1],ht=kt;break}if(ht&&we.label<ht[2]){we.label=ht[2],we.ops.push(kt);break}ht[2]&&we.ops.pop(),we.trys.pop();continue}kt=Kt.call(Gt,we)}catch(ee){kt=[6,ee],oe=0}finally{Bt=ht=0}if(kt[0]&5)throw kt[1];return{value:kt[0]?kt[1]:void 0,done:!0}}}var st=Object.create?function(Gt,Kt,we,Bt){Bt===void 0&&(Bt=we);var oe=Object.getOwnPropertyDescriptor(Kt,we);(!oe||("get"in oe?!Kt.__esModule:oe.writable||oe.configurable))&&(oe={enumerable:!0,get:function(){return Kt[we]}}),Object.defineProperty(Gt,Bt,oe)}:function(Gt,Kt,we,Bt){Bt===void 0&&(Bt=we),Gt[Bt]=Kt[we]};function Rt(Gt,Kt){for(var we in Gt)we!=="default"&&!Object.prototype.hasOwnProperty.call(Kt,we)&&st(Kt,Gt,we)}function xt(Gt){var Kt=typeof Symbol=="function"&&Symbol.iterator,we=Kt&&Gt[Kt],Bt=0;if(we)return we.call(Gt);if(Gt&&typeof Gt.length=="number")return{next:function(){return Gt&&Bt>=Gt.length&&(Gt=void 0),{value:Gt&&Gt[Bt++],done:!Gt}}};throw new TypeError(Kt?"Object is not iterable.":"Symbol.iterator is not defined.")}function nt(Gt,Kt){var we=typeof Symbol=="function"&&Gt[Symbol.iterator];if(!we)return Gt;var Bt=we.call(Gt),oe,ht=[],ut;try{for(;(Kt===void 0||Kt-- >0)&&!(oe=Bt.next()).done;)ht.push(oe.value)}catch(Vt){ut={error:Vt}}finally{try{oe&&!oe.done&&(we=Bt.return)&&we.call(Bt)}finally{if(ut)throw ut.error}}return ht}function Et(){for(var Gt=[],Kt=0;Kt<arguments.length;Kt++)Gt=Gt.concat(nt(arguments[Kt]));return Gt}function ot(){for(var Gt=0,Kt=0,we=arguments.length;Kt<we;Kt++)Gt+=arguments[Kt].length;for(var Bt=Array(Gt),oe=0,Kt=0;Kt<we;Kt++)for(var ht=arguments[Kt],ut=0,Vt=ht.length;ut<Vt;ut++,oe++)Bt[oe]=ht[ut];return Bt}function Ct(Gt,Kt,we){if(we||arguments.length===2)for(var Bt=0,oe=Kt.length,ht;Bt<oe;Bt++)(ht||!(Bt in Kt))&&(ht||(ht=Array.prototype.slice.call(Kt,0,Bt)),ht[Bt]=Kt[Bt]);return Gt.concat(ht||Array.prototype.slice.call(Kt))}function _t(Gt){return this instanceof _t?(this.v=Gt,this):new _t(Gt)}function dt(Gt,Kt,we){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Bt=we.apply(Gt,Kt||[]),oe,ht=[];return oe=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),Vt("next"),Vt("throw"),Vt("return",ut),oe[Symbol.asyncIterator]=function(){return this},oe;function ut(Zt){return function(Yt){return Promise.resolve(Yt).then(Zt,me)}}function Vt(Zt,Yt){Bt[Zt]&&(oe[Zt]=function(S){return new Promise(function(Y,At){ht.push([Zt,S,Y,At])>1||ve(Zt,S)})},Yt&&(oe[Zt]=Yt(oe[Zt])))}function ve(Zt,Yt){try{kt(Bt[Zt](Yt))}catch(S){Nt(ht[0][3],S)}}function kt(Zt){Zt.value instanceof _t?Promise.resolve(Zt.value.v).then(ee,me):Nt(ht[0][2],Zt)}function ee(Zt){ve("next",Zt)}function me(Zt){ve("throw",Zt)}function Nt(Zt,Yt){Zt(Yt),ht.shift(),ht.length&&ve(ht[0][0],ht[0][1])}}function Ot(Gt){var Kt,we;return Kt={},Bt("next"),Bt("throw",function(oe){throw oe}),Bt("return"),Kt[Symbol.iterator]=function(){return this},Kt;function Bt(oe,ht){Kt[oe]=Gt[oe]?function(ut){return(we=!we)?{value:_t(Gt[oe](ut)),done:!1}:ht?ht(ut):ut}:ht}}function wt(Gt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Kt=Gt[Symbol.asyncIterator],we;return Kt?Kt.call(Gt):(Gt=typeof xt=="function"?xt(Gt):Gt[Symbol.iterator](),we={},Bt("next"),Bt("throw"),Bt("return"),we[Symbol.asyncIterator]=function(){return this},we);function Bt(ht){we[ht]=Gt[ht]&&function(ut){return new Promise(function(Vt,ve){ut=Gt[ht](ut),oe(Vt,ve,ut.done,ut.value)})}}function oe(ht,ut,Vt,ve){Promise.resolve(ve).then(function(kt){ht({value:kt,done:Vt})},ut)}}function Ft(Gt,Kt){return Object.defineProperty?Object.defineProperty(Gt,"raw",{value:Kt}):Gt.raw=Kt,Gt}var jt=Object.create?function(Gt,Kt){Object.defineProperty(Gt,"default",{enumerable:!0,value:Kt})}:function(Gt,Kt){Gt.default=Kt},re=function(Gt){return re=Object.getOwnPropertyNames||function(Kt){var we=[];for(var Bt in Kt)Object.prototype.hasOwnProperty.call(Kt,Bt)&&(we[we.length]=Bt);return we},re(Gt)};function Ee(Gt){if(Gt&&Gt.__esModule)return Gt;var Kt={};if(Gt!=null)for(var we=re(Gt),Bt=0;Bt<we.length;Bt++)we[Bt]!=="default"&&st(Kt,Gt,we[Bt]);return jt(Kt,Gt),Kt}function et(Gt){return Gt&&Gt.__esModule?Gt:{default:Gt}}function ge(Gt,Kt,we,Bt){if(we==="a"&&!Bt)throw new TypeError("Private accessor was defined without a getter");if(typeof Kt=="function"?Gt!==Kt||!Bt:!Kt.has(Gt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return we==="m"?Bt:we==="a"?Bt.call(Gt):Bt?Bt.value:Kt.get(Gt)}function yt(Gt,Kt,we,Bt,oe){if(Bt==="m")throw new TypeError("Private method is not writable");if(Bt==="a"&&!oe)throw new TypeError("Private accessor was defined without a setter");if(typeof Kt=="function"?Gt!==Kt||!oe:!Kt.has(Gt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Bt==="a"?oe.call(Gt,we):oe?oe.value=we:Kt.set(Gt,we),we}function te(Gt,Kt){if(Kt===null||typeof Kt!="object"&&typeof Kt!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Gt=="function"?Kt===Gt:Gt.has(Kt)}function Xt(Gt,Kt,we){if(Kt!=null){if(typeof Kt!="object"&&typeof Kt!="function")throw new TypeError("Object expected.");var Bt,oe;if(we){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");Bt=Kt[Symbol.asyncDispose]}if(Bt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");Bt=Kt[Symbol.dispose],we&&(oe=Bt)}if(typeof Bt!="function")throw new TypeError("Object not disposable.");oe&&(Bt=function(){try{oe.call(this)}catch(ht){return Promise.reject(ht)}}),Gt.stack.push({value:Kt,dispose:Bt,async:we})}else we&&Gt.stack.push({async:!0});return Kt}var rt=typeof SuppressedError=="function"?SuppressedError:function(Gt,Kt,we){var Bt=new Error(we);return Bt.name="SuppressedError",Bt.error=Gt,Bt.suppressed=Kt,Bt};function bt(Gt){function Kt(ht){Gt.error=Gt.hasError?new rt(ht,Gt.error,"An error was suppressed during disposal."):ht,Gt.hasError=!0}var we,Bt=0;function oe(){for(;we=Gt.stack.pop();)try{if(!we.async&&Bt===1)return Bt=0,Gt.stack.push(we),Promise.resolve().then(oe);if(we.dispose){var ht=we.dispose.call(we.value);if(we.async)return Bt|=2,Promise.resolve(ht).then(oe,function(ut){return Kt(ut),oe()})}else Bt|=1}catch(ut){Kt(ut)}if(Bt===1)return Gt.hasError?Promise.reject(Gt.error):Promise.resolve();if(Gt.hasError)throw Gt.error}return oe()}function ye(Gt,Kt){return typeof Gt=="string"&&/^\.\.?\//.test(Gt)?Gt.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(we,Bt,oe,ht,ut){return Bt?Kt?".jsx":".js":oe&&(!ht||!ut)?we:oe+ht+"."+ut.toLowerCase()+"js"}):Gt}var be={__extends:F,__assign:R,__rest:L,__decorate:k,__param:O,__esDecorate:b,__runInitializers:E,__propKey:T,__setFunctionName:_,__metadata:P,__awaiter:B,__generator:tt,__createBinding:st,__exportStar:Rt,__values:xt,__read:nt,__spread:Et,__spreadArrays:ot,__spreadArray:Ct,__await:_t,__asyncGenerator:dt,__asyncDelegator:Ot,__asyncValues:wt,__makeTemplateObject:Ft,__importStar:Ee,__importDefault:et,__classPrivateFieldGet:ge,__classPrivateFieldSet:yt,__classPrivateFieldIn:te,__addDisposableResource:Xt,__disposeResources:bt,__rewriteRelativeImportExtension:ye}}}]);
|
|
|
}()); |