mira-app-server
Version:
Mira Server - standalone server application using mira-app-core
359 lines • 240 kB
JavaScript
import{a7 as Pn,a9 as ut,a6 as es,ar as Jc,am as zt,av as Je,aT as vt,aM as Ee,aH as tn,aN as me,bz as St,aO as L,ae as I,b2 as ao,aQ as Ya,bA as Va,aY as Ui,b1 as Ie,aP as fe,ab as ce,b5 as w,n as tu,bB as U,ai as lt,a$ as N,ac as gt,bj as Xa,aK as pi,aI as un,a8 as hn,aj as P,aa as Y,i as Kt,aX as Pe,a_ as eu,ax as nu,au as iu,aW as ru,ad as ou,bi as su,E as cr,_ as Bn,u as In,C as ns,aB as ur,p as hr,q as fr,r as dr,s as Hn,bE as au,G as is,H as rs,J as os,a1 as ss,t as lu,K as cu}from"./index-BAS7XAoe.js";import{a as uu}from"./admin-BnkG0Mjo.js";import{u as hu}from"./useLibrary-lubOK0Bg.js";import{u as fu}from"./useBroadcast-BKGdfaqh.js";import{a as as,b as pr,_ as gr}from"./index-DzCrOkDd.js";import{_ as du}from"./Textarea.vue_vue_type_script_setup_true_lang-DsmTjQmg.js";import{U as pu,W as gu}from"./index-CsJj9qiO.js";const Wn={upload:(t,e)=>Pn.get(`/statistics/${t}/upload`,{params:e?{days:e}:{}}),daily:(t,e)=>Pn.get(`/statistics/${t}/upload/daily`,{params:e?{days:e}:{}}),fileTypes:(t,e)=>Pn.get(`/statistics/${t}/file-types`,{params:e?{days:e}:{}}),recentUploads:(t,e=7)=>Pn.get(`/statistics/${t}/recent-uploads`,{params:{days:e}})};var Dr="http://www.w3.org/1999/xhtml";const ls={svg:"http://www.w3.org/2000/svg",xhtml:Dr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ls.hasOwnProperty(e)?{space:ls[e],local:t}:t}function vu(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Dr&&e.documentElement.namespaceURI===Dr?e.createElement(t):e.createElementNS(n,t)}}function mu(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ga(t){var e=Yi(t);return(e.local?mu:vu)(e)}function _u(){}function lo(t){return t==null?_u:function(){return this.querySelector(t)}}function yu(t){typeof t!="function"&&(t=lo(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],s=o.length,a=i[r]=new Array(s),l,c,u=0;u<s;++u)(l=o[u])&&(c=t.call(l,l.__data__,u,o))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new Nt(i,this._parents)}function xu(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function bu(){return[]}function qa(t){return t==null?bu:function(){return this.querySelectorAll(t)}}function wu(t){return function(){return xu(t.apply(this,arguments))}}function ku(t){typeof t=="function"?t=wu(t):t=qa(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s=e[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(i.push(t.call(l,l.__data__,c,s)),r.push(l));return new Nt(i,r)}function ja(t){return function(){return this.matches(t)}}function Za(t){return function(e){return e.matches(t)}}var Tu=Array.prototype.find;function Su(t){return function(){return Tu.call(this.children,t)}}function Cu(){return this.firstElementChild}function Mu(t){return this.select(t==null?Cu:Su(typeof t=="function"?t:Za(t)))}var Au=Array.prototype.filter;function $u(){return Array.from(this.children)}function Du(t){return function(){return Au.call(this.children,t)}}function Eu(t){return this.selectAll(t==null?$u:Du(typeof t=="function"?t:Za(t)))}function Ru(t){typeof t!="function"&&(t=ja(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],s=o.length,a=i[r]=[],l,c=0;c<s;++c)(l=o[c])&&t.call(l,l.__data__,c,o)&&a.push(l);return new Nt(i,this._parents)}function Qa(t){return new Array(t.length)}function Ou(){return new Nt(this._enter||this._groups.map(Qa),this._parents)}function gi(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}gi.prototype={constructor:gi,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Nu(t){return function(){return t}}function Fu(t,e,n,i,r,o){for(var s=0,a,l=e.length,c=o.length;s<c;++s)(a=e[s])?(a.__data__=o[s],i[s]=a):n[s]=new gi(t,o[s]);for(;s<l;++s)(a=e[s])&&(r[s]=a)}function Lu(t,e,n,i,r,o,s){var a,l,c=new Map,u=e.length,h=o.length,f=new Array(u),d;for(a=0;a<u;++a)(l=e[a])&&(f[a]=d=s.call(l,l.__data__,a,e)+"",c.has(d)?r[a]=l:c.set(d,l));for(a=0;a<h;++a)d=s.call(t,o[a],a,o)+"",(l=c.get(d))?(i[a]=l,l.__data__=o[a],c.delete(d)):n[a]=new gi(t,o[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function zu(t){return t.__data__}function Pu(t,e){if(!arguments.length)return Array.from(this,zu);var n=e?Lu:Fu,i=this._parents,r=this._groups;typeof t!="function"&&(t=Nu(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=i[c],h=r[c],f=h.length,d=Bu(t.call(u,u&&u.__data__,c,i)),g=d.length,p=a[c]=new Array(g),v=s[c]=new Array(g),m=l[c]=new Array(f);n(u,h,p,v,m,d,e);for(var _=0,y=0,b,T;_<g;++_)if(b=p[_]){for(_>=y&&(y=_+1);!(T=v[y])&&++y<g;);b._next=T||null}}return s=new Nt(s,i),s._enter=a,s._exit=l,s}function Bu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Iu(){return new Nt(this._exit||this._groups.map(Qa),this._parents)}function Hu(t,e,n){var i=this.enter(),r=this,o=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function Wu(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=i[l],h=c.length,f=a[l]=new Array(h),d,g=0;g<h;++g)(d=c[g]||u[g])&&(f[g]=d);for(;l<r;++l)a[l]=n[l];return new Nt(a,this._parents)}function Uu(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,o=i[r],s;--r>=0;)(s=i[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Yu(t){t||(t=Vu);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s=n[o],a=s.length,l=r[o]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(e)}return new Nt(r,this._parents).order()}function Vu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Xu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Gu(){return Array.from(this)}function qu(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null}function ju(){let t=0;for(const e of this)++t;return t}function Zu(){return!this.node()}function Qu(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],o=0,s=r.length,a;o<s;++o)(a=r[o])&&t.call(a,a.__data__,o,r);return this}function Ku(t){return function(){this.removeAttribute(t)}}function Ju(t){return function(){this.removeAttributeNS(t.space,t.local)}}function th(t,e){return function(){this.setAttribute(t,e)}}function eh(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function nh(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ih(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function rh(t,e){var n=Yi(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?Ju:Ku:typeof e=="function"?n.local?ih:nh:n.local?eh:th)(n,e))}function Ka(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function oh(t){return function(){this.style.removeProperty(t)}}function sh(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ah(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function lh(t,e,n){return arguments.length>1?this.each((e==null?oh:typeof e=="function"?ah:sh)(t,e,n??"")):Ve(this.node(),t)}function Ve(t,e){return t.style.getPropertyValue(e)||Ka(t).getComputedStyle(t,null).getPropertyValue(e)}function ch(t){return function(){delete this[t]}}function uh(t,e){return function(){this[t]=e}}function hh(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fh(t,e){return arguments.length>1?this.each((e==null?ch:typeof e=="function"?hh:uh)(t,e)):this.node()[t]}function Ja(t){return t.trim().split(/^|\s+/)}function co(t){return t.classList||new tl(t)}function tl(t){this._node=t,this._names=Ja(t.getAttribute("class")||"")}tl.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function el(t,e){for(var n=co(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function nl(t,e){for(var n=co(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function dh(t){return function(){el(this,t)}}function ph(t){return function(){nl(this,t)}}function gh(t,e){return function(){(e.apply(this,arguments)?el:nl)(this,t)}}function vh(t,e){var n=Ja(t+"");if(arguments.length<2){for(var i=co(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?gh:e?dh:ph)(n,e))}function mh(){this.textContent=""}function _h(t){return function(){this.textContent=t}}function yh(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function xh(t){return arguments.length?this.each(t==null?mh:(typeof t=="function"?yh:_h)(t)):this.node().textContent}function bh(){this.innerHTML=""}function wh(t){return function(){this.innerHTML=t}}function kh(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Th(t){return arguments.length?this.each(t==null?bh:(typeof t=="function"?kh:wh)(t)):this.node().innerHTML}function Sh(){this.nextSibling&&this.parentNode.appendChild(this)}function Ch(){return this.each(Sh)}function Mh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ah(){return this.each(Mh)}function $h(t){var e=typeof t=="function"?t:Ga(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Dh(){return null}function Eh(t,e){var n=typeof t=="function"?t:Ga(t),i=e==null?Dh:typeof e=="function"?e:lo(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Rh(){var t=this.parentNode;t&&t.removeChild(this)}function Oh(){return this.each(Rh)}function Nh(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Fh(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Lh(t){return this.select(t?Fh:Nh)}function zh(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ph(t){return function(e){t.call(this,e,this.__data__)}}function Bh(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Ih(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,o;n<r;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++i]=o;++i?e.length=i:delete this.__on}}}function Hh(t,e,n){return function(){var i=this.__on,r,o=Ph(e);if(i){for(var s=0,a=i.length;s<a;++s)if((r=i[s]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function Wh(t,e,n){var i=Bh(t+""),r,o=i.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<o;++r)if((s=i[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Hh:Ih,r=0;r<o;++r)this.each(a(i[r],e,n));return this}function il(t,e,n){var i=Ka(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Uh(t,e){return function(){return il(this,t,e)}}function Yh(t,e){return function(){return il(this,t,e.apply(this,arguments))}}function Vh(t,e){return this.each((typeof e=="function"?Yh:Uh)(t,e))}function*Xh(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length,s;r<o;++r)(s=i[r])&&(yield s)}var rl=[null];function Nt(t,e){this._groups=t,this._parents=e}function Dn(){return new Nt([[document.documentElement]],rl)}function Gh(){return this}Nt.prototype=Dn.prototype={constructor:Nt,select:yu,selectAll:ku,selectChild:Mu,selectChildren:Eu,filter:Ru,data:Pu,enter:Ou,exit:Iu,join:Hu,merge:Wu,selection:Gh,order:Uu,sort:Yu,call:Xu,nodes:Gu,node:qu,size:ju,empty:Zu,each:Qu,attr:rh,style:lh,property:fh,classed:vh,text:xh,html:Th,raise:Ch,lower:Ah,append:$h,insert:Eh,remove:Oh,clone:Lh,datum:zh,on:Wh,dispatch:Vh,[Symbol.iterator]:Xh};function Lt(t){return typeof t=="string"?new Nt([[document.querySelector(t)]],[document.documentElement]):new Nt([[t]],rl)}function qh(t){let e;for(;e=t.sourceEvent;)t=e;return t}function vi(t,e){if(t=qh(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}var mn;(function(t){t[t.SVG=0]="SVG",t[t.HTML=1]="HTML"})(mn||(mn={}));var re;(function(t){t.Fit="fit",t.Extend="extend",t.FitWidth="fit_width"})(re||(re={}));function _n(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function jh(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function uo(t){let e,n,i;t.length!==2?(e=_n,n=(a,l)=>_n(t(a),l),i=(a,l)=>t(a)-l):(e=t===_n||t===jh?t:Zh,n=t,i=t);function r(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const h=c+u>>>1;n(a[h],l)<0?c=h+1:u=h}while(c<u)}return c}function o(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const h=c+u>>>1;n(a[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function s(a,l,c=0,u=a.length){const h=r(a,l,c,u-1);return h>c&&i(a[h-1],l)>-i(a[h],l)?h-1:h}return{left:r,center:s,right:o}}function Zh(){return 0}function ol(t){return t===null?NaN:+t}const sl=uo(_n),En=sl.right,Qh=sl.left;uo(ol).center;function Kh(t,e){let n,i;for(const r of t)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));return[n,i]}class cs extends Map{constructor(e,n=ef){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(us(this,e))}has(e){return super.has(us(this,e))}set(e,n){return super.set(Jh(this,e),n)}delete(e){return super.delete(tf(this,e))}}function us({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Jh({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function tf({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function ef(t){return t!==null&&typeof t=="object"?t.valueOf():t}const nf=Math.sqrt(50),rf=Math.sqrt(10),of=Math.sqrt(2);function mi(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=nf?10:o>=rf?5:o>=of?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?mi(t,e,n*2):[a,l,c]}function Er(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const i=e<t,[r,o,s]=i?mi(e,t,n):mi(t,e,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let c=0;c<a;++c)l[c]=(o-c)/-s;else for(let c=0;c<a;++c)l[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(r+c)/-s;else for(let c=0;c<a;++c)l[c]=(r+c)*s;return l}function Rr(t,e,n){return e=+e,t=+t,n=+n,mi(t,e,n)[2]}function Or(t,e,n){e=+e,t=+t,n=+n;const i=e<t,r=i?Rr(e,t,n):Rr(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function hs(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function fs(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function sf(t,e,n=ol){if(!(!(i=t.length)||isNaN(e=+e))){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(r-o)}}function af(t,e){let n=0,i=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function*lf(t){for(const e of t)yield*e}function cf(t){return Array.from(lf(t))}function uf(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);++i<r;)o[i]=t+i*n;return o}function hf(t,e){let n=0;if(e===void 0)for(let i of t)(i=+i)&&(n+=i);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function ff(t,e,n){var i={},r=i.noTrailing,o=r===void 0?!1:r,s=i.noLeading,a=s===void 0?!1:s,l=i.debounceMode,c=l===void 0?void 0:l,u,h=!1,f=0;function d(){u&&clearTimeout(u)}function g(v){var m=v||{},_=m.upcomingOnly,y=_===void 0?!1:_;d(),h=!y}function p(){for(var v=arguments.length,m=new Array(v),_=0;_<v;_++)m[_]=arguments[_];var y=this,b=Date.now()-f;if(h)return;function T(){f=Date.now(),e.apply(y,m)}function x(){u=void 0}!a&&c&&!u&&T(),d(),c===void 0&&b>t?a?(f=Date.now(),o||(u=setTimeout(c?x:T,t))):T():o!==!0&&(u=setTimeout(c?x:T,c===void 0?t-b:t))}return p.cancel=g,p}var te;(function(t){t.Left="left",t.Right="right",t.Auto="auto"})(te||(te={}));const It=t=>typeof t=="number",ho=t=>typeof t=="function",ge=t=>Array.isArray(t),df=t=>t instanceof Object,_i=t=>t.constructor.name!=="Function"&&t.constructor.name!=="Object",ds=t=>df(t)&&!ge(t)&&!ho(t)&&!_i(t),Ae=(t,e,n=[],i=new Set)=>{if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;if(i.has(t))return!0;i.add(t);for(let r=0;r<t.length;r++)if(!Ae(t[r],e[r],n,i))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(typeof t=="object"&&t!==null&&e!==null){if(typeof e!="object")return!1;if(t===e)return!0;const r=Object.keys(t).filter(s=>!n.includes(s)),o=Object.keys(e).filter(s=>!n.includes(s));if(r.length!==o.length)return!1;if(i.has(t))return!0;i.add(t);for(const s of r)if(!Ae(t[s],e[s],n,i))return!1;return!0}return t===e},Nr=t=>t.flat(),yi=(t,e=new Map)=>{if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){const n=[];e.set(t,n);for(const i of t)n.push(e.has(i)?e.get(i):yi(i,e));return n}if(_i(t))return t;if(t instanceof Object){const n={};e.set(t,n);const i=t;return Object.keys(t).reduce((r,o)=>(r[o]=e.has(i[o])?e.get(i[o]):yi(i[o],e),r),n),n}return t},Xe=(t,e,n=new Map)=>{if(!t||!e||t===e)return t;const i=_i(t)?t:yi(t);return n.has(e)?n.get(e):(n.set(e,i),Object.keys(e).forEach(r=>{r==="__proto__"||r==="constructor"||(ds(t[r])&&ds(e[r])?i[r]=Xe(t[r],e[r],n):_i(e)?i[r]=e:i[r]=yi(e[r]))}),i)},xi=(t,e,n)=>ff(e,t);function Vi(t,e,n){return ho(e)?e(t,n):e}function bi(t,e,n){return Vi(t,e,n)}function st(t,e,n){return Vi(t,e,n)}function rn(t){return t.filter(e=>e&&!It(e))}function ee(t,e,n){return Math.min(Math.max(t,e),n)}function pf(t,...e){if(!t)return[void 0,void 0];if(ge(e)){let n=0,i=0;return t.forEach((r,o)=>{let s=0,a=0;for(const l of e){const c=st(r,l,o)||0;c>=0?s+=c:a+=c}s>i&&(i=s),a<n&&(n=a)}),[n,i]}}function gf(t,e,...n){const i=[];let r=0,o=0;for(const s of n){const a=st(t,s,e)||0;a>=0?i.push(r+=a):i.push(o+=a)}return i}function vf(t,e,n,i){const r=t.map((a,l)=>st(a,e,l)||0),o=n.map((a,l)=>{const c=af(t,(u,h)=>st(u,a,h)||0);return c===0&&Array.isArray(i)?i[l]:c<0}),s=n.map(()=>[]);return t.forEach((a,l)=>{let c=r[l],u=r[l];n.forEach((h,f)=>{const d=st(a,h,l)||0;d>=0?s[f].push([c,c+=d]):s[f].push([u,u+=d])})}),s.forEach((a,l)=>{a.isMostlyNegative=o[l]}),s}function mf(t,...e){return t?fs(t,(i,r)=>fs(e,o=>st(i,o,r))):void 0}function _f(t,...e){return t?hs(t,(i,r)=>hs(e,o=>st(i,o,r))):void 0}function vr(t,...e){return[mf(t,...e),_f(t,...e)]}function wi(t,e,n,i=te.Auto){if(t.length<=1)return t[0];const o=t.map((l,c)=>[l,c]).sort(([l,c],[u,h])=>st(l,n,c)-st(u,n,h)),s=o.map(([l,c])=>st(l,n,c)),a=i===te.Right?Qh(s,e,0,t.length-1):En(s,e,1,t.length);return i===te.Right?o[a][0]:i===te.Left?o[a-1][0]:e-s[a-1]>s[a]-e?o[a][0]:o[a-1][0]}function al(t,e,n,i=!1){if(!n)return[];const r=t.filter((o,s)=>{const a=st(o,n,s);return a>=e[0]&&a<=e[1]});if(i){if(r.length===0){const h=wi(t,e[0],n,te.Left),f=wi(t,e[1],n,te.Right);return[h,f].filter(Boolean)}const o=r[0],s=r[r.length-1],a=t.findIndex(h=>h===o),l=t.findIndex(h=>h===s),c=Math.max(0,a-1),u=Math.min(t.length-1,l+1);return t.slice(c,u+1)}return r}var Te=[],yf=function(){return Te.some(function(t){return t.activeTargets.length>0})},xf=function(){return Te.some(function(t){return t.skippedTargets.length>0})},ps="ResizeObserver loop completed with undelivered notifications.",bf=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:ps}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=ps),window.dispatchEvent(t)},wn;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wn||(wn={}));var Se=function(t){return Object.freeze(t)},wf=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Se(this)}return t})(),ll=(function(){function t(e,n,i,r){return this.x=e,this.y=n,this.width=i,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Se(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,i=e.y,r=e.top,o=e.right,s=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:i,top:r,right:o,bottom:s,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),fo=function(t){return t instanceof SVGElement&&"getBBox"in t},cl=function(t){if(fo(t)){var e=t.getBBox(),n=e.width,i=e.height;return!n&&!i}var r=t,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||t.getClientRects().length)},gs=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},kf=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},yn=typeof window<"u"?window:{},Un=new WeakMap,vs=/auto|scroll/,Tf=/^tb|vertical/,Sf=/msie|trident/i.test(yn.navigator&&yn.navigator.userAgent),Yt=function(t){return parseFloat(t||"0")},He=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new wf((n?e:t)||0,(n?t:e)||0)},ms=Se({devicePixelContentBoxSize:He(),borderBoxSize:He(),contentBoxSize:He(),contentRect:new ll(0,0,0,0)}),ul=function(t,e){if(e===void 0&&(e=!1),Un.has(t)&&!e)return Un.get(t);if(cl(t))return Un.set(t,ms),ms;var n=getComputedStyle(t),i=fo(t)&&t.ownerSVGElement&&t.getBBox(),r=!Sf&&n.boxSizing==="border-box",o=Tf.test(n.writingMode||""),s=!i&&vs.test(n.overflowY||""),a=!i&&vs.test(n.overflowX||""),l=i?0:Yt(n.paddingTop),c=i?0:Yt(n.paddingRight),u=i?0:Yt(n.paddingBottom),h=i?0:Yt(n.paddingLeft),f=i?0:Yt(n.borderTopWidth),d=i?0:Yt(n.borderRightWidth),g=i?0:Yt(n.borderBottomWidth),p=i?0:Yt(n.borderLeftWidth),v=h+c,m=l+u,_=p+d,y=f+g,b=a?t.offsetHeight-y-t.clientHeight:0,T=s?t.offsetWidth-_-t.clientWidth:0,x=r?v+_:0,S=r?m+y:0,F=i?i.width:Yt(n.width)-x-T,z=i?i.height:Yt(n.height)-S-b,O=F+v+T+_,V=z+m+b+y,M=Se({devicePixelContentBoxSize:He(Math.round(F*devicePixelRatio),Math.round(z*devicePixelRatio),o),borderBoxSize:He(O,V,o),contentBoxSize:He(F,z,o),contentRect:new ll(h,l,F,z)});return Un.set(t,M),M},hl=function(t,e,n){var i=ul(t,n),r=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(e){case wn.DEVICE_PIXEL_CONTENT_BOX:return s;case wn.BORDER_BOX:return r;default:return o}},Cf=(function(){function t(e){var n=ul(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Se([n.borderBoxSize]),this.contentBoxSize=Se([n.contentBoxSize]),this.devicePixelContentBoxSize=Se([n.devicePixelContentBoxSize])}return t})(),fl=function(t){if(cl(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Mf=function(){var t=1/0,e=[];Te.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(c){var u=new Cf(c.target),h=fl(c.target);a.push(u),c.lastReportedSize=hl(c.target,c.observedBox),h<t&&(t=h)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,i=e;n<i.length;n++){var r=i[n];r()}return t},_s=function(t){Te.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(r){r.isActive()&&(fl(r.target)>t?n.activeTargets.push(r):n.skippedTargets.push(r))})})},Af=function(){var t=0;for(_s(t);yf();)t=Mf(),_s(t);return xf()&&bf(),t>0},mr,dl=[],$f=function(){return dl.splice(0).forEach(function(t){return t()})},Df=function(t){if(!mr){var e=0,n=document.createTextNode(""),i={characterData:!0};new MutationObserver(function(){return $f()}).observe(n,i),mr=function(){n.textContent="".concat(e?e--:e++)}}dl.push(t),mr()},Ef=function(t){Df(function(){requestAnimationFrame(t)})},Kn=0,Rf=function(){return!!Kn},Of=250,Nf={attributes:!0,characterData:!0,childList:!0,subtree:!0},ys=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],xs=function(t){return t===void 0&&(t=0),Date.now()+t},_r=!1,Ff=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Of),!_r){_r=!0;var i=xs(e);Ef(function(){var r=!1;try{r=Af()}finally{if(_r=!1,e=i-xs(),!Rf())return;r?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Nf)};document.body?n():yn.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ys.forEach(function(n){return yn.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ys.forEach(function(n){return yn.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Fr=new Ff,bs=function(t){!Kn&&t>0&&Fr.start(),Kn+=t,!Kn&&Fr.stop()},Lf=function(t){return!fo(t)&&!kf(t)&&getComputedStyle(t).display==="inline"},zf=(function(){function t(e,n){this.target=e,this.observedBox=n||wn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=hl(this.target,this.observedBox,!0);return Lf(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Pf=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Yn=new WeakMap,ws=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Vn=(function(){function t(){}return t.connect=function(e,n){var i=new Pf(e,n);Yn.set(e,i)},t.observe=function(e,n,i){var r=Yn.get(e),o=r.observationTargets.length===0;ws(r.observationTargets,n)<0&&(o&&Te.push(r),r.observationTargets.push(new zf(n,i&&i.box)),bs(1),Fr.schedule())},t.unobserve=function(e,n){var i=Yn.get(e),r=ws(i.observationTargets,n),o=i.observationTargets.length===1;r>=0&&(o&&Te.splice(Te.indexOf(i),1),i.observationTargets.splice(r,1),bs(-1))},t.disconnect=function(e){var n=this,i=Yn.get(e);i.observationTargets.slice().forEach(function(r){return n.unobserve(e,r.target)}),i.activeTargets.splice(0,i.activeTargets.length)},t})(),Bf=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Vn.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gs(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gs(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.unobserve(this,e)},t.prototype.disconnect=function(){Vn.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();const If=globalThis.ResizeObserver||Bf,po={duration:void 0,margin:{top:0,bottom:0,left:0,right:0},padding:{top:0,bottom:0,left:0,right:0},sizing:re.Fit,width:void 0,height:void 0,svgDefs:void 0,ariaLabel:void 0};class Ge{constructor(e){this._defaultConfig=po,this._isFirstRender=!0,this._renderAnimationFrameId=null,this._container=e;const n=Lt(this._container);n.attr("role","figure"),this.svg=n.append("svg").style("display","block").attr("xmlns","http://www.w3.org/2000/svg").attr("height",Ge.DEFAULT_CONTAINER_HEIGHT).attr("aria-hidden",!0),this._svgDefs=this.svg.append("defs"),this._svgDefsExternal=this.svg.append("defs"),this.element=this.svg.node()}updateContainer(e){var n;this.prevConfig=this.config,this.config=Xe(this._defaultConfig,e),(e==null?void 0:e.svgDefs)!==((n=this.prevConfig)===null||n===void 0?void 0:n.svgDefs)&&(this._svgDefsExternal.selectAll("*").remove(),this._svgDefsExternal.html(e.svgDefs))}_preRender(){}_render(e){const{config:n}=this;Lt(this._container).attr("aria-label",n.ariaLabel),this._isFirstRender=!1}render(e=this.config.duration){const n=this.config.width||this.containerWidth,i=this.config.height||this.containerHeight;this.svg.attr("width",n).attr("height",i),this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}get containerWidth(){return this.config.width?this.element.clientWidth:this._container.clientWidth||this._container.getBoundingClientRect().width}get containerHeight(){return this.config.height?this.element.clientHeight:this._container.clientHeight||this._container.getBoundingClientRect().height||Ge.DEFAULT_CONTAINER_HEIGHT}get width(){return ee(this.containerWidth-this.config.margin.left-this.config.margin.right,0,Number.POSITIVE_INFINITY)}get height(){return ee(this.containerHeight-this.config.margin.top-this.config.margin.bottom,0,Number.POSITIVE_INFINITY)}_removeAllChildren(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}_onResize(){const{config:e}=this;(e.sizing===re.Fit||e.sizing===re.FitWidth)&&this.render(0)}_setUpResizeObserver(){if(this._resizeObserver)return;const e=this._container.getBoundingClientRect();this._containerSize={width:e.width,height:e.height},this._resizeObserver=new If((n,i)=>{cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserverAnimationFrameId=requestAnimationFrame(()=>{const r=this._container.getBoundingClientRect(),o={width:r.width,height:r.height};!Ae(this._containerSize,o)&&o.width&&o.height&&(this._containerSize=o,this._onResize())})}),this._resizeObserver.observe(this._container)}destroy(){var e;cancelAnimationFrame(this._renderAnimationFrameId),cancelAnimationFrame(this._resizeObserverAnimationFrameId),(e=this._resizeObserver)===null||e===void 0||e.disconnect(),this.svg.remove()}}Ge.DEFAULT_CONTAINER_HEIGHT=300;function Hf(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Wf(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Uf=(function(){function t(n){var i=this;this._insertTag=function(r){var o;i.tags.length===0?i.insertionPoint?o=i.insertionPoint.nextSibling:i.prepend?o=i.container.firstChild:o=i.before:o=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,o),i.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(i){i.forEach(this._insertTag)},e.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Wf(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Hf(r);try{o.insertRule(i,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(i));this.ctr++},e.flush=function(){this.tags.forEach(function(i){var r;return(r=i.parentNode)==null?void 0:r.removeChild(i)}),this.tags=[],this.ctr=0},t})(),wt="-ms-",ki="-moz-",J="-webkit-",pl="comm",go="rule",vo="decl",Yf="@import",gl="@keyframes",Vf="@layer",Xf=Math.abs,Xi=String.fromCharCode,Gf=Object.assign;function qf(t,e){return xt(t,0)^45?(((e<<2^xt(t,0))<<2^xt(t,1))<<2^xt(t,2))<<2^xt(t,3):0}function vl(t){return t.trim()}function jf(t,e){return(t=e.exec(t))?t[0]:t}function tt(t,e,n){return t.replace(e,n)}function Lr(t,e){return t.indexOf(e)}function xt(t,e){return t.charCodeAt(e)|0}function kn(t,e,n){return t.slice(e,n)}function Xt(t){return t.length}function mo(t){return t.length}function Xn(t,e){return e.push(t),t}function Zf(t,e){return t.map(e).join("")}var Gi=1,qe=1,ml=0,$t=0,ht=0,en="";function qi(t,e,n,i,r,o,s){return{value:t,root:e,parent:n,type:i,props:r,children:o,line:Gi,column:qe,length:s,return:""}}function on(t,e){return Gf(qi("",null,null,"",null,null,0),t,{length:-t.length},e)}function Qf(){return ht}function Kf(){return ht=$t>0?xt(en,--$t):0,qe--,ht===10&&(qe=1,Gi--),ht}function Ot(){return ht=$t<ml?xt(en,$t++):0,qe++,ht===10&&(qe=1,Gi++),ht}function Gt(){return xt(en,$t)}function Jn(){return $t}function Rn(t,e){return kn(en,t,e)}function Tn(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _l(t){return Gi=qe=1,ml=Xt(en=t),$t=0,[]}function yl(t){return en="",t}function ti(t){return vl(Rn($t-1,zr(t===91?t+2:t===40?t+1:t)))}function Jf(t){for(;(ht=Gt())&&ht<33;)Ot();return Tn(t)>2||Tn(ht)>3?"":" "}function td(t,e){for(;--e&&Ot()&&!(ht<48||ht>102||ht>57&&ht<65||ht>70&&ht<97););return Rn(t,Jn()+(e<6&&Gt()==32&&Ot()==32))}function zr(t){for(;Ot();)switch(ht){case t:return $t;case 34:case 39:t!==34&&t!==39&&zr(ht);break;case 40:t===41&&zr(t);break;case 92:Ot();break}return $t}function ed(t,e){for(;Ot()&&t+ht!==57;)if(t+ht===84&&Gt()===47)break;return"/*"+Rn(e,$t-1)+"*"+Xi(t===47?t:Ot())}function nd(t){for(;!Tn(Gt());)Ot();return Rn(t,$t)}function id(t){return yl(ei("",null,null,null,[""],t=_l(t),0,[0],t))}function ei(t,e,n,i,r,o,s,a,l){for(var c=0,u=0,h=s,f=0,d=0,g=0,p=1,v=1,m=1,_=0,y="",b=r,T=o,x=i,S=y;v;)switch(g=_,_=Ot()){case 40:if(g!=108&&xt(S,h-1)==58){Lr(S+=tt(ti(_),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:S+=ti(_);break;case 9:case 10:case 13:case 32:S+=Jf(g);break;case 92:S+=td(Jn()-1,7);continue;case 47:switch(Gt()){case 42:case 47:Xn(rd(ed(Ot(),Jn()),e,n),l);break;default:S+="/"}break;case 123*p:a[c++]=Xt(S)*m;case 125*p:case 59:case 0:switch(_){case 0:case 125:v=0;case 59+u:m==-1&&(S=tt(S,/\f/g,"")),d>0&&Xt(S)-h&&Xn(d>32?Ts(S+";",i,n,h-1):Ts(tt(S," ","")+";",i,n,h-2),l);break;case 59:S+=";";default:if(Xn(x=ks(S,e,n,c,u,r,a,y,b=[],T=[],h),o),_===123)if(u===0)ei(S,e,x,x,b,o,h,a,T);else switch(f===99&&xt(S,3)===110?100:f){case 100:case 108:case 109:case 115:ei(t,x,x,i&&Xn(ks(t,x,x,0,0,r,a,y,r,b=[],h),T),r,T,h,a,i?b:T);break;default:ei(S,x,x,x,[""],T,0,a,T)}}c=u=d=0,p=m=1,y=S="",h=s;break;case 58:h=1+Xt(S),d=g;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&Kf()==125)continue}switch(S+=Xi(_),_*p){case 38:m=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Xt(S)-1)*m,m=1;break;case 64:Gt()===45&&(S+=ti(Ot())),f=Gt(),u=h=Xt(y=S+=nd(Jn())),_++;break;case 45:g===45&&Xt(S)==2&&(p=0)}}return o}function ks(t,e,n,i,r,o,s,a,l,c,u){for(var h=r-1,f=r===0?o:[""],d=mo(f),g=0,p=0,v=0;g<i;++g)for(var m=0,_=kn(t,h+1,h=Xf(p=s[g])),y=t;m<d;++m)(y=vl(p>0?f[m]+" "+_:tt(_,/&\f/g,f[m])))&&(l[v++]=y);return qi(t,e,n,r===0?go:a,l,c,u)}function rd(t,e,n){return qi(t,e,n,pl,Xi(Qf()),kn(t,2,-2),0)}function Ts(t,e,n,i){return qi(t,e,n,vo,kn(t,0,i),kn(t,i+1,-1),i)}function We(t,e){for(var n="",i=mo(t),r=0;r<i;r++)n+=e(t[r],r,t,e)||"";return n}function od(t,e,n,i){switch(t.type){case Vf:if(t.children.length)break;case Yf:case vo:return t.return=t.return||t.value;case pl:return"";case gl:return t.return=t.value+"{"+We(t.children,i)+"}";case go:t.value=t.props.join(",")}return Xt(n=We(t.children,i))?t.return=t.value+"{"+n+"}":""}function sd(t){var e=mo(t);return function(n,i,r,o){for(var s="",a=0;a<e;a++)s+=t[a](n,i,r,o)||"";return s}}function ad(t){return function(e){e.root||(e=e.return)&&t(e)}}function ld(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var cd=function(e,n,i){for(var r=0,o=0;r=o,o=Gt(),r===38&&o===12&&(n[i]=1),!Tn(o);)Ot();return Rn(e,$t)},ud=function(e,n){var i=-1,r=44;do switch(Tn(r)){case 0:r===38&&Gt()===12&&(n[i]=1),e[i]+=cd($t-1,n,i);break;case 2:e[i]+=ti(r);break;case 4:if(r===44){e[++i]=Gt()===58?"&\f":"",n[i]=e[i].length;break}default:e[i]+=Xi(r)}while(r=Ot());return e},hd=function(e,n){return yl(ud(_l(e),n))},Ss=new WeakMap,fd=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,i=e.parent,r=e.column===i.column&&e.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!Ss.get(i))&&!r){Ss.set(e,!0);for(var o=[],s=hd(n,o),a=i.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},dd=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function xl(t,e){switch(qf(t,e)){case 5103:return J+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return J+t+ki+t+wt+t+t;case 6828:case 4268:return J+t+wt+t+t;case 6165:return J+t+wt+"flex-"+t+t;case 5187:return J+t+tt(t,/(\w+).+(:[^]+)/,J+"box-$1$2"+wt+"flex-$1$2")+t;case 5443:return J+t+wt+"flex-item-"+tt(t,/flex-|-self/,"")+t;case 4675:return J+t+wt+"flex-line-pack"+tt(t,/align-content|flex-|-self/,"")+t;case 5548:return J+t+wt+tt(t,"shrink","negative")+t;case 5292:return J+t+wt+tt(t,"basis","preferred-size")+t;case 6060:return J+"box-"+tt(t,"-grow","")+J+t+wt+tt(t,"grow","positive")+t;case 4554:return J+tt(t,/([^-])(transform)/g,"$1"+J+"$2")+t;case 6187:return tt(tt(tt(t,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),t,"")+t;case 5495:case 3959:return tt(t,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return tt(tt(t,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+wt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+t+t;case 4095:case 3583:case 4068:case 2532:return tt(t,/(.+)-inline(.+)/,J+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xt(t)-1-e>6)switch(xt(t,e+1)){case 109:if(xt(t,e+4)!==45)break;case 102:return tt(t,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+ki+(xt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Lr(t,"stretch")?xl(tt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(xt(t,e+1)!==115)break;case 6444:switch(xt(t,Xt(t)-3-(~Lr(t,"!important")&&10))){case 107:return tt(t,":",":"+J)+t;case 101:return tt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(xt(t,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+wt+"$2box$3")+t}break;case 5936:switch(xt(t,e+11)){case 114:return J+t+wt+tt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return J+t+wt+tt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return J+t+wt+tt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return J+t+wt+t+t}return t}var pd=function(e,n,i,r){if(e.length>-1&&!e.return)switch(e.type){case vo:e.return=xl(e.value,e.length);break;case gl:return We([on(e,{value:tt(e.value,"@","@"+J)})],r);case go:if(e.length)return Zf(e.props,function(o){switch(jf(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return We([on(e,{props:[tt(o,/:(read-\w+)/,":"+ki+"$1")]})],r);case"::placeholder":return We([on(e,{props:[tt(o,/:(plac\w+)/,":"+J+"input-$1")]}),on(e,{props:[tt(o,/:(plac\w+)/,":"+ki+"$1")]}),on(e,{props:[tt(o,/:(plac\w+)/,wt+"input-$1")]})],r)}return""})}},gd=[pd],vd=function(e){var n=e.key;if(n==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(p){var v=p.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||gd,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var v=p.getAttribute("data-emotion").split(" "),m=1;m<v.length;m++)o[v[m]]=!0;a.push(p)});var l,c=[fd,dd];{var u,h=[od,ad(function(p){u.insert(p)})],f=sd(c.concat(r,h)),d=function(v){return We(id(v),f)};l=function(v,m,_,y){u=_,d(v?v+"{"+m.styles+"}":m.styles),y&&(g.inserted[m.name]=!0)}}var g={key:n,sheet:new Uf({key:n,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return g.sheet.hydrate(a),g};function md(t){for(var e=0,n,i=0,r=t.length;r>=4;++i,r-=4)n=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(i+2)&255)<<16;case 2:e^=(t.charCodeAt(i+1)&255)<<8;case 1:e^=t.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var _d={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yd=/[A-Z]|^ms/g,xd=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bl=function(e){return e.charCodeAt(1)===45},Cs=function(e){return e!=null&&typeof e!="boolean"},yr=ld(function(t){return bl(t)?t:t.replace(yd,"-$&").toLowerCase()}),Ms=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(xd,function(i,r,o){return de={name:r,styles:o,next:de},r})}return _d[e]!==1&&!bl(e)&&typeof n=="number"&&n!==0?n+"px":n};function Ti(t,e,n){if(n==null)return"";var i=n;if(i.__emotion_styles!==void 0)return i;switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return de={name:r.name,styles:r.styles,next:de},r.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)de={name:s.name,styles:s.styles,next:de},s=s.next;var a=o.styles+";";return a}return bd(t,e,n)}}var l=n;if(e==null)return l;var c=e[l];return c!==void 0?c:l}function bd(t,e,n){var i="";if(Array.isArray(n))for(var r=0;r<n.length;r++)i+=Ti(t,e,n[r])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;e!=null&&e[a]!==void 0?i+=o+"{"+e[a]+"}":Cs(a)&&(i+=yr(o)+":"+Ms(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var l=0;l<s.length;l++)Cs(s[l])&&(i+=yr(o)+":"+Ms(o,s[l])+";");else{var c=Ti(t,e,s);switch(o){case"animation":case"animationName":{i+=yr(o)+":"+c+";";break}default:i+=o+"{"+c+"}"}}}return i}var As=/label:\s*([^\s;{]+)\s*(;|$)/g,de;function xr(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,r="";de=void 0;var o=t[0];if(o==null||o.raw===void 0)i=!1,r+=Ti(n,e,o);else{var s=o;r+=s[0]}for(var a=1;a<t.length;a++)if(r+=Ti(n,e,t[a]),i){var l=o;r+=l[a]}As.lastIndex=0;for(var c="",u;(u=As.exec(r))!==null;)c+="-"+u[1];var h=md(r)+c;return{name:h,styles:r,next:de}}function wl(t,e,n){var i="";return n.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(i+=r+" ")}),i}var wd=function(e,n,i){var r=e.key+"-"+n.name;e.registered[r]===void 0&&(e.registered[r]=n.styles)},kd=function(e,n,i){wd(e,n);var r=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+r:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function $s(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function Ds(t,e,n){var i=[],r=wl(t,i,n);return i.length<2?n:r+e(i)}var Td=function(e){var n=vd(e);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var i=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var h=xr(c,n.registered,void 0);return kd(n,h),n.key+"-"+h.name},r=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var h=xr(c,n.registered),f="animation-"+h.name;return $s(n,{name:h.name,styles:"@keyframes "+f+"{"+h.styles+"}"}),f},o=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var h=xr(c,n.registered);$s(n,h)},s=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return Ds(n.registered,i,Sd(c))};return{css:i,cx:s,injectGlobal:o,keyframes:r,hydrate:function(l){l.forEach(function(c){n.inserted[c]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:wl.bind(null,n.registered),merge:Ds.bind(null,n.registered,i)}},Sd=function t(e){for(var n="",i=0;i<e.length;i++){var r=e[i];if(r!=null){var o=void 0;switch(typeof r){case"boolean":break;case"object":{if(Array.isArray(r))o=t(r);else{o="";for(var s in r)r[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=r}o&&(n&&(n+=" "),n+=o)}}return n},kl=Td({key:"css"}),Re=kl.injectGlobal,Z=kl.css;function Tl(){const t=()=>Math.floor((1+crypto.getRandomValues(new Uint32Array(1))[0])*65536).toString(16).substring(1);return`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}const Es=new WeakMap;function Cd(t,e){const n=t.substr(4,t.length-5);let i=Es.get(e);if(i||(i=new Map,Es.set(e,i)),i.has(n))return i.get(n);const r=getComputedStyle(e).getPropertyValue(n);return i.set(n,r),r}function Md(t,e,n=0){const[i,r,o,s]=[t.x+n,t.y+t.height-2*n,t.x+t.width-2*n,t.y+n],[a,l,c,u]=[e.x+n,e.y+e.height-2*n,e.x+e.width-2*n,e.y+n];return!(r<u||l<s||o<a||c<i)}function _o(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Sl(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function On(){}var Sn=.7,Si=1/Sn,Ue="\\s*([+-]?\\d+)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ad=/^#([0-9a-f]{3,8})$/,$d=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),Dd=new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`),Ed=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${Cn}\\)$`),Rd=new RegExp(`^rgba\\(${qt},${qt},${qt},${Cn}\\)$`),Od=new RegExp(`^hsl\\(${Cn},${qt},${qt}\\)$`),Nd=new RegExp(`^hsla\\(${Cn},${qt},${qt},${Cn}\\)$`),Rs={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};_o(On,$e,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Os,formatHex:Os,formatHex8:Fd,formatHsl:Ld,formatRgb:Ns,toString:Ns});function Os(){return this.rgb().formatHex()}function Fd(){return this.rgb().formatHex8()}function Ld(){return Cl(this).formatHsl()}function Ns(){return this.rgb().formatRgb()}function $e(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ad.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fs(e):n===3?new Mt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Gn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Gn(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=$d.exec(t))?new Mt(e[1],e[2],e[3],1):(e=Dd.exec(t))?new Mt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ed.exec(t))?Gn(e[1],e[2],e[3],e[4]):(e=Rd.exec(t))?Gn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Od.exec(t))?Ps(e[1],e[2]/100,e[3]/100,1):(e=Nd.exec(t))?Ps(e[1],e[2]/100,e[3]/100,e[4]):Rs.hasOwnProperty(t)?Fs(Rs[t]):t==="transparent"?new Mt(NaN,NaN,NaN,0):null}function Fs(t){return new Mt(t>>16&255,t>>8&255,t&255,1)}function Gn(t,e,n,i){return i<=0&&(t=e=n=NaN),new Mt(t,e,n,i)}function zd(t){return t instanceof On||(t=$e(t)),t?(t=t.rgb(),new Mt(t.r,t.g,t.b,t.opacity)):new Mt}function Pr(t,e,n,i){return arguments.length===1?zd(t):new Mt(t,e,n,i??1)}function Mt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}_o(Mt,Pr,Sl(On,{brighter(t){return t=t==null?Si:Math.pow(Si,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Sn:Math.pow(Sn,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Mt(Ce(this.r),Ce(this.g),Ce(this.b),Ci(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:Ls,formatHex:Ls,formatHex8:Pd,formatRgb:zs,toString:zs}));function Ls(){return`#${we(this.r)}${we(this.g)}${we(this.b)}`}function Pd(){return`#${we(this.r)}${we(this.g)}${we(this.b)}${we((isNaN(this.opacity)?1:this.opacity)*255)}`}function zs(){const t=Ci(this.opacity);return`${t===1?"rgb(":"rgba("}${Ce(this.r)}, ${Ce(this.g)}, ${Ce(this.b)}${t===1?")":`, ${t})`}`}function Ci(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ce(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function we(t){return t=Ce(t),(t<16?"0":"")+t.toString(16)}function Ps(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bt(t,e,n,i)}function Cl(t){if(t instanceof Bt)return new Bt(t.h,t.s,t.l,t.opacity);if(t instanceof On||(t=$e(t)),!t)return new Bt;if(t instanceof Bt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(e===o?s=(n-i)/a+(n<i)*6:n===o?s=(i-e)/a+2:s=(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Bt(s,a,l,t.opacity)}function yo(t,e,n,i){return arguments.length===1?Cl(t):new Bt(t,e,n,i??1)}function Bt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}_o(Bt,yo,Sl(On,{brighter(t){return t=t==null?Si:Math.pow(Si,t),new Bt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Sn:Math.pow(Sn,t),new Bt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Mt(br(t>=240?t-240:t+120,r,i),br(t,r,i),br(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Bt(Bs(this.h),qn(this.s),qn(this.l),Ci(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 t=Ci(this.opacity);return`${t===1?"hsl(":"hsla("}${Bs(this.h)}, ${qn(this.s)*100}%, ${qn(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Bs(t){return t=(t||0)%360,t<0?t+360:t}function qn(t){return Math.max(0,Math.min(1,t||0))}function br(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const fn=(globalThis==null?void 0:globalThis.UNOVIS_COLORS)||["#4D8CFD","#FF6B7E","#F4B83E","#A6CC74","#00C19A","#6859BE"],Bd=(globalThis==null?void 0:globalThis.UNOVIS_COLORS_DARK)||["#4D8CFD","#FF6B7E","#FFC16D","#A6CC74","#00C19A","#7887E0"],ue=t=>`--vis-${It(t)?`color${t%fn.length}`:t}`;function Id(t,e=.4){const n=yo(t);return n.l=n.l*(1+e),n.formatHex()}function Hd(t,e=.4,n=.6){const i=yo(t);return i.s=i.s*(1-n),i.l=i.l*(1-e),i.formatHex()}const Mi=10,Br=[{id:"stripes-diagonal",svg:'<path d="M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2" stroke="#000"/>'},{id:"dots",svg:'<path d="m0-1.5a1 1 0 010 3m10-3a1 1 0 000 3M5 3.5a1 1 0 010 3 1 1 0 010-3M0 8.5 a1 1 0 010 3m10-3a1 1 0 000 3" fill"#000"/>'},{id:"stripes-vertical",svg:'<path d="M 5,-1 L5,11" stroke="#000"/>'},{id:"crosshatch",svg:'<path d="M0 0L10 10ZM10 0L0 10Z" stroke="#000"/>'},{id:"waves",svg:'<path d="M0 4Q2.5 1 5 4 7.5 7 10 4v2Q7.5 9 5 6 2.5 3 0 6Z" fill="#000"/>'},{id:"circles",svg:'<circle cx="5" cy="5" r="3" stroke="#000" fill="#fff"/>'}],Ir=[{id:"circle",marker:'<circle cx="5" cy="5" r="5"/>',dashArray:[]},{id:"triangle",marker:'<path d="M5,0 L10,9 L0,9Z">',dashArray:[9,1]},{id:"diamond",marker:'<path d="M 0 5 L5 0 L 10 5 L 5 10 L 0 5Z">',dashArray:[2]},{id:"arrow",marker:'<path d="M4 0 0 0 6 5 0 10 4 10 10 5Z">',dashArray:[2,3,8,3]},{id:"square",marker:'<rect x="1" y="1" width="8" height="8"/>',dashArray:[6]},{id:"star",marker:'<path d="m2 9 3-9 3 9L0 3h10Z"/>',dashArray:[1,6]}];function he(t){return`vis-${`pattern-${t.svg?"fill":"marker"}`}-${t.id}`}const Wd=t=>`<mask id="${he(t)}">
<pattern id="${t.id}" viewBox="0 0 10 10" width="${Mi}" height="${Mi}" patternUnits="userSpaceOnUse">
<rect width="100%" height="100%" fill="#fff"/>
${t.svg}
</pattern>
<rect x="-50%" y="-50%" width="200%" height="200%" fill="url(#${t.id})"/>
</mask>`,Ud=(t,e)=>`<marker id="${he(t)}"
fill="var(${ue(e)})"
markerUnits="userSpaceOnUse"
refX="5"
refY="5"
markerWidth="${Mi}"
markerHeight="${Mi}">
${t.marker}
</marker>`;function Yd(){const t=Br.map(Wd).concat(Ir.map(Ud)).join(""),e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("height","100%"),e.setAttribute("width","100%"),e.style.position="fixed",e.style.zIndex="-99999999",e.innerHTML=`<defs>${t}</defs>`,document.body.appendChild(e)}typeof window<"u"&&Yd();const Ml=(globalThis==null?void 0:globalThis.UNOVIS_FONT_W2H_RATIO_DEFAULT)||.5,Al=(globalThis==null?void 0:globalThis.UNOVIS_TEXT_SEPARATOR_DEFAULT)||[" ","-",".",","],$l=(globalThis==null?void 0:globalThis.UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT)||"-",xn=(globalThis==null?void 0:globalThis.UNOVIS_TEXT_DEFAULT)||{text:"",fontSize:12,fontFamily:"var(--vis-font-family)",lineHeight:1.25,marginTop:0,marginBottom:0};Re`
:root {
label: vis-root-styles;
--vis-font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
--vis-font-wh-ratio: ${Ml};
--vis-color-main: var(${ue(0)});
--vis-color-main-light: ${Id(fn[0])};
--vis-color-main-dark: ${Hd(fn[0])};
--vis-color-grey: #2a2a2a;
${fn.map((t,e)=>`${ue(e)}: ${t};`)}
${Bd.map((t,e)=>`--vis-dark-color${e}: ${t};`)}
${Br.map((t,e)=>`
--${he(t)}: url(#${he(t)});
--vis-pattern-fill${e}: var(--${he(t)});
`)}
${Ir.map((t,e)=>{var n;return`
--${he(t)}: url(#${he(t)});
--vis-pattern-marker${e}: var(--${he(t)});
--vis-pattern-dasharray${e}: ${(n=t.dashArray)===null||n===void 0?void 0:n.join(" ")};
`})}
body.theme-dark {
${fn.map((t,e)=>`${ue(e)}: var(--vis-dark-color${e});`)}
}
body.theme-patterns {
${Br.map((t,e)=>`path[style*="fill: var(${ue(e)})"] {
mask: var(--vis-pattern-fill${e});
}`)}
${Ir.map((t,e)=>`
path[stroke="var(${ue(e)})"]:not([style*="fill"]),
path[style*="stroke: var(${ue(e)})"]:not([style*="fill"]) {
marker: var(--vis-pattern-marker${e});
stroke-dasharray: var(--vis-pattern-dasharray${e});
}
`)}
}
`;function xo(t=window==null?void 0:window.document.body){return t?+Cd("var(--vis-font-wh-ratio)",t):Ml}var Vd={value:()=>{}};function Dl(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ni(n)}function ni(t){this._=t}function Xd(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ni.prototype=Dl.prototype={constructor:ni,on:function(t,e){var n=this._,i=Xd(t+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o<s;)if((r=(t=i[o]).type)&&(r=Gd(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(r=(t=i[o]).type)n[r]=Is(n[r],t.name,e);else if(e==null)for(r in n)n[r]=Is(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ni(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};function Gd(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function Is(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Vd,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var je=0,dn=0,sn=0,El=1e3,Ai,pn,$i=0,De=0,ji=0,Mn=typeof performance=="object"&&performance.now?performance:Date,Rl=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bo(){return De||(Rl(qd),De=Mn.now()+ji)}function qd(){De=0}function Di(){this._call=this._time=this._next=null}Di.prototype=Ol.prototype={constructor:Di,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?bo():+n)+(e==null?0:+e),!this._next&&pn!==this&&(pn?pn._next=this:Ai=this,pn=this),this._call=t,this._time=n,Hr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hr())}};function Ol(t,e,n){var i=new Di;return i.restart(t,e,n),i}function jd(){bo(),++je;for(var t=Ai,e;t;)(e=De-t._time)>=0&&t._call.call(void 0,e),t=t._next;--je}function Hs(){De=($i=Mn.now())+ji,je=dn=0;try{jd()}finally{je=0,Qd(),De=0}}function Zd(){var t=Mn.now(),e=t-$i;e>El&&(ji-=e,$i=t)}function Qd(){for(var t,e=Ai,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ai=n);pn=t,Hr(i)}function Hr(t){if(!je){dn&&(dn=clearTimeout(dn));var e=t-De;e>24?(t<1/0&&(dn=setTimeout(Hs,t-Mn.now()-ji)),sn&&(sn=clearInterval(sn))):(sn||($i=Mn.now(),sn=setInterval(Zd,El)),je=1,Rl(Hs))}}function Ws(t,e,n){var i=new Di;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var Kd=Dl("start","end","cancel","interrupt"),Jd=[],Nl=0,Us=1,Wr=2,ii=3,Ys=4,Ur=5,ri=6;function Zi(t,e,n,i,r,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;tp(t,n,{name:e,index:i,group:r,on:Kd,tween:Jd,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Nl})}function wo(t,e){var n=Wt(t,e);if(n.state>Nl)throw new Error("too late; already scheduled");return n}function Zt(t,e){var n=Wt(t,e);if(n.state>ii)throw new Error("too late; already running");return n}function Wt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function tp(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Ol(o,0,n.time);function o(c){n.state=Us,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,h,f,d;if(n.state!==Us)return l();for(u in i)if(d=i[u],d.name===n.name){if(d.state===ii)return Ws(s);d.state===Ys?(d.state=ri,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[u]):+u<e&&(d.state=ri,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[u])}if(Ws(function(){n.state===ii&&(n.state=Ys,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Wr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Wr){for(n.state=ii,r=new Array(f=n.tween.length),u=0,h=-1;u<f;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=d);r.length=h+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Ur,1),h=-1,f=r.length;++h<f;)r[h].call(t,u);n.state===Ur&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=ri,n.timer.stop(),delete i[e];for(var c in i)return;delete t.__transition}}function ko(t,e){var n=t.__transition,i,r,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((i=n[s]).name!==e){o=!1;continue}r=i.state>Wr&&i.state<Ur,i.state=ri,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[s]}o&&delete t.__transition}}function ep(t){return this.each(function(){ko(this,t)})}const To=t=>()=>t;function np(t,e){return function(n){return t+n*e}}function ip(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function rp(t){return(t=+t)==1?Fl:function(e,n){return n-e?ip(e,n,t):To(isNaN(e)?n:e)}}function Fl(t,e){var n=e-t;return n?np(t,n):To(isNaN(t)?e:t)}const Ei=(function t(e){var n=rp(e);function i(r,o){var s=n((r=Pr(r)).r,(o=Pr(o)).r),a=n(r.g,o.g),l=n(r.b,o.b),c=Fl(r.opacity,o.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return i.gamma=t,i})(1);function op(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(o){for(r=0;r<n;++r)i[r]=t[r]*(1-o)+e[r]*o;return i}}function sp(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ap(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n),s;for(s=0;s<i;++s)r[s]=Oe(t[s],e[s]);for(;s<n;++s)o[s]=e[s];return function(a){for(s=0;s<i;++s)o[s]=r[s](a);return o}}function lp(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Pt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function cp(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Oe(t[r],e[r]):i[r]=e[r];return function(o){for(r in n)i[r]=n[r](o);return i}}var Yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wr=new RegExp(Yr.source,"g");function up(t){return function(){return t}}function hp(t){return function(e){return t(e)+""}}function Ll(t,e){var n=Yr.lastIndex=wr.lastIndex=0,i,r,o,s=-1,a=[],l=[];for(t=t+"",e=e+"";(i=Yr.exec(t))&&(r=wr.exec(e));)(o=r.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Pt(i,r)})),n=wr.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?hp(l[0].x):up(e):(e=l.length,function(c){for(var u=0,h;u<e;++u)a[(h=l[u]).i]=h.x(c);return a.join("")})}function Oe(t,e){var n=typeof e,i;return e==null||n==="boolean"?To(e):(n==="number"?Pt:n==="string"?(i=$e(e))?(e=i,Ei):Ll:e instanceof $e?Ei:e instanceof Date?lp:sp(e)?op:Array.isArray(e)?ap:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?cp:Pt)(t,e)}function So(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Vs=180/Math.PI,Vr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zl(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*Vs,skewX:Math.atan(l)*Vs,scaleX:s,scaleY:a}}var jn;function fp(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Vr:zl(e.a,e.b,e.c,e.d,e.e,e.f)}function dp(t){return t==null||(jn||(jn=document.createElementNS("http://www.w3.org/2000/svg","g")),jn.setAttribute("transform",t),!(t=jn.transform.baseVal.consolidate()))?Vr:(t=t.matrix,zl(t.a,t.b,t.c,t.d,t.e,t.f))}function Pl(t,e,n,i){function r(c){return c.length?c.pop()+" ":""}function o(c,u,h,f,d,g){if(c!==h||u!==f){var p=d.push("translate(",null,e,null,n);g.push({i:p-4,x:Pt(c,h)},{i:p-2,x:Pt(u,f)})}else(h||f)&&d.push("translate("+h+e+f+n)}function s(c,u,h,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:h.push(r(h)+"rotate(",null,i)-2,x:Pt(c,u)})):u&&h.push(r(h)+"rotate("+u+i)}function a(c,u,h,f){c!==u?f.push({i:h.push(r(h)+"skewX(",null,i)-2,x:Pt(c,u)}):u&&h.push(r(h)+"skewX("+u+i)}function l(c,u,h,f,d,g){if(c!==h||u!==f){var p=d.push(r(d)+"scale(",null,",",null,")");g.push({i:p-4,x:Pt(c,h)},{i:p-2,x:Pt(u,f)})}else(h!==1||f!==1)&&d.push(r(d)+"scale("+h+","+f+")")}return function(c,u){var h=[],f=[];return c=t(c),u=t(u),o(c.translateX,c.translateY,u.translateX,u.translateY,h,f),s(c.rotate,u.rotate,h,f),a(c.skewX,u.skewX,h,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,f),c=u=null,function(d){for(var g=-1,p=f.length,v;++g<p;)h[(v=f[g]).i]=v.x(d);return h.join("")}}}var pp=Pl(fp,"px, ","px)","deg)"),gp=Pl(dp,", ",")",")");function vp(t,e){e===void 0&&(e=t,t=Oe);for(var n=0,i=e.length-1,r=e[0],o=new Array(i<0?0:i);n<i;)o[n]=t(r,r=e[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function mp(t,e){var n,i;return function(){var r=Zt(this,t),o=r.tween;if(o!==n){i=n=o;for(var s=0,a=i.length;s<a;++s)if(i[s].name===e){i=i.slice(),i.splice(s,1);break}}r.tween=i}}function _p(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var o=Zt(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}o.tween=r}}function yp(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=Wt(this.node(),n).tween,r=0,o=i.length,s;r<o;++r)if((s=i[r]).name===t)return s.value;return null}return this.each((e==null?mp:_p)(n,t,e))}function Co(t,e,n){var i=t._id;return t.each(function(){var r=Zt(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Wt(r,i).value[e]}}function Bl(t,e){var n;return(typeof e=="number"?Pt:e instanceof $e?Ei:(n=$e(e))?(e=n,Ei):Ll)(t,e)}function xp(t){return function(){this.removeAttribute(t)}}function bp(t){return function(){this.removeAttributeNS(t.space,t.local)}}function wp(t,e,n){var i,r=n+"",o;return function(){var s=this.getAttribute(t);return s===r?null:s===i?o:o=e(i=s,n)}}function kp(t,e,n){var i,r=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===i?o:o=e(i=s,n)}}function Tp(t,e,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a)))}}function Sp(t,e,n){var i,r,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),l=a+"",s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a)))}}function Cp(t,e){var n=Yi(t),i=n==="transform"?gp:Bl;return this.attrTween(t,typeof e=="function"?(n.local?Sp:Tp)(n,i,Co(this,"attr."+t,e)):e==null?(n.local?bp:xp)(n):(n.local?kp:wp)(n,i,e))}function Mp(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ap(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function $p(t,e){var n,i;function r(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&Ap(t,o)),n}return r._value=e,r}function Dp(t,e){var n,i;function r(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&Mp(t,o)),n}return r._value=e,r}function Ep(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=Yi(t);return this.tween(n,(i.local?$p:Dp)(i,e))}function Rp(t,e){return function(){wo(this,t).delay=+e.apply(this,arguments)}}function Op(t,e){return e=+e,function(){wo(this,t).delay=e}}function Np(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Rp:Op)(e,t)):Wt(this.node(),e).delay}function Fp(t,e){return function(){Zt(this,t).duration=+e.apply(this,arguments)}}function Lp(t,e){return e=+e,function(){Zt(this,t).duration=e}}function zp(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Fp:Lp)(e,t)):Wt(this.node(),e).duration}function Pp(t,e){if(typeof e!="function")throw new Error;return function(){Zt(this,t).ease=e}}function Bp(t){var e=this._id;return arguments.length?this.each(Pp(e,t)):Wt(this.node(),e).ease}function Ip(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Zt(this,t).ease=n}}function Hp(t){if(typeof t!="function")throw new Error;return this.each(Ip(this._id,t))}function Wp(t){typeof t!="function"&&(t=ja(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],s=o.length,a=i[r]=[],l,c=0;c<s;++c)(l=o[c])&&t.call(l,l.__data__,c,o)&&a.push(l);return new oe(i,this._parents,this._name,this._id)}function Up(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l=e[a],c=n[a],u=l.length,h=s[a]=new Array(u),f,d=0;d<u;++d)(f=l[d]||c[d])&&(h[d]=f);for(;a<i;++a)s[a]=e[a];return new oe(s,this._parents,this._name,this._id)}function Yp(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Vp(t,e,n){var i,r,o=Yp(e)?wo:Zt;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}function Xp(t,e){var n=this._id;return arguments.length<2?Wt(this.node(),n).on.on(t):this.each(Vp(n,t,e))}function Gp(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function qp(){return this.on("end.remove",Gp(this._id))}function jp(t){var e=this._name,n=this._id;typeof t!="function"&&(t=lo(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a=i[s],l=a.length,c=o[s]=new Array(l),u,h,f=0;f<l;++f)(u=a[f])&&(h=t.call(u,u.__data__,f,a))&&("__data__"in u&&(h.__data__=u.__data__),c[f]=h,Zi(c[f],e,n,f,c,Wt(u,n)));return new oe(o,this._parents,e,n)}function Zp(t){var e=this._name,n=this._id;typeof t!="function"&&(t=qa(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l=i[a],c=l.length,u,h=0;h<c;++h)if(u=l[h]){for(var f=t.call(u,u.__data__,h,l),d,g=Wt(u,n),p=0,v=f.length;p<v;++p)(d=f[p])&&Zi(d,e,n,p,f,g);o.push(f),s.push(u)}return new oe(o,s,e,n)}var Qp=Dn.prototype.constructor;function Kp(){return new Qp(this._groups,this._parents)}function Jp(t,e){var n,i,r;return function(){var o=Ve(this,t),s=(this.style.removeProperty(t),Ve(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}function Il(t){return function(){this.style.removeProperty(t)}}function tg(t,e,n){var i,r=n+"",o;return function(){var s=Ve(this,t);return s===r?null:s===i?o:o=e(i=s,n)}}function eg(t,e,n){var i,r,o;return function(){var s=Ve(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),Ve(this,t))),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}function ng(t,e){var n,i,r,o="style."+e,s="end."+o,a;return function(){var l=Zt(this,t),c=l.on,u=l.value[o]==null?a||(a=Il(e)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(s,r=u),l.on=i}}function ig(t,e,n){var i=(t+="")=="transform"?pp:Bl;return e==null?this.styleTween(t,Jp(t,i)).on("end.style."+t,Il(t)):typeof e=="function"?this.styleTween(t,eg(t,i,Co(this,"style."+t,e))).each(ng(this._id,t)):this.styleTween(t,tg(t,i,e),n).on("end.style."+t,null)}function rg(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function og(t,e,n){var i,r;function o(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&rg(t,s,n)),i}return o._value=e,o}function sg(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,og(t,e,n??""))}function ag(t){return function(){this.textContent=t}}function lg(t){return function(){var e=t(this);this.textContent=e??""}}function cg(t){return this.tween("text",typeof t=="function"?lg(Co(this,"text",t)):ag(t==null?"":t+""))}function ug(t){return function(e){this.textContent=t.call(this,e)}}function hg(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&ug(r)),e}return i._value=t,i}function fg(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,hg(t))}function dg(){for(var t=this._name,e=this._id,n=Hl(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Wt(l,e);Zi(l,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new oe(i,this._parents,t,n)}function pg(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--r===0&&o()}};n.each(function(){var c=Zt(this,i),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),r===0&&o()})}var gg=0;function oe(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Hl(){return++gg}var Qt=Dn.prototype;oe.prototype={constructor:oe,select:jp,selectAll:Zp,selectChild:Qt.selectChild,selectChildren:Qt.selectChildren,filter:Wp,merge:Up,selection:Kp,transition:dg,call:Qt.call,nodes:Qt.nodes,node:Qt.node,size:Qt.size,empty:Qt.empty,each:Qt.each,on:Xp,attr:Cp,attrTween:Ep,style:ig,styleTween:sg,text:cg,textTween:fg,remove:qp,tween:yp,delay:Np,duration:zp,ease:Bp,easeVarying:Hp,end:pg,[Symbol.iterator]:Qt[Symbol.iterator]};const Xs=t=>+t;function vg(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var mg={time:null,delay:0,duration:250,ease:vg};function _g(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function yg(t){var e,n;t instanceof oe?(e=t._id,t=t._name):(e=Hl(),(n=mg).time=bo(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s=i[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Zi(l,t,e,c,s,n||_g(l,e));return new oe(i,this._parents,t,e)}Dn.prototype.interrupt=ep;Dn.prototype.transition=yg;function mt(t,e,n){if(t.nodes().forEach(i=>ko(i)),e){const i=t.transition().duration(e);return n&&i.ease(n),i}else return t}const xg=Object.assign(Object.assign({},po),{tooltip:void 0,annotations:void 0});class bg extends Ge{constructor(e,n,i){var r;super(e),this._defaultConfig=xg,this.config=this._defaultConfig,n&&(this.updateContainer(n,!0),this.component=n.component),i&&this.setData(i,!0),!((r=this.component)===null||r===void 0)&&r.datamodel.data&&this.render()}setData(e,n){var i;const{config:r}=this;this.component&&this.component.setData(e),n||this.render(),(i=r.tooltip)===null||i===void 0||i.hide()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing),this.element.appendChild(this.component.element);const i=e.tooltip;i&&(i.hasContainer()||i.setContainer(this._container),i.setComponents([this.component]));const r=e.annotations;r&&this.element.appendChild(r.element),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponent(e,n){this.component.setConfig(e),n||this.render()}update(e,n,i){e&&this.updateContainer(e,!0),n&&this.updateComponent(n,!0),i&&this.setData(i,!0),this.render()}getFitWidthScale(){const{config:e,component:n}=this,i=n;if(!i.getWidth)return 1;const r=i.getWidth()+e.margin.left+e.margin.right;return this.width/r}_preRender(){var e,n;super._preRender(),this.component.setSize(this.width,this.height,this.containerWidth,this.containerHeight),this.component.setContainerMargin(this.config.margin),(e=this.config.annotations)===null||e===void 0||e.setSize(this.width,this.height,this.containerWidth,this.containerHeight),(n=this.config.annotations)===null||n===void 0||n.setContainerMargin(this.config.margin)}_render(e){var n,i;const{config:r,component:o}=this;super._render(e),o.g.attr("transform",`translate(${r.margin.left},${r.margin.top})`),o.render(e),(n=r.annotations)===null||n===void 0||n.render(e),r.tooltip&&r.tooltip.update(),(i=r.onRenderComplete)===null||i===void 0||i.call(r,this.svg.node(),r.margin,this.containerWidth,this.containerHeight,this.width,this.height)}render(e=this.config.duration){const{config:n,component:i}=this;if(n.sizing===re.Extend||n.sizing===re.FitWidth){const r=n.sizing===re.FitWidth,o=i,s=o.getWidth()+n.margin.left+n.margin.right,a=o.getHeight()+n.margin.top+n.margin.bottom,l=r?this.getFitWidthScale():1,c=this.svg.attr("width"),u=this.svg.attr("height"),h=s*l,f=a*l,d=c||u;mt(this.svg,d?e:0).attr("width",h).attr("height",f).attr("viewBox",`0 0 ${s} ${r?f:a}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){var e;const{config:n}=this;super._onResize(),(e=n.tooltip)===null||e===void 0||e.hide()}destroy(){var e,n;const{component:i,config:r}=this;super.destroy(),i==null||i.destroy(),(e=r.tooltip)===null||e===void 0||e.destroy(),(n=r.annotations)===null||n===void 0||n.destroy()}}class Mo{constructor(e){this.data=e}get data(){return this._data}set data(e){this._data=e}}var j;(function(t){t.X="x",t.Y="y"})(j||(j={}));function Ut(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Wl(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Gs=Symbol("implicit");function Ao(){var t=new cs,e=[],n=[],i=Gs;function r(o){let s=t.get(o);if(s===void 0){if(i!==Gs)return i;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new cs;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Ao(e,n).unknown(i)},Ut.apply(r,arguments),r}function $o(){var t=Ao().unknown(void 0),e=t.domain,n=t.range,i=0,r=1,o,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function h(){var f=e().length,d=r<i,g=d?r:i,p=d?i:r;o=(p-g)/Math.max(1,f-l+c*2),a&&(o=Math.floor(o)),g+=(p-g-o*(f-l))*u,s=o*(1-l),a&&(g=Math.round(g),s=Math.round(s));var v=uf(f).map(function(m){return g+o*m});return n(d?v.reverse():v)}return t.domain=function(f){return arguments.length?(e(f),h()):e()},t.range=function(f){return arguments.length?([i,r]=f,i=+i,r=+r,h()):[i,r]},t.rangeRound=function(f){return[i,r]=f,i=+i,r=+r,a=!0,h()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(f){return arguments.length?(a=!!f,h()):a},t.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),h()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},t.paddingOuter=function(f){return arguments.length?(c=+f,h()):c},t.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),h()):u},t.copy=function(){return $o(e(),[i,r]).round(a).paddingInner(l).paddingOuter(c).align(u)},Ut.apply(h(),arguments)}function Ul(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ul(e())},t}function wg(){return Ul($o.apply(null,arguments).paddingInner(1))}function kg(t){return function(){return t}}function Xr(t){return+t}var qs=[0,1];function At(t){return t}function Gr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:kg(isNaN(e)?NaN:.5)}function Tg(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Sg(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=Gr(r,i),o=n(s,o)):(i=Gr(i,r),o=n(o,s)),function(a){return o(i(a))}}function Cg(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=Gr(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(a){var l=En(t,a,1,i)-1;return o[l](r[l](a))}}function Nn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Qi(){var t=qs,e=qs,n=Oe,i,r,o,s=At,a,l,c;function u(){var f=Math.min(t.length,e.length);return s!==At&&(s=Tg(t[0],t[f-1])),a=f>2?Cg:Sg,l=c=null,h}function h(f){return f==null||isNaN(f=+f)?o:(l||(l=a(t.map(i),e,n)))(i(s(f)))}return h.invert=function(f){return s(r((c||(c=a(e,t.map(i),Pt)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,Xr),u()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),n=So,u()},h.clamp=function(f){return arguments.length?(s=f?!0:At,u()):s!==At},h.interpolate=function(f){return arguments.length?(n=f,u()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,d){return i=f,r=d,u()}}function Yl(){return Qi()(At,At)}function Mg(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ri(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Ze(t){return t=Ri(Math.abs(t)),t?t[1]:NaN}function Ag(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function $g(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Dg=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function An(t){if(!(e=Dg.exec(t)))throw new Error("invalid format: "+t);var e;return new Do({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}An.prototype=Do.prototype;function Do(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Do.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Eg(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break t;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var Oi;function Rg(t,e){var n=Ri(t,e);if(!n)return Oi=void 0,t.toPrecision(e);var i=n[0],r=n[1],o=r-(Oi=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Ri(t,Math.max(0,e+o-1))[0]}function js(t,e){var n=Ri(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const Zs={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Mg,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>js(t*100,e),r:js,s:Rg,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Qs(t){return t}var Ks=Array.prototype.map,Js=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Og(t){var e=t.grouping===void 0||t.thousands===void 0?Qs:Ag(Ks.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Qs:$g(Ks.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(h,f){h=An(h);var d=h.fill,g=h.align,p=h.sign,v=h.symbol,m=h.zero,_=h.width,y=h.comma,b=h.precision,T=h.trim,x=h.type;x==="n"?(y=!0,x="g"):Zs[x]||(b===void 0&&(b=12),T=!0,x="g"),(m||d==="0"&&g==="=")&&(m=!0,d="0",g="=");var S=(f&&f.prefix!==void 0?f.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),F=(v==="$"?i:/[%p]/.test(x)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),z=Zs[x],O=/[defgprs%]/.test(x);b=b===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function V(M){var A=S,B=F,nt,pt,it;if(x==="c")B=z(M)+B,M="";else{M=+M;var yt=M<0||1/M<0;if(M=isNaN(M)?l:z(Math.abs(M),b),T&&(M=Eg(M)),yt&&+M==0&&p!=="+"&&(yt=!1),A=(yt?p==="("?p:a:p==="-"||p==="("?"":p)+A,B=(x==="s"&&!isNaN(M)&&Oi!==void 0?Js[8+Oi/3]:"")+B+(yt&&p==="("?")":""),O){for(nt=-1,pt=M.length;++nt<pt;)if(it=M.charCodeAt(nt),48>it||it>57){B=(it===46?r+M.slice(nt+1):M.slice(nt))+B,M=M.slice(0,nt);break}}}y&&!m&&(M=e(M,1/0));var Tt=A.length+M.length+B.length,D=Tt<_?new Array(_-Tt+1).join(d):"";switch(y&&m&&(M=e(D+M,D.length?_-B.length:1/0),D=""),g){case"<":M=A+M+B+D;break;case"=":M=A+D+M+B;break;case"^":M=D.slice(0,Tt=D.length>>1)+A+M+B+D.slice(Tt);break;default:M=D+A+M+B;break}return o(M)}return V.toString=function(){return h+""},V}function u(h,f){var d=Math.max(-8,Math.min(8,Math.floor(Ze(f)/3)))*3,g=Math.pow(10,-d),p=c((h=An(h),h.type="f",h),{suffix:Js[8+d/3]});return function(v){return p(g*v)}}return{format:c,formatPrefix:u}}var Zn,Eo,Vl;Ng({thousands:",",grouping:[3],currency:["$",""]});function Ng(t){return Zn=Og(t),Eo=Zn.format,Vl=Zn.formatPrefix,Zn}function Fg(t){return Math.max(0,-Ze(Math.abs(t)))}function Lg(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ze(e)/3)))*3-Ze(Math.abs(t)))}function zg(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ze(e)-Ze(t))+1}function Pg(t,e,n,i){var r=Or(t,e,n),o;switch(i=An(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(o=Lg(r,s))&&(i.precision=o),Vl(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=zg(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=Fg(r))&&(i.precision=o-(i.type==="%")*2);break}}return Eo(i)}function Ne(t){var e=t.domain;return t.ticks=function(n){var i=e();return Er(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return Pg(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,o=i.length-1,s=i[r],a=i[o],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=r,r=o,o=c);u-- >0;){if(c=Rr(s,a,n),c===l)return i[r]=s,i[o]=a,e(i);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function Xl(){var t=Yl();return t.copy=function(){return Nn(t,Xl())},Ut.apply(t,arguments),Ne(t)}function Gl(t){var e;function n(i){return i==null||isNaN(i=+i)?e:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(t=Array.from(i,Xr),n):t.slice()},n.unknown=function(i){return arguments.length?(e=i,n):e},n.copy=function(){return Gl(t).unknown(e)},t=arguments.length?Array.from(t,Xr):[0,1],Ne(n)}function ql(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],o=t[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),t[n]=e.floor(r),t[i]=e.ceil(o),t}function ta(t){return Math.log(t)}function ea(t){return Math.exp(t)}function Bg(t){return-Math.log(-t)}function Ig(t){return-Math.exp(-t)}function Hg(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Wg(t){return t===10?Hg:t===Math.E?Math.exp:e=>Math.pow(t,e)}function Ug(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function na(t){return(e,n)=>-t(-e,n)}function Yg(t){const e=t(ta,ea),n=e.domain;let i=10,r,o;function s(){return r=Ug(i),o=Wg(i),n()[0]<0?(r=na(r),o=na(o),t(Bg,Ig)):t(ta,ea),e}return e.base=function(a){return arguments.length?(i=+a,s()):i},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const h=u<c;h&&([c,u]=[u,c]);let f=r(c),d=r(u),g,p;const v=a==null?10:+a;let m=[];if(!(i%1)&&d-f<v){if(f=Math.floor(f),d=Math.ceil(d),c>0){for(;f<=d;++f)for(g=1;g<i;++g)if(p=f<0?g/o(-f):g*o(f),!(p<c)){if(p>u)break;m.push(p)}}else for(;f<=d;++f)for(g=i-1;g>=1;--g)if(p=f>0?g/o(-f):g*o(f),!(p<c)){if(p>u)break;m.push(p)}m.length*2<v&&(m=Er(c,u,v))}else m=Er(f,d,Math.min(d-f,v)).map(o);return h?m.reverse():m},e.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=An(l)).precision==null&&(l.trim=!0),l=Eo(l)),a===1/0)return l;const c=Math.max(1,i*a/e.ticks().length);return u=>{let h=u/o(Math.round(r(u)));return h*i<i-.5&&(h*=i),h<=c?l(u):""}},e.nice=()=>n(ql(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),e}function jl(){const t=Yg(Qi()).domain([1,10]);return t.copy=()=>Nn(t,jl()).base(t.base()),Ut.apply(t,arguments),t}function ia(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function ra(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Vg(t){var e=1,n=t(ia(e),ra(e));return n.constant=function(i){return arguments.length?t(ia(e=+i),ra(e)):e},Ne(n)}function Zl(){var t=Vg(Qi());return t.copy=function(){return Nn(t,Zl()).constant(t.constant())},Ut.apply(t,arguments)}function oa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Xg(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Gg(t){return t<0?-t*t:t*t}function qg(t){var e=t(At,At),n=1;function i(){return n===1?t(At,At):n===.5?t(Xg,Gg):t(oa(n),oa(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,i()):n},Ne(e)}function Ro(){var t=qg(Qi());return t.copy=function(){return Nn(t,Ro()).exponent(t.exponent())},Ut.apply(t,arguments),t}function jg(){return Ro.apply(null,arguments).exponent(.5)}function Ql(){var t=[],e=[],n=[],i;function r(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=sf(t,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:e[En(n,s)]}return o.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},o.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(_n),r()},o.range=function(s){return arguments.length?(e=Array.from(s),r()):e.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return Ql().domain(t).range(e).unknown(i)},Ut.apply(o,arguments)}function Kl(){var t=0,e=1,n=1,i=[.5],r=[0,1],o;function s(l){return l!=null&&l<=l?r[En(i,l,0,n)]:o}function a(){var l=-1;for(i=new Array(n);++l<n;)i[l]=((l+1)*e-(l-n)*t)/(n+1);return s}return s.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,a()):[t,e]},s.range=function(l){return arguments.length?(n=(r=Array.from(l)).length-1,a()):r.slice()},s.invertExtent=function(l){var c=r.indexOf(l);return c<0?[NaN,NaN]:c<1?[t,i[0]]:c>=n?[i[n-1],e]:[i[c-1],i[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return i.slice()},s.copy=function(){return Kl().domain([t,e]).range(r).unknown(o)},Ut.apply(Ne(s),arguments)}function Jl(){var t=[.5],e=[0,1],n,i=1;function r(o){return o!=null&&o<=o?e[En(t,o,0,i)]:n}return r.domain=function(o){return arguments.length?(t=Array.from(o),i=Math.min(t.length,e.length-1),r):t.slice()},r.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(t.length,e.length-1),r):e.slice()},r.invertExtent=function(o){var s=e.indexOf(o);return[t[s-1],t[s]]},r.unknown=function(o){return arguments.length?(n=o,r):n},r.copy=function(){return Jl().domain(t).range(e).unknown(n)},Ut.apply(r,arguments)}const kr=new Date,Tr=new Date;function dt(t,e,n,i){function r(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(t(o=new Date(+o)),o),r.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const l=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(c<o&&o<s);return l},r.filter=o=>dt(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(r.count=(o,s)=>(kr.setTime(+o),Tr.setTime(+s),t(kr),t(Tr),Math.floor(n(kr,Tr))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const Ni=dt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Ni.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?dt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Ni);Ni.range;const ne=1e3,Ft=ne*60,ie=Ft*60,se=ie*24,Oo=se*7,sa=se*30,Sr=se*365,ke=dt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*ne)},(t,e)=>(e-t)/ne,t=>t.getUTCSeconds());ke.range;const No=dt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ne)},(t,e)=>{t.setTime(+t+e*Ft)},(t,e)=>(e-t)/Ft,t=>t.getMinutes());No.range;const Fo=dt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Ft)},(t,e)=>(e-t)/Ft,t=>t.getUTCMinutes());Fo.range;const Lo=dt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ne-t.getMinutes()*Ft)},(t,e)=>{t.setTime(+t+e*ie)},(t,e)=>(e-t)/ie,t=>t.getHours());Lo.range;const zo=dt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*ie)},(t,e)=>(e-t)/ie,t=>t.getUTCHours());zo.range;const Fn=dt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ft)/se,t=>t.getDate()-1);Fn.range;const Ki=dt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/se,t=>t.getUTCDate()-1);Ki.range;const tc=dt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/se,t=>Math.floor(t/se));tc.range;function Fe(t){return dt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ft)/Oo)}const Ji=Fe(0),Fi=Fe(1),Zg=Fe(2),Qg=Fe(3),Qe=Fe(4),Kg=Fe(5),Jg=Fe(6);Ji.range;Fi.range;Zg.range;Qg.range;Qe.range;Kg.range;Jg.range;function Le(t){return dt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Oo)}const tr=Le(0),Li=Le(1),t0=Le(2),e0=Le(3),Ke=Le(4),n0=Le(5),i0=Le(6);tr.range;Li.range;t0.range;e0.range;Ke.range;n0.range;i0.range;const Po=dt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Po.range;const Bo=dt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Bo.range;const ae=dt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ae.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});ae.range;const le=dt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());le.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:dt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});le.range;function ec(t,e,n,i,r,o){const s=[[ke,1,ne],[ke,5,5*ne],[ke,15,15*ne],[ke,30,30*ne],[o,1,Ft],[o,5,5*Ft],[o,15,15*Ft],[o,30,30*Ft],[r,1,ie],[r,3,3*ie],[r,6,6*ie],[r,12,12*ie],[i,1,se],[i,2,2*se],[n,1,Oo],[e,1,sa],[e,3,3*sa],[t,1,Sr]];function a(c,u,h){const f=u<c;f&&([c,u]=[u,c]);const d=h&&typeof h.range=="function"?h:l(c,u,h),g=d?d.range(c,+u+1):[];return f?g.reverse():g}function l(c,u,h){const f=Math.abs(u-c)/h,d=uo(([,,v])=>v).right(s,f);if(d===s.length)return t.every(Or(c/Sr,u/Sr,h));if(d===0)return Ni.every(Math.max(Or(c,u,h),1));const[g,p]=s[f/s[d-1][2]<s[d][2]/f?d-1:d];return g.every(p)}return[a,l]}const[r0,o0]=ec(le,Bo,tr,tc,zo,Fo),[s0,a0]=ec(ae,Po,Ji,Fn,Lo,No);function Cr(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Mr(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function an(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function l0(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=ln(r),u=cn(r),h=ln(o),f=cn(o),d=ln(s),g=cn(s),p=ln(a),v=cn(a),m=ln(l),_=cn(l),y={a:it,A:yt,b:Tt,B:D,c:null,d:fa,e:fa,f:E0,g:H0,G:U0,H:A0,I:$0,j:D0,L:nc,m:R0,M:O0,p:R,q:k,Q:ga,s:va,S:N0,u:F0,U:L0,V:z0,w:P0,W:B0,x:null,X:null,y:I0,Y:W0,Z:Y0,"%":pa},b={a:H,A:G,b:et,B:ft,c:null,d:da,e:da,f:q0,g:rv,G:sv,H:V0,I:X0,j:G0,L:rc,m:j0,M:Z0,p:W,q:ot,Q:ga,s:va,S:Q0,u:K0,U:J0,V:tv,w:ev,W:nv,x:null,X:null,y:iv,Y:ov,Z:av,"%":pa},T={a:O,A:V,b:M,B:A,c:B,d:ua,e:ua,f:T0,g:ca,G:la,H:ha,I:ha,j:x0,L:k0,m:y0,M:b0,p:z,q:_0,Q:C0,s:M0,S:w0,u:d0,U:p0,V:g0,w:f0,W:v0,x:nt,X:pt,y:ca,Y:la,Z:m0,"%":S0};y.x=x(n,y),y.X=x(i,y),y.c=x(e,y),b.x=x(n,b),b.X=x(i,b),b.c=x(e,b);function x($,X){return function(q){var C=[],Ct=-1,rt=0,Dt=$.length,Et,ye,ts;for(q instanceof Date||(q=new Date(+q));++Ct<Dt;)$.charCodeAt(Ct)===37&&(C.push($.slice(rt,Ct)),(ye=aa[Et=$.charAt(++Ct)])!=null?Et=$.charAt(++Ct):ye=Et==="e"?" ":"0",(ts=X[Et])&&(Et=ts(q,ye)),C.push(Et),rt=Ct+1);return C.push($.slice(rt,Ct)),C.join("")}}function S($,X){return function(q){var C=an(1900,void 0,1),Ct=F(C,$,q+="",0),rt,Dt;if(Ct!=q.length)return null;if("Q"in C)return new Date(C.Q);if("s"in C)return new Date(C.s*1e3+("L"in C?C.L:0));if(X&&!("Z"in C)&&(C.Z=0),"p"in C&&(C.H=C.H%12+C.p*12),C.m===void 0&&(C.m="q"in C?C.q:0),"V"in C){if(C.V<1||C.V>53)return null;"w"in C||(C.w=1),"Z"in C?(rt=Mr(an(C.y,0,1)),Dt=rt.getUTCDay(),rt=Dt>4||Dt===0?Li.ceil(rt):Li(rt),rt=Ki.offset(rt,(C.V-1)*7),C.y=rt.getUTCFullYear(),C.m=rt.getUTCMonth(),C.d=rt.getUTCDate()+(C.w+6)%7):(rt=Cr(an(C.y,0,1)),Dt=rt.getDay(),rt=Dt>4||Dt===0?Fi.ceil(rt):Fi(rt),rt=Fn.offset(rt,(C.V-1)*7),C.y=rt.getFullYear(),C.m=rt.getMonth(),C.d=rt.getDate()+(C.w+6)%7)}else("W"in C||"U"in C)&&("w"in C||(C.w="u"in C?C.u%7:"W"in C?1:0),Dt="Z"in C?Mr(an(C.y,0,1)).getUTCDay():Cr(an(C.y,0,1)).getDay(),C.m=0,C.d="W"in C?(C.w+6)%7+C.W*7-(Dt+5)%7:C.w+C.U*7-(Dt+6)%7);return"Z"in C?(C.H+=C.Z/100|0,C.M+=C.Z%100,Mr(C)):Cr(C)}}function F($,X,q,C){for(var Ct=0,rt=X.length,Dt=q.length,Et,ye;Ct<rt;){if(C>=Dt)return-1;if(Et=X.charCodeAt(Ct++),Et===37){if(Et=X.charAt(Ct++),ye=T[Et in aa?X.charAt(Ct++):Et],!ye||(C=ye($,q,C))<0)return-1}else if(Et!=q.charCodeAt(C++))return-1}return C}function z($,X,q){var C=c.exec(X.slice(q));return C?($.p=u.get(C[0].toLowerCase()),q+C[0].length):-1}function O($,X,q){var C=d.exec(X.slice(q));return C?($.w=g.get(C[0].toLowerCase()),q+C[0].length):-1}function V($,X,q){var C=h.exec(X.slice(q));return C?($.w=f.get(C[0].toLowerCase()),q+C[0].length):-1}function M($,X,q){var C=m.exec(X.slice(q));return C?($.m=_.get(C[0].toLowerCase()),q+C[0].length):-1}function A($,X,q){var C=p.exec(X.slice(q));return C?($.m=v.get(C[0].toLowerCase()),q+C[0].length):-1}function B($,X,q){return F($,e,X,q)}function nt($,X,q){return F($,n,X,q)}function pt($,X,q){return F($,i,X,q)}function it($){return s[$.getDay()]}function yt($){return o[$.getDay()]}function Tt($){return l[$.getMonth()]}function D($){return a[$.getMonth()]}function R($){return r[+($.getHours()>=12)]}function k($){return 1+~~($.getMonth()/3)}function H($){return s[$.getUTCDay()]}function G($){return o[$.getUTCDay()]}function et($){return l[$.getUTCMonth()]}function ft($){return a[$.getUTCMonth()]}function W($){return r[+($.getUTCHours()>=12)]}function ot($){return 1+~~($.getUTCMonth()/3)}return{format:function($){var X=x($+="",y);return X.toString=function(){return $},X},parse:function($){var X=S($+="",!1);return X.toString=function(){return $},X},utcFormat:function($){var X=x($+="",b);return X.toString=function(){return $},X},utcParse:function($){var X=S($+="",!0);return X.toString=function(){return $},X}}}var aa={"-":"",_:" ",0:"0"},_t=/^\s*\d+/,c0=/^%/,u0=/[\\^$*+?|[\]().{}]/g;function K(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function h0(t){return t.replace(u0,"\\$&")}function ln(t){return new RegExp("^(?:"+t.map(h0).join("|")+")","i")}function cn(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function f0(t,e,n){var i=_t.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function d0(t,e,n){var i=_t.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function p0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function g0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function v0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function la(t,e,n){var i=_t.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ca(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function m0(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function _0(t,e,n){var i=_t.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function y0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function ua(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function x0(t,e,n){var i=_t.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function ha(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function b0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function w0(t,e,n){var i=_t.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function k0(t,e,n){var i=_t.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function T0(t,e,n){var i=_t.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function S0(t,e,n){var i=c0.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function C0(t,e,n){var i=_t.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function M0(t,e,n){var i=_t.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function fa(t,e){return K(t.getDate(),e,2)}function A0(t,e){return K(t.getHours(),e,2)}function $0(t,e){return K(t.getHours()%12||12,e,2)}function D0(t,e){return K(1+Fn.count(ae(t),t),e,3)}function nc(t,e){return K(t.getMilliseconds(),e,3)}function E0(t,e){return nc(t,e)+"000"}function R0(t,e){return K(t.getMonth()+1,e,2)}function O0(t,e){return K(t.getMinutes(),e,2)}function N0(t,e){return K(t.getSeconds(),e,2)}function F0(t){var e=t.getDay();return e===0?7:e}function L0(t,e){return K(Ji.count(ae(t)-1,t),e,2)}function ic(t){var e=t.getDay();return e>=4||e===0?Qe(t):Qe.ceil(t)}function z0(t,e){return t=ic(t),K(Qe.count(ae(t),t)+(ae(t).getDay()===4),e,2)}function P0(t){return t.getDay()}function B0(t,e){return K(Fi.count(ae(t)-1,t),e,2)}function I0(t,e){return K(t.getFullYear()%100,e,2)}function H0(t,e){return t=ic(t),K(t.getFullYear()%100,e,2)}function W0(t,e){return K(t.getFullYear()%1e4,e,4)}function U0(t,e){var n=t.getDay();return t=n>=4||n===0?Qe(t):Qe.ceil(t),K(t.getFullYear()%1e4,e,4)}function Y0(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+K(e/60|0,"0",2)+K(e%60,"0",2)}function da(t,e){return K(t.getUTCDate(),e,2)}function V0(t,e){return K(t.getUTCHours(),e,2)}function X0(t,e){return K(t.getUTCHours()%12||12,e,2)}function G0(t,e){return K(1+Ki.count(le(t),t),e,3)}function rc(t,e){return K(t.getUTCMilliseconds(),e,3)}function q0(t,e){return rc(t,e)+"000"}function j0(t,e){return K(t.getUTCMonth()+1,e,2)}function Z0(t,e){return K(t.getUTCMinutes(),e,2)}function Q0(t,e){return K(t.getUTCSeconds(),e,2)}function K0(t){var e=t.getUTCDay();return e===0?7:e}function J0(t,e){return K(tr.count(le(t)-1,t),e,2)}function oc(t){var e=t.getUTCDay();return e>=4||e===0?Ke(t):Ke.ceil(t)}function tv(t,e){return t=oc(t),K(Ke.count(le(t),t)+(le(t).getUTCDay()===4),e,2)}function ev(t){return t.getUTCDay()}function nv(t,e){return K(Li.count(le(t)-1,t),e,2)}function iv(t,e){return K(t.getUTCFullYear()%100,e,2)}function rv(t,e){return t=oc(t),K(t.getUTCFullYear()%100,e,2)}function ov(t,e){return K(t.getUTCFullYear()%1e4,e,4)}function sv(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Ke(t):Ke.ceil(t),K(t.getUTCFullYear()%1e4,e,4)}function av(){return"+0000"}function pa(){return"%"}function ga(t){return+t}function va(t){return Math.floor(+t/1e3)}var ze,sc,ac;lv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lv(t){return ze=l0(t),sc=ze.format,ze.parse,ac=ze.utcFormat,ze.utcParse,ze}function cv(t){return new Date(t)}function uv(t){return t instanceof Date?+t:+new Date(+t)}function Io(t,e,n,i,r,o,s,a,l,c){var u=Yl(),h=u.invert,f=u.domain,d=c(".%L"),g=c(":%S"),p=c("%I:%M"),v=c("%I %p"),m=c("%a %d"),_=c("%b %d"),y=c("%B"),b=c("%Y");function T(x){return(l(x)<x?d:a(x)<x?g:s(x)<x?p:o(x)<x?v:i(x)<x?r(x)<x?m:_:n(x)<x?y:b)(x)}return u.invert=function(x){return new Date(h(x))},u.domain=function(x){return arguments.length?f(Array.from(x,uv)):f().map(cv)},u.ticks=function(x){var S=f();return t(S[0],S[S.length-1],x??10)},u.tickFormat=function(x,S){return S==null?T:c(S)},u.nice=function(x){var S=f();return(!x||typeof x.range!="function")&&(x=e(S[0],S[S.length-1],x??10)),x?f(ql(S,x)):u},u.copy=function(){return Nn(u,Io(t,e,n,i,r,o,s,a,l,c))},u}function hv(){return Ut.apply(Io(s0,a0,ae,Po,Ji,Fn,Lo,No,ke,sc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fv(){return Ut.apply(Io(r0,o0,le,Bo,tr,Ki,zo,Fo,ke,ac).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function dv(){var t=0,e=1,n,i,r,o,s=At,a=!1,l;function c(h){return h==null||isNaN(h=+h)?l:s(r===0?.5:(h=(o(h)-n)*r,a?Math.max(0,Math.min(1,h)):h))}c.domain=function(h){return arguments.length?([t,e]=h,n=o(t=+t),i=o(e=+e),r=n===i?0:1/(i-n),c):[t,e]},c.clamp=function(h){return arguments.length?(a=!!h,c):a},c.interpolator=function(h){return arguments.length?(s=h,c):s};function u(h){return function(f){var d,g;return arguments.length?([d,g]=f,s=h(d,g),c):[s(0),s(1)]}}return c.range=u(Oe),c.rangeRound=u(So),c.unknown=function(h){return arguments.length?(l=h,c):l},function(h){return o=h,n=h(t),i=h(e),r=n===i?0:1/(i-n),c}}function lc(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function cc(){var t=Ne(dv()(At));return t.copy=function(){return lc(t,cc())},Wl.apply(t,arguments)}function pv(){var t=0,e=.5,n=1,i=1,r,o,s,a,l,c=At,u,h=!1,f;function d(p){return isNaN(p=+p)?f:(p=.5+((p=+u(p))-o)*(i*p<i*o?a:l),c(h?Math.max(0,Math.min(1,p)):p))}d.domain=function(p){return arguments.length?([t,e,n]=p,r=u(t=+t),o=u(e=+e),s=u(n=+n),a=r===o?0:.5/(o-r),l=o===s?0:.5/(s-o),i=o<r?-1:1,d):[t,e,n]},d.clamp=function(p){return arguments.length?(h=!!p,d):h},d.interpolator=function(p){return arguments.length?(c=p,d):c};function g(p){return function(v){var m,_,y;return arguments.length?([m,_,y]=v,c=vp(p,[m,_,y]),d):[c(0),c(.5),c(1)]}}return d.range=g(Oe),d.rangeRound=g(So),d.unknown=function(p){return arguments.length?(f=p,d):f},function(p){return u=p,r=p(t),o=p(e),s=p(n),a=r===o?0:.5/(o-r),l=o===s?0:.5/(s-o),i=o<r?-1:1,d}}function uc(){var t=Ne(pv()(At));return t.copy=function(){return lc(t,uc())},Wl.apply(t,arguments)}const ma={scaleLinear:Xl,scalePow:Ro,scaleSqrt:jg,scaleLog:jl,scaleSymlog:Zl,scaleIdentity:Gl,scaleTime:hv,scaleUtc:fv,scaleSequential:cc,scaleDiverging:uc,scaleQuantize:Kl,scaleQuantile:Ql,scaleThreshold:Jl,scaleOrdinal:Ao,scaleBand:$o,scalePoint:wg};var ct;(function(t){t.X="x",t.Y="y"})(ct||(ct={}));var jt;(function(t){t.West="west",t.East="east",t.North="north",t.South="south"})(jt||(jt={}));const gv=Object.assign(Object.assign({},po),{components:[],tooltip:void 0,crosshair:void 0,annotations:void 0,xAxis:void 0,yAxis:void 0,autoMargin:!0,xScale:void 0,xDomain:void 0,xDomainMinConstraint:void 0,xDomainMaxConstraint:void 0,xRange:void 0,yScale:void 0,yDomain:void 0,yDomainMinConstraint:void 0,yDomainMaxConstraint:void 0,yRange:void 0,yDirection:jt.North,preventEmptyDomain:null,scaleByDomain:!1,clipPathExtend:2});class vv extends Ge{constructor(e,n,i){var r,o;super(e),this._defaultConfig=gv,this.datamodel=new Mo,this.config=this._defaultConfig,this._clipPathId=Tl(),this._axisMargin={top:0,bottom:0,left:0,right:0},this._firstRender=!0,this._clipPath=this.svg.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect");const s="saturate",a=window.location.href.replace(window.location.hash,"");this.svg.attr("class",Z`
--highlight-filter-id: url(${a}#${s}); // defining a css variable
`),this._svgDefs.append("filter").attr("id",s).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),i&&this.setData(i,!0),(this.config.xAxis||this.config.yAxis||!((r=this.components)===null||r===void 0)&&r.some(l=>l.datamodel.data))&&this.render(),(o=document.fonts)===null||o===void 0||o.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){const e=this._getMargin();return ee(this.containerWidth-e.left-e.right,0,Number.POSITIVE_INFINITY)}get height(){const e=this._getMargin();return ee(this.containerHeight-e.top-e.bottom,0,Number.POSITIVE_INFINITY)}setData(e,n){var i,r,o,s,a;const{components:l,config:c}=this;if(!e)return;this.datamodel.data=e,l.forEach(h=>{h.setData(e)}),(i=c.crosshair)===null||i===void 0||i.setData(e),(r=c.xAxis)===null||r===void 0||r.setData(e),(o=c.yAxis)===null||o===void 0||o.setData(e),!Ae(this.datamodel.data,e)&&((s=c.tooltip)===null||s===void 0||s.hide(),(a=c.crosshair)===null||a===void 0||a.hide()),n||this.render()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.setData(this.datamodel.data,!0),e.xAxis&&(this.config.xAxis.config.type=j.X,this.element.appendChild(e.xAxis.element)),e.yAxis&&(this.config.yAxis.config.type=j.Y,this.element.appendChild(e.yAxis.element));for(const s of this.components)this.element.appendChild(s.element);const i=e.tooltip;i&&(i.hasContainer()||i.setContainer(this._container),i.setComponents(this.components));const r=e.crosshair;r&&(r.setContainer(this.svg),r.tooltip=i,this.element.appendChild(r.element));const o=e.annotations;o&&this.element.appendChild(o.element),this.element.appendChild(this._clipPath.node()),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponents(e,n){const{config:i}=this;this.components.forEach((r,o)=>{e[o]&&r.setConfig(e[o])}),this._updateScales(...this.components,i.xAxis,i.yAxis,i.crosshair),n||this.render()}update(e,n,i){i&&(this.datamodel.data=i),e&&this.updateContainer(e,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){const{config:e}=this;super._preRender(),e.autoMargin&&this._setAutoMargin();const n=rn([...this.components,e.xAxis,e.yAxis,e.crosshair,e.annotations]),i=this._getMargin();for(const r of n)r.setSize(this.width,this.height,this.containerWidth,this.containerHeight),r.setContainerMargin(i);this._updateScales(...this.components,e.xAxis,e.yAxis,e.crosshair)}_render(e){var n,i,r,o,s,a;const{config:l}=this;super._render();const c=this._getMargin();for(const f of this.components)f.g.attr("transform",`translate(${c.left},${c.top})`).style("clip-path",f.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",f.clippable?`url(#${this._clipPathId})`:null),f.render(e);this._renderAxes(this._firstRender?0:e);const u=l.clipPathExtend;this._clipPath.select("rect").attr("x",-u).attr("y",-u).attr("width",this.width+2*u).attr("height",this.height+2*u),(n=l.tooltip)===null||n===void 0||n.update();const h=l.crosshair;if(h){const f=this.components.filter(v=>!v.stacked).map(v=>v.config.y),d=this.components.filter(v=>v.stacked).map(v=>v.config.y),g=(i=this.components.find(v=>v.config.baseline))===null||i===void 0?void 0:i.config,p=g==null?void 0:g.baseline;h.accessors={x:(r=this.components[0])===null||r===void 0?void 0:r.config.x,y:Nr(f),yStacked:Nr(d),baseline:p},h.g.attr("transform",`translate(${c.left},${c.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),h.render()}(o=l.annotations)===null||o===void 0||o.g.attr("transform",`translate(${c.left},${c.top})`),(s=l.annotations)===null||s===void 0||s.render(),this._firstRender=!1,(a=l.onRenderComplete)===null||a===void 0||a.call(l,this.svg.node(),c,this._getBleed(this.components),this.containerWidth,this.containerHeight,this.width,this.height)}_updateScales(...e){const n=rn(e||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...e){const{config:n}=this;e&&(n.xScale&&e.forEach(i=>i.setScale(ct.X,n.xScale)),n.yScale&&e.forEach(i=>i.setScale(ct.Y,n.yScale)))}_updateScalesDomain(...e){const{config:n}=this;if(!e)return;const i=e.filter(r=>!r.config.excludeFromDomainCalculation);Object.values(ct).forEach(r=>{var o,s,a,l,c,u,h,f;const[d,g]=Kh(cf(i.map(T=>T.getDataExtent(r,n.scaleByDomain)))),p=r===ct.Y?n.yDomain:n.xDomain,v=r===ct.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,m=r===ct.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,_=(s=(o=p==null?void 0:p[0])!==null&&o!==void 0?o:d)!==null&&s!==void 0?s:0,y=(l=(a=p==null?void 0:p[1])!==null&&a!==void 0?a:g)!==null&&l!==void 0?l:1,b=[ee(_,(c=v==null?void 0:v[0])!==null&&c!==void 0?c:Number.NEGATIVE_INFINITY,(u=v==null?void 0:v[1])!==null&&u!==void 0?u:Number.POSITIVE_INFINITY),ee(y,(h=m==null?void 0:m[0])!==null&&h!==void 0?h:Number.NEGATIVE_INFINITY,(f=m==null?void 0:m[1])!==null&&f!==void 0?f:Number.POSITIVE_INFINITY)];if(b[0]===b[1]){const T=i.some(x=>{var S;return((S=x.datamodel.data)===null||S===void 0?void 0:S.length)>0});(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!T||r===ct.Y))&&(b[1]=b[0]+1)}e.forEach(T=>T.setScaleDomain(r,b))})}_updateScalesRange(...e){var n,i,r,o,s,a;const{config:l}=this;if(!e)return;const c=l.yDirection===jt.South,u=[(n=l.padding.left)!==null&&n!==void 0?n:0,this.width-((i=l.padding.right)!==null&&i!==void 0?i:0)],h=[this.height-((r=l.padding.bottom)!==null&&r!==void 0?r:0),(o=l.padding.top)!==null&&o!==void 0?o:0];c&&h.reverse();for(const d of e)d.setSize(this.width,this.height,this.containerWidth,this.containerHeight),d.setScaleRange(ct.X,(s=l.xRange)!==null&&s!==void 0?s:u),d.setScaleRange(ct.Y,(a=l.yRange)!==null&&a!==void 0?a:h);const f=this._getBleed(e);for(const d of e)d.setScaleRange(ct.X,[u[0]+f.left,u[1]-f.right]),d.setScaleRange(ct.Y,c?[h[0]+f.top,h[1]-f.bottom]:[h[0]-f.bottom,h[1]+f.top])}_renderAxes(e){const{config:{xAxis:n,yAxis:i}}=this,r=this._getMargin();rn([n,i]).forEach(s=>{const a=s.getOffset(r);s.g.attr("transform",`translate(${a.left},${a.top})`),s.render(e)})}_setAutoMargin(){const{config:{xAxis:e,yAxis:n}}=this,i=rn([...this.components,e,n]);this._setScales(...i),this._updateScalesDomain(...i);const r=this._firstRender?2:1;for(let o=0;o<r;o+=1){const s={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...i),rn([e,n]).forEach(l=>{l.preRender();const c=l.getRequiredMargin();s.top<c.top&&(s.top=c.top),s.bottom<c.bottom&&(s.bottom=c.bottom),s.left<c.left&&(s.left=c.left),s.right<c.right&&(s.right=c.right)}),this._axisMargin=s}}_getMargin(){const{config:{margin:e}}=this;return{top:e.top+this._axisMargin.top,bottom:e.bottom+this._axisMargin.bottom,left:e.left+this._axisMargin.left,right:e.right+this._axisMargin.right}}_getBleed(e){return e.map(n=>n.bleed).reduce((n,i)=>{for(const r of Object.keys(n)){const o=r;n[o]<i[o]&&(n[o]=i[o])}return n},{top:0,bottom:0,left:0,right:0})}destroy(){const{components:e,config:{tooltip:n,crosshair:i,annotations:r,xAxis:o,yAxis:s}}=this;super.destroy();for(const a of e)a==null||a.destroy();n==null||n.destroy(),i==null||i.destroy(),r==null||r.destroy(),o==null||o.destroy(),s==null||s.destroy()}}const Ho={duration:600,events:{},attributes:{}};class hc{constructor(e=mn.SVG){var n,i;this.type=mn.SVG,this.datamodel=new Mo,this.sizing=re.Fit,this.events={},this._defaultConfig=Ho,this._width=400,this._height=200,this._containerWidth=void 0,this._containerHeight=void 0,this._containerMargin={top:0,bottom:0,left:0,right:0},this._setUpComponentEventsThrottled=xi(this._setUpComponentEvents,500),this._setCustomAttributesThrottled=xi(this._setCustomAttributes,500),e===mn.SVG?this.element=document.createElementNS("http://www.w3.org/2000/svg","g"):this.element=document.createElement("div"),this.uid=Tl(),this.g=Lt(this.element);const r=(i=(n=this.constructor)===null||n===void 0?void 0:n.selectors)===null||i===void 0?void 0:i.root;r&&this.g.attr("class",r)}setContainerMargin(e){this._containerMargin=e}setConfig(e){this.prevConfig=this.config,this.config=Xe(this._defaultConfig,e)}setData(e){this.datamodel.data=e}setSize(e,n,i,r){isFinite(e)&&(this._width=e),isFinite(n)&&(this._height=n),isFinite(i)&&(this._containerWidth=i),isFinite(r)&&(this._containerHeight=r)}render(e=this.config.duration){this._render(e);const n="animating";e&&(this.g.attr(n,""),this.g.transition(n).duration(e).on("end interrupt",()=>{this.g.attr(n,null)})),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled()}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e=this.config.duration){}_setCustomAttributes(){const e=this.config.attributes;Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(i=>{this.g.selectAll(`.${n}`).attr(i,e[n][i])})})}_setUpComponentEvents(){this._bindEvents(this.events),this._bindEvents(this.config.events,".user")}_mapEventDatum(e){return e}_bindEvents(e=this.events,n=""){Object.keys(e).forEach(i=>{Object.keys(e[i]).forEach(r=>{const o=this.g.selectAll(`.${i}`);o.on(r+n,(s,a)=>{const l=o.nodes(),c=l.indexOf(s.currentTarget),u=e[i][r],h=this._mapEventDatum(a);return u==null?void 0:u(h,s,c,l)})})})}destroy(){var e;(e=this.g)===null||e===void 0||e.remove(),this.element=void 0}isDestroyed(){return!this.element}}class fc extends Mo{constructor(e){super(e)}get data(){var e;return(e=this._data)!==null&&e!==void 0?e:[]}set data(e){Array.isArray(e)&&(this._data=e)}}const Ln=Object.assign(Object.assign({},Ho),{x:void 0,y:void 0,id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:`${e}`},color:t=>t.color,xScale:void 0,yScale:void 0,excludeFromDomainCalculation:!1});class er extends hc{constructor(){super(...arguments),this.datamodel=new fc,this.clippable=!0,this.stacked=!1,this._defaultConfig=Ln,this._xScale=ma.scaleLinear(),this._yScale=ma.scaleLinear()}get xScale(){return this.config.xScale||this._xScale}get yScale(){return this.config.yScale||this._yScale}setConfig(e){var n,i;!((n=this.config)===null||n===void 0)&&n.xScale&&(e.xScale=this.config.xScale),!((i=this.config)===null||i===void 0)&&i.yScale&&(e.yScale=this.config.yScale),super.setConfig(e)}setScaleDomain(e,n){var i,r;e===ct.X&&((i=this._xScale)===null||i===void 0||i.domain(n)),e===ct.Y&&((r=this._yScale)===null||r===void 0||r.domain(n))}setScaleRange(e,n){var i,r;e===ct.X&&((i=this._xScale)===null||i===void 0||i.range(n)),e===ct.Y&&((r=this._yScale)===null||r===void 0||r.range(n))}setScale(e,n){n&&e===ct.X&&(this._xScale=n),n&&e===ct.Y&&(this._yScale=n)}getDataExtent(e,n){const{config:i,datamodel:r}=this;switch(e){case ct.X:return this.getXDataExtent();case ct.Y:return this.getYDataExtent(n);default:return vr(r.data,i[e])}}getXDataExtent(){const{config:e,datamodel:n}=this;return vr(n.data,e.x)}getYDataExtent(e){const{config:n,datamodel:i}=this,r=this.xScale.domain(),o=e?al(i.data,r,n.x,!0):i.data,s=ge(n.y)?n.y:[n.y];return vr(o,...s)}}var E;(function(t){t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center",t.Auto="auto"})(E||(E={}));var _a;(function(t){t.Absolute="absolute",t.Fixed="fixed"})(_a||(_a={}));var ya;(function(t){t.Inside="inside",t.Outside="outside",t.Center="center"})(ya||(ya={}));var xa;(function(t){t.Horizontal="horizontal",t.Vertical="vertical"})(xa||(xa={}));const mv={components:[],container:void 0,followCursor:!0,allowHover:!1,horizontalPlacement:E.Auto,horizontalShift:0,verticalPlacement:E.Top,verticalShift:0,attributes:{},triggers:{},className:void 0,showDelay:void 0,hideDelay:void 0},nr=Z`
label: tooltip;
display: inline-block;
left: 0;
bottom: 0;
min-width: max-content;
position: absolute;
opacity: 0;
transition: opacity;
transition-duration: var(--vis-tooltip-transition-duration);
z-index: 999999;
padding: var(--vis-tooltip-padding);
color: var(--vis-tooltip-text-color);
border-radius: var(--vis-tooltip-border-radius);
box-shadow: var(--vis-tooltip-box-shadow);
border: solid 1px var(--vis-tooltip-border-color);
background-color: var(--vis-tooltip-background-color);
backdrop-filter: var(--vis-tooltip-backdrop-filter);
`,_v=nr,yv=Re`
:root {
--vis-tooltip-background-color: rgba(255, 255, 255, 0.95);
--vis-tooltip-border-color: #e5e9f7;
--vis-tooltip-text-color: #000;
--vis-tooltip-shadow-color: rgba(172, 179, 184, 0.35);
--vis-tooltip-backdrop-filter: none;
--vis-tooltip-padding: 10px 15px;
--vis-tooltip-border-radius: 5px;
--vis-tooltip-transition-duration: 300ms;
--vis-tooltip-box-shadow: none;
--vis-dark-tooltip-background-color: rgba(30,30,30, 0.95);
--vis-dark-tooltip-text-color: #e5e9f7;
--vis-dark-tooltip-border-color: var(--vis-color-grey);
--vis-dark-tooltip-shadow-color: rgba(0,0,0, 0.95);
}
body.theme-dark ${`.${nr}`} {
--vis-tooltip-background-color: var(--vis-dark-tooltip-background-color);
--vis-tooltip-text-color: var(--vis-dark-tooltip-text-color);
--vis-tooltip-border-color: var(--vis-dark-tooltip-border-color);
--vis-tooltip-shadow-color: var(--vis-dark-tooltip-shadow-color);
}
body.theme-dark {
--vis-tooltip-background-color: rgba(30,30,30, 0.95);
--vis-tooltip-text-color: #e5e9f7;
--vis-tooltip-border-color: var(--vis-color-grey);
--vis-tooltip-shadow-color: rgba(0,0,0, 0.95);
}
`,dc=Z`
bottom: unset;
position: fixed;
`,oi=Z`
opacity: 1;
`,si=Z`
display: none;
`,pc=Z`
label: non-interactive;
pointer-events: none;
user-select: none;
`,xv=Object.freeze(Object.defineProperty({__proto__:null,hidden:si,nonInteractive:pc,positionFixed:dc,root:nr,show:oi,tooltip:_v,variables:yv},Symbol.toStringTag,{value:"Module"}));class gc{constructor(e={}){this._defaultConfig=mv,this.config=this._defaultConfig,this._setUpEventsThrottled=xi(this._setUpEvents,500),this._setContainerPositionThrottled=xi(this._setContainerPosition,500),this._isShown=!1,this.element=document.createElement("div"),this.div=Lt(this.element).attr("class",nr).classed(oi,!1).classed(si,!0),this.setConfig(e),this.components=this.config.components,this._mutationObserver=new MutationObserver(()=>{this._isShown&&(!this.config.followCursor&&this._hoveredElement?this.placeByElement(this._hoveredElement):this._position&&this.place({x:this._position[0],y:this._position[1]}))}),this._mutationObserver.observe(this.div.node(),{childList:!0,subtree:!0})}setConfig(e){var n;this.prevConfig=this.config,this.config=Xe(this._defaultConfig,e),this.prevConfig.horizontalPlacement!==this.config.horizontalPlacement&&this.overrideHorizontalPlacement(void 0),this.config.container&&this.config.container!==((n=this.prevConfig)===null||n===void 0?void 0:n.container)&&this.setContainer(this.config.container),this._setUpAttributes()}setContainer(e){var n;(n=this.element.parentNode)===null||n===void 0||n.removeChild(this.element),this._container=e,this._container.appendChild(this.element),this._setContainerPositionThrottled()}getContainer(){return this._container}hasContainer(){return!!this._container&&this._container.isConnected}setComponents(e){this.components=e}update(){this._container&&this._setUpEventsThrottled()}show(e,n){this.render(e),this.place(n)}_hide(){this.div.classed(oi,!1).on("transitionend",()=>{this.div.classed(si,!this._isShown)}),this._isShown=!1}hide(){window.clearTimeout(this._showDelayTimeoutId),this.config.hideDelay?(window.clearTimeout(this._hideDelayTimeoutId),this._hideDelayTimeoutId=setTimeout(()=>this._hide(),this.config.hideDelay)):this._hide()}_display(){window.clearTimeout(this._hideDelayTimeoutId),this.div.classed(si,!1).classed(oi,!0),this._isShown=!0}display(){this._isShown||(this.config.showDelay?(window.clearTimeout(this._showDelayTimeoutId),this._showDelayTimeoutId=setTimeout(()=>{this._display(),this.place({x:this._position[0],y:this._position[1]})},this.config.showDelay)):this._display())}place(e){if(this._position=[e.x,e.y],!this.hasContainer()){console.warn("Unovis | Tooltip: Container was not set or is not initialized yet");return}const{config:n}=this,i=this.element.offsetWidth,r=this.element.offsetHeight,o=this._overriddenHorizontalPlacement||(n.horizontalPlacement===E.Auto?E.Center:n.horizontalPlacement),s=n.verticalPlacement===E.Auto?e.y-r<0?E.Bottom:E.Top:n.verticalPlacement,a=5,l=o===E.Left?-i-a-n.horizontalShift:o===E.Center?-i/2:a+n.horizontalShift,c=s===E.Bottom?a+n.verticalShift:s===E.Center?-r/2:-a-n.verticalShift-r,[u,h]=this._constraintPosToContainer(e.x+l,e.y+c,i,r);this._applyPosition(u,h,r)}placeByElement(e){const{config:n}=this;this._hoveredElement=e;const i=5,r=this.element.offsetWidth,o=this.element.offsetHeight,s=this.isContainerBody(),a=s?window.innerWidth:this._container.scrollWidth,l=e.getBoundingClientRect(),c=s?[l.x,l.y]:vi({clientX:l.x,clientY:l.y,pageX:l.x,pageY:l.y},this._container),u=this._overriddenHorizontalPlacement||(n.horizontalPlacement===E.Auto?c[0]-r<0?E.Right:c[0]+r>a?E.Left:E.Center:n.horizontalPlacement);let h=0;switch(u){case E.Left:h=-r-i-n.horizontalShift;break;case E.Right:h=l.width+i+n.horizontalShift;break;case E.Center:default:h=(-r+l.width)/2;break}const f=n.verticalPlacement===E.Auto?u!==E.Center?E.Center:c[1]-o<0?E.Bottom:E.Top:n.verticalPlacement;let d=-o;switch(f){case E.Center:d+=(o+l.height)/2;break;case E.Bottom:d+=o+l.height+i+n.verticalShift;break;case E.Top:default:d+=-i-n.verticalShift;break}const[g,p]=this._constraintPosToContainer(c[0]+h,c[1]+d,r,o);this._applyPosition(g,p,o)}isContainerBody(){return this._container===document.body}overrideHorizontalPlacement(e){this._overriddenHorizontalPlacement=e}render(e){var n;const{config:i,prevConfig:r}=this;e instanceof HTMLElement?this.div.select(":first-child").node()!==e&&this.div.html("").append(()=>e):e!==null&&this.div.html(e||""),this.div.classed((n=i.className)!==null&&n!==void 0?n:"",!!i.className).classed(pc,!i.allowHover),r!=null&&r.className&&r.className!==i.className&&this.div.classed(r.className,!1),this.display()}_applyPosition(e,n,i){const r=this.isContainerBody(),o=r?window.innerHeight:this._container.scrollHeight;this.div.classed(dc,r).style("top",r?`${n}px`:"unset").style("bottom",r?"unset":`${o-n-i}px`).style("left",`${e}px`)}_constraintPosToContainer(e,n,i,r){const o=this.isContainerBody(),s=o?window.innerHeight:this._container.scrollHeight,a=o?window.innerWidth:this._container.scrollWidth,l=10,c=e>a-i-l,u=e<l,h=c?a-i-l:u?l:e,f=10,d=n>s-r-f,g=n<f,p=d?s-r-f:g?f:n;return[a<i?0:h,s<r?0:p]}_setContainerPosition(){var e;this._container!==document.body&&((e=getComputedStyle(this._container))===null||e===void 0?void 0:e.position)==="static"&&(this._container.style.position="relative")}_setUpEvents(){const{config:e}=this;this.components.forEach(n=>{const i=Lt(n.element);i.on("mousemove.tooltip",r=>{const{config:o}=this,s=r.composedPath&&r.composedPath()||r.path||[r.target];for(const a of Object.keys(o.triggers)){const l=o.triggers[a];if(!l)continue;const c=i.selectAll(`.${a}`).nodes();for(const u of s){if(u===i.node())break;if(u.classList.contains(a)){const h=c.indexOf(u),f=Lt(u).datum(),d=l(f,h,c),[g,p]=this.isContainerBody()?[r.clientX,r.clientY]:vi(r,this._container);d===null?this.hide():(this.render(d),o.followCursor?this.place({x:g,y:p}):this.placeByElement(u)),r.stopPropagation();return}}}this._isShown&&this.hide()}).on("mouseleave.tooltip",r=>{r.stopPropagation(),this.hide()})}),e.allowHover?this.div.on("mouseenter.tooltip",this._display.bind(this)).on("mouseleave.tooltip",this.hide.bind(this)):this.div.on("mouseenter.tooltip",null).on("mouseleave.tooltip",null)}_setUpAttributes(){const e=this.config.attributes;e&&Object.keys(e).forEach(n=>{this.div.attr(n,e[n])})}destroy(){var e;this._mutationObserver.disconnect(),window.clearTimeout(this._hideDelayTimeoutId),window.clearTimeout(this._showDelayTimeoutId),(e=this.div)===null||e===void 0||e.remove()}}gc.selectors=xv;function Q(t){return function(){return t}}const ba=Math.abs,bt=Math.atan2,xe=Math.cos,bv=Math.max,Ar=Math.min,Vt=Math.sin,Be=Math.sqrt,kt=1e-12,$n=Math.PI,zi=$n/2,ai=2*$n;function wv(t){return t>1?0:t<-1?$n:Math.acos(t)}function wa(t){return t>=1?zi:t<=-1?-zi:Math.asin(t)}const qr=Math.PI,jr=2*qr,be=1e-6,kv=jr-be;function vc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Tv(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return vc;const n=10**e;return function(i){this._+=i[0];for(let r=1,o=i.length;r<o;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}class Sv{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?vc:Tv(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,i,r){this._append`Q${+e},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(e,n,i,r,o,s){this._append`C${+e},${+n},${+i},${+r},${this._x1=+o},${this._y1=+s}`}arcTo(e,n,i,r,o){if(e=+e,n=+n,i=+i,r=+r,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=i-e,c=r-n,u=s-e,h=a-n,f=u*u+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>be)if(!(Math.abs(h*l-c*u)>be)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let d=i-s,g=r-a,p=l*l+c*c,v=d*d+g*g,m=Math.sqrt(p),_=Math.sqrt(f),y=o*Math.tan((qr-Math.acos((p+f-v)/(2*m*_)))/2),b=y/_,T=y/m;Math.abs(b-1)>be&&this._append`L${e+b*u},${n+b*h}`,this._append`A${o},${o},0,0,${+(h*d>u*g)},${this._x1=e+T*l},${this._y1=n+T*c}`}}arc(e,n,i,r,o,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),l=i*Math.sin(r),c=e+a,u=n+l,h=1^s,f=s?r-o:o-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>be||Math.abs(this._y1-u)>be)&&this._append`L${c},${u}`,i&&(f<0&&(f=f%jr+jr),f>kv?this._append`A${i},${i},0,1,${h},${e-a},${n-l}A${i},${i},0,1,${h},${this._x1=c},${this._y1=u}`:f>be&&this._append`A${i},${i},0,${+(f>=qr)},${h},${this._x1=e+i*Math.cos(o)},${this._y1=n+i*Math.sin(o)}`)}rect(e,n,i,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}}function Wo(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new Sv(e)}function Cv(t){return t.innerRadius}function Mv(t){return t.outerRadius}function Av(t){return t.startAngle}function $v(t){return t.endAngle}function Dv(t){return t&&t.padAngle}function Ev(t,e,n,i,r,o,s,a){var l=n-t,c=i-e,u=s-r,h=a-o,f=h*l-u*c;if(!(f*f<kt))return f=(u*(e-o)-h*(t-r))/f,[t+f*l,e+f*c]}function Qn(t,e,n,i,r,o,s){var a=t-n,l=e-i,c=(s?o:-o)/Be(a*a+l*l),u=c*l,h=-c*a,f=t+u,d=e+h,g=n+u,p=i+h,v=(f+g)/2,m=(d+p)/2,_=g-f,y=p-d,b=_*_+y*y,T=r-o,x=f*p-g*d,S=(y<0?-1:1)*Be(bv(0,T*T*b-x*x)),F=(x*y-_*S)/b,z=(-x*_-y*S)/b,O=(x*y+_*S)/b,V=(-x*_+y*S)/b,M=F-v,A=z-m,B=O-v,nt=V-m;return M*M+A*A>B*B+nt*nt&&(F=O,z=V),{cx:F,cy:z,x01:-u,y01:-h,x11:F*(r/T-1),y11:z*(r/T-1)}}function Rv(){var t=Cv,e=Mv,n=Q(0),i=null,r=Av,o=$v,s=Dv,a=null,l=Wo(c);function c(){var u,h,f=+t.apply(this,arguments),d=+e.apply(this,arguments),g=r.apply(this,arguments)-zi,p=o.apply(this,arguments)-zi,v=ba(p-g),m=p>g;if(a||(a=u=l()),d<f&&(h=d,d=f,f=h),!(d>kt))a.moveTo(0,0);else if(v>ai-kt)a.moveTo(d*xe(g),d*Vt(g)),a.arc(0,0,d,g,p,!m),f>kt&&(a.moveTo(f*xe(p),f*Vt(p)),a.arc(0,0,f,p,g,m));else{var _=g,y=p,b=g,T=p,x=v,S=v,F=s.apply(this,arguments)/2,z=F>kt&&(i?+i.apply(this,arguments):Be(f*f+d*d)),O=Ar(ba(d-f)/2,+n.apply(this,arguments)),V=O,M=O,A,B;if(z>kt){var nt=wa(z/f*Vt(F)),pt=wa(z/d*Vt(F));(x-=nt*2)>kt?(nt*=m?1:-1,b+=nt,T-=nt):(x=0,b=T=(g+p)/2),(S-=pt*2)>kt?(pt*=m?1:-1,_+=pt,y-=pt):(S=0,_=y=(g+p)/2)}var it=d*xe(_),yt=d*Vt(_),Tt=f*xe(T),D=f*Vt(T);if(O>kt){var R=d*xe(y),k=d*Vt(y),H=f*xe(b),G=f*Vt(b),et;if(v<$n)if(et=Ev(it,yt,H,G,R,k,Tt,D)){var ft=it-et[0],W=yt-et[1],ot=R-et[0],$=k-et[1],X=1/Vt(wv((ft*ot+W*$)/(Be(ft*ft+W*W)*Be(ot*ot+$*$)))/2),q=Be(et[0]*et[0]+et[1]*et[1]);V=Ar(O,(f-q)/(X-1)),M=Ar(O,(d-q)/(X+1))}else V=M=0}S>kt?M>kt?(A=Qn(H,G,it,yt,d,M,m),B=Qn(R,k,Tt,D,d,M,m),a.moveTo(A.cx+A.x01,A.cy+A.y01),M<O?a.arc(A.cx,A.cy,M,bt(A.y01,A.x01),bt(B.y01,B.x01),!m):(a.arc(A.cx,A.cy,M,bt(A.y01,A.x01),bt(A.y11,A.x11),!m),a.arc(0,0,d,bt(A.cy+A.y11,A.cx+A.x11),bt(B.cy+B.y11,B.cx+B.x11),!m),a.arc(B.cx,B.cy,M,bt(B.y11,B.x11),bt(B.y01,B.x01),!m))):(a.moveTo(it,yt),a.arc(0,0,d,_,y,!m)):a.moveTo(it,yt),!(f>kt)||!(x>kt)?a.lineTo(Tt,D):V>kt?(A=Qn(Tt,D,R,k,f,-V,m),B=Qn(it,yt,H,G,f,-V,m),a.lineTo(A.cx+A.x01,A.cy+A.y01),V<O?a.arc(A.cx,A.cy,V,bt(A.y01,A.x01),bt(B.y01,B.x01),!m):(a.arc(A.cx,A.cy,V,bt(A.y01,A.x01),bt(A.y11,A.x11),!m),a.arc(0,0,f,bt(A.cy+A.y11,A.cx+A.x11),bt(B.cy+B.y11,B.cx+B.x11),m),a.arc(B.cx,B.cy,V,bt(B.y11,B.x11),bt(B.y01,B.x01),!m))):a.arc(0,0,f,T,b,m)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,h=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-$n/2;return[xe(h)*u,Vt(h)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Q(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Q(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Q(+u),c):n},c.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:Q(+u),c):i},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:Q(+u),c):r},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Q(+u),c):o},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:Q(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function Uo(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function mc(t){this._context=t}mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Yo(t){return new mc(t)}function _c(t){return t[0]}function yc(t){return t[1]}function Vo(t,e){var n=Q(!0),i=null,r=Yo,o=null,s=Wo(a);t=typeof t=="function"?t:t===void 0?_c:Q(t),e=typeof e=="function"?e:e===void 0?yc:Q(e);function a(l){var c,u=(l=Uo(l)).length,h,f=!1,d;for(i==null&&(o=r(d=s())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(h,c,l),+e(h,c,l));if(d)return o=null,d+""||null}return a.x=function(l){return arguments.length?(t=typeof l=="function"?l:Q(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:Q(+l),a):e},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Q(!!l),a):n},a.curve=function(l){return arguments.length?(r=l,i!=null&&(o=r(i)),a):r},a.context=function(l){return arguments.length?(l==null?i=o=null:o=r(i=l),a):i},a}function Ov(t,e,n){var i=null,r=Q(!0),o=null,s=Yo,a=null,l=Wo(c);t=typeof t=="function"?t:t===void 0?_c:Q(+t),e=typeof e=="function"?e:Q(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?yc:Q(+n);function c(h){var f,d,g,p=(h=Uo(h)).length,v,m=!1,_,y=new Array(p),b=new Array(p);for(o==null&&(a=s(_=l())),f=0;f<=p;++f){if(!(f<p&&r(v=h[f],f,h))===m)if(m=!m)d=f,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=f-1;g>=d;--g)a.point(y[g],b[g]);a.lineEnd(),a.areaEnd()}m&&(y[f]=+t(v,f,h),b[f]=+e(v,f,h),a.point(i?+i(v,f,h):y[f],n?+n(v,f,h):b[f]))}if(_)return a=null,_+""||null}function u(){return Vo().defined(r).curve(s).context(o)}return c.x=function(h){return arguments.length?(t=typeof h=="function"?h:Q(+h),i=null,c):t},c.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Q(+h),c):t},c.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:Q(+h),c):i},c.y=function(h){return arguments.length?(e=typeof h=="function"?h:Q(+h),n=null,c):e},c.y0=function(h){return arguments.length?(e=typeof h=="function"?h:Q(+h),c):e},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Q(+h),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(h){return arguments.length?(r=typeof h=="function"?h:Q(!!h),c):r},c.curve=function(h){return arguments.length?(s=h,o!=null&&(a=s(o)),c):s},c.context=function(h){return arguments.length?(h==null?o=a=null:a=s(o=h),c):o},c}function Nv(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Fv(t){return t}function Lv(){var t=Fv,e=Nv,n=null,i=Q(0),r=Q(ai),o=Q(0);function s(a){var l,c=(a=Uo(a)).length,u,h,f=0,d=new Array(c),g=new Array(c),p=+i.apply(this,arguments),v=Math.min(ai,Math.max(-ai,r.apply(this,arguments)-p)),m,_=Math.min(Math.abs(v)/c,o.apply(this,arguments)),y=_*(v<0?-1:1),b;for(l=0;l<c;++l)(b=g[d[l]=l]=+t(a[l],l,a))>0&&(f+=b);for(e!=null?d.sort(function(T,x){return e(g[T],g[x])}):n!=null&&d.sort(function(T,x){return n(a[T],a[x])}),l=0,h=f?(v-c*y)/f:0;l<c;++l,p=m)u=d[l],b=g[u],m=p+(b>0?b*h:0)+y,g[u]={data:a[u],index:l,value:b,startAngle:p,endAngle:m,padAngle:_};return g}return s.value=function(a){return arguments.length?(t=typeof a=="function"?a:Q(+a),s):t},s.sortValues=function(a){return arguments.length?(e=a,n=null,s):e},s.sort=function(a){return arguments.length?(n=a,e=null,s):n},s.startAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Q(+a),s):i},s.endAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Q(+a),s):r},s.padAngle=function(a){return arguments.length?(o=typeof a=="function"?a:Q(+a),s):o},s}function ve(){}function Pi(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ir(t){this._context=t}ir.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pi(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zv(t){return new ir(t)}function xc(t){this._context=t}xc.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Pi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pv(t){return new xc(t)}function bc(t){this._context=t}bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Pi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bv(t){return new bc(t)}function wc(t,e){this._basis=new ir(t),this._beta=e}wc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],r=e[0],o=t[n]-i,s=e[n]-r,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(i+l*o),this._beta*e[a]+(1-this._beta)*(r+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Iv=(function t(e){function n(i){return e===1?new ir(i):new wc(i,e)}return n.beta=function(i){return t(+i)},n})(.85);function Bi(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Xo(t,e){this._context=t,this._k=(1-e)/6}Xo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Bi(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Bi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Hv=(function t(e){function n(i){return new Xo(i,e)}return n.tension=function(i){return t(+i)},n})(0);function Go(t,e){this._context=t,this._k=(1-e)/6}Go.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Wv=(function t(e){function n(i){return new Go(i,e)}return n.tension=function(i){return t(+i)},n})(0);function qo(t,e){this._context=t,this._k=(1-e)/6}qo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Uv=(function t(e){function n(i){return new qo(i,e)}return n.tension=function(i){return t(+i)},n})(0);function jo(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>kt){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>kt){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function kc(t,e){this._context=t,this._alpha=e}kc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:jo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Yv=(function t(e){function n(i){return e?new kc(i,e):new Xo(i,0)}return n.alpha=function(i){return t(+i)},n})(.5);function Tc(t,e){this._context=t,this._alpha=e}Tc.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:jo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Vv=(function t(e){function n(i){return e?new Tc(i,e):new Go(i,0)}return n.alpha=function(i){return t(+i)},n})(.5);function Sc(t,e){this._context=t,this._alpha=e}Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xv=(function t(e){function n(i){return e?new Sc(i,e):new qo(i,0)}return n.alpha=function(i){return t(+i)},n})(.5);function Cc(t){this._context=t}Cc.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Gv(t){return new Cc(t)}function ka(t){return t<0?-1:1}function Ta(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(ka(o)+ka(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Sa(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function $r(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function Ii(t){this._context=t}Ii.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$r(this,this._t0,Sa(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,$r(this,Sa(this,n=Ta(this,t,e)),n);break;default:$r(this,this._t0,n=Ta(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function Mc(t){this._context=new Ac(t)}(Mc.prototype=Object.create(Ii.prototype)).point=function(t,e){Ii.prototype.point.call(this,e,t)};function Ac(t){this._context=t}Ac.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}};function qv(t){return new Ii(t)}function jv(t){return new Mc(t)}function $c(t){this._context=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=Ca(t),r=Ca(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Ca(t){var e,n=t.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)r[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=r[e]/o[e-1],o[e]-=i,s[e]-=i*s[e-1];for(r[n-1]=s[n-1]/o[n-1],e=n-2;e>=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[n-1]=(t[n]+r[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function Zv(t){return new $c(t)}function rr(t,e){this._context=t,this._t=e}rr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Qv(t){return new rr(t,.5)}function Kv(t){return new rr(t,0)}function Jv(t){return new rr(t,1)}function Ma(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function tm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ma(Object(n),!0).forEach(function(i){em(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function bn(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bn=function(e){return typeof e}:bn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(t)}function em(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hi(){return Hi=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Hi.apply(this,arguments)}function nm(t,e){if(t){if(typeof t=="string")return Aa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aa(t,e)}}function Aa(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Dc(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=nm(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(l){throw l},f:r}}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 o=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function im(t,e){var n=[],i=[];function r(o,s){if(o.length===1)n.push(o[0]),i.push(o[0]);else{for(var a=Array(o.length-1),l=0;l<a.length;l++)l===0&&n.push(o[0]),l===a.length-1&&i.push(o[l+1]),a[l]=[(1-s)*o[l][0]+s*o[l+1][0],(1-s)*o[l][1]+s*o[l+1][1]];r(a,s)}}return t.length&&r(t,e),{left:n,right:i.reverse()}}function rm(t){var e={};return t.length===4&&(e.x2=t[2][0],e.y2=t[2][1]),t.length>=3&&(e.x1=t[1][0],e.y1=t[1][1]),e.x=t[t.length-1][0],e.y=t[t.length-1][1],t.length===4?e.type="C":t.length===3?e.type="Q":e.type="L",e}function om(t,e){e=e||2;for(var n=[],i=t,r=1/e,o=0;o<e-1;o++){var s=r/(1-r*o),a=im(i,s);n.push(a.left),i=a.right}return n.push(i),n}function sm(t,e,n){var i=[[t.x,t.y]];return e.x1!=null&&i.push([e.x1,e.y1]),e.x2!=null&&i.push([e.x2,e.y2]),i.push([e.x,e.y]),om(i,n).map(rm)}var am=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,Ye={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};Object.keys(Ye).forEach(function(t){Ye[t.toLowerCase()]=Ye[t]});function Zr(t,e){for(var n=Array(t),i=0;i<t;i++)n[i]=e;return n}function lm(t){return"".concat(t.type).concat(Ye[t.type].map(function(e){return t[e]}).join(","))}function cm(t,e){var n={x1:"x",y1:"y",x2:"x",y2:"y"},i=["xAxisRotation","largeArcFlag","sweepFlag"];if(t.type!==e.type&&e.type.toUpperCase()!=="M"){var r={};Object.keys(e).forEach(function(o){var s=e[o],a=t[o];a===void 0&&(i.includes(o)?a=s:(a===void 0&&n[o]&&(a=t[n[o]]),a===void 0&&(a=0))),r[o]=a}),r.type=e.type,t=r}return t}function um(t,e,n){var i=[];if(e.type==="L"||e.type==="Q"||e.type==="C")i=i.concat(sm(t,e,n));else{var r=Hi({},t);r.type==="M"&&(r.type="L"),i=i.concat(Zr(n-1).map(function(){return r})),i.push(e)}return i}function $a(t,e,n){var i=t.length-1,r=e.length-1,o=i/r,s=Zr(r).reduce(function(l,c,u){var h=Math.floor(o*u);if(n&&h<t.length-1&&n(t[h],t[h+1])){var f=o*u%1<.5;l[h]&&(f?h>0?h-=1:h<t.length-1&&(h+=1):h<t.length-1?h+=1:h>0&&(h-=1))}return l[h]=(l[h]||0)+1,l},[]),a=s.reduce(function(l,c,u){if(u===t.length-1){var h=Zr(c,Hi({},t[t.length-1]));return h[0].type==="M"&&h.forEach(function(f){f.type="L"}),l.concat(h)}return l.concat(um(t[u],t[u+1],c))},[]);return a.unshift(t[0]),a}function Da(t){for(var e=(t||"").match(am)||[],n=[],i,r,o=0;o<e.length;++o)if(i=Ye[e[o]],i){r={type:e[o]};for(var s=0;s<i.length;++s)r[i[s]]=+e[o+s+1];o+=i.length,n.push(r)}return n}function hm(t,e,n){var i=t==null?[]:t.slice(),r=e==null?[]:e.slice(),o=bn(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},s=o.excludeSegment,a=o.snapEndsToInput;if(!i.length&&!r.length)return function(){return[]};var l=(i.length===0||i[i.length-1].type==="Z")&&(r.length===0||r[r.length-1].type==="Z");i.length>0&&i[i.length-1].type==="Z"&&i.pop(),r.length>0&&r[r.length-1].type==="Z"&&r.pop(),i.length?r.length||r.push(i[0]):i.push(r[0]);var c=Math.abs(r.length-i.length);c!==0&&(r.length>i.length?i=$a(i,r,s):r.length<i.length&&(r=$a(r,i,s))),i=i.map(function(h,f){return cm(h,r[f])});var u=i.map(function(h){return tm({},h)});return l&&(u.push({type:"Z"}),i.push({type:"Z"})),function(f){if(f===1&&a)return e??[];if(f===0)return i;for(var d=0;d<u.length;++d){var g=i[d],p=r[d],v=u[d],m=Dc(Ye[v.type]),_;try{for(m.s();!(_=m.n()).done;){var y=_.value;v[y]=(1-f)*g[y]+f*p[y],(y==="largeArcFlag"||y==="sweepFlag")&&(v[y]=Math.round(v[y]))}}catch(b){m.e(b)}finally{m.f()}}return u}}function Qr(t,e,n){var i=Da(t),r=Da(e),o=bn(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},s=o.excludeSegment,a=o.snapEndsToInput;if(!i.length&&!r.length)return function(){return""};var l=hm(i,r,{excludeSegment:s,snapEndsToInput:a});return function(u){if(u===1&&a)return e??"";var h=l(u),f="",d=Dc(h),g;try{for(d.s();!(g=d.n()).done;){var p=g.value;f+=lm(p)}}catch(v){d.e(v)}finally{d.f()}return f}}function Rt(t,e,n,i){return Array.isArray(e)&&isFinite(n)?e[n%e.length]:bi(t,e,n)||(It(n)?`var(${ue(n)})`:null)}var at;(function(t){t.Basis="basis",t.BasisClosed="basisClosed",t.BasisOpen="basisOpen",t.Bundle="bundle",t.Cardinal="cardinal",t.CardinalClosed="cardinalClosed",t.CardinalOpen="cardinalOpen",t.CatmullRom="catmullRom",t.CatmullRomClosed="catmullRomClosed",t.CatmullRomOpen="catmullRomOpen",t.Linear="linear",t.LinearClosed="linearClosed",t.MonotoneX="monotoneX",t.MonotoneY="monotoneY",t.Natural="natural",t.Step="step",t.StepAfter="stepAfter",t.StepBefore="stepBefore"})(at||(at={}));const Wi={[at.Basis]:zv,[at.BasisClosed]:Pv,[at.BasisOpen]:Bv,[at.Bundle]:Iv,[at.Cardinal]:Hv,[at.CardinalClosed]:Wv,[at.CardinalOpen]:Uv,[at.CatmullRom]:Yv,[at.CatmullRomClosed]:Vv,[at.CatmullRomOpen]:Xv,[at.Linear]:Yo,[at.LinearClosed]:Gv,[at.MonotoneX]:qv,[at.MonotoneY]:jv,[at.Natural]:Zv,[at.Step]:Qv,[at.StepAfter]:Jv,[at.StepBefore]:Kv},fm=Object.assign(Object.assign({},Ln),{curveType:at.MonotoneX,lineWidth:2,lineDashArray:void 0,fallbackValue:void 0,highlightOnHover:!1,cursor:null,interpolateMissingData:!1}),dm=Re`
:root {
--vis-line-cursor: default;
--vis-line-stroke-dasharray: none;
--vis-line-stroke-dashoffset: 0;
--vis-line-gapfill-stroke-dasharray: 2 3;
--vis-line-gapfill-stroke-opacity: 0.8;
--vis-line-gapfill-stroke-dashoffset: 0;
}
`,pm=Z`
label: line-component;
`,gn=Z`
label: line;
transition: opacity 200ms;
cursor: var(--vis-line-cursor);
`,Kr=Z`
label: linePath;
fill: none;
stroke-dasharray: var(--vis-line-stroke-dasharray);
stroke-dashoffset: var(--vis-line-stroke-dashoffset);
`,Jr=Z`
label: lineSelectionHelper;
fill: none;
stroke: rgba(0, 0, 0, 0);
stroke-width: 8px;
`,to=Z`
opacity: 0.2;
`,eo=Z`
label: interpolated-path;
fill: none;
stroke-dasharray: var(--vis-line-gapfill-stroke-dasharray);
stroke-dashoffset: var(--vis-line-gapfill-stroke-dashoffset);
stroke-opacity: var(--vis-line-gapfill-stroke-opacity);
`,gm=Object.freeze(Object.defineProperty({__proto__:null,dim:to,globalStyles:dm,interpolatedPath:eo,line:gn,linePath:Kr,lineSelectionHelper:Jr,root:pm},Symbol.toStringTag,{value:"Module"}));class or extends er{constructor(e){super(),this._defaultConfig=fm,this.config=this._defaultConfig,this.curve=Wi[at.MonotoneX],this.events={[or.selectors.line]:{mouseover:this._highlight.bind(this),mouseleave:this._resetHighlight.bind(this)}},e&&this.setConfig(e)}get bleed(){const{config:{lineWidth:e}}=this,n=this.yScale.domain(),r=(this.yScale.range()[0]>this.yScale.range()[1]?jt.North:jt.South)===jt.South,o=e>3,s=e>=10;return{top:!s&&(!r&&n[1]===0||r&&n[0]===0)?0:e/2,bottom:!s&&(!r&&n[0]===0||r&&n[1]===0)?0:e/2,left:o?e/2:0,right:o?e/2:0}}_render(e){super._render(e);const{config:n,datamodel:{data:i}}=this,r=It(e)?e:n.duration;this.curve=Wi[n.curveType],this.lineGen=Vo().x(h=>h.x).y(h=>h.y).defined(h=>h.defined).curve(this.curve);const o=ge(n.y)?n.y:[n.y],s=i.map((h,f)=>this.xScale(st(h,n.x,f))),a=o.map(h=>{const f=i.map((m,_)=>{const y=st(m,h,_),b=(It(y)||y===null)&&isFinite(y)?y:n.fallbackValue,T=n.interpolateMissingData?(It(y)||y===null)&&isFinite(y):isFinite(b);return{x:s[_],y:this.yScale(b??0),defined:T,value:b}}),d=f.reduce((m,_)=>_.defined||m,!1);let g=!1;const p=f.reduce((m,_,y)=>{!_.defined&&isFinite(n.fallbackValue)&&m.push(Object.assign(Object.assign({},_),{defined:!0})),!_.defined&&!g&&(g=!0);const b=y>0&&!f[y-1].defined||y<f.length-1&&!f[y+1].defined;return _.defined&&b&&(g||m.push(Object.assign(Object.assign({},_),{defined:!1})),m.push(_),g=!1),m},[]),v=d&&f.some(m=>m.value!==null);return{values:f,defined:d,gaps:p,visible:v}}),l=this.g.selectAll(`.${gn}`).data(a),c=l.enter().append("g").attr("class",gn);c.append("path").attr("class",Kr).attr("stroke",(h,f)=>Rt(i,n.color,f)).attr("stroke-opacity",0).attr("stroke-width",n.lineWidth),c.append("path").attr("class",Jr).attr("d",this._emptyPath()),c.append("path").attr("class",eo).attr("d",this._emptyPath()).style("opacity",0);const u=c.merge(l);u.style("cursor",(h,f)=>bi(i,n.cursor,f)),u.each((h,f,d)=>{var g;const p=Lt(d[f]),v=p.select(`.${Kr}`),m=p.select(`.${Jr}`),_=p.select(`.${eo}`),y=h.visible,b=Vi(i,n.lineDashArray,f),T=mt(v,r).attr("stroke",Rt(i,n.color,f)).attr("stroke-width",n.lineWidth).attr("stroke-opacity",y?1:0).style("stroke-dasharray",(g=b==null?void 0:b.join(" "))!==null&&g!==void 0?g:null),x=h.values.some(F=>!F.defined),S=this.lineGen(h.values);if(r&&!x){const F=v.attr("d")||this._emptyPath(),z=S||this._emptyPath();T.attrTween("d",()=>Qr(F,z))}else h.visible&&T.attr("d",S);m.attr("d",S).attr("visibility",y?null:"hidden"),x&&n.interpolateMissingData?mt(_,r).attr("d",this.lineGen(h.gaps)).attr("stroke",Rt(i,n.color,f)).attr("stroke-width",n.lineWidth-1).style("opacity",1):_.transition().duration(r).style("opacity",0)}),mt(l.exit(),r).style("opacity",0).remove()}_emptyPath(){const e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}_highlight(e){const{config:n}=this;n.highlightOnHover&&this.g.selectAll(`.${gn}`).classed(to,i=>i!==e)}_resetHighlight(){const{config:e}=this;e.highlightOnHover&&this.g.selectAll(`.${gn}`).classed(to,!1)}}or.selectors=gm;function vm(t){return t}var li=1,ci=2,no=3,vn=4,Ea=1e-6;function mm(t){return"translate("+t+",0)"}function _m(t){return"translate(0,"+t+")"}function ym(t){return e=>+t(e)}function xm(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function bm(){return!this.__axis}function sr(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===li||t===vn?-1:1,u=t===vn||t===ci?"x":"y",h=t===li||t===no?mm:_m;function f(d){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),p=r??(e.tickFormat?e.tickFormat.apply(e,n):vm),v=Math.max(o,0)+a,m=e.range(),_=+m[0]+l,y=+m[m.length-1]+l,b=(e.bandwidth?xm:ym)(e.copy(),l),T=d.selection?d.selection():d,x=T.selectAll(".domain").data([null]),S=T.selectAll(".tick").data(g,e).order(),F=S.exit(),z=S.enter().append("g").attr("class","tick"),O=S.select("line"),V=S.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(z),O=O.merge(z.append("line").attr("stroke","currentColor").attr(u+"2",c*o)),V=V.merge(z.append("text").attr("fill","currentColor").attr(u,c*v).attr("dy",t===li?"0em":t===no?"0.71em":"0.32em")),d!==T&&(x=x.transition(d),S=S.transition(d),O=O.transition(d),V=V.transition(d),F=F.transition(d).attr("opacity",Ea).attr("transform",function(M){return isFinite(M=b(M))?h(M+l):this.getAttribute("transform")}),z.attr("opacity",Ea).attr("transform",function(M){var A=this.parentNode.__axis;return h((A&&isFinite(A=A(M))?A:b(M))+l)})),F.remove(),x.attr("d",t===vn||t===ci?s?"M"+c*s+","+_+"H"+l+"V"+y+"H"+c*s:"M"+l+","+_+"V"+y:s?"M"+_+","+c*s+"V"+l+"H"+y+"V"+c*s:"M"+_+","+l+"H"+y),S.attr("opacity",1).attr("transform",function(M){return h(b(M)+l)}),O.attr(u+"2",c*o),V.attr(u,c*v).text(p),T.filter(bm).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ci?"start":t===vn?"end":"middle"),T.each(function(){this.__axis=b})}return f.scale=function(d){return arguments.length?(e=d,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),f):n.slice()},f.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),f):i&&i.slice()},f.tickFormat=function(d){return arguments.length?(r=d,f):r},f.tickSize=function(d){return arguments.length?(o=s=+d,f):o},f.tickSizeInner=function(d){return arguments.length?(o=+d,f):o},f.tickSizeOuter=function(d){return arguments.length?(s=+d,f):s},f.tickPadding=function(d){return arguments.length?(a=+d,f):a},f.offset=function(d){return arguments.length?(l=+d,f):l},f}function Ra(t){return sr(li,t)}function Oa(t){return sr(ci,t)}function Na(t){return sr(no,t)}function Fa(t){return sr(vn,t)}var pe;(function(t){t.Start="start",t.Middle="middle",t.End="end"})(pe||(pe={}));var Me;(function(t){t.Top="top",t.Middle="middle",t.Bottom="bottom"})(Me||(Me={}));var Jt;(function(t){t.Wrap="wrap",t.Trim="trim"})(Jt||(Jt={}));var Ht;(function(t){t.Left="left",t.Center="center",t.Right="right"})(Ht||(Ht={}));function wm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ui={exports:{}},km=ui.exports,La;function Tm(){return La||(La=1,(function(t){(function(e){if(typeof n!="function"){var n=function(g){return g};n.nonNative=!0}const i=n("plaintext"),r=n("html"),o=n("comment"),s=/<(\w*)>/g,a=/<\/?([^\s\/>]+)/;function l(g,p,v){g=g||"",p=p||[],v=v||"";let m=u(p,v);return h(g,m)}function c(g,p){g=g||[],p=p||"";let v=u(g,p);return function(_){return h(_||"",v)}}l.init_streaming_mode=c;function u(g,p){return g=f(g),{allowable_tags:g,tag_replacement:p,state:i,tag_buffer:"",depth:0,in_quote_char:""}}function h(g,p){if(typeof g!="string")throw new TypeError("'html' parameter must be a string");let v=p.allowable_tags,m=p.tag_replacement,_=p.state,y=p.tag_buffer,b=p.depth,T=p.in_quote_char,x="";for(let S=0,F=g.length;S<F;S++){let z=g[S];if(_===i)switch(z){case"<":_=r,y+=z;break;default:x+=z;break}else if(_===r)switch(z){case"<":if(T)break;b++;break;case">":if(T)break;if(b){b--;break}T="",_=i,y+=">",v.has(d(y))?x+=y:x+=m,y="";break;case'"':case"'":z===T?T="":T=T||z,y+=z;break;case"-":y==="<!-"&&(_=o),y+=z;break;case" ":case`
`:if(y==="<"){_=i,x+="< ",y="";break}y+=z;break;default:y+=z;break}else if(_===o)switch(z){case">":y.slice(-2)=="--"&&(_=i),y="";break;default:y+=z;break}}return p.state=_,p.tag_buffer=y,p.depth=b,p.in_quote_char=T,x}function f(g){let p=new Set;if(typeof g=="string"){let v;for(;v=s.exec(g);)p.add(v[1])}else!n.nonNative&&typeof g[n.iterator]=="function"?p=new Set(g):typeof g.forEach=="function"&&g.forEach(p.add,p);return p}function d(g){let p=a.exec(g);return p?p[1].toLowerCase():null}t.exports?t.exports=l:e.striptags=l})(km)})(ui)),ui.exports}var Sm=Tm();const Cm=wm(Sm);function Mm(t){switch(t){case Ht.Center:return"middle";case Ht.Right:return"end";case Ht.Left:default:return"start"}}const Am=t=>{switch(t){case Ht.Left:return"start";case Ht.Right:return"end";case Ht.Center:return"middle";default:return null}};function $m(t){return t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function Dm(t){var e;return(e=t.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g))===null||e===void 0?void 0:e.filter(Boolean).map(n=>n.toLowerCase()).join("-")}function Em(t){return t.replace(/['"]/g,"'").replace(/\u0000/g,"\\0").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\v/g,"\\v").replace(/\t/g,"\\t").replace(/\f/g,"\\f")}function Rm(t,e=15){return t?t.length>e?`…${t.substr(t.length-e,e)}`:t:""}function Om(t,e=15){if(!t)return"";const n=Math.floor((e-3)/2);return t.length>e?`${t.substr(0,n)}…${t.substr(-n,n)}`:t}function Nm(t,e=15){return t?t.length>e?`${t.substr(0,e)}…`:t:""}function Fm(t,e=15,n=pe.Middle){if(!t)return"";let i=Nm(t,e);return n===pe.Start?i=Rm(t,e):n===pe.Middle&&(i=Om(t,e)),i}function Ec(t,e=[" "]){let n=[t];for(let i=0;i<e.length;i++){const r=e[i];n.forEach((o,s)=>{const a=o.split(r),l=a.map((c,u)=>`${c}${u===a.length-1?"":r}`);n[s]=l}),n=Nr(n)}return n}function Rc(t,e,n=[" ","-",".",","]){const i=t.text();if(!i)return;const r=ge(n)?n:[n],o=Ec(i,r),s=parseFloat(t.attr("x"))||0;t.text("");let a=t.append("tspan").attr("x",s),l=`${o[0]}`;a.text(l),o.forEach((c,u)=>{if(u===0)return;const h=`${l}${c}`;a.text(h),a.node().getComputedTextLength()>e?(a.text(l.trim()),a=t.append("tspan").attr("x",s).attr("dy","1.2em").text(c),l=c):l+=c})}function za(t,e,n,i,r,o){var s;e===void 0&&(e=50),n===void 0&&(n=pe.Middle),r===void 0&&(r=+((s=window.getComputedStyle(t.node()))===null||s===void 0?void 0:s.fontSize)||0),o===void 0&&(o=xo());const a=t.text()||"",l=a.length,c=r*l*o,h=Math.ceil(l*e/(1.1*c));return h<l?(t.text(Fm(a,h,n)),!0):!1}function hi(t,e,n=xo()){return t.length*e*n||0}function fi(t,e,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),o=document.createElementNS(i,"text");o.textContent=t,o.setAttribute("font-size",`${n}`),o.setAttribute("font-family",e),r.appendChild(o),document.body.appendChild(r);const s=o.getComputedTextLength();return document.body.removeChild(r),s}function Lm(t,e=void 0,n=!0,i=Al,r=!1){var o,s,a;const l=`${t.text}`;if(!l)return[];const c=(o=t.fontSize)!==null&&o!==void 0?o:xn.fontSize,u=(s=t.fontFamily)!==null&&s!==void 0?s:xn.fontFamily,h=(a=t.fontWidthToHeightRatio)!==null&&a!==void 0?a:xn.fontWidthToHeightRatio,f=Array.isArray(i)?i:[i];return l.split(`
`).map(g=>{const p=[];if(!e)return[g];const v=Ec(g,f);let m="";for(let _=0;_<v.length;_+=1){(n?hi(m+v[_],c,h):fi(m+v[_],u,c))<e||_===0?m+=v[_]:(p.push(m.trim()),m=v[_]);const b=2;if(r)for(;m.trim().length>b&&(n?hi(m,c,h):fi(m,u,c))>e;){let x=m.trim().length-b;for(;x>0;){const S=`${m.substring(0,x)}${$l}`;if((n?hi(S,c,h):fi(S,u,c))<=e||x===1){p.push(S.trim()),m=m.substring(x);break}x--}}}return m&&p.push(m.trim()),p}).flat()}function zm(t,e=void 0,n=void 0,i=!0,r=Al,o=!1){const s=Array.isArray(t)?t.map(h=>Xe(xn,h)):[Xe(xn,t)],a=s.map(h=>Lm(h,e,i,r,o)),l=s[0];let c=-l.fontSize*(l.lineHeight-1);const u=[];return s.forEach((h,f)=>{var d;let g=a[f];const p=f>0?u[f-1]:void 0,v=p?p.marginBottom:0,m=h.marginTop,_=Math.max(v,m);c+=_;const y=h.fontSize*h.lineHeight;let b=0;for(let T=0;T<g.length;T+=1){let x=g[T];c+=y;const S=`${x} …`,F=i?hi(S,h.fontSize,h.fontWidthToHeightRatio):fi(S,h.fontFamily,h.fontSize);if(b=Math.max(F,b),n&&c+y>n&&T!==g.length-1){x.charAt(x.length-1)===$l&&(x=x.substr(0,g[T].length-1)),F<e?g[T]=S:g[T]=`${g[T].substr(0,g[T].length-2)}…`,g=g.slice(0,T+1);break}}u.push(Object.assign(Object.assign({},h),{_lines:g,_estimatedHeight:c-((p==null?void 0:p._estimatedHeight)||0),_maxWidth:Math.max(b,(d=p==null?void 0:p._maxWidth)!==null&&d!==void 0?d:0)}))}),u}function Pm(t,e=0,n,i){return t.map((r,o)=>{const s=o>0?t[o-1]:void 0,a=s?s.marginBottom/s.fontSize:0,l=r.marginTop/r.fontSize,c=Math.max(a,l),u={fontSize:r.fontSize,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fill:r.color,y:o===0&&n};return`<tspan xmlns="http://www.w3.org/2000/svg" ${Object.entries(u).filter(([f,d])=>d).map(([f,d])=>`${Dm(f)}="${Em(d.toString())}"`).join(" ")}>${r._lines.map((f,d)=>{let g;return o===0&&d===0?g=c:d===0?g=c+r.lineHeight:g=r.lineHeight,`<tspan x="${e}" dy="${g}em" dominant-baseline="${i??"auto"}">${f.length?f:" "}</tspan>`}).join("")}</tspan>`})}function Bm(t){return hf(t,e=>e._estimatedHeight)}const Im=["text","tspan","textPath","altGlyph","altGlyphDef","altGlyphItem","glyphRef","textRef","textArea"];function Hm(t,e,n,i){var r,o;const s=zm(e,n.width,void 0,n.fastMode,n.separator,n.wordBreak),a=(r=n.x)!==null&&r!==void 0?r:+t.getAttribute("x"),l=(o=n.y)!==null&&o!==void 0?o:+t.getAttribute("y"),c=a??0;let u=l??0;if(n.textAlign&&t.setAttribute("text-anchor",Mm(n.textAlign)),n.verticalAlign&&n.verticalAlign!==Me.Top){const f=Bm(s),d=n.verticalAlign===Me.Middle?-f/2:n.verticalAlign===Me.Bottom?-f:0;u+=d}n.textRotationAngle?t.setAttribute("transform",`rotate(${n.textRotationAngle===0||n.textRotationAngle?n.textRotationAngle:0} ${c} ${u})`):t.removeAttribute("transform");const h=new DOMParser;t.textContent="",s.forEach(f=>{const d=Pm([f],c,u,i).join(""),g=Cm(d,Im),p=h.parseFromString(g,"image/svg+xml").firstChild;t.appendChild(p)})}const Wm=Object.assign(Object.assign({},Ln),{position:void 0,type:void 0,label:void 0,labelFontSize:null,labelTextFitMode:Jt.Wrap,labelTextTrimType:pe.Middle,gridLine:!0,tickLine:!0,domainLine:!0,numTicks:void 0,minMaxTicksOnly:!1,minMaxTicksOnlyWhenWidthIsLess:250,minMaxTicksOnlyShowGridLines:!1,tickTextWidth:void 0,tickTextSeparator:void 0,tickTextForceWordBreak:!1,tickTextTrimType:pe.Middle,tickTextFitMode:Jt.Wrap,tickTextFontSize:null,tickTextAlign:void 0,tickTextColor:null,tickTextAngle:void 0,labelMargin:8,labelColor:null,tickFormat:void 0,tickValues:void 0,fullSize:!0,tickPadding:8,tickTextHideOverlapping:void 0});function Um(t,e){const n="--vis-",i=Object.entries(t);return Object.fromEntries(i.map(([r])=>[$m(r.replace(n,"")),r]))}function Ym(t,e){Re({":root":t,[`body.theme-dark .${e}`]:Object.keys(t).filter(n=>n.includes("--vis-dark")).map(n=>({[n.replace("--vis-dark","--vis")]:`var(${n})`}))})}const Oc=Z`
label: axis-component;
`,Zo={"--vis-axis-tick-color":"#e8e9ef","--vis-axis-grid-color":"#e8e9ef","--vis-axis-grid-line-width":"1px","--vis-axis-grid-line-dasharray":"none","--vis-axis-label-font-size":"14px","--vis-axis-label-color":"#6c778c","--vis-axis-label-weight":"500","--vis-axis-tick-label-color":"#6c778c","--vis-axis-tick-label-font-size":"12px","--vis-axis-tick-label-weight":"500","--vis-axis-tick-label-cursor":"default","--vis-axis-tick-label-text-decoration":"none","--vis-axis-tick-line-width":"1px","--vis-axis-tick-label-hide-transition":"opacity 400ms ease-in-out","--vis-dark-axis-tick-color":"#6c778c","--vis-dark-axis-tick-label-color":"#e8e9ef","--vis-dark-axis-grid-color":"#6c778c","--vis-dark-axis-label-color":"#fefefe"},Vm=Um(Zo);Ym(Zo,Oc);const Qo=Z`
label: hide-tick-line;
`,Ko=Z`
label: hide-domain;
`,Nc=Z`
label: axis;
user-select: none;
.domain {
stroke: var(--vis-axis-domain-color, var(--vis-axis-tick-color));
stroke-width: var(--vis-axis-domain-line-width, var(--vis-axis-grid-line-width));
stroke-dasharray: var(--vis-axis-domain-line-dasharray, var(--vis-axis-grid-line-dasharray));
}
&${`.${Qo}`} {
.tick > line {
opacity: 0;
}
}
&${`.${Ko}`} {
.domain {
opacity: 0;
}
}
`,Fc=Z`
label: grid;
.domain {
opacity: 0;
}
line {
stroke: var(--vis-axis-grid-color);
stroke-width: var(--vis-axis-grid-line-width);
stroke-dasharray: var(--vis-axis-grid-line-dasharray);
}
`,Lc=Z`
label: tick;
stroke: none;
font-size: var(--vis-axis-tick-label-font-size);
font-weight: var(--vis-axis-tick-label-weight);
line {
stroke: var(--vis-axis-tick-color);
stroke-width: var(--vis-axis-tick-line-width);
}
text {
fill: var(--vis-axis-tick-label-color);
cursor: var(--vis-axis-tick-label-cursor);
font-family: var(--vis-axis-font-family, var(--vis-font-family));
text-decoration: var(--vis-axis-tick-label-text-decoration);
stroke: none;
}
`,io=Z`
label: tick-text-exiting;
`,ro=Z`
label: label;
fill: var(--vis-axis-label-color);
font-size: var(--vis-axis-label-font-size);
font-weight: var(--vis-axis-label-weight);
font-family: var(--vis-axis-font-family, var(--vis-font-family));
text-anchor: middle;
`,zc=Z`
label: tick-label;
`,Pc=Z`
label: tick-label-hideable;
opacity: 0;
transition: var(--vis-axis-tick-label-hide-transition);
`,Xm=Object.freeze(Object.defineProperty({__proto__:null,axis:Nc,cssVarDefaults:Zo,grid:Fc,hideDomain:Ko,hideTickLine:Qo,label:ro,root:Oc,tick:Lc,tickLabel:zc,tickLabelHideable:Pc,tickTextExiting:io,variables:Vm},Symbol.toStringTag,{value:"Module"}));class Bc extends er{constructor(e){super(),this._defaultConfig=Wm,this.config=this._defaultConfig,this._defaultNumTicks=3,this.events={},e&&this.setConfig(e),this.axisGroup=this.g.append("g"),this.gridGroup=this.g.append("g").attr("class",Fc)}preRender(){const{config:e}=this,n=this.g.append("g").attr("opacity",0);this._renderAxis(n,0),this._axisRawBBox=n.node().getBBox(),e.tickTextAlign&&this._alignTickLabels(),this._renderAxisLabel(n),this._axisSizeBBox=this._getAxisSize(n),this._requiredMargin=this._getRequiredMargin(this._axisSizeBBox),n.remove()}getPosition(){const{config:{type:e,position:n}}=this;return n??(e===j.X?E.Bottom:E.Left)}_getAxisSize(e){return e.node().getBBox()}_getRequiredMargin(e=this._axisSizeBBox){const{config:{type:n,position:i}}=this;switch(n){case j.X:{const o=this._axisSizeBBox.x+this._axisSizeBBox.width,s=this._axisSizeBBox.x<0?Math.abs(this._axisSizeBBox.x):0,a=o-this._width>1?o-this._width:0;switch(i){case E.Top:return{top:e.height,left:s,right:a};case E.Bottom:default:return{bottom:e.height,left:s,right:a}}}case j.Y:{const r=e.height>this._height?(e.height-this._height)/2:0,o=r,s=r;switch(i){case E.Right:return{right:e.width,top:o,bottom:s};case E.Left:default:return{left:e.width,top:o,bottom:s}}}}}getRequiredMargin(){return this._requiredMargin}getOffset(e){const{config:{type:n,position:i}}=this;switch(n){case j.X:switch(i){case E.Top:return{top:e.top,left:e.left};case E.Bottom:default:return{top:e.top+this._height,left:e.left}}case j.Y:switch(i){case E.Right:return{top:e.top,left:e.left+this._width};case E.Left:default:return{top:e.top,left:e.left}}}}_render(e=this.config.duration,n=this.axisGroup){const{config:i}=this;if(this._renderAxis(n,e),this._renderAxisLabel(n),i.gridLine){const r=this._buildGrid();this.gridGroup.selectAll("*").interrupt(),mt(this.gridGroup,e).call(r).style("opacity",1)}else mt(this.gridGroup,e).style("opacity",0);i.tickTextAlign&&this._alignTickLabels(),this._resolveTickLabelOverlap(n)}_buildAxis(){const{config:{type:e,position:n,tickPadding:i}}=this,r=this._getNumTicks();switch(e){case j.X:switch(n){case E.Top:return Ra(this.xScale).ticks(r).tickPadding(i);case E.Bottom:default:return Na(this.xScale).ticks(r).tickPadding(i)}case j.Y:switch(n){case E.Right:return Oa(this.yScale).ticks(r).tickPadding(i);case E.Left:default:return Fa(this.yScale).ticks(r).tickPadding(i)}}}_buildGrid(){const{config:e}=this;let n;switch(e.type){case j.X:switch(e.position){case E.Top:{n=Ra(this.xScale);break}case E.Bottom:default:{n=Na(this.xScale);break}}n.tickSize(-this._height);break;case j.Y:switch(e.position){case E.Right:{n=Oa(this.yScale);break}case E.Left:default:{n=Fa(this.yScale);break}}n.tickSize(-this._width)}n.tickSizeOuter(0).tickFormat(()=>"");const i=this._getNumTicks()*2,r=n.scale(),o=r.domain(),s=()=>{if(!e.minMaxTicksOnlyShowGridLines)return o;const l=r.ticks(i);if(l.length<2)return o;const c=+l[1]-+l[0],u=o[1];return+u-+l[l.length-1]>c/2?[...l,u]:l},a=e.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?s():r.ticks(i);return n.tickValues(a),n}_renderAxis(e=this.axisGroup,n=this.config.duration){const{config:i}=this,r=this._buildAxis(),o=r.scale(),s=i.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?o.domain():o.ticks(this._getNumTicks()),a=s.length;r.tickValues(s),e.selectAll("*").interrupt();const l=mt(e,n).call(r);e.selectAll("text").attr("dy",null).attr("y",null),l.on("end",()=>{this._resolveTickLabelOverlap(e)}),e.selectAll("g.tick").classed(Lc,!0).style("font-size",i.tickTextFontSize);const u=e.selectAll("g.tick > text").filter(g=>s.some(p=>Ae(g,p))).classed(zc,!0).classed(Pc,!!i.tickTextHideOverlapping).style("fill",i.tickTextColor);e.selectAll("g.tick > text").filter(g=>!s.some(p=>Ae(g,p))).classed(io,!0),u.nodes().forEach(g=>ko(g));const h=r.tickSize(),f=this.getPosition(),d=i.tickTextWidth||(i.type===j.X?this._containerWidth/(a+1):this._containerWidth/5);if(u.each((g,p,v)=>{var m,_;let y=(_=(m=i.tickFormat)===null||m===void 0?void 0:m.call(i,g,p,s))!==null&&_!==void 0?_:`${g}`;const b=v[p];if(!this._tickTextStyleCached){const O=getComputedStyle(b);this._tickTextStyleCached={fontSize:Number.parseFloat(O.fontSize),fontFamily:O.fontFamily,fontWidthToHeightRatio:xo()}}const[T,x]=this._getTickTextOffset(f,h,this._tickTextStyleCached.fontSize),S={verticalAlign:i.type===j.X?Me.Top:Me.Middle,width:d,textRotationAngle:i.tickTextAngle,separator:i.tickTextSeparator,wordBreak:i.tickTextForceWordBreak,x:T,y:x};if(i.tickTextFitMode===Jt.Trim){const O=Lt(b).text(y);za(O,d,i.tickTextTrimType,!0,this._tickTextStyleCached.fontSize,.58),y=Lt(b).text()}const F=Object.assign({text:y},this._tickTextStyleCached),z=i.type===j.X?"central":"hanging";Hm(b,F,S,z)}),e.classed(Nc,!0).classed(Qo,!i.tickLine).classed(Ko,!i.domainLine),i.fullSize){const g=this._getFullDomainPath(0);mt(e.select(".domain"),n).attr("d",g)}}_resolveTickLabelOverlap(e=this.axisGroup){const{config:n}=this,i=e.selectAll(`g.tick > text:not(.${io})`);if(!n.tickTextHideOverlapping){i.style("opacity",null);return}cancelAnimationFrame(this._collideTickLabelsAnimFrameId),this._collideTickLabelsAnimFrameId=requestAnimationFrame(()=>{this._collideTickLabels(i)})}_collideTickLabels(e){e.each((i,r,o)=>{const s=o[r];s._visible=!0});const n=3;for(let i=0;i<n;i+=1)e.each((r,o,s)=>{const a=s[o];if(!a._visible)return;const c=a.getBoundingClientRect();for(let u=o+1;u<s.length;u+=1){if(o===u)continue;const h=s[u];if(h._visible){const d=h.getBoundingClientRect();if(Md(c,d,-5)){h._visible=!1;break}}}});e.each((i,r,o)=>{const s=o[r];Lt(s).style("opacity",s._visible?1:0)})}_getNumTicks(){const{config:{type:e,numTicks:n}}=this;if(n)return n;if(e===j.X){const i=this.xScale.range(),r=i[1]-i[0];return Math.floor(r/175)}if(e===j.Y){const i=this.yScale.range(),r=Math.abs(i[0]-i[1]);return Math.pow(r,.85)/25}return this._defaultNumTicks}_getConfiguredTickValues(){const{config:e}=this,n=e.type===j.X?this.xScale:this.yScale,i=n==null?void 0:n.domain();return e.tickValues?e.tickValues.filter(r=>r>=i[0]&&r<=i[1]):null}_shouldRenderMinMaxTicksOnly(){const{config:e}=this;return e.minMaxTicksOnly||e.type===j.X&&this._width<e.minMaxTicksOnlyWhenWidthIsLess}_getFullDomainPath(e=0){const{config:{type:n}}=this;switch(n){case j.X:return`M0.5, ${e} V0.5 H${this._width+.5} V${e}`;case j.Y:return`M${-e}, ${this._height+.5} H0.5 V0.5 H${-e}`}}_renderAxisLabel(e=this.axisGroup){var n;const{type:i,label:r,labelMargin:o,labelFontSize:s,labelTextFitMode:a}=this.config;if(e.selectAll(`.${ro}`).remove(),!r)return;const l=this.getPosition(),{width:c,height:u}=(n=this._axisRawBBox)!==null&&n!==void 0?n:e.node().getBBox(),h=i===j.Y?-90:0,f=e.append("text").attr("class",ro).attr("dy",`${this._getLabelDY()}em`).style("font-size",s).style("fill",this.config.labelColor);f.text(r);let d=!1;if(a===Jt.Wrap){const b=i===j.Y?this._height:this._width;f.node().getComputedTextLength()>b&&(Rc(f,b),d=!0)}let g=c,p=u;if(a===Jt.Wrap){const b=f.node().getBBox();g=b.width,p=b.height}else{const b=i===j.X?g:p,T=getComputedStyle(f.node()),x=Number.parseFloat(T.fontSize);za(f,b,this.config.labelTextTrimType,!0,x);const S=f.node().getBBox();g=S.width,p=S.height}const v=i===j.X?this._width/2:i===j.Y&&a===Jt.Wrap&&d?l===E.Left?-c-p/2-10:c:Math.pow(-1,+(l===E.Left))*c,m=i===j.Y?this._height/2:i===j.X&&a===Jt.Wrap?l===E.Top?-u-p/2:u:Math.pow(-1,+(l===E.Top))*u,_=i===j.X?0:Math.pow(-1,+(l===E.Left))*o,y=i===j.X?Math.pow(-1,+(l===E.Top))*o:0;f.attr("transform",`translate(${v+_},${m+y}) rotate(${h})`)}_getLabelDY(){const{type:e,position:n}=this.config;switch(e){case j.X:switch(n){case E.Top:return 0;case E.Bottom:default:return .75}case j.Y:switch(n){case E.Right:return .75;case E.Left:default:return-.25}}}_getTickTextOffset(e,n,i){var r;const{config:o}=this,s=((r=o.tickTextAngle)!==null&&r!==void 0?r:0)/180*Math.PI,a=n+o.tickPadding;if(o.type===j.X){const l=e===E.Bottom?1:-1;return[l*a*Math.sin(s),l*(a+i/2)*Math.cos(s)]}else{const l=e===E.Right?1:-1;return[l*a*Math.cos(s),l*a*Math.sin(s)]}}_alignTickLabels(){const{config:{type:e,tickTextAlign:n,tickTextAngle:i,position:r}}=this,o=this.g.selectAll("g.tick > text"),s=Am(n),a=e===j.X?0:this._getYTickTextTranslate(n,r),l=i?`translate(${a},0) rotate(${i})`:`translate(${a},0)`;o.attr("transform",l).attr("text-anchor",s)}_getYTickTextTranslate(e,n=E.Left){var i,r,o,s;const a=this.config.tickPadding+1,l=((s=(r=(i=this._axisRawBBox)===null||i===void 0?void 0:i.width)!==null&&r!==void 0?r:(o=this.axisGroup.node())===null||o===void 0?void 0:o.getBBox().width)!==null&&s!==void 0?s:0)-a;switch(e){case Ht.Left:return n===E.Left?l*-1:0;case Ht.Right:return n===E.Left?0:l;case Ht.Center:return n===E.Left?l*-.5:l*.5;default:return 0}}}Bc.selectors=Xm;const Gm=Object.assign(Object.assign({},Ln),{yStacked:void 0,baseline:null,duration:100,tooltip:void 0,template:(t,e,n,i)=>"",hideWhenFarFromPointer:!0,hideWhenFarFromPointerDistance:100,snapToData:!0,getCircles:void 0,color:void 0,strokeColor:void 0,strokeWidth:void 0,onCrosshairMove:void 0,forceShowAt:void 0,skipRangeCheck:!1}),qm=Re`
:root {
--vis-crosshair-line-stroke-color: #888;
--vis-crosshair-line-stroke-width: 1px;
--vis-crosshair-line-stroke-opacity: 1;
--vis-crosshair-circle-stroke-color: #fff;
--vis-crosshair-circle-stroke-width: 1px;
--vis-crosshair-circle-stroke-opacity: 0.75;
}
`,jm=Z`
label: crosshair-component;
`,Ic=Z`
stroke: var(--vis-crosshair-line-stroke-color);
stroke-width: var(--vis-crosshair-line-stroke-width);
stroke-opacity: var(--vis-crosshair-line-stroke-opacity);
pointer-events: none;
`,Hc=Z`
stroke: var(--vis-crosshair-circle-stroke-color);
stroke-width: var(--vis-crosshair-circle-stroke-width);
stroke-opacity: var(--vis-crosshair-circle-stroke-opacity);
pointer-events: none;
`,Zm=Object.freeze(Object.defineProperty({__proto__:null,circle:Hc,globalStyles:qm,line:Ic,root:jm},Symbol.toStringTag,{value:"Module"}));class Wc extends er{constructor(e){super(),this.clippable=!0,this._defaultConfig=Gm,this.config=this._defaultConfig,this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this._animFrameId=null,this._accessors={x:void 0,y:void 0,yStacked:void 0,baseline:void 0},e&&this.setConfig(e),this.g.style("opacity",0),this.line=this.g.append("line").attr("class",Ic)}set accessors(e){this._accessors=e}get accessors(){var e;const{config:n}=this,i=!!(n.x||n.y||n.yStacked),r=i?n.x:this._accessors.x,o=i?n.y:this._accessors.y,s=o?ge(o)?o:[o]:void 0,a=i?n.yStacked:this._accessors.yStacked,l=(e=n.baseline)!==null&&e!==void 0?e:this._accessors.baseline;return{x:r,y:s,yStacked:a,baseline:l}}_isContainerInViewport(){var e;if(!(!((e=this.container)===null||e===void 0)&&e.node()))return!1;const n=this.container.node().getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,o=Math.max(0,Math.min(n.right,i)-Math.max(n.left,0)),s=Math.max(0,Math.min(n.bottom,r)-Math.max(n.top,0)),a=n.width*n.height,l=o*s;return a>0&&l/a>=.35}setContainer(e){this.container!==e&&(this.container=e,this.container.on("mousemove.crosshair",this._onMouseMove.bind(this)),this.container.on("mouseout.crosshair",this._onMouseOut.bind(this)),this.container.on("wheel.crosshair",this._onWheel.bind(this)))}_render(e){var n,i,r,o,s;const{config:a,datamodel:l}=this,c=It(e)?e:a.duration,u=a.forceShowAt!==void 0,h=u?this.xScale(a.forceShowAt):this._xPx,f=this.xScale.invert(h),d=!((n=l.data)===null||n===void 0)&&n.length&&this.accessors.x?l.data.indexOf(wi(l.data,f,this.accessors.x,te.Left)):void 0;let g,p;a.snapToData&&(!this.accessors.y&&!this.accessors.yStacked&&(!((i=l.data)===null||i===void 0)&&i.length)&&console.warn("Unovis | Crosshair: Y accessors have not been configured. Please check if they're present in the configuration object"),!(!((r=l.data)===null||r===void 0)&&r.length)&&this._mouseEvent&&console.warn("Unovis | Crosshair: No data to snap to. Make sure the data has been passed to the container or to the crosshair itself"),g=wi(l.data,f,this.accessors.x),p=l.data.indexOf(g));const v=this.xScale.range(),m=this.yScale.range(),_=a.snapToData&&g?ee(Math.round(this.xScale(st(g,this.accessors.x,p))),0,this._width):ee(h,v[0],v[1]),y=h>=v[0]&&h<=v[1],b=this._yPx>=Math.min(m[0],m[1])&&this._yPx<=Math.max(m[0],m[1]);let T=a.skipRangeCheck?!!this._xPx:this._xPx?y&&b:y;a.hideWhenFarFromPointer&&Math.abs(_-+h)>=a.hideWhenFarFromPointerDistance&&(T=!1);const x=(o=a.tooltip)!==null&&o!==void 0?o:this.tooltip;if(T&&x&&this._isContainerInViewport()){const O=x.getContainer()||this.container.node(),V=x.isContainerBody(),M=this.accessors.x?st(g,this.accessors.x,p):void 0;if(u){const A=this.container.node().getBoundingClientRect(),B=(V?h+A.left:h)+this._containerMargin.left,nt=this._height/2+(V?A.top:0),pt=[B,nt];this._showTooltip(g,M,pt,d)}else if(this._mouseEvent){const A=V?[this._mouseEvent.clientX,this._mouseEvent.clientY]:vi(this._mouseEvent,O);this._showTooltip(g,M,A,d)}}else this._hideTooltip();if(this._mouseEvent&&((s=a.onCrosshairMove)===null||s===void 0||s.call(a,T?this.xScale.invert(this._xPx):void 0,g,p,this._mouseEvent),this._mouseEvent=void 0),mt(this.g,c).style("opacity",T?1:0),!isFinite(h))return;this.line.attr("y1",0).attr("y2",this._height),mt(this.line,c,Xs).attr("x1",_).attr("x2",_);const S=ho(a.getCircles)?a.getCircles(f,l.data,this.yScale,d):this.getCircleData(g,p),F=this.g.selectAll("circle").data(S,(O,V)=>{var M;return(M=O.id)!==null&&M!==void 0?M:V}),z=F.enter().append("circle").attr("class",Hc).attr("r",0).attr("cx",_).attr("cy",O=>O.y).style("fill",O=>O.color).style("stroke",O=>O.strokeColor).style("stroke-width",O=>O.strokeWidth);mt(z.merge(F),c,Xs).attr("cx",_).attr("cy",O=>O.y).attr("r",4).style("opacity",O=>O.opacity).style("fill",O=>O.color).style("stroke",O=>O.strokeColor).style("stroke-width",O=>O.strokeWidth),F.exit().remove()}hide(e){window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{var n,i;this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,(i=(n=this.config).onCrosshairMove)===null||i===void 0||i.call(n,void 0,void 0,void 0,e),this._render()})}_onMouseMove(e){var n;const{datamodel:i,element:r}=this;!this.accessors.x&&(!((n=i.data)===null||n===void 0)&&n.length)&&console.warn("Unovis | Crosshair: X accessor function has not been configured. Please check if it's present in the configuration object");const[o,s]=vi(e,r);this._xPx=o,this._yPx=s,this._mouseEvent=e,window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._render()})}_onMouseOut(e){var n;(!e||!(!((n=this.container)===null||n===void 0)&&n.node().contains(e.relatedTarget)))&&this.hide(e)}_onWheel(e){this.hide(e)}_showTooltip(e,n,i,r){var o;const{config:s,datamodel:a}=this,l=(o=s.tooltip)!==null&&o!==void 0?o:this.tooltip;if(!l||!i)return;const[c,u]=i,h=s.template(e,n,a.data,r);if(l.config.followCursor=!0,!l.config.horizontalPlacement||l.config.horizontalPlacement===E.Auto){const f=l.isContainerBody()?c-this.container.node().getBoundingClientRect().left:c;l.overrideHorizontalPlacement(f>this._containerWidth/2?E.Left:E.Right)}h&&l.show(h,{x:c,y:u})}_hideTooltip(){var e;const{config:n}=this,i=(e=n.tooltip)!==null&&e!==void 0?e:this.tooltip;i==null||i.hide()}getYDataExtent(){return[void 0,void 0]}getCircleData(e,n){var i,r;const{config:o}=this;if(o.snapToData&&e){const s=(i=this.accessors.y)!==null&&i!==void 0?i:[],a=(r=this.accessors.yStacked)!==null&&r!==void 0?r:[],l=st(e,this.accessors.baseline,n)||0,c=gf(e,n,...a).map((h,f)=>({y:this.yScale(h+l),opacity:It(st(e,a[f],f))?1:0,color:Rt(e,o.color,f),strokeColor:o.strokeColor?Rt(e,o.strokeColor,f):void 0,strokeWidth:o.strokeWidth?st(e,o.strokeWidth,f):void 0})),u=s.map((h,f)=>{const d=st(e,h,n);return{y:this.yScale(d),opacity:It(d)?1:0,color:Rt(e,o.color,c.length+f),strokeColor:o.strokeColor?Rt(e,o.strokeColor,f):void 0,strokeWidth:o.strokeWidth?st(e,o.strokeWidth,f):void 0}});return c.concat(u)}return[]}}Wc.selectors=Zm;const Qm=Object.assign(Object.assign({},Ln),{color:void 0,curveType:at.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1}),Uc=Z`
label: area-component;
`,Km=Re`
:root {
--vis-area-cursor: default;
--vis-area-fill-opacity: 1;
--vis-area-stroke-color: none;
--vis-area-stroke-width: 0px;
--vis-area-stroke-dasharray: none;
--vis-area-stroke-opacity: 1;
--vis-area-hover-fill-opacity: none;
--vis-area-hover-stroke-width: none;
/* Dark Theme */
--vis-dark-area-stroke-color: none;
}
body.theme-dark ${`.${Uc}`} {
--vis-area-stroke-color: var(--vis-dark-area-stroke-color);
}
`,di=Z`
label: area;
cursor: var(--vis-area-cursor);
fill-opacity: var(--vis-area-fill-opacity);
stroke-width: var(--vis-area-stroke-width);
stroke-dasharray: var(--vis-area-stroke-dasharray);
stroke: var(--vis-area-stroke-color);
stroke-opacity: var(--vis-area-stroke-opacity);
&:hover {
fill-opacity: var(--vis-area-hover-fill-opacity);
stroke-width: var(--vis-area-hover-stroke-width);
}
`,oo=Z`
label: areaLinePath;
fill: none;
stroke-dasharray: var(--vis-line-stroke-dasharray);
stroke-dashoffset: var(--vis-line-stroke-dashoffset);
`,Jm=Object.freeze(Object.defineProperty({__proto__:null,area:di,areaLinePath:oo,globalStyles:Km,root:Uc},Symbol.toStringTag,{value:"Module"}));class ar extends er{constructor(e){super(),this._defaultConfig=Qm,this.config=this._defaultConfig,this.stacked=!0,this.events={[ar.selectors.area]:{}},e&&this.setConfig(e),this.stacked=Array.isArray(this.config.y)}get bleed(){const{config:{line:e,lineWidth:n}}=this;if(!e)return{top:0,bottom:0,left:0,right:0};const i=this.yScale.domain(),o=(this.yScale.range()[0]>this.yScale.range()[1]?jt.North:jt.South)===jt.South,s=n>3,a=n>=10;return{top:!a&&(!o&&i[1]===0||o&&i[0]===0)?0:n/2,bottom:!a&&(!o&&i[0]===0||o&&i[1]===0)?0:n/2,left:s?n/2:0,right:s?n/2:0}}_render(e){super._render(e);const{config:n,datamodel:{data:i}}=this,r=It(e)?e:n.duration,o=Wi[n.curveType];this._areaGen=Ov().x(v=>v.x).y0(v=>v.y0).y1(v=>v.y1).curve(o);const s=ge(n.y)?n.y:[n.y],a=i.map((v,m)=>this.xScale(st(v,n.x,m))),l=vf(i,n.baseline,s,this._prevNegative);this._prevNegative=l.map(v=>!!v.isMostlyNegative);const c=[],u=l.map(v=>v.map((m,_)=>{var y,b;const T=a[_],x=this.yScale(m[0]),S=this.yScale(m[1]),F=S>x,z=n.stackMinHeight&&c[_]||0,O=F?x+z:x-z,V=F?S+z:S-z;let M=0;return(n.minHeight||n.minHeight1Px)&&Math.abs(V-O)<((y=n.minHeight)!==null&&y!==void 0?y:1)&&(M=((b=n.minHeight)!==null&&b!==void 0?b:1)-Math.abs(V-O),n.stackMinHeight&&(c[_]=z+M)),{x:T,y0:O,y1:F?V+M:V-M}})),h=u.length-1,f=[...u].reverse(),d=this.g.selectAll(`.${di}`).data(f),g=d.enter().append("path").attr("class",di).attr("d",v=>this._areaGen(v)||this._emptyPath()).style("opacity",0).style("fill",(v,m)=>Rt(i,n.color,h-m)),p=mt(g.merge(d),r).style("opacity",(v,m)=>v.some(y=>y.y0-y.y1!==0)?st(i,n.opacity,h-m):0).style("fill",(v,m)=>Rt(i,n.color,h-m)).style("cursor",(v,m)=>bi(i,n.cursor,h-m));r?p.attrTween("d",(m,_,y)=>{const b=Lt(y[_]).attr("d"),T=this._areaGen(m)||this._emptyPath();return Qr(b,T)}):p.attr("d",v=>this._areaGen(v)||this._emptyPath()),mt(d.exit(),r).style("opacity",0).remove(),n.line&&this._renderLines(r,u)}_renderLines(e,n){var i;const{config:r,datamodel:{data:o}}=this,s=n.length-1,a=[...n].reverse(),l=(i=r.lineColor)!==null&&i!==void 0?i:r.color,c=this.g.selectAll(`.${oo}`).data(a),u=this.g.selectAll(`.${di}`).nodes(),h=c.enter().insert("path",(g,p)=>u[p+1]).attr("class",oo).attr("stroke",(g,p)=>Rt(o,l,s-p)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",0),f=mt(h.merge(c),e).attr("stroke",(g,p)=>Rt(o,l,s-p)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",1).attr("cursor",(g,p)=>bi(o,r.cursor,s-p)).style("stroke-dasharray",(g,p)=>{var v,m;return(m=(v=Vi(o,r.lineDashArray,p))===null||v===void 0?void 0:v.join(" "))!==null&&m!==void 0?m:null}),d=Wi[r.curveType];this._lineGen=Vo().x(g=>g.x).y(g=>g.y1).curve(d),e?f.attrTween("d",(p,v,m)=>{const _=Lt(m[v]).attr("d")||this._emptyLinePath(),y=this._lineGen(p)||this._emptyLinePath();return Qr(_,y)}):f.attr("d",g=>this._lineGen(g)||this._emptyLinePath()),mt(c.exit(),e).style("opacity",0).remove()}getYDataExtent(e){const{config:n,datamodel:i}=this,r=ge(n.y)?n.y:[n.y],o=this.xScale.domain(),s=e?al(i.data,o,n.x,!0):i.data;return pf(s,n.baseline,...r)}_emptyPath(){const e=this.xScale.range(),n=this.yScale.domain(),i=this.yScale((n[0]+n[1])/2),r=i;return this._areaGen([{y0:i,y1:r,x:e[0]},{y0:i,y1:r,x:e[1]}])}_emptyLinePath(){const e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}}ar.selectors=Jm;const t_=Object.assign(Object.assign({},Ho),{id:(t,e)=>{var n;return(n=t.id)!==null&&n!==void 0?n:e},value:void 0,angleRange:[0,2*Math.PI],padAngle:0,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0});function e_(t,e){t.style("fill",n=>Rt(n.data,e.color,n.index)).style("opacity",0).each((n,i,r)=>{const o=r[i],s=(n.startAngle+n.endAngle)/2,a=(n.endAngle-n.startAngle)/2;o._animState={startAngle:s-a,endAngle:s+a,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function n_(t,e,n,i){t.style("transition",`fill ${i}ms`).style("fill",o=>Rt(o.data,e.color,o.index));const r=o=>e.showEmptySegments||o.value?1:0;i?mt(t,i).style("opacity",r).attrTween("d",(s,a,l)=>{const c=l[a],u={startAngle:s.startAngle,endAngle:s.endAngle,innerRadius:s.innerRadius,outerRadius:s.outerRadius,padAngle:s.padAngle},h=Oe(c._animState,u);return f=>(c._animState=h(f),n(c._animState))}):t.attr("d",n).style("opacity",r)}function i_(t,e){mt(t,e).style("opacity",0).remove()}const Yc=Array.from({length:4},(t,e)=>{const n=-Math.PI/2+e*Math.PI/2;return[n,n+Math.PI]}),[zy,Py,By,Iy]=Yc,Vc=Z`
label: donut-component;
`,r_=Re`
:root {
--vis-donut-central-label-font-size: 16px;
--vis-donut-central-label-text-color: #5b5f6d;
// Undefined by default to allow proper fallback to var(--vis-font-family)
/* --vis-donut-central-label-font-family: */
--vis-donut-central-label-font-weight: 600;
--vis-donut-central-sub-label-font-size: 12px;
--vis-donut-central-sub-label-text-color: #5b5f6d;
// Undefined by default to allow proper fallback to var(--vis-font-family)
/* --vis-donut-central-sub-label-font-family: */
--vis-donut-central-sub-label-font-weight: 500;
--vis-donut-background-color: #E7E9F3;
--vis-donut-segment-stroke-width: 0;
// The line segment color variable is not defined by default
// to allow it to fallback to the donut background color
/* --vis-donut-segment-stroke-color: none; */
--vis-dark-donut-central-label-text-color: #C2BECE;
--vis-dark-donut-central-sub-label-text-color: #C2BECE;
--vis-dark-donut-background-color: #18160C;
}
body.theme-dark ${`.${Vc}`} {
--vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
--vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
--vis-donut-background-color: var(--vis-dark-donut-background-color);
}
`,Xc=Z`
label: background;
fill: var(--vis-donut-background-color);
`,so=Z`
label: segment;
stroke-width: var(--vis-donut-segment-stroke-width);
stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
`,Gc=Z`
label: segment-exit;
`,qc=Z`
label: central-label;
text-anchor: middle;
dominant-baseline: middle;
font-size: var(--vis-donut-central-label-font-size);
font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
font-weight: var(--vis-donut-central-label-font-weight);
fill: var(--vis-donut-central-label-text-color);
`,jc=Z`
label: central-label;
text-anchor: middle;
dominant-baseline: middle;
font-size: var(--vis-donut-central-sub-label-font-size);
font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
font-weight: var(--vis-donut-central-sub-label-font-weight);
fill: var(--vis-donut-central-sub-label-text-color);
`,o_=Object.freeze(Object.defineProperty({__proto__:null,background:Xc,centralLabel:qc,centralSubLabel:jc,root:Vc,segment:so,segmentExit:Gc,variables:r_},Symbol.toStringTag,{value:"Module"}));class lr extends hc{constructor(e){super(),this._defaultConfig=t_,this.config=this._defaultConfig,this.datamodel=new fc,this.arcGen=Rv(),this.events={},e&&this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",qc),this.centralSubLabel=this.g.append("text").attr("class",jc)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){var n,i,r,o,s,a,l,c,u,h,f,d,g,p;const{config:v,datamodel:m,bleed:_}=this,y=m.data.map((W,ot)=>({index:ot,datum:W})).filter(W=>v.showEmptySegments||st(W.datum,v.value,W.index)),b=It(e)?e:v.duration,[T,x,S,F]=Yc.map(W=>v.angleRange&&v.angleRange[0]===W[0]&&v.angleRange[1]===W[1]),z=T||S,O=x||F,V=this._width*(O?2:1),M=this._height*(z?2:1),A=v.radius||Math.min(V-_.left-_.right,M-_.top-_.bottom)/2,B=v.arcWidth===0?0:ee(A-v.arcWidth,0,A-1),nt=this._height/2+(T?A/2:S?-A/2:0),pt=this._width/2+(F?A/2:x?-A/2:0),it=`translate(${pt},${nt})`;this.arcGroup.attr("transform",it),this.arcGen.startAngle(W=>W.startAngle).endAngle(W=>W.endAngle).innerRadius(W=>W.innerRadius).outerRadius(W=>W.outerRadius).padAngle(W=>W.padAngle).cornerRadius(v.cornerRadius);const Tt=Lv().startAngle((i=(n=v.angleRange)===null||n===void 0?void 0:n[0])!==null&&i!==void 0?i:0).endAngle((o=(r=v.angleRange)===null||r===void 0?void 0:r[1])!==null&&o!==void 0?o:2*Math.PI).padAngle(v.padAngle).value(W=>st(W.datum,v.value,W.index)||0).sort((W,ot)=>{var $;return($=v.sortFunction)===null||$===void 0?void 0:$.call(v,W.datum,ot.datum)})(y).map(W=>{const ot=Object.assign(Object.assign({},W),{data:W.data.datum,index:W.data.index,innerRadius:B,outerRadius:A});return v.showEmptySegments&&W.endAngle-W.startAngle-W.padAngle<=Number.EPSILON&&(ot.endAngle=W.startAngle+Math.max(v.emptySegmentAngle,v.padAngle),ot.padAngle=W.padAngle/2),ot}),D=this.arcGroup.selectAll(`.${so}`).data(Tt,W=>v.id(W.data,W.index)),R=D.enter().append("path").attr("class",so).call(e_,v),k=D.merge(R);k.call(n_,v,this.arcGen,b),k.sort((W,ot)=>ot.value-W.value),D.exit().attr("class",Gc).call(i_,b);const H=x?"start":F?"end":"middle";this.centralLabel.attr("dy",v.centralSubLabel?"-0.55em":null).style("text-anchor",H).text((s=v.centralLabel)!==null&&s!==void 0?s:null),this.centralSubLabel.attr("dy",v.centralLabel?"0.55em":null).style("text-anchor",H).text((a=v.centralSubLabel)!==null&&a!==void 0?a:null),v.centralSubLabelWrap&&Rc(this.centralSubLabel,B*1.9);const G=(v.centralLabelOffsetX||0)+pt;let et=(v.centralLabelOffsetY||0)+nt;z&&v.centralLabelOffsetX===void 0&&v.centralLabelOffsetY===void 0&&(et=(T?-this.centralSubLabel.node().getBoundingClientRect().height:S?this.centralLabel.node().getBoundingClientRect().height:0)+nt);const ft=`translate(${G},${et})`;this.centralLabel.attr("transform",ft),this.centralSubLabel.attr("transform",ft),this.arcBackground.attr("class",Xc).attr("visibility",v.showBackground?null:"hidden").attr("transform",it),mt(this.arcBackground,b).attr("d",this.arcGen({startAngle:(h=(c=(l=v.backgroundAngleRange)===null||l===void 0?void 0:l[0])!==null&&c!==void 0?c:(u=v.angleRange)===null||u===void 0?void 0:u[0])!==null&&h!==void 0?h:0,endAngle:(p=(d=(f=v.backgroundAngleRange)===null||f===void 0?void 0:f[1])!==null&&d!==void 0?d:(g=v.angleRange)===null||g===void 0?void 0:g[1])!==null&&p!==void 0?p:2*Math.PI,innerRadius:B,outerRadius:A}))}}lr.selectors=o_;function nn(t,e){return Ae(t,e)}function _e(t){const e=Jc(),n=e.attrs;return ut(()=>{const i={},r=(e==null?void 0:e.vnode.props)??{};return Object.keys(r).forEach(o=>{i[es(o)]=t[es(o)]}),{...i,...n}})}const zn=Symbol("componentAccessorKey"),Jo=Symbol("tooltipAccessorKey"),Zc=Symbol("crosshairAccessorKey"),Qc=Symbol("axisAccessorKey"),Kc=Symbol("annotationsAccessorKey"),s_={"data-vis-component":""},a_=zt({__name:"index",props:{color:{type:[Function,String,Array,null]},curveType:{},baseline:{type:[Function,Number,null]},opacity:{type:[Function,Number,null]},cursor:{type:[Function,String,null]},line:{type:Boolean},lineColor:{type:[Function,String,Array,null]},lineWidth:{},lineDashArray:{type:[Function,Array,null]},minHeight1Px:{type:Boolean},minHeight:{},stackMinHeight:{type:Boolean},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Je(zn),i=t,r=ut(()=>n.data.value??i.data),o=_e(i),s=vt();return Ee(()=>{tn(()=>{var a;s.value=new ar(o.value),(a=s.value)==null||a.setData(r.value),n.update(s.value)})}),me(()=>{var a;(a=s.value)==null||a.destroy(),n.destroy()}),St(o,(a,l)=>{var c;nn(a,l)||(c=s.value)==null||c.setConfig(o.value)}),St(r,()=>{var a;(a=s.value)==null||a.setData(r.value)}),e({component:s}),(a,l)=>(L(),I("div",s_))}}),l_={"data-vis-axis":""},Pa=zt({__name:"index",props:{position:{},type:{},fullSize:{type:Boolean},label:{},labelFontSize:{},labelMargin:{},labelTextFitMode:{},labelTextTrimType:{},labelColor:{},gridLine:{type:Boolean},tickLine:{type:Boolean},domainLine:{type:Boolean},minMaxTicksOnly:{type:Boolean},minMaxTicksOnlyShowGridLines:{type:Boolean},minMaxTicksOnlyWhenWidthIsLess:{},tickFormat:{type:Function},tickValues:{},numTicks:{},tickTextFitMode:{},tickTextWidth:{},tickTextSeparator:{},tickTextForceWordBreak:{type:Boolean},tickTextTrimType:{},tickTextFontSize:{},tickTextAlign:{},tickTextColor:{},tickTextAngle:{},tickTextHideOverlapping:{type:Boolean},tickPadding:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},color:{type:[Function,String,Array,null]},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Je(Qc),i=t,r=ut(()=>n.data.value??i.data),o=_e(i),s=vt();return Ee(()=>{tn(()=>{var a;s.value=new Bc(o.value),(a=s.value)==null||a.setData(r.value),n.update(s.value)})}),me(()=>{var a;(a=s.value)==null||a.destroy(),n.destroy(i.type)}),St(o,(a,l)=>{var c;nn(a,l)||(c=s.value)==null||c.setConfig(o.value)}),St(r,()=>{var a;(a=s.value)==null||a.setData(r.value)}),e({component:s}),(a,l)=>(L(),I("div",l_))}}),c_={"data-vis-crosshair":""},u_=zt({__name:"index",setup(t,{expose:e}){const n=Je(Zc),i=t,r=ut(()=>n.data.value??i.data),o=_e(i),s=vt();return Ee(()=>{tn(()=>{var a;s.value=new Wc(o.value),(a=s.value)==null||a.setData(r.value),n.update(s.value)})}),me(()=>{var a;(a=s.value)==null||a.destroy(),n.destroy()}),St(o,(a,l)=>{var c;nn(a,l)||(c=s.value)==null||c.setConfig(o.value)}),St(r,()=>{var a;(a=s.value)==null||a.setData(r.value)}),e({component:s}),(a,l)=>(L(),I("div",c_))}}),h_={"data-vis-component":""};lr.selectors;const f_=zt({__name:"index",props:{id:{type:Function},value:{type:[Function,Number,null]},angleRange:{},padAngle:{},sortFunction:{type:Function},cornerRadius:{},color:{type:[Function,String,Array,null]},radius:{},arcWidth:{},centralLabel:{},centralSubLabel:{},centralSubLabelWrap:{type:Boolean},showEmptySegments:{type:Boolean},emptySegmentAngle:{},showBackground:{type:Boolean},backgroundAngleRange:{},centralLabelOffsetX:{},centralLabelOffsetY:{},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Je(zn),i=t,r=ut(()=>n.data.value??i.data),o=_e(i),s=vt();return Ee(()=>{tn(()=>{var a;s.value=new lr(o.value),(a=s.value)==null||a.setData(r.value),n.update(s.value)})}),me(()=>{var a;(a=s.value)==null||a.destroy(),n.destroy()}),St(o,(a,l)=>{var c;nn(a,l)||(c=s.value)==null||c.setConfig(o.value)}),St(r,()=>{var a;(a=s.value)==null||a.setData(r.value)}),e({component:s}),(a,l)=>(L(),I("div",h_))}}),d_={"data-vis-component":""},p_=zt({__name:"index",props:{color:{type:[Function,String,Array,null]},curveType:{},lineWidth:{},lineDashArray:{type:[Function,Array,null]},fallbackValue:{},highlightOnHover:{type:Boolean},cursor:{type:[Function,String,null]},interpolateMissingData:{type:Boolean},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(t,{expose:e}){const n=Je(zn),i=t,r=ut(()=>n.data.value??i.data),o=_e(i),s=vt();return Ee(()=>{tn(()=>{var a;s.value=new or(o.value),(a=s.value)==null||a.setData(r.value),n.update(s.value)})}),me(()=>{var a;(a=s.value)==null||a.destroy(),n.destroy()}),St(o,(a,l)=>{var c;nn(a,l)||(c=s.value)==null||c.setConfig(o.value)}),St(r,()=>{var a;(a=s.value)==null||a.setData(r.value)}),e({component:s}),(a,l)=>(L(),I("div",d_))}}),g_=zt({__name:"index",props:{component:{},tooltip:{},annotations:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(t,{expose:e}){const n=t,{data:i}=ao(n),r=_e(n);let o;const s=Ya({component:void 0,tooltip:void 0,annotations:void 0}),a=vt(),l=()=>{o||a.value&&s.component&&(o=new bg(a.value,{...Ie(s)},i.value))};return Va(()=>{var c;l(),(c=s.component)==null||c.config,o==null||o.updateContainer({...Ie(r.value),...Ie(s)})}),St(i,()=>{o?o.setData(i.value,!0):l()}),me(()=>o==null?void 0:o.destroy()),fe(zn,{data:i,update:c=>s.component=c,destroy:()=>s.component=void 0}),fe(Jo,{data:i,update:c=>s.tooltip=c,destroy:()=>{s.tooltip=void 0}}),fe(Kc,{data:i,update:c=>s.annotations=c,destroy:()=>{s.annotations=void 0}}),e({component:o}),(c,u)=>(L(),I("div",{"data-vis-single-container":"",ref_key:"elRef",ref:a,class:"unovis-single-container"},[Ui(c.$slots,"default")],512))}}),v_={"data-vis-tooltip":""},Ba=zt({__name:"index",props:{components:{},container:{},followCursor:{type:Boolean},allowHover:{type:Boolean},horizontalPlacement:{},horizontalShift:{},verticalPlacement:{},verticalShift:{},triggers:{},attributes:{},className:{},hideDelay:{},showDelay:{},data:{}},setup(t,{expose:e}){const n=Je(Jo),i=_e(t),r=vt();return Ee(()=>{tn(()=>{r.value=new gc(i.value),n.update(r.value)})}),me(()=>{var o;(o=r.value)==null||o.destroy(),n.destroy()}),St(i,(o,s)=>{var a;nn(o,s)||(a=r.value)==null||a.setConfig(i.value)}),e({component:r}),(o,s)=>(L(),I("div",v_))}}),m_=zt({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},clipPathExtend:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(t,{expose:e}){const n=t,{data:i}=ao(n),r=_e(n),o=vt(),s=Ya({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),a=vt();return St(i,()=>{o.value&&o.value.setData(i.value,!0)}),Va(()=>{var l;s.components.map(c=>c.config),(l=o.value)==null||l.updateContainer({...Ie(r.value),...Ie(s)})}),Ee(()=>{a.value&&(o.value=new vv(a.value,{...Ie(s)},i.value))}),me(()=>{var l;return(l=o.value)==null?void 0:l.destroy()}),fe(zn,{data:i,update:l=>s.components=[...s.components,l],destroy:()=>{var l;return s.components=(l=s.components)==null?void 0:l.filter(c=>!c.isDestroyed())}}),fe(Qc,{data:i,update:l=>s[`${l.config.type}Axis`]=l,destroy:l=>{s[`${l}Axis`]=void 0}}),fe(Zc,{data:i,update:l=>s.crosshair=l,destroy:()=>{s.crosshair=void 0}}),fe(Jo,{data:i,update:l=>s.tooltip=l,destroy:()=>{s.tooltip=void 0}}),fe(Kc,{data:i,update:l=>s.annotations=l,destroy:()=>{s.annotations=void 0}}),e({component:o}),(l,c)=>(L(),I("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:a,class:"unovis-xy-container"},[Ui(l.$slots,"default")],512))}});(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("[data-vis-bullet-legend],[data-vis-flow-legend]{display:block}[data-vis-leaflet-flow-map],[data-vis-leaflet-map]{display:block;position:relative}[data-vis-rolling-pin-legend]{display:block}.unovis-single-container,.unovis-xy-container{display:block;position:relative;width:100%}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const __=zt({__name:"ChartStyle",props:{id:{}},setup(t){const{config:e}=A_(),n=ut(()=>Object.entries(e.value).filter(([,i])=>i.theme||i.color));return(i,r)=>n.value.length?(L(),ce(w(tu),{key:0,as:"style"},{default:U(()=>[lt(N(Object.entries(w(M_)).map(([o,s])=>`
${s} [data-chart=${i.id}] {
${n.value.map(([a,l])=>{var u;const c=((u=l.theme)==null?void 0:u[o])||l.color;return c?` --color-${a}: ${c};`:null}).join(`
`)}
}
`).join(`
`)),1)]),_:1})):gt("",!0)}}),y_=["data-chart"],Ia=zt({__name:"ChartContainer",props:{id:{},class:{},config:{},cursor:{type:Boolean}},setup(t){const e=t,{config:n}=ao(e),i=Xa(),r=ut(()=>`chart-${e.id||i.replace(/:/g,"")}`);return $_({id:i,config:n}),(o,s)=>(L(),I("div",{"data-slot":"chart","data-chart":r.value,class:un(w(hn)("cn-chart [&_.tick_text]:!fill-muted-foreground [&_.tick_line]:!stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex flex-col aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden [&_[data-vis-xy-container]]:h-full [&_[data-vis-single-container]]:h-full h-full [&_[data-vis-xy-container]]:w-full [&_[data-vis-single-container]]:w-full w-full ",e.class)),style:pi({"--vis-tooltip-padding":"0px","--vis-tooltip-background-color":"transparent","--vis-tooltip-border-color":"transparent","--vis-tooltip-text-color":"none","--vis-tooltip-shadow-color":"none","--vis-tooltip-backdrop-filter":"none","--vis-crosshair-circle-stroke-color":"#0000","--vis-crosshair-line-stroke-width":o.cursor?"1px":"0px","--vis-font-family":"var(--font-sans)"})},[Ui(o.$slots,"default",{id:w(i),config:w(n)}),P(__,{id:r.value},null,8,["id"])],14,y_))}}),x_={key:0,class:"font-medium"},b_={class:"grid gap-1.5"},w_={class:"grid gap-1.5"},k_={key:0,class:"font-medium"},T_={class:"text-muted-foreground"},S_={key:0,class:"text-foreground font-mono font-medium tabular-nums"},Ha=zt({__name:"ChartTooltipContent",props:{hideLabel:{type:Boolean},hideIndicator:{type:Boolean},indicator:{default:"dot"},nameKey:{},labelKey:{},labelFormatter:{},payload:{default:()=>({})},config:{default:()=>({})},class:{},color:{},x:{}},setup(t){const e=t,n=ut(()=>Object.entries(e.payload).map(([o,s])=>{var c;const a=e.config[o],l=((c=e.config[o])==null?void 0:c.color)??e.payload.fill;return{key:o,value:s,itemConfig:a,indicatorColor:l}}).filter(o=>o.itemConfig)),i=ut(()=>Object.keys(e.payload).length===1&&e.indicator!=="dot"),r=ut(()=>{var o;return e.hideLabel?null:e.labelFormatter&&e.x!==void 0?e.labelFormatter(e.x):e.labelKey?((o=e.config[e.labelKey])==null?void 0:o.label)||e.payload[e.labelKey]:e.x});return(o,s)=>(L(),I("div",{class:un(w(hn)("border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs/relaxed shadow-xl grid min-w-32 items-start",e.class))},[Ui(o.$slots,"default",{},()=>[!i.value&&r.value?(L(),I("div",x_,N(r.value),1)):gt("",!0),Y("div",b_,[(L(!0),I(Kt,null,Pe(n.value,({value:a,itemConfig:l,indicatorColor:c,key:u})=>(L(),I("div",{key:u,class:un(w(hn)("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",o.indicator==="dot"&&"items-center"))},[l!=null&&l.icon?(L(),ce(eu(l.icon),{key:0})):o.hideIndicator?gt("",!0):(L(),I("div",{key:1,class:un(w(hn)("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":o.indicator==="dot","w-1":o.indicator==="line","w-0 border-[1.5px] border-dashed bg-transparent":o.indicator==="dashed","my-0.5":i.value&&o.indicator==="dashed"})),style:pi({"--color-bg":c,"--color-border":c})},null,6)),Y("div",{class:un(w(hn)("flex flex-1 justify-between leading-none",i.value?"items-end":"items-center"))},[Y("div",w_,[i.value?(L(),I("div",k_,N(r.value),1)):gt("",!0),Y("span",T_,N((l==null?void 0:l.label)||a),1)]),a?(L(),I("span",S_,N(a.toLocaleString()),1)):gt("",!0)],2)],2))),128))])])],2))}}),Wa=new Map;function C_(t){return JSON.stringify(t,Object.keys(t).sort())}function Ua(t,e,n){if(!nu)return;const i=Xa();return(r,o)=>{const s="data"in r?r.data:r,a=`${i}-${C_(s)}`,l=Wa.get(a);if(l)return l;const c=iu(e,{...n,payload:s,config:t,x:o}),u=document.createElement("div");return ru(c,u),Wa.set(a,u.innerHTML),u.innerHTML}}const M_={light:"",dark:".dark"},[A_,$_]=ou("Chart"),D_={class:"space-y-6"},E_={class:"flex items-center justify-between gap-4"},R_={class:"text-2xl font-bold"},O_={class:"text-muted-foreground text-sm"},N_={key:0,class:"flex items-center gap-3 shrink-0"},F_={class:"inline-flex h-8 rounded-md bg-muted p-0.5"},L_={key:0,class:"flex flex-col items-center justify-center py-24 text-center"},z_={class:"text-lg font-medium text-muted-foreground"},P_={class:"text-sm text-muted-foreground/70 mt-1"},B_={key:1,class:"grid gap-6 lg:grid-cols-[3fr_2fr]"},I_={class:"grid flex-1 gap-1"},H_={key:0,class:"text-muted-foreground py-16 text-center"},W_={key:1,class:"text-muted-foreground py-16 text-center"},U_={key:0,class:"overflow-hidden rounded-lg border bg-card"},Y_={class:"flex items-center justify-between border-b px-4 py-3"},V_={class:"flex items-center gap-2"},X_={class:"font-medium text-sm"},G_={class:"text-muted-foreground text-xs"},q_={class:"px-4 py-3 overflow-y-auto max-h-[380px]"},j_={class:"relative"},Z_={key:0,class:"absolute top-8 bottom-0 left-[15px] w-px bg-border"},Q_={class:"relative z-10 shrink-0"},K_={class:"min-w-0 flex-1 pt-0.5"},J_={class:"text-sm leading-relaxed"},ty=["onClick"],ey={key:1,class:"font-medium"},ny={class:"text-muted-foreground"},iy={class:"font-medium"},ry={class:"text-muted-foreground"},oy=["href"],sy={key:3,class:"font-medium"},ay={class:"mt-1 flex items-center gap-2"},ly={class:"text-muted-foreground text-xs"},cy={key:2,class:"grid gap-6 md:grid-cols-2"},uy={key:0,class:"text-muted-foreground py-8 text-center"},hy={key:1,class:"space-y-3"},fy={class:"flex items-center gap-2 w-24 shrink-0"},dy=["onClick"],py={key:1,class:"text-xs truncate"},gy={class:"flex-1 flex items-center gap-2 min-w-0"},vy={class:"flex-1 h-6 rounded bg-muted overflow-hidden min-w-0"},my={class:"text-xs text-muted-foreground w-10 text-right shrink-0"},_y={key:0,class:"text-muted-foreground py-8 text-center"},yy={class:"flex flex-wrap justify-center gap-x-4 gap-y-1.5"},xy={class:"text-muted-foreground"},by={key:0,class:"py-8 text-center text-muted-foreground"},wy={key:1,class:"py-8 text-center text-muted-foreground"},ky={key:2,class:"flex items-center gap-4"},Ty={class:"space-y-1"},Sy={class:"text-lg font-medium"},Cy={class:"text-muted-foreground text-sm"},My={class:"text-muted-foreground text-xs"},Ay={key:0},$y=`
<linearGradient id="fillFileCount" x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stop-color="var(--color-fileCount)" stop-opacity="0.8" />
<stop offset="95%" stop-color="var(--color-fileCount)" stop-opacity="0.1" />
</linearGradient>
<linearGradient id="fillTotalSizeMB" x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stop-color="var(--color-totalSizeMB)" stop-opacity="0.8" />
<stop offset="95%" stop-color="var(--color-totalSizeMB)" stop-opacity="0.1" />
</linearGradient>
`,Hy=zt({__name:"index",setup(t){const{t:e}=su(),{dialogOpen:n,broadcastTitle:i,broadcastMsg:r,sending:o,sendBroadcast:s}=fu();function a(){const D=f.value.flatMap(R=>R.items.map(k=>`${k.userName} ${e("statistics.uploaded")} ${k.fileCount} ${e("statistics.uploadedTo")} ${k.target}`));r.value=D.join(`
`),n.value=!0}const{selectedId:l}=hu(),c=vt([]),u=vt([]),h=vt([]),f=vt([]),d=vt(!1),g=vt(30),p=[{label:()=>e("statistics.1d"),value:1},{label:()=>e("statistics.7d"),value:7},{label:()=>e("statistics.30d"),value:30},{label:()=>e("statistics.180d"),value:180},{label:()=>e("statistics.365d"),value:365}];async function v(){var D,R,k,H;if(l.value){d.value=!0;try{const G=g.value,[et,ft,W,ot]=await Promise.all([Wn.daily(l.value,G),Wn.upload(l.value,G),Wn.fileTypes(l.value,G),Wn.recentUploads(l.value,G)]);c.value=((D=et.data)==null?void 0:D.data)||[],u.value=((R=ft.data)==null?void 0:R.data)||[],h.value=((k=W.data)==null?void 0:k.data)||[],f.value=((H=ot.data)==null?void 0:H.data)||[]}catch{c.value=[],u.value=[],h.value=[]}finally{d.value=!1}}}St(l,v),St(g,v),v();const m=ut(()=>{const D=g.value,R=new Date,k=new Date(R);k.setDate(k.getDate()-D);const H=new Map;for(const et of c.value)H.set(et.date,et);const G=[];for(let et=0;et<=D;et++){const ft=new Date(k);ft.setDate(ft.getDate()+et);const W=ft.toISOString().slice(0,10),ot=H.get(W);G.push({date:ft,fileCount:(ot==null?void 0:ot.file_count)??0,totalSizeMB:Math.round(((ot==null?void 0:ot.total_size)??0)/1024/1024*100)/100})}return G}),_={fileCount:{label:e("statistics.fileCount"),color:"hsl(var(--chart-1))"},totalSizeMB:{label:e("statistics.totalSizeMB"),color:"hsl(var(--chart-2))"}},y=ut(()=>{if(!m.value.length)return 10;const D=Math.max(...m.value.map(R=>Math.max(R.fileCount,R.totalSizeMB)));return Math.max(Math.ceil(D*1.2),10)}),b=ut(()=>m.value.some(D=>D.fileCount>0||D.totalSizeMB>0));function T(D){let R=0;for(let H=0;H<D.length;H++)R=D.charCodeAt(H)+((R<<5)-R);return`hsl(${(R%360+360)%360}, 65%, 50%)`}const x=ut(()=>[...u.value].sort((D,R)=>R.fileCount-D.fileCount).map((D,R)=>({index:R,name:D.uploaderName,uploaderId:D.uploader,count:D.fileCount,fill:T(D.uploaderName)}))),S=ut(()=>x.value.length?Math.max(...x.value.map(D=>D.count)):0),F={image:"hsl(220, 70%, 55%)",video:"hsl(160, 60%, 45%)",audio:"hsl(40, 80%, 50%)",pdf:"hsl(340, 65%, 50%)",doc:"hsl(260, 55%, 55%)",xls:"hsl(210, 70%, 50%)",ppt:"hsl(280, 60%, 55%)",archive:"hsl(30, 80%, 55%)",text:"hsl(150, 50%, 45%)",other:"hsl(0, 0%, 60%)"},z=ut(()=>h.value.map(D=>({type:D.type,fileCount:D.file_count,fill:F[D.type]||F.other}))),O=ut(()=>{const D={fileCount:{label:e("statistics.fileCount"),color:""}};for(const R of h.value)D[R.type]={label:e(`statistics.type.${R.type}`,R.type),color:F[R.type]||F.other};return D});function V(D){if(D===0)return"0 B";const R=["B","KB","MB","GB","TB"],k=Math.floor(Math.log(D)/Math.log(1024));return(D/Math.pow(1024,k)).toFixed(1)+" "+R[k]}const M=ut(()=>{const D=c.value.reduce((k,H)=>k+H.file_count,0),R=c.value.reduce((k,H)=>k+H.total_size,0);return{totalFiles:D,totalSize:R}}),A=ut(()=>c.value.length>0||u.value.length>0||h.value.length>0);function B(D){const R=new Date;R.setHours(0,0,0,0);const k=new Date(D+"T00:00:00"),H=Math.floor((R.getTime()-k.getTime())/864e5);return H===0?"今天":H===1?"昨天":`${H}天前`}const nt=vt(!1),pt=vt(!1),it=vt(null);async function yt(D){var R;if(D){nt.value=!0,pt.value=!0;try{const k=await uu.list(),H=Array.isArray(k.data)?k.data:((R=k.data)==null?void 0:R.data)||[];it.value=H.find(G=>String(G.id)===String(D))||null}catch{it.value=null}finally{pt.value=!1}}}function Tt(D,R,k){if(R==null)return"";const H={type:"openTab",data:{tabType:D,id:R,name:k,libraryId:l.value}},G=JSON.stringify(H);return`mira://?json=${btoa(unescape(encodeURIComponent(G)))}`}return(D,R)=>(L(),I("div",D_,[Y("div",E_,[Y("div",null,[Y("h1",R_,N(w(e)("statistics.title")),1),Y("p",O_,N(w(e)("statistics.subtitle")),1)]),w(l)?(L(),I("div",N_,[Y("div",F_,[(L(),I(Kt,null,Pe(p,k=>P(w(In),{key:k.value,variant:g.value===k.value?"outline":"ghost",size:"sm",class:"h-7 rounded-sm px-2.5 text-xs data-[variant=outline]:bg-background data-[variant=outline]:shadow-sm",onClick:H=>g.value=k.value},{default:U(()=>[lt(N(k.label()),1)]),_:2},1032,["variant","onClick"])),64))]),A.value?(L(),I(Kt,{key:0},[P(w(cr),{variant:"secondary"},{default:U(()=>[lt(N(w(e)("statistics.fileCount"))+": "+N(M.value.totalFiles),1)]),_:1}),P(w(cr),{variant:"secondary"},{default:U(()=>[lt(N(w(e)("statistics.totalSize"))+": "+N(V(M.value.totalSize)),1)]),_:1})],64)):gt("",!0)])):gt("",!0)]),w(l)&&!d.value&&!A.value?(L(),I("div",L_,[R[6]||(R[6]=Y("div",{class:"rounded-full bg-muted p-4 mb-4"},[Y("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-8 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5"},[Y("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"})])],-1)),Y("p",z_,N(w(e)("statistics.noData")),1),Y("p",P_,N(w(e)("statistics.noDataHint")),1)])):gt("",!0),w(l)&&A.value?(L(),I("div",B_,[P(w(Bn),{class:"pt-0"},{default:U(()=>[P(w(hr),{class:"flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row"},{default:U(()=>[Y("div",I_,[P(w(fr),null,{default:U(()=>[lt(N(w(e)("statistics.trend")),1)]),_:1}),P(w(dr),null,{default:U(()=>[lt(N(w(e)("statistics.trendDesc")),1)]),_:1})])]),_:1}),P(w(Hn),{class:"px-2 pt-4 sm:px-6 sm:pt-6 pb-4"},{default:U(()=>[d.value?(L(),I("div",H_,N(w(e)("common.loading")),1)):b.value?(L(),ce(w(Ia),{key:2,config:_,class:"aspect-auto h-[300px] w-full",cursor:!1},{default:U(()=>[P(w(m_),{data:m.value,"svg-defs":$y,margin:{left:10},"y-domain":[0,y.value]},{default:U(()=>[P(w(a_),{x:k=>k.date.getTime(),y:[k=>k.fileCount,k=>k.totalSizeMB],color:(k,H)=>["url(#fillFileCount)","url(#fillTotalSizeMB)"][H],opacity:.6},null,8,["x","y","color"]),P(w(p_),{x:k=>k.date.getTime(),y:[k=>k.fileCount,k=>k.totalSizeMB],color:(k,H)=>[_.fileCount.color,_.totalSizeMB.color][H],"line-width":1.5},null,8,["x","y","color"]),P(w(Pa),{type:"x",x:k=>k.date.getTime(),"tick-line":!1,"domain-line":!1,"grid-line":!1,"num-ticks":6,"tick-format":k=>new Date(k).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})},null,8,["x","tick-format"]),P(w(Pa),{type:"y","num-ticks":4,"tick-line":!1,"domain-line":!1}),P(w(Ba)),P(w(u_),{template:w(Ua)(_,w(Ha),{labelFormatter:k=>new Date(k).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}),color:(k,H)=>[_.fileCount.color,_.totalSizeMB.color][H%2]},null,8,["template","color"])]),_:1},8,["data","y-domain"])]),_:1})):(L(),I("div",W_,N(w(e)("common.noData")),1))]),_:1})]),_:1}),f.value.length?(L(),I("div",U_,[Y("div",Y_,[Y("div",V_,[Y("span",X_,N(w(e)("statistics.recentUploads")),1),Y("span",G_,N(f.value.reduce((k,H)=>k+H.items.length,0))+" events",1)]),P(w(In),{variant:"ghost",size:"sm",class:"h-7 px-2 text-xs",onClick:a},{default:U(()=>[P(w(pu),{class:"mr-1 size-3.5"}),lt(" "+N(w(e)("device.broadcast")),1)]),_:1})]),Y("div",q_,[Y("div",j_,[(L(!0),I(Kt,null,Pe(f.value,(k,H)=>(L(),I(Kt,{key:k.date},[(L(!0),I(Kt,null,Pe(k.items,(G,et)=>(L(),I("div",{key:H+"-"+et,class:"relative flex gap-3 pb-6 last:pb-0"},[et<k.items.length-1||H<f.value.length-1?(L(),I("div",Z_)):gt("",!0),Y("div",Q_,[P(w(gr),{class:"size-8 ring-2 ring-card"},{default:U(()=>[G.uploader?(L(),ce(w(as),{key:0,src:`/api/user/avatar/${G.uploader}`},null,8,["src"])):gt("",!0),P(w(pr),{class:"text-[11px]"},{default:U(()=>{var ft;return[lt(N((ft=G.userName)==null?void 0:ft.slice(0,2).toUpperCase()),1)]}),_:2},1024)]),_:2},1024)]),Y("div",K_,[Y("p",J_,[G.uploader?(L(),I("a",{key:0,class:"cursor-pointer font-medium hover:underline",onClick:au(ft=>yt(G.uploader),["prevent"])},N(G.userName),9,ty)):(L(),I("span",ey,N(G.userName),1)),Y("span",ny,N(w(e)("statistics.uploaded")),1),Y("span",iy,N(G.fileCount),1),Y("span",ry,N(w(e)("statistics.uploadedTo")),1),G.targetId!=null?(L(),I("a",{key:2,href:Tt(G.targetType,G.targetId,G.target),class:"font-medium text-primary hover:underline"},N(G.target),9,oy)):(L(),I("span",sy,N(G.target),1))]),Y("div",ay,[Y("span",ly,N(B(k.date)),1),G.targetType?(L(),ce(w(cr),{key:0,variant:"secondary",class:"h-5 text-[10px]"},{default:U(()=>[lt(N(G.targetType),1)]),_:2},1024)):gt("",!0)])])]))),128))],64))),128))])])])):gt("",!0)])):gt("",!0),w(l)&&A.value?(L(),I("div",cy,[P(w(Bn),null,{default:U(()=>[P(w(hr),null,{default:U(()=>[P(w(fr),null,{default:U(()=>[lt(N(w(e)("statistics.uploaderRank")),1)]),_:1}),P(w(dr),null,{default:U(()=>[lt(N(w(e)("statistics.uploaderRankDesc")),1)]),_:1})]),_:1}),P(w(Hn),null,{default:U(()=>[x.value.length?(L(),I("div",hy,[(L(!0),I(Kt,null,Pe(x.value,k=>(L(),I("div",{key:k.index,class:"flex items-center gap-3"},[Y("div",fy,[P(w(gr),{class:"size-6"},{default:U(()=>[k.uploaderId?(L(),ce(w(as),{key:0,src:`/api/user/avatar/${k.uploaderId}`},null,8,["src"])):gt("",!0),P(w(pr),{class:"text-[9px]"},{default:U(()=>{var H;return[lt(N((H=k.name)==null?void 0:H.slice(0,1).toUpperCase()),1)]}),_:2},1024)]),_:2},1024),k.uploaderId?(L(),I("span",{key:0,class:"text-xs truncate cursor-pointer hover:underline",onClick:H=>yt(k.uploaderId)},N(k.name),9,dy)):(L(),I("span",py,N(k.name),1))]),Y("div",gy,[Y("div",vy,[Y("div",{class:"h-full rounded transition-all duration-500",style:pi({width:S.value?k.count/S.value*100+"%":"0%",backgroundColor:k.fill})},null,4)]),Y("span",my,N(k.count),1)])]))),128))])):(L(),I("div",uy,N(w(e)("common.noData")),1))]),_:1})]),_:1}),P(w(Bn),{class:"flex flex-col"},{default:U(()=>[P(w(hr),{class:"items-center pb-0"},{default:U(()=>[P(w(fr),null,{default:U(()=>[lt(N(w(e)("statistics.fileTypeDist")),1)]),_:1}),P(w(dr),null,{default:U(()=>[lt(N(w(e)("statistics.fileTypeDistDesc")),1)]),_:1})]),_:1}),P(w(Hn),{class:"flex-1 pb-0 flex flex-col items-center gap-4"},{default:U(()=>[z.value.length?(L(),I(Kt,{key:1},[P(w(Ia),{config:O.value,class:"mx-auto aspect-square max-h-[220px]"},{default:U(()=>[P(w(g_),{data:z.value,margin:{top:10,bottom:10}},{default:U(()=>[P(w(f_),{value:k=>k.fileCount,color:k=>F[k.type]||F.other,"arc-width":40},null,8,["value","color"]),P(w(Ba),{triggers:{[w(lr).selectors.segment]:w(Ua)(O.value,w(Ha),{hideLabel:!0})}},null,8,["triggers"])]),_:1},8,["data"])]),_:1},8,["config"]),Y("div",yy,[(L(!0),I(Kt,null,Pe(z.value,k=>(L(),I("div",{key:k.type,class:"flex items-center gap-1.5 text-xs"},[Y("span",{class:"inline-block size-2.5 rounded-full",style:pi({backgroundColor:F[k.type]||F.other})},null,4),Y("span",null,N(w(e)(`statistics.type.${k.type}`,k.type)),1),Y("span",xy,N(k.fileCount),1)]))),128))])],64)):(L(),I("div",_y,N(w(e)("common.noData")),1))]),_:1})]),_:1})])):gt("",!0),P(w(ns),{open:nt.value,"onUpdate:open":R[0]||(R[0]=k=>nt.value=k)},{default:U(()=>[P(w(is),{class:"sm:max-w-md"},{default:U(()=>{var k;return[P(w(rs),null,{default:U(()=>[P(w(os),null,{default:U(()=>[lt(N(w(e)("statistics.userInfo")),1)]),_:1}),P(w(ss))]),_:1}),pt.value?(L(),I("div",by,N(w(e)("common.loading")),1)):it.value?(L(),I("div",ky,[P(w(gr),{class:"h-14 w-14"},{default:U(()=>[P(w(pr),{class:"text-lg"},{default:U(()=>[lt(N(it.value.username.slice(0,2).toUpperCase()),1)]),_:1})]),_:1}),Y("div",Ty,[Y("div",Sy,N(it.value.username),1),Y("div",Cy,N(it.value.email),1),Y("div",My,[lt(N(w(e)("statistics.role"))+": "+N(it.value.role)+" ",1),it.value.createdAt?(L(),I("span",Ay," · "+N(w(e)("statistics.joinedAt"))+": "+N((k=it.value.createdAt)==null?void 0:k.slice(0,10)),1)):gt("",!0)])])])):(L(),I("div",wy,N(w(e)("common.noData")),1))]}),_:1})]),_:1},8,["open"]),P(w(ns),{open:w(n),"onUpdate:open":R[5]||(R[5]=k=>ur(n)?n.value=k:null)},{default:U(()=>[P(w(is),{class:"sm:max-w-md"},{default:U(()=>[P(w(rs),null,{default:U(()=>[P(w(os),null,{default:U(()=>[lt(N(w(e)("device.broadcastTitle")),1)]),_:1}),P(w(ss),null,{default:U(()=>[lt(N(w(e)("device.broadcastTo"))+": "+N(w(e)("device.allDevices")),1)]),_:1})]),_:1}),P(w(lu),{modelValue:w(i),"onUpdate:modelValue":R[1]||(R[1]=k=>ur(i)?i.value=k:null),placeholder:w(e)("device.broadcastTitlePlaceholder")},null,8,["modelValue","placeholder"]),P(w(du),{modelValue:w(r),"onUpdate:modelValue":R[2]||(R[2]=k=>ur(r)?r.value=k:null),placeholder:w(e)("device.broadcastPlaceholder"),rows:"4"},null,8,["modelValue","placeholder"]),P(w(cu),null,{default:U(()=>[P(w(In),{variant:"outline",onClick:R[3]||(R[3]=k=>n.value=!1)},{default:U(()=>[lt(N(w(e)("common.cancel")),1)]),_:1}),P(w(In),{disabled:w(o)||!w(r).trim(),onClick:R[4]||(R[4]=k=>w(s)())},{default:U(()=>[w(o)?(L(),ce(w(gu),{key:0,class:"mr-2 size-4 animate-spin"})):gt("",!0),lt(" "+N(w(e)("device.send")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),w(l)?gt("",!0):(L(),ce(w(Bn),{key:3},{default:U(()=>[P(w(Hn),{class:"text-muted-foreground py-16 text-center"},{default:U(()=>[lt(N(w(e)("statistics.selectLibrary")),1)]),_:1})]),_:1}))]))}});export{Hy as default};