PageSourceSearch

https://stuudioyksus.fit/assets/index-B8Gfr8_T.js

js stuudioyksus.fit collected 2026-10-10 00:32:48 UTC 561,806 bytes, 88 lines download raw bytes

1import{c as Ue,r as Et,a as Ke,b as ya,g as Se,d as _,e as me,R as $,f as z1,h as V1,u as X1,i as pe,s as ie,j as o,k as Y1,A as Z1,l as J1,m as Q1,S as ew,n as tw,o as rw,p as nw,q as aw,t as iw,v as sw,w as ow,x as lw,y as or,z as cw,B as uw,C as dw,D as fw,E as pw,F as hw,G as mw,H as gw,I as vw,J as yw}from"./index-C8se2Tj_.js";import{r as xw}from"./password-reset.functions-DmOcsyfS.js";import{u as bw,T as Hx,A as ww,C as jw}from"./admin-i18n-KhwRkGFe.js";const kw=Ue({method:"POST"}).middleware([Et]).handler(Ke("6078738dbfc1d438ce62f9a771526d8970d63bb98cbe5f22396ba1cb19c0dc35")),_w=Ue({method:"GET"}).middleware([Et]).handler(Ke("bbb8c72297a1d1d5b5f4dff8de06a0e6e1b987227a0192dc40983327f254098c")),Sw=Ue({method:"POST"}).middleware([Et]).handler(Ke("4516e95dac22bed93e352c222abd08747f25b2918e510572971206a154c9f082")),Ow=Ue({method:"POST"}).middleware([Et]).handler(Ke("f83e6998c5eeffbd4c837e910185ede1e752a3a53b8a5e136c9d1e669eac1096")),Aw=Ue({method:"POST"}).handler(Ke("d1a0ba56c5dfa38c1ff162d313cda0fd0a9a82a1daa14bcc14ff86728198c4a4")),Wx=Ue({method:"POST"}).handler(Ke("f37a019f614e57a2c7448021f98d7e6f7dc5ef43a866e1b812cf31e6ca71393a")),Nw=Ue({method:"POST"}).handler(Ke("0c9d91ec60a796a867df6bdd4cc9c3f0a96b7cb7c975dcd789f568f9a7aeedfb")),Ew=["ei","1x nädalas","2x nädalas","korrapääsmed","personaaltrenn"],Tw=["jah","ei"];function Gx(e,t){const[r,n,a]=e.split("-").map(Number),i=new Date(Date.UTC(r,n-1+t,1)),s=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth()+1,0)).getUTCDate();return i.setUTCDate(Math.min(a,s)),i.toISOString().slice(0,10)}function Pw(e=new Date){return new Intl.DateTimeFormat("en-CA",{timeZone:"Europe/Tallinn"}).format(e)}function Cw(e,t,r=new Date){return Pw(r)>=Gx(e,t)}const Mw=new Set(["kalisteenika","kalisteenika-hiline","alfa-kolmik","laste-kalisteenika","algajate-kalisteenika"]);function Su(e){return e.event_type_slug?Mw.has(e.event_type_slug):e.trainer_name==="Erik"}const Iw=900*1e3;function Rw(e){if(e.booking_start){const a=Date.parse(e.booking_start);if(Number.isFinite(a))return a}if(!e.booking_date||!e.booking_time)return null;const t=Date.parse(`${e.booking_date}T${e.booking_time}:00Z`);if(!Number.isFinite(t))return null;const r={};for(const a of new Intl.DateTimeFormat("en-US",{timeZone:"Europe/Tallinn",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).formatToParts(new Date(t)))a.type!=="literal"&&(r[a.type]=a.value);const n=Date.UTC(Number(r.year),Number(r.month)-1,Number(r.day),Number(r.hour==="24"?"00":r.hour),Number(r.minute));return t-(n-t)}function Qf(e){const t=Rw(e);return t==null?null:t-Iw}const Kd="Muu",Ni=["Googledas kalisteenika","Jälgib Instagrami","AI soovitas","Google maps","Facebook","Sotsiaalmeedia post","Sotsmeedia reklaam","Sõber kutsus/soovitas","Sõber teadis rääkida","Tik-tok","Plakat Arsenalis","Oli kunagi käinud","Naabruskonnas silma jäänud","Google reklaam","Nägi messil või üritusel","Üksust juba külastanud","Kinkekaart","Stebby","FB grupipostitus","Võõras reklaam tõi","Lapsevanem","Ise kutsusin",Kd],$w={"Sõber kutsus":"Sõber kutsus/soovitas","Sõber käis ja soovitas":"Sõber kutsus/soovitas"};function Hd(e){const t=new Set(Ni),r=[];for(const n of e??[]){const a=$w[n]??n;t.has(a)&&!r.includes(a)&&r.push(a)}return r}const Wd=["Mees","Naine"],Gd=["8-13","14-17","18-21","22-29","30-39","40-49","50-59","60+"];var vs,ep;function et(){if(ep)return vs;ep=1;var e=Array.isArray;return vs=e,vs}var ys,tp;function zx(){if(tp)return ys;tp=1;var e=typeof ya=="object"&&ya&&ya.Object===Object&&ya;return ys=e,ys}var xs,rp;function Tt(){if(rp)return xs;rp=1;var e=zx(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return xs=r,xs}var bs,np;function oa(){if(np)return bs;np=1;var e=Tt(),t=e.Symbol;return bs=t,bs}var ws,ap;function Dw(){if(ap)return ws;ap=1;var e=oa(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(s){var l=r.call(s,a),c=s[a];try{s[a]=void 0;var u=!0}catch{}var f=n.call(s);return u&&(l?s[a]=c:delete s[a]),f}return ws=i,ws}var js,ip;function Lw(){if(ip)return js;ip=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return js=r,js}var ks,sp;function Ut(){if(sp)return ks;sp=1;
vendor: 4,328 bytes, line 1
1var e=oa(),t=Dw(),r=Lw(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function s(l){return l==null?l===void 0?a:n:i&&i in Object(l)?t(l):r(l)}return ks=s,ks}var _s,op;function Kt(){if(op)return _s;op=1;function e(t){return t!=null&&typeof t=="object"}return _s=e,_s}var Ss,lp;function Qr(){if(lp)return Ss;lp=1;var e=Ut(),t=Kt(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Ss=n,Ss}var Os,cp;function zd(){if(cp)return Os;cp=1;var e=et(),t=Qr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(e(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return Os=a,Os}var As,up;function Yt(){if(up)return As;up=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return As=e,As}var Ns,dp;function Vd(){if(dp)return Ns;dp=1;var e=Ut(),t=Yt(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(l){if(!t(l))return!1;var c=e(l);return c==n||c==a||c==r||c==i}return Ns=s,Ns}var Es,fp;function qw(){if(fp)return Es;fp=1;var e=Tt(),t=e["__core-js_shared__"];return Es=t,Es}var Ts,pp;function Bw(){if(pp)return Ts;pp=1;var e=qw(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Ts=r,Ts}var Ps,hp;function Vx(){if(hp)return Ps;hp=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ps=r,Ps}var Cs,mp;function Fw(){if(mp)return Cs;mp=1;var e=Vd(),t=Bw(),r=Yt(),n=Vx(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,f=RegExp("^"+c.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(p){if(!r(p)||t(p))return!1;var m=e(p)?f:i;return m.test(n(p))}return Cs=d,Cs}var Ms,gp;function Uw(){if(gp)return Ms;gp=1;function e(t,r){return t?.[r]}return Ms=e,Ms}var Is,vp;function mr(){if(vp)return Is;vp=1;var e=Fw(),t=Uw();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return Is=r,Is}var Rs,yp;function Ei(){if(yp)return Rs;yp=1;var e=mr(),t=e(Object,"create");return Rs=t,Rs}var $s,xp;function Kw(){if(xp)return $s;xp=1;var e=Ei();function t(){this.__data__=e?e(null):{},this.size=0}return $s=t,$s}var Ds,bp;function Hw(){if(bp)return Ds;bp=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Ds=e,Ds}var Ls,wp;function Ww(){if(wp)return Ls;wp=1;var e=Ei(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(e){var l=s[i];return l===t?void 0:l}return n.call(s,i)?s[i]:void 0}return Ls=a,Ls}var qs,jp;function Gw(){if(jp)return qs;jp=1;var e=Ei(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return qs=n,qs}var Bs,kp;function zw(){if(kp)return Bs;kp=1;var e=Ei(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return Bs=r,Bs}var Fs,_p;function Vw(){if(_p)return Fs;_p=1;var e=Kw(),t=Hw(),r=Ww(),n=Gw(),a=zw();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Fs=i,Fs}var Us,Sp;function Xw(){if(Sp)return Us;Sp=1;function e(){this.__data__=[],this.size=0}return Us=e,Us}var Ks,Op;function Xd(){if(Op)return Ks;Op=1;function e(t,r){return t===r||t!==t&&r!==r}return Ks=e,Ks}var Hs,Ap;function Ti(){if(Ap)return Hs;Ap=1;var e=Xd();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return Hs=t,Hs}var Ws,Np;function Yw(){if(Np)return Ws;Np=1;var e=Ti(),t=Array.prototype,r=t.splice;function n(a){var i=this.__data__,s=e(i,a);if(s<0)return!1;var l=i.length-1;return s==l?i.pop():r.call(i,s,1),--this.size,!0}return Ws=n,Ws}var Gs,Ep;function Zw(){if(Ep)return Gs;Ep=1;var e=Ti();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return Gs=t,Gs}var zs,Tp;function Jw(){if(Tp)return zs;Tp=1;var e=Ti();function t(r){return e(this.__data__,r)>-1}
vendor: 12,226 bytes, line 1
1return zs=t,zs}var Vs,Pp;function Qw(){if(Pp)return Vs;Pp=1;var e=Ti();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Vs=t,Vs}var Xs,Cp;function Pi(){if(Cp)return Xs;Cp=1;var e=Xw(),t=Yw(),r=Zw(),n=Jw(),a=Qw();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Xs=i,Xs}var Ys,Mp;function Yd(){if(Mp)return Ys;Mp=1;var e=mr(),t=Tt(),r=e(t,"Map");return Ys=r,Ys}var Zs,Ip;function ej(){if(Ip)return Zs;Ip=1;var e=Vw(),t=Pi(),r=Yd();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Zs=n,Zs}var Js,Rp;function tj(){if(Rp)return Js;Rp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Js=e,Js}var Qs,$p;function Ci(){if($p)return Qs;$p=1;var e=tj();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Qs=t,Qs}var eo,Dp;function rj(){if(Dp)return eo;Dp=1;var e=Ci();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return eo=t,eo}var to,Lp;function nj(){if(Lp)return to;Lp=1;var e=Ci();function t(r){return e(this,r).get(r)}return to=t,to}var ro,qp;function aj(){if(qp)return ro;qp=1;var e=Ci();function t(r){return e(this,r).has(r)}return ro=t,ro}var no,Bp;function ij(){if(Bp)return no;Bp=1;var e=Ci();function t(r,n){var a=e(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return no=t,no}var ao,Fp;function Zd(){if(Fp)return ao;Fp=1;var e=ej(),t=rj(),r=nj(),n=aj(),a=ij();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,ao=i,ao}var io,Up;function Xx(){if(Up)return io;Up=1;var e=Zd(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var s=arguments,l=a?a.apply(this,s):s[0],c=i.cache;if(c.has(l))return c.get(l);var u=n.apply(this,s);return i.cache=c.set(l,u)||c,u};return i.cache=new(r.Cache||e),i}return r.Cache=e,io=r,io}var so,Kp;function sj(){if(Kp)return so;Kp=1;var e=Xx(),t=500;function r(n){var a=e(n,function(s){return i.size===t&&i.clear(),s}),i=a.cache;return a}return so=r,so}var oo,Hp;function oj(){if(Hp)return oo;Hp=1;var e=sj(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(s,l,c,u){i.push(c?u.replace(r,"$1"):l||s)}),i});return oo=n,oo}var lo,Wp;function Jd(){if(Wp)return lo;Wp=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++n<a;)i[n]=r(t[n],n,t);return i}return lo=e,lo}var co,Gp;function lj(){if(Gp)return co;Gp=1;var e=oa(),t=Jd(),r=et(),n=Qr(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function s(l){if(typeof l=="string")return l;if(r(l))return t(l,s)+"";if(n(l))return i?i.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return co=s,co}var uo,zp;function Yx(){if(zp)return uo;zp=1;var e=lj();function t(r){return r==null?"":e(r)}return uo=t,uo}var fo,Vp;function Zx(){if(Vp)return fo;Vp=1;var e=et(),t=zd(),r=oj(),n=Yx();function a(i,s){return e(i)?i:t(i,s)?[i]:r(n(i))}return fo=a,fo}var po,Xp;function Mi(){if(Xp)return po;Xp=1;var e=Qr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return po=t,po}var ho,Yp;function Qd(){if(Yp)return ho;Yp=1;var e=Zx(),t=Mi();function r(n,a){a=e(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[t(a[i++])];return i&&i==s?n:void 0}return ho=r,ho}var mo,Zp;function Jx(){if(Zp)return mo;Zp=1;var e=Qd();function t(r,n,a){var i=r==null?void 0:e(r,n);return i===void 0?a:i}return mo=t,mo}var cj=Jx();const wt=Se(cj);var go,Jp;function uj(){if(Jp)return go;Jp=1;function e(t){return t==null}return go=e,go}var dj=uj();const he=Se(dj);var vo,Qp;function fj(){if(Qp)return vo;Qp=1;var e=Ut(),t=et(),r=Kt(),n="[object String]";function a(i){return typeof i=="string"||!t(i)&&r(i)&&e(i)==n}return vo=a,vo}var pj=fj();const la=Se(pj);var hj=Vd();const de=Se(hj);var mj=Yt();const en=Se(mj);var yo={exports:{}},xe={};var eh;function gj(){if(eh)return xe;eh=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function y(h){if(typeof h=="object"&&h!==null){var w=h.$$typeof;switch(w){case e:switch(h=h.type,h){case r:case a:case n:case u:case f:return h;default:switch(h=h&&h.$$typeof,h){case l:case s:case c:case p:case d:case i:return h;default:return w}}case t:return w}}}return xe.ContextConsumer=s,xe.ContextProvider=i,xe.Element=e,xe.ForwardRef=c,xe.Fragment=r,xe.Lazy=p,xe.Memo=d,xe.Portal=t,xe.Profiler=a,xe.StrictMode=n,xe.Suspense=u,xe.SuspenseList=f,xe.isAsyncMode=function(){return!1},xe.isConcurrentMode=function(){return!1},xe.isContextConsumer=function(h){return y(h)===s},xe.isContextProvider=function(h){return y(h)===i},xe.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===e},xe.isForwardRef=function(h){return y(h)===c},xe.isFragment=function(h){return y(h)===r},xe.isLazy=function(h){return y(h)===p},xe.isMemo=function(h){return y(h)===d},xe.isPortal=function(h){return y(h)===t},xe.isProfiler=function(h){return y(h)===a},xe.isStrictMode=function(h){return y(h)===n},xe.isSuspense=function(h){return y(h)===u},xe.isSuspenseList=function(h){return y(h)===f},xe.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===r||h===a||h===n||h===u||h===f||h===m||typeof h=="object"&&h!==null&&(h.$$typeof===p||h.$$typeof===d||h.$$typeof===i||h.$$typeof===s||h.$$typeof===c||h.$$typeof===v||h.getModuleId!==void 0)},xe.typeOf=y,xe}var th;function vj(){return th||(th=1,yo.exports=gj()),yo.exports}var yj=vj(),xo,rh;function Qx(){if(rh)return xo;rh=1;var e=Ut(),t=Kt(),r="[object Number]";function n(a){return typeof a=="number"||t(a)&&e(a)==r}return xo=n,xo}var bo,nh;function xj(){if(nh)return bo;nh=1;var e=Qx();function t(r){return e(r)&&r!=+r}return bo=t,bo}var bj=xj();const ca=Se(bj);var wj=Qx();const jj=Se(wj);var pt=function(t){return t===0?0:t>0?1:-1},lr=function(t){return la(t)&&t.indexOf("%")===t.length-1},Y=function(t){return jj(t)&&!ca(t)},Fe=function(t){return Y(t)||la(t)},kj=0,Ii=function(t){var r=++kj;return"".concat(t||"").concat(r)},Je=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Y(t)&&!la(t))return n;var i;if(lr(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return ca(i)&&(i=n),a&&i>r&&(i=r),i},jr=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},_j=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},ah=function(t,r){return Y(t)&&Y(r)?function(n){return t+n*(r-t)}:function(){return r}};function Ou(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):wt(n,t))===r})}function Au(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}var Sj=["viewBox","children"],Oj=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],ih=["points","pathLength"],wo={svg:Sj,polygon:ih,polyline:ih},ef=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
1ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Da=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(_.isValidElement(t)&&(n=t.props),!en(n))return null;var a={};return Object.keys(n).forEach(function(i){ef.includes(i)&&(a[i]=r||function(s){return n[i](n,s)})}),a},Aj=function(t,r,n){return function(a){return t(r,n,a),null}},Ri=function(t,r,n){if(!en(t)||Nu(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var s=t[i];ef.includes(i)&&typeof s=="function"&&(a||(a={}),a[i]=Aj(s,r,n))}),a},Nj=["children"],Ej=["children"];function sh(e,t){if(e==null)return{};var r=Tj(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tj(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var oh={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},$t=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},lh=null,jo=null,tf=function e(t){if(t===lh&&Array.isArray(jo))return jo;var r=[];return _.Children.forEach(t,function(n){he(n)||(yj.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),jo=r,lh=t,r};function St(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return $t(a)}):n=[$t(t)],tf(e).forEach(function(a){var i=wt(a,"type.displayName")||wt(a,"type.n
1ame");n.indexOf(i)!==-1&&r.push(a)}),r}function ut(e,t){var r=St(e,t);return r&&r[0]}var ch=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!Y(n)||n<=0||!Y(a)||a<=0)},Pj=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Cj=function(t){return t&&t.type&&la(t.type)&&Pj.indexOf(t.type)>=0},Mj=function(t,r,n,a){var i,s=(i=wo?.[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!de(t)&&(a&&s.includes(r)||Oj.includes(r))||n&&ef.includes(r)},le=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(_.isValidElement(t)&&(a=t.props),!en(a))return null;var i={};return Object.keys(a).forEach(function(s){var l;Mj((l=a)===null||l===void 0?void 0:l[s],s,r,n)&&(i[s]=a[s])}),i},Eu=function e(t,r){if(t===r)return!0;var n=_.Children.count(t);if(n!==_.Children.count(r))return!1;if(n===0)return!0;if(n===1)return uh(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],s=r[a];if(Array.isArray(i)||Array.isArray(s)){if(!e(i,s))return!1}else if(!uh(i,s))return!1}return!0},uh=function(t,r){if(he(t)&&he(r))return!0;if(!he(t)&&!he(r)){var n=t.props||{},a=n.children,i=sh(n,Nj),s=r.props||{},l=s.children,c=sh(s,Ej);return a&&l?Au(i,c)&&Eu(a,l):!a&&!l?Au(i,c):!1}return!1},dh=function(t,r){var n=[],a={};return tf(t).forEach(function(i,s){if(Cj(i))n.push(i);else if(i){var l=$t(i.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!a[l])){var d=u(i,l,s);n.push(d),a[l]=!0}}}),n},Ij=function(t){var r=t&&t.type;return r&&oh[r]?oh[r]:null},Rj=function(t,r){return tf(r).indexOf(t)},$j=["children","width","height","viewBox","className","style","title","desc"];function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tu.apply(this,arguments)}function Dj(e,t){if(e==null)return{};var r=Lj(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lj(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pu(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,l=e.title,c=e.desc,u=Dj(e,$j),f=a||{width:r,height:n,x:0,y:0},d=me("recharts-surface",i);return $.createElement("svg",Tu({},le(u,!0,"svg"),{className:d,width:r,height:n,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),$.createElement("title",null,l),$.createElement("desc",null,c),t)}var qj=["children","className"];function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cu.apply(this,arguments)}function Bj(e,t){if(e==null)return{};var r=Fj(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fj(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Re=$.forwardRef(function(e,t){var r=e.children,n=e.className,a=Bj(e,qj),i=me("recharts-layer",n);return $.createElement("g",Cu({className:i},le(a,!0),{ref:t}),r)}),Dt=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]},ko,fh;function Uj(){if(fh)return ko;fh=1;function e(t,r,n){var a=-1,i=t.length;r<0&&(r=-r>i?0:i+r),n=n>i?i:n,n<0&&(n+=i),i=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(i);++a<i;)s[a]=t[a+r];return s}return ko=e,ko}var _o,ph;function Kj(){if(ph)return _o;ph=1;var e=Uj();function t(r,n,a){var i=r.length;return a=a===void 0?i:a,!n&&a>=i?r:e(r,n,a)}return _o=t,_o}var So,hh;function eb(){if(hh)return So;hh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",s="\\u200d",l=RegExp("["+s+e+a+i+"]");function c(u){return l.test(u)}return So=c,So}var Oo,mh;function Hj(){if(mh)return Oo;mh=1;function e(t){return t.split("")}return Oo=e,Oo}var Ao,gh;function Wj(){if(gh)return Ao;gh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",s="["+e+"]",l="["+a+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",f="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",m="\\u200d",v=u+"?",y="["+i+"]?",h="(?:"+m+"(?:"+[f,d,p].join("|")+")"+y+v+")*",w=y+v+h,j="(?:"+[f+l+"?",l,d,p,s].join("|")+")",x=RegExp(c+"(?="+c+")|"+j+w,"g");function k(g){return g.match(x)||[]}return Ao=k,Ao}var No,vh;function Gj(){if(vh)return No;vh=1;var e=Hj(),t=eb(),r=Wj();function n(a){return t(a)?r(a):e(a)}return No=n,No}var Eo,yh;function zj(){if(yh)return Eo;yh=1;var e=Kj(),t=eb(),r=Gj(),n=Yx();function a(i){return function(s){s=n(s);
vendor: 4,554 bytes, line 1
1var l=t(s)?r(s):void 0,c=l?l[0]:s.charAt(0),u=l?e(l,1).join(""):s.slice(1);return c[i]()+u}}return Eo=a,Eo}var To,xh;function Vj(){if(xh)return To;xh=1;var e=zj(),t=e("toUpperCase");return To=t,To}var Xj=Vj();const $i=Se(Xj);function Ae(e){return function(){return e}}const tb=Math.cos,La=Math.sin,jt=Math.sqrt,qa=Math.PI,Di=2*qa,Mu=Math.PI,Iu=2*Mu,ar=1e-6,Yj=Iu-ar;function rb(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Zj(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rb;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class Jj{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?rb:Zj(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=n-t,u=a-r,f=s-t,d=l-r,p=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>ar)if(!(Math.abs(d*c-u*f)>ar)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-s,v=a-l,y=c*c+u*u,h=m*m+v*v,w=Math.sqrt(y),j=Math.sqrt(p),x=i*Math.tan((Mu-Math.acos((y+p-h)/(2*w*j)))/2),k=x/j,g=x/w;Math.abs(k-1)>ar&&this._append`L${t+k*f},${r+k*d}`,this._append`A${i},${i},0,0,${+(d*m>f*v)},${this._x1=t+g*c},${this._y1=r+g*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,f=r+c,d=1^s,p=s?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>ar||Math.abs(this._y1-f)>ar)&&this._append`L${u},${f}`,n&&(p<0&&(p=p%Iu+Iu),p>Yj?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:p>ar&&this._append`A${n},${n},0,${+(p>=Mu)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function rf(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Jj(t)}function nf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nb(e){this._context=e}nb.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Li(e){return new nb(e)}function ab(e){return e[0]}function ib(e){return e[1]}function sb(e,t){var r=Ae(!0),n=null,a=Li,i=null,s=rf(l);e=typeof e=="function"?e:e===void 0?ab:Ae(e),t=typeof t=="function"?t:t===void 0?ib:Ae(t);function l(c){var u,f=(c=nf(c)).length,d,p=!1,m;for(n==null&&(i=a(m=s())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+e(d,u,c),+t(d,u,c));if(m)return i=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ae(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ae(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Ae(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function xa(e,t,r){var n=null,a=Ae(!0),i=null,s=Li,l=null,c=rf(u);e=typeof e=="function"?e:e===void 0?ab:Ae(+e),t=typeof t=="function"?t:Ae(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ib:Ae(+r);function u(d){var p,m,v,y=(d=nf(d)).length,h,w=!1,j,x=new Array(y),k=new Array(y);for(i==null&&(l=s(j=c())),p=0;p<=y;++p){if(!(p<y&&a(h=d[p],p,d))===w)if(w=!w)m=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=p-1;v>=m;--v)l.point(x[v],k[v]);l.lineEnd(),l.areaEnd()}w&&(x[p]=+e(h,p,d),k[p]=+t(h,p,d),l.point(n?+n(h,p,d):x[p],r?+r(h,p,d):k[p]))}if(j)return l=null,j+""||null}
1function f(){return sb().defined(a).curve(s).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Ae(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Ae(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Ae(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Ae(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Ae(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Ae(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:Ae(!!d),u):a},u.curve=function(d){return arguments.length?(s=d,i!=null&&(l=s(i)),u):s},u.context=function(d){return arguments.length?(d==null?i=l=null:l=s(i=d),u):i},u}class ob{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Qj(e){return new ob(e,!0)}function ek(e){return new ob(e,!1)}const af={draw(e,t){const r=jt(t/qa);e.moveTo(r,0),e.arc(0,0,r,0,Di)}},tk={draw(e,t){const r=jt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},lb=jt(1/3),rk=lb*2,nk={draw(e,t){const r=jt(t/rk),n=r*lb;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},ak={draw(e,t){const r=jt(t),n=-r/2;e.rect(n,n,r,r)}},ik=.8908130915292852,cb=La(qa/10)/La(7*qa/10),sk=La(Di/10)*cb,ok=-tb(Di/10)*cb,lk={draw(e,t){const r=jt(t*ik),n=sk*r,a=ok*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=Di*i/5,l=tb(s),c=La(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},Po=jt(3),ck={draw(e,t){const r=-jt(t/(Po*3));e.moveTo(0,r*2),e.lineTo(-Po*r,-r),e.lineTo(Po*r,-r),e.closePath()}},ot=-.5,lt=jt(3)/2,Ru=1/jt(12),uk=(Ru/2+1)*3,dk={draw(e,t){const r=jt(t/uk),n=r/2,a=r*Ru,i=n,s=r*Ru+r,l=-i,c=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(l,c),e.lineTo(ot*n-lt*a,lt*n+ot*a),e.lineTo(ot*i-lt*s,lt*i+ot*s),e.lineTo(ot*l-lt*c,lt*l+ot*c),e.lineTo(ot*n+lt*a,ot*a-lt*n),e.lineTo(ot*i+lt*s,ot*s-lt*i),e.lineTo(ot*l+lt*c,ot*c-lt*l),e.closePath()}};function fk(e,t){let r=null,n=rf(a);e=typeof e=="function"?e:Ae(e||af),t=typeof t=="function"?t:Ae(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Ae(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Ae(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Ba(){}function Fa(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ub(e){this._context=e}ub.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:Fa(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Fa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pk(e){return new ub(e)}function db(e){this._context=e}db.prototype={areaStart:Ba,areaEnd:Ba,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Fa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hk(e){return new db(e)}function fb(e){this._context=e}fb.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Fa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mk(e){return new fb(e)}function pb(e){this._context=e}pb.prototype={areaStart:Ba,areaEnd:Ba,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function gk(e){return new pb(e)}function bh(e){return e<0?-1:1}function wh(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),l=(i*a+s*n)/(n+a);return(bh(i)+bh(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function jh(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Co(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,s-l*r,i,s)}function Ua(e){this._context=e}Ua.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:Co(this,this._t0,jh(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Co(this,jh(this,r=wh(this,e,t)),r);break;default:Co(this,this._t0,r=wh(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function hb(e){this._context=new mb(e)}(hb.prototype=Object.create(Ua.prototype)).point=function(e,t){Ua.prototype.point.call(this,t,e)};function mb(e){this._context=e}mb.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function vk(e){return new Ua(e)}function yk(e){return new hb(e)}function gb(e){this._context=e}gb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=kh(e),a=kh(t),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function kh(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),s=new Array(r);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(a[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function xk(e){return new gb(e)}function qi(e,t){this._context=e,this._t=t}qi.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 18,959 bytes, lines 1-4
1default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function bk(e){return new qi(e,.5)}function wk(e){return new qi(e,0)}function jk(e){return new qi(e,1)}function Pr(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,l=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function $u(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function kk(e,t){return e[t]}function _k(e){const t=[];return t.key=e,t}function Sk(){var e=Ae([]),t=$u,r=Pr,n=kk;function a(i){var s=Array.from(e.apply(this,arguments),_k),l,c=s.length,u=-1,f;for(const d of i)for(l=0,++u;l<c;++l)(s[l][u]=[0,+n(d,s[l].key,u,i)]).data=d;for(l=0,f=nf(t(s));l<c;++l)s[f[l]].index=l;return r(s,f),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Ae(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:Ae(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?$u:typeof i=="function"?i:Ae(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??Pr,a):r},a}function Ok(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,s;a<i;++a){for(s=r=0;r<n;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<n;++r)e[r][a][1]/=s}Pr(e,t)}}function Ak(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var s=0,l=0;s<a;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}Pr(e,t)}}function Nk(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n<i;++n){for(var l=0,c=0,u=0;l<s;++l){for(var f=e[t[l]],d=f[n][1]||0,p=f[n-1][1]||0,m=(d-p)/2,v=0;v<l;++v){var y=e[t[v]],h=y[n][1]||0,w=y[n-1][1]||0;m+=h-w}c+=d,u+=m*d}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,Pr(e,t)}}function Nn(e){"@babel/helpers - typeof";return Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(e)}var Ek=["type","size","sizeType"];function Du(){return Du=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Du.apply(this,arguments)}function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_h(Object(r),!0).forEach(function(n){Tk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tk(e,t,r){return t=Pk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pk(e){var t=Ck(e,"string");return Nn(t)=="symbol"?t:t+""}function Ck(e,t){if(Nn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mk(e,t){if(e==null)return{};var r=Ik(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ik(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var vb={symbolCircle:af,symbolCross:tk,symbolDiamond:nk,symbolSquare:ak,symbolStar:lk,symbolTriangle:ck,symbolWye:dk},Rk=Math.PI/180,$k=function(t){var r="symbol".concat($i(t));return vb[r]||af},Dk=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Rk;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Lk=function(t,r){vb["symbol".concat($i(t))]=r},sf=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,l=s===void 0?"area":s,c=Mk(t,Ek),u=Sh(Sh({},c),{},{type:n,size:i,sizeType:l}),f=function(){var h=$k(n),w=fk().type(h).size(Dk(i,l,n));return w()},d=u.className,p=u.cx,m=u.cy,v=le(u,!0);return p===+p&&m===+m&&i===+i?$.createElement("path",Du({},v,{className:me("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(m,")"),d:f()})):null};sf.registerSymbol=Lk;function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function Lu(){return Lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lu.apply(this,arguments)}function Oh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oh(Object(r),!0).forEach(function(n){En(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xb(n.key),n)}}function Uk(e,t,r){return t&&Fk(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kk(e,t,r){return t=Ka(t),Hk(e,yb()?Reflect.construct(t,r||[],Ka(e).constructor):t.apply(e,r))}function Hk(e,t){if(t&&(Cr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wk(e)}function Wk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yb=function(){return!!e})()}function Ka(e){return Ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ka(e)}function Gk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qu(e,t)}function qu(e,t){return qu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},qu(e,t)}function En(e,t,r){return t=xb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xb(e){var t=zk(e,"string");return Cr(t)=="symbol"?t:t+""}function zk(e,t){if(Cr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ct=32,of=(function(e){function t(){return Bk(this,t),Kk(this,t,arguments)}return Gk(t,e),Uk(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=ct/2,s=ct/6,l=ct/3,c=n.inactive?a:n.color;if(n.type==="plainline")return $.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:ct,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return $.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
2            A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
3            H`).concat(ct,"M").concat(2*l,",").concat(i,`
4            A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return $.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ct/8,"h").concat(ct,"v").concat(ct*3/4,"h").concat(-ct,"z"),className:"recharts-legend-icon"});if($.isValidElement(n.legendIcon)){var u=qk({},n);return delete u.legendIcon,$.cloneElement(n.legendIcon,u)}return $.createElement(sf,{fill:c,cx:i,cy:i,size:ct,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,s=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,f={x:0,y:0,width:ct,height:ct},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(m,v){var y=m.formatter||c,h=me(En(En({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",m.inactive));if(m.type==="none")return null;var w=de(m.value)?null:m.value;Dt(!de(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var j=m.inactive?u:m.color;return $.createElement("li",Lu({className:h,style:d,key:"legend-item-".concat(v)},Ri(n.props,m,v)),$.createElement(Pu,{width:s,height:s,viewBox:f,style:p},n.renderIcon(m)),$.createElement("span",{className:"recharts-legend-item-text",style:{color:j}},y?y(w,m,v):w))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return $.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(_.PureComponent);En(of,"displayName","Legend");En(of,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Mo,Ah;function Vk(){if(Ah)return Mo;Ah=1;var e=Pi();function t(){this.__data__=new e,this.size=0}return Mo=t,Mo}var Io,Nh;function Xk(){if(Nh)return Io;Nh=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Io=e,Io}var Ro,Eh;function Yk(){if(Eh)return Ro;Eh=1;function e(t){return this.__data__.get(t)}return Ro=e,Ro}var $o,Th;function Zk(){if(Th)return $o;Th=1;function e(t){return this.__data__.has(t)}return $o=e,$o}var Do,Ph;function Jk(){if(Ph)return Do;Ph=1;var e=Pi(),t=Yd(),r=Zd(),n=200;function a(i,s){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<n-1)return c.push([i,s]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(i,s),this.size=l.size,this}return Do=a,Do}var Lo,Ch;function bb(){if(Ch)return Lo;Ch=1;var e=Pi(),t=Vk(),r=Xk(),n=Yk(),a=Zk(),i=Jk();function s(l){var c=this.__data__=new e(l);this.size=c.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,Lo=s,Lo}var qo,Mh;function Qk(){if(Mh)return qo;Mh=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return qo=t,qo}var Bo,Ih;function e_(){if(Ih)return Bo;Ih=1;function e(t){return this.__data__.has(t)}return Bo=e,Bo}var Fo,Rh;function wb(){if(Rh)return Fo;Rh=1;var e=Zd(),t=Qk(),r=e_();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new e;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Fo=n,Fo}var Uo,$h;function jb(){if($h)return Uo;$h=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(r(t[n],n,t))return!0;return!1}return Uo=e,Uo}var Ko,Dh;function kb(){if(Dh)return Ko;Dh=1;function e(t,r){return t.has(r)}return Ko=e,Ko}var Ho,Lh;function _b(){if(Lh)return Ho;Lh=1;var e=wb(),t=jb(),r=kb(),n=1,a=2;function i(s,l,c,u,f,d){var p=c&n,m=s.length,v=l.length;if(m!=v&&!(p&&v>m))return!1;var y=d.get(s),h=d.get(l);if(y&&h)return y==l&&h==s;var w=-1,j=!0,x=c&a?new e:void 0;for(d.set(s,l),d.set(l,s);++w<m;){var k=s[w],g=l[w];if(u)var b=p?u(g,k,w,l,s,d):u(k,g,w,s,l,d);if(b!==void 0){if(b)continue;j=!1;break}if(x){if(!t(l,function(S,O){if(!r(x,O)&&(k===S||f(k,S,c,u,d)))return x.push(O)})){j=!1;break}}else if(!(k===g||f(k,g,c,u,d))){j=!1;break}}return d.delete(s),d.delete(l),j}return Ho=i,Ho}var Wo,qh;function t_(){if(qh)return Wo;qh=1;var e=Tt(),t=e.Uint8Array;return Wo=t,Wo}var Go,Bh;function r_(){if(Bh)return Go;Bh=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,i){n[++r]=[i,a]}),n}return Go=e,Go}var zo,Fh;function lf(){if(Fh)return zo;Fh=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return zo=e,zo}var Vo,Uh;function n_(){if(Uh)return Vo;Uh=1;var e=oa(),t=t_(),r=Xd(),n=_b(),a=r_(),i=lf(),s=1,l=2,c="[object Boolean]",u="[object Date]",f="[object Error]",d="[object Map]",p="[object Number]",m="[object RegExp]",v="[object Set]",y="[object String]",h="[object Symbol]",w="[object ArrayBuffer]",j="[object DataView]",x=e?e.prototype:void 0,k=x?x.valueOf:void 0;function g(b,S,O,E,T,N,A){switch(O){case j:if(b.byteLength!=S.byteLength||b.byteOffset!=S.byteOffset)return!1;b=b.buffer,S=S.buffer;case w:return!(b.byteLength!=S.byteLength||!N(new t(b),new t(S)));case c:case u:case p:return r(+b,+S);case f:return b.name==S.name&&b.message==S.message;case m:case y:return b==S+"";case d:var C=a;case v:var I=E&s;if(C||(C=i),b.size!=S.size&&!I)return!1;var P=A.get(b);if(P)return P==S;E|=l,A.set(b,S);var L=n(C(b),C(S),E,T,N,A);return A.delete(b),L;case h:if(k)return k.call(b)==k.call(S)}return!1}return Vo=g,Vo}var Xo,Kh;function Sb(){if(Kh)return Xo;Kh=1;function e(t,r){for(var n=-1,a=r.length,i=t.length;++n<a;)t[i+n]=r[n];return t}return Xo=e,Xo}var Yo,Hh;function a_(){if(Hh)return Yo;Hh=1;var e=Sb(),t=et();function r(n,a,i){var s=a(n);return t(n)?s:e(s,i(n))}return Yo=r,Yo}var Zo,Wh;function i_(){if(Wh)return Zo;Wh=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=0,s=[];++n<a;){var l=t[n];r(l,n,t)&&(s[i++]=l)}return s}return Zo=e,Zo}var Jo,Gh;function s_(){if(Gh)return Jo;Gh=1;function e(){return[]}return Jo=e,Jo}var Qo,zh;function o_(){if(zh)return Qo;zh=1;var e=i_(),t=s_(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),e(a(s),function(l){return n.call(s,l)}))}:t;return Qo=i,Qo}var el,Vh;function l_(){if(Vh)return el;Vh=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return el=e,el}var tl,Xh;function c_(){if(Xh)return tl;Xh=1;var e=Ut(),t=Kt(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return tl=n,tl}var rl,Yh;function cf(){if(Yh)return rl;Yh=1;var e=c_(),t=Kt(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(s){return t(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return rl=i,rl}var xn={exports:{}},nl,Zh;function u_(){if(Zh)return nl;Zh=1;function e(){return!1}return nl=e,nl}xn.exports;var Jh;function Ob(){return Jh||(Jh=1,(function(e,t){var r=Tt(),n=u_(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(xn,xn.exports)),xn.exports}var al,Qh;function uf(){if(Qh)return al;Qh=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return al=r,al}var il,em;function df(){if(em)return il;em=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return il=t,il}var sl,tm;function d_(){if(tm)return sl;tm=1;var e=Ut(),t=df(),r=Kt(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",f="[object Number]",d="[object Object]",p="[object RegExp]",m="[object Set]",v="[object String]",y="[object WeakMap]",h="[object ArrayBuffer]",w="[object DataView]",j="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",g="[object Int16Array]",b="[object Int32Array]",S="[object Uint8Array]",O="[object Uint8ClampedArray]",E="[object Uint16Array]",T="[object Uint32Array]",N={};N[j]=N[x]=N[k]=N[g]=N[b]=N[S]=N[O]=N[E]=N[T]=!0,N[n]=N[a]=N[h]=N[i]=N[w]=N[s]=N[l]=N[c]=N[u]=N[f]=N[d]=N[p]=N[m]=N[v]=N[y]=!1;function A(C){return r(C)&&t(C.length)&&!!N[e(C)]}return sl=A,sl}var ol,rm;function Ab(){if(rm)return ol;rm=1;function e(t){return function(r){return t(r)}}return ol=e,ol}var bn={exports:{}};bn.exports;var nm;function f_(){return nm||(nm=1,(function(e,t){var r=zx(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,l=(function(){try{var c=a&&a.require&&a.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}})();e.exports=l})(bn,bn.exports)),bn.exports}var ll,am;function Nb(){if(am)return ll;am=1;var e=d_(),t=Ab(),r=f_(),n=r&&r.isTypedArray,a=n?t(n):e;return ll=a,ll}var cl,im;function p_(){if(im)return cl;im=1;var e=l_(),t=cf(),r=et(),n=Ob(),a=uf(),i=Nb(),s=Object.prototype,l=s.hasOwnProperty;function c(u,f){var d=r(u),p=!d&&t(u),m=!d&&!p&&n(u),v=!d&&!p&&!m&&i(u),y=d||p||m||v,h=y?e(u.length,String):[],w=h.length;for(var j in u)(f||l.call(u,j))&&!(y&&(j=="length"||m&&(j=="offset"||j=="parent")||v&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||a(j,w)))&&h.push(j);return h}return cl=c,cl}var ul,sm;function h_(){if(sm)return ul;sm=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return ul=t,ul}var dl,om;function Eb(){if(om)return dl;om=1;function e(t,r){return function(n){return t(r(n))}}return dl=e,dl}var fl,lm;function m_(){if(lm)return fl;lm=1;var e=Eb(),t=e(Object.keys,Object);return fl=t,fl}var pl,cm;function g_(){if(cm)return pl;cm=1;var e=h_(),t=m_(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&s.push(l);return s}return pl=a,pl}var hl,um;function ua(){if(um)return hl;um=1;var e=Vd(),t=df();function r(n){return n!=null&&t(n.length)&&!e(n)}return hl=r,hl}var ml,dm;function Bi(){if(dm)return ml;dm=1;var e=p_(),t=g_(),r=ua();function n(a){return r(a)?e(a):t(a)}return ml=n,ml}var gl,fm;function v_(){if(fm)return gl;fm=1;var e=a_(),t=o_(),r=Bi();function n(a){return e(a,r,t)}return gl=n,gl}var vl,pm;function y_(){if(pm)return vl;pm=1;var e=v_(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,s,l,c,u,f){var d=l&t,p=e(i),m=p.length,v=e(s),y=v.length;if(m!=y&&!d)return!1;for(var h=m;h--;){var w=p[h];if(!(d?w in s:n.call(s,w)))return!1}var j=f.get(i),x=f.get(s);if(j&&x)return j==s&&x==i;var k=!0;f.set(i,s),f.set(s,i);for(var g=d;
vendor: 3,889 bytes, line 4
4++h<m;){w=p[h];var b=i[w],S=s[w];if(c)var O=d?c(S,b,w,s,i,f):c(b,S,w,i,s,f);if(!(O===void 0?b===S||u(b,S,l,c,f):O)){k=!1;break}g||(g=w=="constructor")}if(k&&!g){var E=i.constructor,T=s.constructor;E!=T&&"constructor"in i&&"constructor"in s&&!(typeof E=="function"&&E instanceof E&&typeof T=="function"&&T instanceof T)&&(k=!1)}return f.delete(i),f.delete(s),k}return vl=a,vl}var yl,hm;function x_(){if(hm)return yl;hm=1;var e=mr(),t=Tt(),r=e(t,"DataView");return yl=r,yl}var xl,mm;function b_(){if(mm)return xl;mm=1;var e=mr(),t=Tt(),r=e(t,"Promise");return xl=r,xl}var bl,gm;function Tb(){if(gm)return bl;gm=1;var e=mr(),t=Tt(),r=e(t,"Set");return bl=r,bl}var wl,vm;function w_(){if(vm)return wl;vm=1;var e=mr(),t=Tt(),r=e(t,"WeakMap");return wl=r,wl}var jl,ym;function j_(){if(ym)return jl;ym=1;var e=x_(),t=Yd(),r=b_(),n=Tb(),a=w_(),i=Ut(),s=Vx(),l="[object Map]",c="[object Object]",u="[object Promise]",f="[object Set]",d="[object WeakMap]",p="[object DataView]",m=s(e),v=s(t),y=s(r),h=s(n),w=s(a),j=i;return(e&&j(new e(new ArrayBuffer(1)))!=p||t&&j(new t)!=l||r&&j(r.resolve())!=u||n&&j(new n)!=f||a&&j(new a)!=d)&&(j=function(x){var k=i(x),g=k==c?x.constructor:void 0,b=g?s(g):"";if(b)switch(b){case m:return p;case v:return l;case y:return u;case h:return f;case w:return d}return k}),jl=j,jl}var kl,xm;function k_(){if(xm)return kl;xm=1;var e=bb(),t=_b(),r=n_(),n=y_(),a=j_(),i=et(),s=Ob(),l=Nb(),c=1,u="[object Arguments]",f="[object Array]",d="[object Object]",p=Object.prototype,m=p.hasOwnProperty;function v(y,h,w,j,x,k){var g=i(y),b=i(h),S=g?f:a(y),O=b?f:a(h);S=S==u?d:S,O=O==u?d:O;var E=S==d,T=O==d,N=S==O;if(N&&s(y)){if(!s(h))return!1;g=!0,E=!1}if(N&&!E)return k||(k=new e),g||l(y)?t(y,h,w,j,x,k):r(y,h,S,w,j,x,k);if(!(w&c)){var A=E&&m.call(y,"__wrapped__"),C=T&&m.call(h,"__wrapped__");if(A||C){var I=A?y.value():y,P=C?h.value():h;return k||(k=new e),x(I,P,w,j,k)}}return N?(k||(k=new e),n(y,h,w,j,x,k)):!1}return kl=v,kl}var _l,bm;function ff(){if(bm)return _l;bm=1;var e=k_(),t=Kt();function r(n,a,i,s,l){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,i,s,r,l)}return _l=r,_l}var Sl,wm;function __(){if(wm)return Sl;wm=1;var e=bb(),t=ff(),r=1,n=2;function a(i,s,l,c){var u=l.length,f=u,d=!c;if(i==null)return!f;for(i=Object(i);u--;){var p=l[u];if(d&&p[2]?p[1]!==i[p[0]]:!(p[0]in i))return!1}for(;++u<f;){p=l[u];var m=p[0],v=i[m],y=p[1];if(d&&p[2]){if(v===void 0&&!(m in i))return!1}else{var h=new e;if(c)var w=c(v,y,m,i,s,h);if(!(w===void 0?t(y,v,r|n,c,h):w))return!1}}return!0}return Sl=a,Sl}var Ol,jm;function Pb(){if(jm)return Ol;jm=1;var e=Yt();function t(r){return r===r&&!e(r)}return Ol=t,Ol}var Al,km;function S_(){if(km)return Al;km=1;var e=Pb(),t=Bi();function r(n){for(var a=t(n),i=a.length;i--;){var s=a[i],l=n[s];a[i]=[s,l,e(l)]}return a}return Al=r,Al}var Nl,_m;function Cb(){if(_m)return Nl;_m=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return Nl=e,Nl}var El,Sm;function O_(){if(Sm)return El;Sm=1;var e=__(),t=S_(),r=Cb();function n(a){var i=t(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||e(s,a,i)}}return El=n,El}var Tl,Om;function A_(){if(Om)return Tl;Om=1;function e(t,r){return t!=null&&r in Object(t)}return Tl=e,Tl}var Pl,Am;function N_(){if(Am)return Pl;Am=1;var e=Zx(),t=cf(),r=et(),n=uf(),a=df(),i=Mi();function s(l,c,u){c=e(c,l);for(var f=-1,d=c.length,p=!1;++f<d;){var m=i(c[f]);if(!(p=l!=null&&u(l,m)))break;l=l[m]}return p||++f!=d?p:(d=l==null?0:l.length,!!d&&a(d)&&n(m,d)&&(r(l)||t(l)))}return Pl=s,Pl}var Cl,Nm;function E_(){if(Nm)return Cl;Nm=1;var e=A_(),t=N_();function r(n,a){return n!=null&&t(n,a,e)}return Cl=r,Cl}var Ml,Em;function T_(){if(Em)return Ml;Em=1;var e=ff(),t=Jx(),r=E_(),n=zd(),a=Pb(),i=Cb(),s=Mi(),l=1,c=2;function u(f,d){return n(f)&&a(d)?i(s(f),d):function(p){var m=t(p,f);return m===void 0&&m===d?r(p,f):e(d,m,l|c)}}
vendor: 44,900 bytes, lines 4-12
4return Ml=u,Ml}var Il,Tm;function tn(){if(Tm)return Il;Tm=1;function e(t){return t}return Il=e,Il}var Rl,Pm;function P_(){if(Pm)return Rl;Pm=1;function e(t){return function(r){return r?.[t]}}return Rl=e,Rl}var $l,Cm;function C_(){if(Cm)return $l;Cm=1;var e=Qd();function t(r){return function(n){return e(n,r)}}return $l=t,$l}var Dl,Mm;function M_(){if(Mm)return Dl;Mm=1;var e=P_(),t=C_(),r=zd(),n=Mi();function a(i){return r(i)?e(n(i)):t(i)}return Dl=a,Dl}var Ll,Im;function Pt(){if(Im)return Ll;Im=1;var e=O_(),t=T_(),r=tn(),n=et(),a=M_();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):a(s)}return Ll=i,Ll}var ql,Rm;function Mb(){if(Rm)return ql;Rm=1;function e(t,r,n,a){for(var i=t.length,s=n+(a?1:-1);a?s--:++s<i;)if(r(t[s],s,t))return s;return-1}return ql=e,ql}var Bl,$m;function I_(){if($m)return Bl;$m=1;function e(t){return t!==t}return Bl=e,Bl}var Fl,Dm;function R_(){if(Dm)return Fl;Dm=1;function e(t,r,n){for(var a=n-1,i=t.length;++a<i;)if(t[a]===r)return a;return-1}return Fl=e,Fl}var Ul,Lm;function $_(){if(Lm)return Ul;Lm=1;var e=Mb(),t=I_(),r=R_();function n(a,i,s){return i===i?r(a,i,s):e(a,t,s)}return Ul=n,Ul}var Kl,qm;function D_(){if(qm)return Kl;qm=1;var e=$_();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return Kl=t,Kl}var Hl,Bm;function L_(){if(Bm)return Hl;Bm=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a<i;)if(n(r,t[a]))return!0;return!1}return Hl=e,Hl}var Wl,Fm;function q_(){if(Fm)return Wl;Fm=1;function e(){}return Wl=e,Wl}var Gl,Um;function B_(){if(Um)return Gl;Um=1;var e=Tb(),t=q_(),r=lf(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(i){return new e(i)}:t;return Gl=a,Gl}var zl,Km;function F_(){if(Km)return zl;Km=1;var e=wb(),t=D_(),r=L_(),n=kb(),a=B_(),i=lf(),s=200;function l(c,u,f){var d=-1,p=t,m=c.length,v=!0,y=[],h=y;if(f)v=!1,p=r;else if(m>=s){var w=u?null:a(c);if(w)return i(w);v=!1,p=n,h=new e}else h=u?[]:y;e:for(;++d<m;){var j=c[d],x=u?u(j):j;if(j=f||j!==0?j:0,v&&x===x){for(var k=h.length;k--;)if(h[k]===x)continue e;u&&h.push(x),y.push(j)}else p(h,x,f)||(h!==y&&h.push(x),y.push(j))}return y}return zl=l,zl}var Vl,Hm;function U_(){if(Hm)return Vl;Hm=1;var e=Pt(),t=F_();function r(n,a){return n&&n.length?t(n,e(a,2)):[]}return Vl=r,Vl}var K_=U_();const Wm=Se(K_);function Ib(e,t,r){return t===!0?Wm(e,r):de(t)?Wm(e,t):e}function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}var H_=["ref"];function Gm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gm(Object(r),!0).forEach(function(n){Fi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function W_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$b(n.key),n)}}function G_(e,t,r){return t&&zm(e.prototype,t),r&&zm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function z_(e,t,r){return t=Ha(t),V_(e,Rb()?Reflect.construct(t,r||[],Ha(e).constructor):t.apply(e,r))}function V_(e,t){if(t&&(Mr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X_(e)}function X_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rb=function(){return!!e})()}function Ha(e){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ha(e)}function Y_(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bu(e,t)}function Bu(e,t){return Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Bu(e,t)}function Fi(e,t,r){return t=$b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $b(e){var t=Z_(e,"string");return Mr(t)=="symbol"?t:t+""}function Z_(e,t){if(Mr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function J_(e,t){if(e==null)return{};var r=Q_(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Q_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function eS(e){return e.value}function tS(e,t){if($.isValidElement(e))return $.cloneElement(e,t);if(typeof e=="function")return $.createElement(e,t);t.ref;var r=J_(t,H_);return $.createElement(of,r)}var Vm=1,Ar=(function(e){function t(){var r;W_(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=z_(this,t,[].concat(a)),Fi(r,"lastBoundingBox",{width:-1,height:-1}),r}return Y_(t,e),G_(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Vm||Math.abs(a.height-this.lastBoundingBox.height)>Vm)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ct({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,f=a.chartHeight,d,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var m=this.getBBoxSnapshot();d={left:((u||0)-m.width)/2}}else d=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();p={top:((f||0)-v.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ct(Ct({},d),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=Ct(Ct({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return $.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(m){n.wrapperNode=m}},tS(i,Ct(Ct({},this.props),{},{payload:Ib(f,u,eS)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Ct(Ct({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&Y(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])})(_.PureComponent);Fi(Ar,"displayName","Legend");Fi(Ar,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Xl,Xm;function rS(){if(Xm)return Xl;Xm=1;var e=oa(),t=cf(),r=et(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Xl=a,Xl}var Yl,Ym;function Db(){if(Ym)return Yl;Ym=1;var e=Sb(),t=rS();function r(n,a,i,s,l){var c=-1,u=n.length;for(i||(i=t),l||(l=[]);++c<u;){var f=n[c];a>0&&i(f)?a>1?r(f,a-1,i,s,l):e(l,f):s||(l[l.length]=f)}return l}return Yl=r,Yl}var Zl,Zm;function nS(){if(Zm)return Zl;Zm=1;function e(t){return function(r,n,a){for(var i=-1,s=Object(r),l=a(r),c=l.length;c--;){var u=l[t?c:++i];if(n(s[u],u,s)===!1)break}return r}}return Zl=e,Zl}var Jl,Jm;function aS(){if(Jm)return Jl;Jm=1;var e=nS(),t=e();return Jl=t,Jl}var Ql,Qm;function Lb(){if(Qm)return Ql;Qm=1;var e=aS(),t=Bi();function r(n,a){return n&&e(n,a,t)}return Ql=r,Ql}var ec,eg;function iS(){if(eg)return ec;eg=1;var e=ua();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var s=a.length,l=n?s:-1,c=Object(a);(n?l--:++l<s)&&i(c[l],l,c)!==!1;);return a}}return ec=t,ec}var tc,tg;function pf(){if(tg)return tc;tg=1;var e=Lb(),t=iS(),r=t(e);return tc=r,tc}var rc,rg;function qb(){if(rg)return rc;rg=1;var e=pf(),t=ua();function r(n,a){var i=-1,s=t(n)?Array(n.length):[];return e(n,function(l,c,u){s[++i]=a(l,c,u)}),s}return rc=r,rc}var nc,ng;function sS(){if(ng)return nc;ng=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return nc=e,nc}var ac,ag;function oS(){if(ag)return ac;ag=1;var e=Qr();function t(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,l=e(r),c=n!==void 0,u=n===null,f=n===n,d=e(n);if(!u&&!d&&!l&&r>n||l&&c&&f&&!u&&!d||i&&c&&f||!a&&f||!s)return 1;if(!i&&!l&&!d&&r<n||d&&a&&s&&!i&&!l||u&&a&&s||!c&&s||!f)return-1}return 0}return ac=t,ac}var ic,ig;function lS(){if(ig)return ic;ig=1;var e=oS();function t(r,n,a){for(var i=-1,s=r.criteria,l=n.criteria,c=s.length,u=a.length;++i<c;){var f=e(s[i],l[i]);if(f){if(i>=u)return f;var d=a[i];return f*(d=="desc"?-1:1)}}return r.index-n.index}return ic=t,ic}var sc,sg;function cS(){if(sg)return sc;sg=1;var e=Jd(),t=Qd(),r=Pt(),n=qb(),a=sS(),i=Ab(),s=lS(),l=tn(),c=et();function u(f,d,p){d.length?d=e(d,function(y){return c(y)?function(h){return t(h,y.length===1?y[0]:y)}:y}):d=[l];var m=-1;d=e(d,i(r));var v=n(f,function(y,h,w){var j=e(d,function(x){return x(y)});return{criteria:j,index:++m,value:y}});return a(v,function(y,h){return s(y,h,p)})}return sc=u,sc}var oc,og;function uS(){if(og)return oc;og=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return oc=e,oc}var lc,lg;function dS(){if(lg)return lc;lg=1;var e=uS(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,l=-1,c=t(s.length-a,0),u=Array(c);++l<c;)u[l]=s[a+l];l=-1;for(var f=Array(a+1);++l<a;)f[l]=s[l];return f[a]=i(u),e(n,this,f)}}return lc=r,lc}var cc,cg;function fS(){if(cg)return cc;cg=1;function e(t){return function(){return t}}return cc=e,cc}var uc,ug;function Bb(){if(ug)return uc;ug=1;var e=mr(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return uc=t,uc}var dc,dg;function pS(){if(dg)return dc;dg=1;var e=fS(),t=Bb(),r=tn(),n=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:r;return dc=n,dc}var fc,fg;function hS(){if(fg)return fc;fg=1;var e=800,t=16,r=Date.now;function n(a){var i=0,s=0;return function(){var l=r(),c=t-(l-s);if(s=l,c>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return fc=n,fc}var pc,pg;function mS(){if(pg)return pc;pg=1;var e=pS(),t=hS(),r=t(e);return pc=r,pc}var hc,hg;function gS(){if(hg)return hc;hg=1;var e=tn(),t=dS(),r=mS();function n(a,i){return r(t(a,i,e),a+"")}return hc=n,hc}var mc,mg;function Ui(){if(mg)return mc;mg=1;var e=Xd(),t=ua(),r=uf(),n=Yt();function a(i,s,l){if(!n(l))return!1;var c=typeof s;return(c=="number"?t(l)&&r(s,l.length):c=="string"&&s in l)?e(l[s],i):!1}return mc=a,mc}var gc,gg;function vS(){if(gg)return gc;gg=1;var e=Db(),t=cS(),r=gS(),n=Ui(),a=r(function(i,s){if(i==null)return[];var l=s.length;return l>1&&n(i,s[0],s[1])?s=[]:l>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return gc=a,gc}var yS=vS();const hf=Se(yS);function Tn(e){"@babel/helpers - typeof";return Tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(e)}function Fu(){return Fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fu.apply(this,arguments)}function xS(e,t){return kS(e)||jS(e,t)||wS(e,t)||bS()}function bS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wS(e,t){if(e){if(typeof e=="string")return vg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vg(e,t)}}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jS(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function kS(e){if(Array.isArray(e))return e}function yg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function vc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yg(Object(r),!0).forEach(function(n){_S(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _S(e,t,r){return t=SS(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SS(e){var t=OS(e,"string");return Tn(t)=="symbol"?t:t+""}function OS(e,t){if(Tn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AS(e){return Array.isArray(e)&&Fe(e[0])&&Fe(e[1])?e.join(" ~ "):e}var NS=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,p=t.itemSorter,m=t.wrapperClassName,v=t.labelClassName,y=t.label,h=t.labelFormatter,w=t.accessibilityLayer,j=w===void 0?!1:w,x=function(){if(f&&f.length){var A={padding:0,margin:0},C=(p?hf(f,p):f).map(function(I,P){if(I.type==="none")return null;var L=vc({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},l),D=I.formatter||d||AS,R=I.value,F=I.name,V=R,Z=F;if(D&&V!=null&&Z!=null){var W=D(R,F,I,P,f);if(Array.isArray(W)){var re=xS(W,2);V=re[0],Z=re[1]}else V=W}return $.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(P),style:L},Fe(Z)?$.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Fe(Z)?$.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,$.createElement("span",{className:"recharts-tooltip-item-value"},V),$.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return $.createElement("ul",{className:"recharts-tooltip-item-list",style:A},C)}return null},k=vc({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),g=vc({margin:0},u),b=!he(y),S=b?y:"",O=me("recharts-default-tooltip",m),E=me("recharts-tooltip-label",v);b&&h&&f!==void 0&&f!==null&&(S=h(y,f));var T=j?{role:"status","aria-live":"assertive"}:{};return $.createElement("div",Fu({className:O,style:k},T),$.createElement("p",{className:E,style:g},$.isValidElement(S)?S:"".concat(S)),x())};function Pn(e){"@babel/helpers - typeof";return Pn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(e)}function ba(e,t,r){return t=ES(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ES(e){var t=TS(e,"string");return Pn(t)=="symbol"?t:t+""}function TS(e,t){if(Pn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cn="recharts-tooltip-wrapper",PS={visibility:"hidden"};function CS(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return me(cn,ba(ba(ba(ba({},"".concat(cn,"-right"),Y(r)&&t&&Y(t.x)&&r>=t.x),"".concat(cn,"-left"),Y(r)&&t&&Y(t.x)&&r<t.x),"".concat(cn,"-bottom"),Y(n)&&t&&Y(t.y)&&n>=t.y),"".concat(cn,"-top"),Y(n)&&t&&Y(t.y)&&n<t.y))}function xg(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&Y(i[n]))return i[n];var f=r[n]-l-a,d=r[n]+a;if(t[n])return s[n]?f:d;if(s[n]){var p=f,m=c[n];return p<m?Math.max(d,c[n]):Math.max(f,c[n])}var v=d+l,y=c[n]+u;return v>y?Math.max(f,c[n]):Math.max(d,c[n])}function MS(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function IS(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return s.height>0&&s.width>0&&r?(f=xg({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),d=xg({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=MS({translateX:f,translateY:d,useTranslate3d:l})):u=PS,{cssProperties:u,cssClasses:CS({translateX:f,translateY:d,coordinate:r})}}function Ir(e){"@babel/helpers - typeof";return Ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(e)}function bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function wg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(r),!0).forEach(function(n){Ku(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ub(n.key),n)}}function DS(e,t,r){return t&&$S(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LS(e,t,r){return t=Wa(t),qS(e,Fb()?Reflect.construct(t,r||[],Wa(e).constructor):t.apply(e,r))}function qS(e,t){if(t&&(Ir(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BS(e)}function BS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fb=function(){return!!e})()}function Wa(e){return Wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wa(e)}function FS(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uu(e,t)}function Uu(e,t){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Uu(e,t)}function Ku(e,t,r){return t=Ub(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ub(e){var t=US(e,"string");return Ir(t)=="symbol"?t:t+""}function US(e,t){if(Ir(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ir(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jg=1,KS=(function(e){function t(){var r;RS(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=LS(this,t,[].concat(a)),Ku(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Ku(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return FS(t,e),DS(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>jg||Math.abs(n.height-this.state.lastBoundingBox.height)>jg)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,p=a.isAnimationActive,m=a.offset,v=a.position,y=a.reverseDirection,h=a.useTranslate3d,w=a.viewBox,j=a.wrapperStyle,x=IS({allowEscapeViewBox:s,coordinate:f,offsetTopLeft:m,position:v,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:h,viewBox:w}),k=x.cssClasses,g=x.cssProperties,b=wg(wg({transition:p&&i?"transform ".concat(l,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},j);return $.createElement("div",{tabIndex:-1,className:k,style:b,ref:function(O){n.wrapperNode=O}},u)}}])})(_.PureComponent),HS=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ki={isSsr:HS()};function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function kg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _g(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kg(Object(r),!0).forEach(function(n){mf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hb(n.key),n)}}function zS(e,t,r){return t&&GS(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function VS(e,t,r){return t=Ga(t),XS(e,Kb()?Reflect.construct(t,r||[],Ga(e).constructor):t.apply(e,r))}function XS(e,t){if(t&&(Rr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YS(e)}function YS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kb=function(){return!!e})()}function Ga(e){return Ga=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ga(e)}function ZS(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hu(e,t)}function Hu(e,t){return Hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Hu(e,t)}function mf(e,t,r){return t=Hb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hb(e){var t=JS(e,"string");return Rr(t)=="symbol"?t:t+""}function JS(e,t){if(Rr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QS(e){return e.dataKey}function eO(e,t){return $.isValidElement(e)?$.cloneElement(e,t):typeof e=="function"?$.createElement(e,t):$.createElement(NS,t)}var kt=(function(e){function t(){return WS(this,t),VS(this,t,arguments)}return ZS(t,e),zS(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,f=a.coordinate,d=a.filterNull,p=a.isAnimationActive,m=a.offset,v=a.payload,y=a.payloadUniqBy,h=a.position,w=a.reverseDirection,j=a.useTranslate3d,x=a.viewBox,k=a.wrapperStyle,g=v??[];d&&g.length&&(g=Ib(v.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),y,QS));var b=g.length>0;return $.createElement(KS,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:p,active:i,coordinate:f,hasPayload:b,offset:m,position:h,reverseDirection:w,useTranslate3d:j,viewBox:x,wrapperStyle:k},eO(u,_g(_g({},this.props),{},{payload:g})))}}])})(_.PureComponent);mf(kt,"displayName","Tooltip");mf(kt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ki.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var yc,Sg;function tO(){if(Sg)return yc;Sg=1;var e=Tt(),t=function(){return e.Date.now()};return yc=t,yc}var xc,Og;function rO(){if(Og)return xc;Og=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return xc=t,xc}var bc,Ag;function nO(){if(Ag)return bc;Ag=1;var e=rO(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return bc=r,bc}var wc,Ng;function Wb(){if(Ng)return wc;Ng=1;var e=nO(),t=Yt(),r=Qr(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=t(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=i.test(u);return d||s.test(u)?l(u.slice(2),d?2:8):a.test(u)?n:+u}return wc=c,wc}var jc,Eg;function aO(){if(Eg)return jc;Eg=1;var e=Yt(),t=tO(),r=Wb(),n="Expected a function",a=Math.max,i=Math.min;function s(l,c,u){var f,d,p,m,v,y,h=0,w=!1,j=!1,x=!0;if(typeof l!="function")throw new TypeError(n);c=r(c)||0,e(u)&&(w=!!u.leading,j="maxWait"in u,p=j?a(r(u.maxWait)||0,c):p,x="trailing"in u?!!u.trailing:x);function k(C){var I=f,P=d;return f=d=void 0,h=C,m=l.apply(P,I),m}function g(C){return h=C,v=setTimeout(O,c),w?k(C):m}function b(C){var I=C-y,P=C-h,L=c-I;return j?i(L,p-P):L}function S(C){var I=C-y,P=C-h;return y===void 0||I>=c||I<0||j&&P>=p}function O(){var C=t();if(S(C))return E(C);v=setTimeout(O,b(C))}function E(C){return v=void 0,x&&f?k(C):(f=d=void 0,m)}function T(){v!==void 0&&clearTimeout(v),h=0,f=y=d=v=void 0}function N(){return v===void 0?m:E(t())}function A(){var C=t(),I=S(C);if(f=arguments,d=this,y=C,I){if(v===void 0)return g(y);if(j)return clearTimeout(v),v=setTimeout(O,c),k(y)}return v===void 0&&(v=setTimeout(O,c)),m}return A.cancel=T,A.flush=N,A}return jc=s,jc}var kc,Tg;function iO(){if(Tg)return kc;Tg=1;var e=aO(),t=Yt(),r="Expected a function";function n(a,i,s){var l=!0,c=!0;if(typeof a!="function")throw new TypeError(r);return t(s)&&(l="leading"in s?!!s.leading:l,c="trailing"in s?!!s.trailing:c),e(a,i,{leading:l,maxWait:i,trailing:c})}return kc=n,kc}var sO=iO();const Gb=Se(sO);function Cn(e){"@babel/helpers - typeof";return Cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(e)}function Pg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pg(Object(r),!0).forEach(function(n){oO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oO(e,t,r){return t=lO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lO(e){var t=cO(e,"string");return Cn(t)=="symbol"?t:t+""}function cO(e,t){if(Cn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uO(e,t){return hO(e)||pO(e,t)||fO(e,t)||dO()}function dO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fO(e,t){if(e){if(typeof e=="string")return Cg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cg(e,t)}}function Cg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pO(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function hO(e){if(Array.isArray(e))return e}var mO=_.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,s=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,p=e.maxHeight,m=e.children,v=e.debounce,y=v===void 0?0:v,h=e.id,w=e.className,j=e.onResize,x=e.style,k=x===void 0?{}:x,g=_.useRef(null),b=_.useRef();b.current=j,_.useImperativeHandle(t,function(){return Object.defineProperty(g.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),g.current},configurable:!0})});var S=_.useState({containerWidth:a.width,containerHeight:a.height}),O=uO(S,2),E=O[0],T=O[1],N=_.useCallback(function(C,I){T(function(P){var L=Math.round(C),D=Math.round(I);return P.containerWidth===L&&P.containerHeight===D?P:{containerWidth:L,containerHeight:D}})},[]);_.useEffect(function(){var C=function(F){var V,Z=F[0].contentRect,W=Z.width,re=Z.height;N(W,re),(V=b.current)===null||V===void 0||V.call(b,W,re)};y>0&&(C=Gb(C,y,{trailing:!0,leading:!1}));var I=new ResizeObserver(C),P=g.current.getBoundingClientRect(),L=P.width,D=P.height;return N(L,D),I.observe(g.current),function(){I.disconnect()}},[N,y]);var A=_.useMemo(function(){var C=E.containerWidth,I=E.containerHeight;if(C<0||I<0)return null;Dt(lr(s)||lr(c),`The width(%s) and height(%s) are both fixed numbers,
7       maybe you don't need to use a ResponsiveContainer.`,s,c),Dt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var P=lr(s)?C:s,L=lr(c)?I:c;r&&r>0&&(P?L=P/r:L&&(P=L*r),p&&L>p&&(L=p)),Dt(P>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0,
8       please check the style of container, or the props width(%s) and height(%s),
9       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
10       height and width.`,P,L,s,c,f,d,r);var D=!Array.isArray(m)&&$t(m.type).endsWith("Chart");return $.Children.map(m,function(R){return $.isValidElement(R)?_.cloneElement(R,wa({width:P,height:L},D?{style:wa({height:"100%",width:"100%",maxHeight:L,maxWidth:P},R.props.style)}:{})):R})},[r,m,c,p,d,f,E,s]);return $.createElement("div",{id:h?"".concat(h):void 0,className:me("recharts-responsive-container",w),style:wa(wa({},k),{},{width:s,height:c,minWidth:f,minHeight:d,maxHeight:p}),ref:g},A)}),gf=function(t){return null};gf.displayName="Cell";function Mn(e){"@babel/helpers - typeof";return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(e)}function Mg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mg(Object(r),!0).forEach(function(n){gO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gO(e,t,r){return t=vO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vO(e){var t=yO(e,"string");return Mn(t)=="symbol"?t:t+""}function yO(e,t){if(Mn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var br={widthCache:{},cacheCount:0},xO=2e3,bO={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Ig="recharts_measurement_span";function wO(e){var t=Wu({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Rg=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ki.isSsr)return{width:0,height:0};var n=wO(r),a=JSON.stringify({text:t,copyStyle:n});if(br.widthCache[a])return br.widthCache[a];try{var i=document.getElementById(Ig);i||(i=document.createElement("span"),i.setAttribute("id",Ig),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=Wu(Wu({},bO),n);Object.assign(i.style,s),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return br.widthCache[a]=c,++br.cacheCount>xO&&(br.cacheCount=0,br.widthCache={}),c}catch{return{width:0,height:0}}},jO=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function In(e){"@babel/helpers - typeof";return In=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(e)}function za(e,t){return OO(e)||SO(e,t)||_O(e,t)||kO()}function kO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _O(e,t){if(e){if(typeof e=="string")return $g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $g(e,t)}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function SO(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function OO(e){if(Array.isArray(e))return e}function AO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EO(n.key),n)}}function NO(e,t,r){return t&&Dg(e.prototype,t),r&&Dg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function EO(e){var t=TO(e,"string");return In(t)=="symbol"?t:t+""}function TO(e,t){if(In(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(In(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lg=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,qg=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PO=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,CO=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,zb={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},MO=Object.keys(zb),kr="NaN";function IO(e,t){return e*zb[t]}var ja=(function(){function e(t,r){AO(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!PO.test(r)&&(this.num=NaN,this.unit=""),MO.includes(r)&&(this.num=IO(t,r),this.unit="px")}return NO(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=CO.exec(r))!==null&&n!==void 0?n:[],i=za(a,3),s=i[1],l=i[2];return new e(parseFloat(s),l??"")}}])})();function Vb(e){if(e.includes(kr))return kr;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=Lg.exec(t))!==null&&r!==void 0?r:[],a=za(n,4),i=a[1],s=a[2],l=a[3],c=ja.parse(i??""),u=ja.parse(l??""),f=s==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return kr;t=t.replace(Lg,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,p=(d=qg.exec(t))!==null&&d!==void 0?d:[],m=za(p,4),v=m[1],y=m[2],h=m[3],w=ja.parse(v??""),j=ja.parse(h??""),x=y==="+"?w.add(j):w.subtract(j);if(x.isNaN())return kr;t=t.replace(qg,x.toString())}return t}var Bg=/\(([^()]*)\)/;function RO(e){for(var t=e;t.includes("(");){var r=Bg.exec(t),n=za(r,2),a=n[1];t=t.replace(Bg,Vb(a))}return t}function $O(e){var t=e.replace(/\s+/g,"");return t=RO(t),t=Vb(t),t}function DO(e){try{return $O(e)}catch{return kr}}function _c(e){var t=DO(e.slice(5,-1));return t===kr?"":t}var LO=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],qO=["dx","dy","angle","className","breakAll"];function Gu(){return Gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gu.apply(this,arguments)}function Fg(e,t){if(e==null)return{};var r=BO(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ug(e,t){return HO(e)||KO(e,t)||UO(e,t)||FO()}function FO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UO(e,t){if(e){if(typeof e=="string")return Kg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kg(e,t)}}function Kg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function KO(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function HO(e){if(Array.isArray(e))return e}var Xb=/[ \f\n\r\t\v\u2028\u2029]+/,Yb=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];he(r)||(n?i=r.toString().split(""):i=r.toString().split(Xb));var s=i.map(function(c){return{word:c,width:Rg(c,a).width}}),l=n?0:Rg(" ",a).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},WO=function(t,r,n,a,i){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=Y(s),d=l,p=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return P.reduce(function(L,D){var R=D.word,F=D.width,V=L[L.length-1];if(V&&(a==null||i||V.width+F+n<Number(a)))V.words.push(R),V.width+=F+n;else{var Z={words:[R],width:F};L.push(Z)}return L},[])},m=p(r),v=function(P){return P.reduce(function(L,D){return L.width>D.width?L:D})};if(!f)return m;for(var y="…",h=function(P){var L=d.slice(0,P),D=Yb({breakAll:u,style:c,children:L+y}).wordsWithComputedWidth,R=p(D),F=R.length>s||v(R).width>Number(a);return[F,R]},w=0,j=d.length-1,x=0,k;w<=j&&x<=d.length-1;){var g=Math.floor((w+j)/2),b=g-1,S=h(b),O=Ug(S,2),E=O[0],T=O[1],N=h(g),A=Ug(N,1),C=A[0];if(!E&&!C&&(w=g+1),E&&C&&(j=g-1),!E&&C){k=T;break}x++}return k||m},Hg=function(t){var r=he(t)?[]:t.toString().split(Xb);return[{words:r}]},GO=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!Ki.isSsr){var c,u,f=Yb({breakAll:s,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;c=d,u=p}else return Hg(a);
12return WO({breakAll:s,children:a,maxLines:l,style:i},c,u,r,n)}return Hg(a)},Wg="#808080",$r=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,p=t.textAnchor,m=p===void 0?"start":p,v=t.verticalAnchor,y=v===void 0?"end":v,h=t.fill,w=h===void 0?Wg:h,j=Fg(t,LO),x=_.useMemo(function(){return GO({breakAll:j.breakAll,children:j.children,maxLines:j.maxLines,scaleToFit:d,style:j.style,width:j.width})},[j.breakAll,j.children,j.maxLines,d,j.style,j.width]),k=j.dx,g=j.dy,b=j.angle,S=j.className,O=j.breakAll,E=Fg(j,qO);if(!Fe(n)||!Fe(i))return null;var T=n+(Y(k)?k:0),N=i+(Y(g)?g:0),A;switch(y){case"start":A=_c("calc(".concat(u,")"));break;case"middle":A=_c("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:A=_c("calc(".concat(x.length-1," * -").concat(l,")"));break}var C=[];if(d){var I=x[0].width,P=j.width;C.push("scale(".concat((Y(P)?P/I:1)/I,")"))}return b&&C.push("rotate(".concat(b,", ").concat(T,", ").concat(N,")")),C.length&&(E.transform=C.join(" ")),$.createElement("text",Gu({},le(E,!0),{x:T,y:N,className:me("recharts-text",S),textAnchor:m,fill:w.includes("url")?Wg:w}),x.map(function(L,D){var R=L.words.join(O?"":" ");return $.createElement("tspan",{x:T,dy:D===0?A:l,key:"".concat(R,"-").concat(D)},R)}))};function Vt(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zO(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vf(e){let t,r,n;e.length!==2?(t=Vt,r=(l,c)=>Vt(e(l),c),n=(l,c)=>e(l)-c):(t=e===Vt||e===zO?e:VO,r=e,n=e);function a(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function s(l,c,u=0,f=l.length){const d=a(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:a,center:s,right:i}}function VO(){return 0}function Zb(e){return e===null?NaN:+e}function*XO(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const YO=vf(Vt),da=YO.right;vf(Zb).center;class Gg extends Map{constructor(t,r=QO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(zg(this,t))}has(t){return super.has(zg(this,t))}set(t,r){return super.set(ZO(this,t),r)}delete(t){return super.delete(JO(this,t))}}function zg({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function ZO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function JO({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function QO(e){return e!==null&&typeof e=="object"?e.valueOf():e}function eA(e=Vt){if(e===Vt)return Jb;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Jb(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tA=Math.sqrt(50),rA=Math.sqrt(10),nA=Math.sqrt(2);function Va(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=tA?10:i>=rA?5:i>=nA?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Va(e,t,r*2):[l,c,u]}function zu(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?Va(t,e,r):Va(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(i-u)/-s;else for(let u=0;u<l;++u)c[u]=(i-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(a+u)/-s;else for(let u=0;u<l;++u)c[u]=(a+u)*s;return c}function Vu(e,t,r){return t=+t,e=+e,r=+r,Va(e,t,r)[2]}function Xu(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Vu(t,e,r):Vu(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function Vg(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Xg(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Qb(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?Jb:eA(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(t-u*d/c+p)),v=Math.min(n,Math.floor(t+(c-u)*d/c+p));Qb(e,t,m,v,a)}const i=e[t];let s=r,l=n;for(un(e,r,t),a(e[n],i)>0&&un(e,r,n);s<l;){for(un(e,s,l),++s,--l;a(e[s],i)<0;)++s;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?un(e,r,l):(++l,un(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function un(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function aA(e,t,r){if(e=Float64Array.from(XO(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Xg(e);
12if(t>=1)return Vg(e);var n,a=(n-1)*t,i=Math.floor(a),s=Vg(Qb(e,i).subarray(0,i+1)),l=Xg(e.subarray(i+1));return s+(l-s)*(a-i)}}function iA(e,t,r=Zb){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return s+(l-s)*(a-i)}}function sA(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function gt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ht(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Yu=Symbol("implicit");function yf(){var e=new Gg,t=[],r=[],n=Yu;function a(i){let s=e.get(i);if(s===void 0){if(n!==Yu)return n;e.set(i,s=t.push(i)-1)}return r[s%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Gg;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return yf(t,r).unknown(n)},gt.apply(a,arguments),a}function Rn(){var e=yf().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,s,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var p=t().length,m=a<n,v=m?a:n,y=m?n:a;i=(y-v)/Math.max(1,p-c+u*2),l&&(i=Math.floor(i)),v+=(y-v-i*(p-c))*f,s=i*(1-c),l&&(v=Math.round(v),s=Math.round(s));var h=sA(p).map(function(w){return v+i*w});return r(m?h.reverse():h)}return e.domain=function(p){return arguments.length?(t(p),d()):t()},e.range=function(p){return arguments.length?([n,a]=p,n=+n,a=+a,d()):[n,a]},e.rangeRound=function(p){return[n,a]=p,n=+n,a=+a,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(p){return arguments.length?(l=!!p,d()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),d()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),d()):c},e.paddingOuter=function(p){return arguments.length?(u=+p,d()):u},e.align=function(p){return arguments.length?(f=Math.max(0,Math.min(1,p)),d()):f},e.copy=function(){return Rn(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(f)},gt.apply(d(),arguments)}function e0(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return e0(t())},e}function kn(){return e0(Rn.apply(null,arguments).paddingInner(1))}function xf(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function t0(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function fa(){}var $n=.7,Xa=1/$n,Nr="\\s*([+-]?\\d+)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oA=/^#([0-9a-f]{3,8})$/,lA=new RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),cA=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),uA=new RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Dn}\\)$`),dA=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Dn}\\)$`),fA=new RegExp(`^hsl\\(${Dn},${Ot},${Ot}\\)$`),pA=new RegExp(`^hsla\\(${Dn},${Ot},${Ot},${Dn}\\)$`),Yg={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};xf(fa,Ln,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zg,formatHex:Zg,formatHex8:hA,formatHsl:mA,formatRgb:Jg,toString:Jg});function Zg(){return this.rgb().formatHex()}function hA(){return this.rgb().formatHex8()}function mA(){return r0(this).formatHsl()}function Jg(){return this.rgb().formatRgb()}function Ln(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=oA.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Qg(t):r===3?new Qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ka(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ka(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=lA.exec(e))?new Qe(t[1],t[2],t[3],1):(t=cA.exec(e))?new Qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=uA.exec(e))?ka(t[1],t[2],t[3],t[4]):(t=dA.exec(e))?ka(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=fA.exec(e))?rv(t[1],t[2]/100,t[3]/100,1):(t=pA.exec(e))?rv(t[1],t[2]/100,t[3]/100,t[4]):Yg.hasOwnProperty(e)?Qg(Yg[e]):e==="transparent"?new Qe(NaN,NaN,NaN,0):null}function Qg(e){return new Qe(e>>16&255,e>>8&255,e&255,1)}function ka(e,t,r,n){return n<=0&&(e=t=r=NaN),new Qe(e,t,r,n)}function gA(e){return e instanceof fa||(e=Ln(e)),e?(e=e.rgb(),new Qe(e.r,e.g,e.b,e.opacity)):new Qe}function Zu(e,t,r,n){return arguments.length===1?gA(e):new Qe(e,t,r,n??1)}function Qe(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}xf(Qe,Zu,t0(fa,{brighter(e){return e=e==null?Xa:Math.pow(Xa,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qe(dr(this.r),dr(this.g),dr(this.b),Ya(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:ev,formatHex:ev,formatHex8:vA,formatRgb:tv,toString:tv}));function ev(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}`}function vA(){return`#${cr(this.r)}${cr(this.g)}${cr(this.b)}${cr((isNaN(this.opacity)?1:this.opacity)*255)}`}function tv(){const e=Ya(this.opacity);return`${e===1?"rgb(":"rgba("}${dr(this.r)}, ${dr(this.g)}, ${dr(this.b)}${e===1?")":`, ${e})`}`}function Ya(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cr(e){return e=dr(e),(e<16?"0":"")+e.toString(16)}function rv(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new bt(e,t,r,n)}function r0(e){if(e instanceof bt)return new bt(e.h,e.s,e.l,e.opacity);if(e instanceof fa||(e=Ln(e)),!e)return new bt;if(e instanceof bt)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,l=i-a,c=(i+a)/2;return l?(t===i?s=(r-n)/l+(r<n)*6:r===i?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?i+a:2-i-a,s*=60):l=c>0&&c<1?0:s,new bt(s,l,c,e.opacity)}function yA(e,t,r,n){return arguments.length===1?r0(e):new bt(e,t,r,n??1)}function bt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}xf(bt,yA,t0(fa,{brighter(e){return e=e==null?Xa:Math.pow(Xa,e),new bt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new bt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Qe(Sc(e>=240?e-240:e+120,a,n),Sc(e,a,n),Sc(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new bt(nv(this.h),_a(this.s),_a(this.l),Ya(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 e=Ya(this.opacity);return`${e===1?"hsl(":"hsla("}${nv(this.h)}, ${_a(this.s)*100}%, ${_a(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nv(e){return e=(e||0)%360,e<0?e+360:e}function _a(e){return Math.max(0,Math.min(1,e||0))}function Sc(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const bf=e=>()=>e;function xA(e,t){return function(r){return e+r*t}}function bA(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}
vendor: 5,962 bytes, line 12
12function wA(e){return(e=+e)==1?n0:function(t,r){return r-t?bA(t,r,e):bf(isNaN(t)?r:t)}}function n0(e,t){var r=t-e;return r?xA(e,r):bf(isNaN(e)?t:e)}const av=(function e(t){var r=wA(t);function n(a,i){var s=r((a=Zu(a)).r,(i=Zu(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=n0(a.opacity,i.opacity);return function(f){return a.r=s(f),a.g=l(f),a.b=c(f),a.opacity=u(f),a+""}}return n.gamma=e,n})(1);function jA(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function kA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _A(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=rn(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(l){for(s=0;s<n;++s)i[s]=a[s](l);return i}}function SA(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Za(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function OA(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=rn(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Ju=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oc=new RegExp(Ju.source,"g");function AA(e){return function(){return e}}function NA(e){return function(t){return e(t)+""}}function EA(e,t){var r=Ju.lastIndex=Oc.lastIndex=0,n,a,i,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Ju.exec(e))&&(a=Oc.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(n=n[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,c.push({i:s,x:Za(n,a)})),r=Oc.lastIndex;return r<t.length&&(i=t.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?NA(c[0].x):AA(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function rn(e,t){var r=typeof t,n;return t==null||r==="boolean"?bf(t):(r==="number"?Za:r==="string"?(n=Ln(t))?(t=n,av):EA:t instanceof Ln?av:t instanceof Date?SA:kA(t)?jA:Array.isArray(t)?_A:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?OA:Za)(e,t)}function wf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function TA(e,t){t===void 0&&(t=e,e=rn);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return i[l](s-l)}}function PA(e){return function(){return e}}function Ja(e){return+e}var iv=[0,1];function Ze(e){return e}function Qu(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:PA(isNaN(t)?NaN:.5)}function CA(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function MA(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=Qu(a,n),i=r(s,i)):(n=Qu(n,a),i=r(i,s)),function(l){return i(n(l))}}function IA(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=Qu(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(l){var c=da(e,l,1,n)-1;return i[c](a[c](l))}}function pa(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Hi(){var e=iv,t=iv,r=rn,n,a,i,s=Ze,l,c,u;function f(){var p=Math.min(e.length,t.length);return s!==Ze&&(s=CA(e[0],e[p-1])),l=p>2?IA:MA,c=u=null,d}function d(p){return p==null||isNaN(p=+p)?i:(c||(c=l(e.map(n),t,r)))(n(s(p)))}return d.invert=function(p){return s(a((u||(u=l(t,e.map(n),Za)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,Ja),f()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=wf,f()},d.clamp=function(p){return arguments.length?(s=p?!0:Ze,f()):s!==Ze},d.interpolate=function(p){return arguments.length?(r=p,f()):r},d.unknown=function(p){return arguments.length?(i=p,d):i},function(p,m){return n=p,a=m,f()}}function jf(){return Hi()(Ze,Ze)}function RA(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qa(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Dr(e){return e=Qa(Math.abs(e)),e?e[1]:NaN}function $A(e,t){return function(r,n){for(var a=r.length,i=[],s=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return i.reverse().join(t)}}function DA(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var LA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qn(e){if(!(t=LA.exec(e)))throw new Error("invalid format: "+e);var t;return new kf({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}qn.prototype=kf.prototype;function kf(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}kf.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 qA(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var ei;function BA(e,t){var r=Qa(e,t);if(!r)return ei=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(ei=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>
vendor: 5,986 bytes, line 12
120?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Qa(e,Math.max(0,t+i-1))[0]}function sv(e,t){var r=Qa(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const ov={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:RA,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>sv(e*100,t),r:sv,s:BA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lv(e){return e}var cv=Array.prototype.map,uv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function FA(e){var t=e.grouping===void 0||e.thousands===void 0?lv:$A(cv.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?lv:DA(cv.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=qn(d);var m=d.fill,v=d.align,y=d.sign,h=d.symbol,w=d.zero,j=d.width,x=d.comma,k=d.precision,g=d.trim,b=d.type;b==="n"?(x=!0,b="g"):ov[b]||(k===void 0&&(k=12),g=!0,b="g"),(w||m==="0"&&v==="=")&&(w=!0,m="0",v="=");var S=(p&&p.prefix!==void 0?p.prefix:"")+(h==="$"?r:h==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),O=(h==="$"?n:/[%p]/.test(b)?s:"")+(p&&p.suffix!==void 0?p.suffix:""),E=ov[b],T=/[defgprs%]/.test(b);k=k===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function N(A){var C=S,I=O,P,L,D;if(b==="c")I=E(A)+I,A="";else{A=+A;var R=A<0||1/A<0;if(A=isNaN(A)?c:E(Math.abs(A),k),g&&(A=qA(A)),R&&+A==0&&y!=="+"&&(R=!1),C=(R?y==="("?y:l:y==="-"||y==="("?"":y)+C,I=(b==="s"&&!isNaN(A)&&ei!==void 0?uv[8+ei/3]:"")+I+(R&&y==="("?")":""),T){for(P=-1,L=A.length;++P<L;)if(D=A.charCodeAt(P),48>D||D>57){I=(D===46?a+A.slice(P+1):A.slice(P))+I,A=A.slice(0,P);break}}}x&&!w&&(A=t(A,1/0));var F=C.length+A.length+I.length,V=F<j?new Array(j-F+1).join(m):"";switch(x&&w&&(A=t(V+A,V.length?j-I.length:1/0),V=""),v){case"<":A=C+A+I+V;break;case"=":A=C+V+A+I;break;case"^":A=V.slice(0,F=V.length>>1)+C+A+I+V.slice(F);break;default:A=V+C+A+I;break}return i(A)}return N.toString=function(){return d+""},N}function f(d,p){var m=Math.max(-8,Math.min(8,Math.floor(Dr(p)/3)))*3,v=Math.pow(10,-m),y=u((d=qn(d),d.type="f",d),{suffix:uv[8+m/3]});return function(h){return y(v*h)}}return{format:u,formatPrefix:f}}var Sa,_f,a0;UA({thousands:",",grouping:[3],currency:["$",""]});function UA(e){return Sa=FA(e),_f=Sa.format,a0=Sa.formatPrefix,Sa}function KA(e){return Math.max(0,-Dr(Math.abs(e)))}function HA(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dr(t)/3)))*3-Dr(Math.abs(e)))}function WA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Dr(t)-Dr(e))+1}function i0(e,t,r,n){var a=Xu(e,t,r),i;switch(n=qn(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=HA(a,s))&&(n.precision=i),a0(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=WA(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=KA(a))&&(n.precision=i-(n.type==="%")*2);break}}return _f(n)}function Zt(e){var t=e.domain;return e.ticks=function(r){var n=t();return zu(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return i0(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],l=n[i],c,u,f=10;for(l<s&&(u=s,s=l,l=u,u=a,a=i,i=u);f-- >0;){if(u=Vu(s,l,r),u===c)return n[a]=s,n[i]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function ti(){var e=jf();return e.copy=function(){return pa(e,ti())},gt.apply(e,arguments),Zt(e)}function s0(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Ja),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return s0(e).unknown(t)},e=arguments.length?Array.from(e,Ja):[0,1],Zt(r)}function o0(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}function dv(e){return Math.log(e)}function fv(e){return Math.exp(e)}function GA(e){return-Math.log(-e)}function zA(e){return-Math.exp(-e)}function VA(e){return isFinite(e)?+("1e"+e):e<0?0:e}function XA(e){return e===10?VA:e===Math.E?Math.exp:t=>Math.pow(e,t)}function YA(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function pv(e){return(t,r)=>-e(-t,r)}function Sf(e){const t=e(dv,fv),r=t.domain;let n=10,a,i;function s(){return a=YA(n),i=XA(n),r()[0]<0?(a=pv(a),i=pv(i),e(GA,zA)):e(dv,fv),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let p=a(u),m=a(f),v,y;const h=l==null?10:+l;let w=[];if(!(n%1)&&m-p<h){if(p=Math.floor(p),m=Math.ceil(m),u>0){for(;p<=m;++p)for(v=1;v<n;++v)if(y=p<0?v/i(-p):v*i(p),!(y<u)){if(y>f)break;w.push(y)}}else for(;p<=m;++p)for(v=n-1;v>=1;--v)if(y=p>0?v/i(-p):v*i(p),!(y<u)){if(y>f)break;w.push(y)}w.length*2<h&&(w=zu(u,f,h))}else w=zu(p,m,Math.min(m-p,h)).map(i);return d?w.reverse():w},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=qn(c)).precision==null&&(c.trim=!0),c=_f(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(o0(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function l0(){const e=Sf(Hi()).domain([1,10]);return e.copy=()=>pa(e,l0()).base(e.base()),gt.apply(e,arguments),e}
12function hv(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mv(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Of(e){var t=1,r=e(hv(t),mv(t));return r.constant=function(n){return arguments.length?e(hv(t=+n),mv(t)):t},Zt(r)}function c0(){var e=Of(Hi());return e.copy=function(){return pa(e,c0()).constant(e.constant())},gt.apply(e,arguments)}function gv(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ZA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function JA(e){return e<0?-e*e:e*e}function Af(e){var t=e(Ze,Ze),r=1;function n(){return r===1?e(Ze,Ze):r===.5?e(ZA,JA):e(gv(r),gv(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Zt(t)}function Nf(){var e=Af(Hi());return e.copy=function(){return pa(e,Nf()).exponent(e.exponent())},gt.apply(e,arguments),e}function QA(){return Nf.apply(null,arguments).exponent(.5)}function vv(e){return Math.sign(e)*e*e}function eN(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function u0(){var e=jf(),t=[0,1],r=!1,n;function a(i){var s=eN(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert(vv(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Ja)).map(vv)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return u0(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},gt.apply(a,arguments),Zt(a)}function d0(){var e=[],t=[],r=[],n;function a(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=iA(e,s/l);return i}function i(s){return s==null||isNaN(s=+s)?n:t[da(r,s)]}return i.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Vt),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return d0().domain(e).range(t).unknown(n)},gt.apply(i,arguments)}function f0(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function s(c){return c!=null&&c<=c?a[da(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},s.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return f0().domain([e,t]).range(a).unknown(i)},gt.apply(Zt(s),arguments)}function p0(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[da(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return p0().domain(e).range(t).unknown(r)},gt.apply(a,arguments)}const Ac=new Date,Nc=new Date;function He(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),l=a.ceil(i);return i-s<l-i?s:l},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<s);return c},a.filter=i=>He(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!i(s););else for(;--l>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>
vendor: 5,190 bytes, line 12
12(Ac.setTime(+i),Nc.setTime(+s),e(Ac),e(Nc),Math.floor(r(Ac,Nc))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const ri=He(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ri.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?He(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ri);ri.range;const It=1e3,ht=It*60,Rt=ht*60,qt=Rt*24,Ef=qt*7,yv=qt*30,Ec=qt*365,ur=He(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*It)},(e,t)=>(t-e)/It,e=>e.getUTCSeconds());ur.range;const Tf=He(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getMinutes());Tf.range;const Pf=He(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getUTCMinutes());Pf.range;const Cf=He(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*It-e.getMinutes()*ht)},(e,t)=>{e.setTime(+e+t*Rt)},(e,t)=>(t-e)/Rt,e=>e.getHours());Cf.range;const Mf=He(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Rt)},(e,t)=>(t-e)/Rt,e=>e.getUTCHours());Mf.range;const ha=He(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ht)/qt,e=>e.getDate()-1);ha.range;const Wi=He(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qt,e=>e.getUTCDate()-1);Wi.range;const h0=He(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qt,e=>Math.floor(e/qt));h0.range;function gr(e){return He(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*ht)/Ef)}const Gi=gr(0),ni=gr(1),tN=gr(2),rN=gr(3),Lr=gr(4),nN=gr(5),aN=gr(6);Gi.range;ni.range;tN.range;rN.range;Lr.range;nN.range;aN.range;function vr(e){return He(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Ef)}const zi=vr(0),ai=vr(1),iN=vr(2),sN=vr(3),qr=vr(4),oN=vr(5),lN=vr(6);zi.range;ai.range;iN.range;sN.range;qr.range;oN.range;lN.range;const If=He(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());If.range;const Rf=He(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Rf.range;const Bt=He(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Bt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:He(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Bt.range;const Ft=He(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ft.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:He(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ft.range;function m0(e,t,r,n,a,i){const s=[[ur,1,It],[ur,5,5*It],[ur,15,15*It],[ur,30,30*It],[i,1,ht],[i,5,5*ht],[i,15,15*ht],[i,30,30*ht],[a,1,Rt],[a,3,3*Rt],[a,6,6*Rt],[a,12,12*Rt],[n,1,qt],[n,2,2*qt],[r,1,Ef],[t,1,yv],[t,3,3*yv],[e,1,Ec]];function l(u,f,d){const p=f<u;p&&([u,f]=[f,u]);const m=d&&typeof d.range=="function"?d:c(u,f,d),v=m?m.range(u,+f+1):[];return p?v.reverse():v}function c(u,f,d){const p=Math.abs(f-u)/d,m=vf(([,,h])=>h).right(s,p);if(m===s.length)return e.every(Xu(u/Ec,f/Ec,d));if(m===0)return ri.every(Math.max(Xu(u,f,d),1));const[v,y]=s[p/s[m-1][2]<s[m][2]/p?m-1:m];return v.every(y)}return[l,c]}const[cN,uN]=m0(Ft,Rf,zi,h0,Mf,Pf),[dN,fN]=m0(Bt,If,Gi,ha,Cf,Tf);function Tc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Pc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function dn(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function pN(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=fn(a),f=pn(a),d=fn(i),p=pn(i),m=fn(s),v=pn(s),y=fn(l),h=pn(l),w=fn(c),j=pn(c),x={a:D,A:R,b:F,B:V,c:null,d:_v,e:_v,f:$N,g:GN,G:VN,H:MN,I:IN,j:RN,L:g0,m:DN,M:LN,p:Z,q:W,Q:Av,s:Nv,S:qN,u:BN,U:FN,V:UN,w:KN,W:HN,x:null,X:null,y:WN,Y:zN,Z:XN,"%":Ov},k={a:re,A:ce,b:H,B:ae,c:null,d:Sv,e:Sv,f:QN,g:cE,G:dE,H:YN,I:ZN,j:JN,L:y0,m:eE,M:tE,p:K,q:z,Q:Av,s:Nv,S:rE,u:nE,U:aE,V:iE,w:sE,W:oE,x:null,X:null,y:lE,Y:uE,Z:fE,"%":Ov},g={a:T,A:N,b:A,B:C,c:I,d:jv,e:jv,f:EN,g:wv,G:bv,H:kv,I:kv,j:SN,L:NN,m:_N,M:ON,p:E,q:kN,Q:PN,s:CN,S:AN,u:yN,U:xN,V:bN,w:vN,W:wN,x:P,X:L,y:wv,Y:bv,Z:jN,"%":TN};x.x=b(r,x),x.X=b(n,x),x.c=b(t,x),k.x=b(r,k),k.X=b(n,k),k.c=b(t,k);function b(B,X){return function(J){var U=[],ye=-1,ue=0,$e=B.length,Me,De,tt;for(J instanceof Date||(J=new Date(+J));++ye<$e;
vendor: 6,264 bytes, line 12
12)B.charCodeAt(ye)===37&&(U.push(B.slice(ue,ye)),(De=xv[Me=B.charAt(++ye)])!=null?Me=B.charAt(++ye):De=Me==="e"?" ":"0",(tt=X[Me])&&(Me=tt(J,De)),U.push(Me),ue=ye+1);return U.push(B.slice(ue,ye)),U.join("")}}function S(B,X){return function(J){var U=dn(1900,void 0,1),ye=O(U,B,J+="",0),ue,$e;if(ye!=J.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(X&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(ue=Pc(dn(U.y,0,1)),$e=ue.getUTCDay(),ue=$e>4||$e===0?ai.ceil(ue):ai(ue),ue=Wi.offset(ue,(U.V-1)*7),U.y=ue.getUTCFullYear(),U.m=ue.getUTCMonth(),U.d=ue.getUTCDate()+(U.w+6)%7):(ue=Tc(dn(U.y,0,1)),$e=ue.getDay(),ue=$e>4||$e===0?ni.ceil(ue):ni(ue),ue=ha.offset(ue,(U.V-1)*7),U.y=ue.getFullYear(),U.m=ue.getMonth(),U.d=ue.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),$e="Z"in U?Pc(dn(U.y,0,1)).getUTCDay():Tc(dn(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-($e+5)%7:U.w+U.U*7-($e+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Pc(U)):Tc(U)}}function O(B,X,J,U){for(var ye=0,ue=X.length,$e=J.length,Me,De;ye<ue;){if(U>=$e)return-1;if(Me=X.charCodeAt(ye++),Me===37){if(Me=X.charAt(ye++),De=g[Me in xv?X.charAt(ye++):Me],!De||(U=De(B,J,U))<0)return-1}else if(Me!=J.charCodeAt(U++))return-1}return U}function E(B,X,J){var U=u.exec(X.slice(J));return U?(B.p=f.get(U[0].toLowerCase()),J+U[0].length):-1}function T(B,X,J){var U=m.exec(X.slice(J));return U?(B.w=v.get(U[0].toLowerCase()),J+U[0].length):-1}function N(B,X,J){var U=d.exec(X.slice(J));return U?(B.w=p.get(U[0].toLowerCase()),J+U[0].length):-1}function A(B,X,J){var U=w.exec(X.slice(J));return U?(B.m=j.get(U[0].toLowerCase()),J+U[0].length):-1}function C(B,X,J){var U=y.exec(X.slice(J));return U?(B.m=h.get(U[0].toLowerCase()),J+U[0].length):-1}function I(B,X,J){return O(B,t,X,J)}function P(B,X,J){return O(B,r,X,J)}function L(B,X,J){return O(B,n,X,J)}function D(B){return s[B.getDay()]}function R(B){return i[B.getDay()]}function F(B){return c[B.getMonth()]}function V(B){return l[B.getMonth()]}function Z(B){return a[+(B.getHours()>=12)]}function W(B){return 1+~~(B.getMonth()/3)}function re(B){return s[B.getUTCDay()]}function ce(B){return i[B.getUTCDay()]}function H(B){return c[B.getUTCMonth()]}function ae(B){return l[B.getUTCMonth()]}function K(B){return a[+(B.getUTCHours()>=12)]}function z(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var X=b(B+="",x);return X.toString=function(){return B},X},parse:function(B){var X=S(B+="",!1);return X.toString=function(){return B},X},utcFormat:function(B){var X=b(B+="",k);return X.toString=function(){return B},X},utcParse:function(B){var X=S(B+="",!0);return X.toString=function(){return B},X}}}var xv={"-":"",_:" ",0:"0"},Ge=/^\s*\d+/,hN=/^%/,mN=/[\\^$*+?|[\]().{}]/g;function ge(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function gN(e){return e.replace(mN,"\\$&")}function fn(e){return new RegExp("^(?:"+e.map(gN).join("|")+")","i")}function pn(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function vN(e,t,r){var n=Ge.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function yN(e,t,r){var n=Ge.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function xN(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function bN(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function wN(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function bv(e,t,r){var n=Ge.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wv(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function jN(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function kN(e,t,r){var n=Ge.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function _N(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function jv(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function SN(e,t,r){var n=Ge.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function kv(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function ON(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function AN(e,t,r){var n=Ge.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function NN(e,t,r){var n=Ge.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function EN(e,t,r){var n=Ge.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function TN(e,t,r){var n=hN.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function PN(e,t,r){var n=Ge.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function CN(e,t,r){var n=Ge.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function _v(e,t){return ge(e.getDate(),t,2)}function MN(e,t){return ge(e.getHours(),t,2)}function IN(e,t){return ge(e.getHours()%12||12,t,2)}function RN(e,t){return ge(1+ha.count(Bt(e),e),t,3)}function g0(e,t){return ge(e.getMilliseconds(),t,3)}function $N(e,t){return g0(e,t)+"000"}function DN(e,t){return ge(e.getMonth()+1,t,2)}function LN(e,t){return ge(e.getMinutes(),t,2)}function qN(e,t){return ge(e.getSeconds(),t,2)}function BN(e){var t=e.getDay();return t===0?7:t}function FN(e,t){return ge(Gi.count(Bt(e)-1,e),t,2)}function v0(e){var t=e.getDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function UN(e,t){return e=v0(e),ge(Lr.count(Bt(e),e)+(Bt(e).getDay()===4),t,2)}function KN(e){return e.getDay()}function HN(e,t){return ge(ni.count(Bt(e)-1,e),t,2)}function WN(e,t){return ge(e.getFullYear()%100,t,2)}function GN(e,t){return e=v0(e),ge(e.getFullYear()%100,t,2)}function zN(e,t){return ge(e.getFullYear()%1e4,t,4)}function VN(e,t){var r=e.getDay();return e=r>=4||r===0?Lr(e):Lr.ceil(e),ge(e.getFullYear()%1e4,t,4)}function XN(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ge(t/60|0,"0",2)+ge(t%60,"0",2)}function Sv(e,t){return ge(e.getUTCDate(),t,2)}function YN(e,t){return ge(e.getUTCHours(),t,2)}function ZN(e,t){return ge(e.getUTCHours()%12||12,t,2)}
12function JN(e,t){return ge(1+Wi.count(Ft(e),e),t,3)}function y0(e,t){return ge(e.getUTCMilliseconds(),t,3)}function QN(e,t){return y0(e,t)+"000"}function eE(e,t){return ge(e.getUTCMonth()+1,t,2)}function tE(e,t){return ge(e.getUTCMinutes(),t,2)}function rE(e,t){return ge(e.getUTCSeconds(),t,2)}function nE(e){var t=e.getUTCDay();return t===0?7:t}function aE(e,t){return ge(zi.count(Ft(e)-1,e),t,2)}function x0(e){var t=e.getUTCDay();return t>=4||t===0?qr(e):qr.ceil(e)}function iE(e,t){return e=x0(e),ge(qr.count(Ft(e),e)+(Ft(e).getUTCDay()===4),t,2)}function sE(e){return e.getUTCDay()}function oE(e,t){return ge(ai.count(Ft(e)-1,e),t,2)}function lE(e,t){return ge(e.getUTCFullYear()%100,t,2)}function cE(e,t){return e=x0(e),ge(e.getUTCFullYear()%100,t,2)}function uE(e,t){return ge(e.getUTCFullYear()%1e4,t,4)}function dE(e,t){var r=e.getUTCDay();return e=r>=4||r===0?qr(e):qr.ceil(e),ge(e.getUTCFullYear()%1e4,t,4)}function fE(){return"+0000"}function Ov(){return"%"}function Av(e){return+e}function Nv(e){return Math.floor(+e/1e3)}var wr,b0,w0;pE({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 pE(e){return wr=pN(e),b0=wr.format,wr.parse,w0=wr.utcFormat,wr.utcParse,wr}function hE(e){return new Date(e)}function mE(e){return e instanceof Date?+e:+new Date(+e)}function $f(e,t,r,n,a,i,s,l,c,u){var f=jf(),d=f.invert,p=f.domain,m=u(".%L"),v=u(":%S"),y=u("%I:%M"),h=u("%I %p"),w=u("%a %d"),j=u("%b %d"),x=u("%B"),k=u("%Y");function g(b){return(c(b)<b?m:l(b)<b?v:s(b)<b?y:i(b)<b?h:n(b)<b?a(b)<b?w:j:r(b)<b?x:k)(b)}return f.invert=function(b){return new Date(d(b))},f.domain=function(b){return arguments.length?p(Array.from(b,mE)):p().map(hE)},f.ticks=function(b){var S=p();return e(S[0],S[S.length-1],b??10)},f.tickFormat=function(b,S){return S==null?g:u(S)},f.nice=function(b){var S=p();return(!b||typeof b.range!="function")&&(b=t(S[0],S[S.length-1],b??10)),b?p(o0(S,b)):f},f.copy=function(){return pa(f,$f(e,t,r,n,a,i,s,l,c,u))},f}function gE(){return gt.apply($f(dN,fN,Bt,If,Gi,ha,Cf,Tf,ur,b0).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function vE(){return gt.apply($f(cN,uN,Ft,Rf,zi,Wi,Mf,Pf,ur,w0).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Vi(){var e=0,t=1,r,n,a,i,s=Ze,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(a===0?.5:(d=(i(d)-r)*a,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function f(d){return function(p){var m,v;return arguments.length?([m,v]=p,s=d(m,v),u):[s(0),s(1)]}}return u.range=f(rn),u.rangeRound=f(wf),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Jt(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function j0(){var e=Zt(Vi()(Ze));return e.copy=function(){return Jt(e,j0())},Ht.apply(e,arguments)}function k0(){var e=Sf(Vi()).domain([1,10]);return e.copy=function(){return Jt(e,k0()).base(e.base())},Ht.apply(e,arguments)}function _0(){var e=Of(Vi());return e.copy=function(){return Jt(e,_0()).constant(e.constant())},Ht.apply(e,arguments)}function Df(){var e=Af(Vi());return e.copy=function(){return Jt(e,Df()).exponent(e.exponent())},Ht.apply(e,arguments)}function yE(){return Df.apply(null,arguments).exponent(.5)}function S0(){var e=[],t=Ze;function r(n){if(n!=null&&!isNaN(n=+n))return t((da(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Vt),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>aA(e,i/n))},r.copy=function(){return S0(t).domain(e)},Ht.apply(r,arguments)}function Xi(){var e=0,t=.5,r=1,n=1,a,i,s,l,c,u=Ze,f,d=!1,p;function m(y){return isNaN(y=+y)?p:(y=.5+((y=+f(y))-i)*(n*y<n*i?l:c),u(d?Math.max(0,Math.min(1,y)):y))}m.domain=function(y){return arguments.length?([e,t,r]=y,a=f(e=+e),i=f(t=+t),s=f(r=+r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,m):[e,t,r]},m.clamp=function(y){return arguments.length?(d=!!y,m):d},m.interpolator=function(y){return arguments.length?(u=y,m):u};function v(y){return function(h){var w,j,x;return arguments.length?([w,j,x]=h,u=TA(y,[w,j,x]),m):[u(0),u(.5),u(1)]}}return m.range=v(rn),m.rangeRound=v(wf),m.unknown=function(y){return arguments.length?(p=y,m):p},function(y){return f=y,a=y(e),i=y(t),s=y(r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,m}}function O0(){var e=Zt(Xi()(Ze));return e.copy=function(){return Jt(e,O0())},Ht.apply(e,arguments)}function A0(){var e=Sf(Xi()).domain([.1,1,10]);return e.copy=function(){return Jt(e,A0()).base(e.base())},Ht.apply(e,arguments)}function N0(){var e=Of(Xi());return e.copy=function(){return Jt(e,N0()).constant(e.constant())},Ht.apply(e,arguments)}function Lf(){var e=Af(Xi());return e.copy=function(){return Jt(e,Lf()).exponent(e.exponent())},Ht.apply(e,arguments)}function xE(){return Lf.apply(null,arguments).exponent(.5)}const Ev=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Rn,scaleDiverging:O0,scaleDivergingLog:A0,scaleDivergingPow:Lf,scaleDivergingSqrt:xE,scaleDivergingSymlog:N0,scaleIdentity:s0,scaleImplicit:Yu,scaleLinear:ti,scaleLog:l0,scaleOrdinal:yf,scalePoint:kn,scalePow:Nf,scaleQuantile:d0,scaleQuantize:f0,scaleRadial:u0,scaleSequential:j0,scaleSequentialLog:k0,scaleSequentialPow:Df,scaleSequentialQuantile:S0,scaleSequentialSqrt:yE,scaleSequentialSymlog:_0,scaleSqrt:QA,scaleSymlog:c0,scaleThreshold:p0,scaleTime:gE,scaleUtc:vE,tick
vendor: 68,516 bytes, lines 12-39
12Format:i0},Symbol.toStringTag,{value:"Module"}));var Cc,Tv;function Yi(){if(Tv)return Cc;Tv=1;var e=Qr();function t(r,n,a){for(var i=-1,s=r.length;++i<s;){var l=r[i],c=n(l);if(c!=null&&(u===void 0?c===c&&!e(c):a(c,u)))var u=c,f=l}return f}return Cc=t,Cc}var Mc,Pv;function E0(){if(Pv)return Mc;Pv=1;function e(t,r){return t>r}return Mc=e,Mc}var Ic,Cv;function bE(){if(Cv)return Ic;Cv=1;var e=Yi(),t=E0(),r=tn();function n(a){return a&&a.length?e(a,r,t):void 0}return Ic=n,Ic}var wE=bE();const Zi=Se(wE);var Rc,Mv;function T0(){if(Mv)return Rc;Mv=1;function e(t,r){return t<r}return Rc=e,Rc}var $c,Iv;function jE(){if(Iv)return $c;Iv=1;var e=Yi(),t=T0(),r=tn();function n(a){return a&&a.length?e(a,r,t):void 0}return $c=n,$c}var kE=jE();const Ji=Se(kE);var Dc,Rv;function _E(){if(Rv)return Dc;Rv=1;var e=Jd(),t=Pt(),r=qb(),n=et();function a(i,s){var l=n(i)?e:r;return l(i,t(s,3))}return Dc=a,Dc}var Lc,$v;function SE(){if($v)return Lc;$v=1;var e=Db(),t=_E();function r(n,a){return e(t(n,a),1)}return Lc=r,Lc}var OE=SE();const AE=Se(OE);var qc,Dv;function NE(){if(Dv)return qc;Dv=1;var e=ff();function t(r,n){return e(r,n)}return qc=t,qc}var EE=NE();const qf=Se(EE);var nn=1e9,TE={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ff,Pe=!0,mt="[DecimalError] ",fr=mt+"Invalid argument: ",Bf=mt+"Exponent out of range: ",an=Math.floor,ir=Math.pow,PE=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,at,We=1e7,Ee=7,P0=9007199254740991,ii=an(P0/Ee),Q={};Q.absoluteValue=Q.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Q.comparedTo=Q.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Q.decimalPlaces=Q.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ee;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Q.dividedBy=Q.div=function(e){return Lt(this,new this.constructor(e))};Q.dividedToIntegerBy=Q.idiv=function(e){var t=this,r=t.constructor;return je(Lt(t,new r(e),0,1),r.precision)};Q.equals=Q.eq=function(e){return!this.cmp(e)};Q.exponent=function(){return qe(this)};Q.greaterThan=Q.gt=function(e){return this.cmp(e)>0};Q.greaterThanOrEqualTo=Q.gte=function(e){return this.cmp(e)>=0};Q.isInteger=Q.isint=function(){return this.e>this.d.length-2};Q.isNegative=Q.isneg=function(){return this.s<0};Q.isPositive=Q.ispos=function(){return this.s>0};Q.isZero=function(){return this.s===0};Q.lessThan=Q.lt=function(e){return this.cmp(e)<0};Q.lessThanOrEqualTo=Q.lte=function(e){return this.cmp(e)<1};Q.logarithm=Q.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(at))throw Error(mt+"NaN");if(r.s<1)throw Error(mt+(r.s?"NaN":"-Infinity"));return r.eq(at)?new n(0):(Pe=!1,t=Lt(Bn(r,i),Bn(e,i),i),Pe=!0,je(t,a))};Q.minus=Q.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?I0(t,e):C0(t,(e.s=-e.s,e))};Q.modulo=Q.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(mt+"NaN");return r.s?(Pe=!1,t=Lt(r,e,0,1).times(e),Pe=!0,r.minus(t)):je(new n(r),a)};Q.naturalExponential=Q.exp=function(){return M0(this)};Q.naturalLogarithm=Q.ln=function(){return Bn(this)};Q.negated=Q.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Q.plus=Q.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?C0(t,e):I0(t,(e.s=-e.s,e))};Q.precision=Q.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(fr+e);if(t=qe(a)+1,n=a.d.length-1,r=n*Ee+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Q.squareRoot=Q.sqrt=function(){var e,t,r,n,a,i,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(mt+"NaN")}for(e=qe(l),Pe=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=_t(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=an((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=s=r+3;;)if(i=n,n=i.plus(Lt(l,i,s+2)).times(.5),_t(i.d).slice(0,s)===(t=_t(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(je(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;s+=4}return Pe=!0,je(n,r)};Q.times=Q.mul=function(e){var t,r,n,a,i,s,l,c,u,f=this,d=f.constructor,p=f.d,m=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=p.length,u=m.length,c<u&&(i=p,p=m,m=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+m[n]*p[a-n-1]+t,i[a--]=l%We|0,t=l/We|0;i[a]=(i[a]+t)%We|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Pe?je(e,d.precision):e};Q.toDecimalPlaces=Q.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Nt(e,0,nn),t===void 0?t=n.rounding:Nt(t,0,8),je(r,e+qe(r)+1,t))};Q.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=hr(n,!0):(Nt(e,0,nn),t===void 0?t=a.rounding:Nt(t,0,8),n=je(new a(n),e+1,t),r=hr(n,!0,e+1)),r};Q.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?hr(a):(Nt(e,0,nn),t===void 0?t=i.rounding:Nt(t,0,8),n=je(new i(a),e+qe(a)+1,t),r=hr(n.abs(),!1,e+qe(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Q.toInteger=Q.toint=function(){var e=this,t=e.constructor;return je(new t(e),qe(e)+1,t.rounding)};Q.toNumber=function(){return+this};Q.toPower=Q.pow=function(e){var t,r,n,a,i,s,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(at);if(l=new c(l),!l.s){if(e.s<1)throw Error(mt+"Infinity");return l}if(l.eq(at))return l;if(n=c.precision,e.eq(at))return je(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=l.s,s){if((r=f<0?-f:f)<=P0){for(a=new c(at),t=Math.ceil(n/Ee+4),Pe=!1;r%2&&(a=a.times(l),qv(a.d,t)),r=an(r/2),r!==0;)l=l.times(l),qv(l.d,t);return Pe=!0,e.s<0?new c(at).div(a):je(a,n)}}else if(i<0)throw Error(mt+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Pe=!1,a=e.times(Bn(l,n+u)),Pe=!0,a=M0(a),a.s=i,a};Q.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=qe(a),n=hr(a,r<=i.toExpNeg||r>=i.toExpPos)):(Nt(e,1,nn),t===void 0?t=i.rounding:Nt(t,0,8),a=je(new i(a),e,t),r=qe(a),n=hr(a,e<=r||r<=i.toExpNeg,e)),n};Q.toSignificantDigits=Q.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Nt(e,1,nn),t===void 0?t=n.rounding:Nt(t,0,8)),je(new n(r),e,t)};Q.toString=Q.valueOf=Q.val=Q.toJSON=Q[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=qe(e),r=e.constructor;return hr(e,t<=r.toExpNeg||t>=r.toExpPos)};function C0(e,t){var r,n,a,i,s,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Pe?je(t,d):t;if(c=e.d,u=t.d,s=e.e,a=t.e,c=c.slice(),i=s-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=s,l=c.length),s=Math.ceil(d/Ee),l=s>l?s+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/We|0,c[i]%=We;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Pe?je(t,d):t}function Nt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(fr+e)}function _t(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)n=e[t]+"",r=Ee-n.length,r&&(i+=zt(r)),i+=n;s=e[t],n=s+"",r=Ee-n.length,r&&(i+=zt(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var Lt=(function(){function e(n,a){var i,s=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+s,n[l]=i%We|0,s=i/We|0;return s&&n.unshift(s),n}function t(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]<a[i]?1:0,n[i]=s*We+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s){var l,c,u,f,d,p,m,v,y,h,w,j,x,k,g,b,S,O,E=n.constructor,T=n.s==a.s?1:-1,N=n.d,A=a.d;if(!n.s)return new E(n);if(!a.s)throw Error(mt+"Division by zero");for(c=n.e-a.e,S=A.length,g=N.length,m=new E(T),v=m.d=[],u=0;A[u]==(N[u]||0);)++u;if(A[u]>(N[u]||0)&&--c,i==null?j=i=E.precision:s?j=i+(qe(n)-qe(a))+1:j=i,j<0)return new E(0);if(j=j/Ee+2|0,u=0,S==1)for(f=0,A=A[0],j++;(u<g||f)&&j--;u++)x=f*We+(N[u]||0),v[u]=x/A|0,f=x%A|0;else{for(f=We/(A[0]+1)|0,f>1&&(A=e(A,f),N=e(N,f),S=A.length,g=N.length),k=S,y=N.slice(0,S),h=y.length;h<S;)y[h++]=0;O=A.slice(),O.unshift(0),b=A[0],A[1]>=We/2&&++b;do f=0,l=t(A,y,S,h),l<0?(w=y[0],S!=h&&(w=w*We+(y[1]||0)),f=w/b|0,f>1?(f>=We&&(f=We-1),d=e(A,f),p=d.length,h=y.length,l=t(d,y,p,h),l==1&&(f--,r(d,S<p?O:A,p))):(f==0&&(l=f=1),d=A.slice()),p=d.length,p<h&&d.unshift(0),r(y,d,h),l==-1&&(h=y.length,l=t(A,y,S,h),l<1&&(f++,r(y,S<h?O:A,h))),h=y.length):l===0&&(f++,y=[0]),v[u++]=f,l&&y[0]?y[h++]=N[k]||0:(y=[N[k]],h=1);while((k++<g||y[0]!==void 0)&&j--)}return v[0]||v.shift(),m.e=c,je(m,s?i+qe(m)+1:i)}})();function M0(e,t){var r,n,a,i,s,l,c=0,u=0,f=e.constructor,d=f.precision;if(qe(e)>16)throw Error(Bf+qe(e));if(!e.s)return new f(at);for(Pe=!1,l=d,s=new f(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(ir(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new f(at),f.precision=l;;){if(a=je(a.times(e),l),r=r.times(++c),s=i.plus(Lt(a,r,l)),_t(s.d).slice(0,l)===_t(i.d).slice(0,l)){for(;u--;)i=je(i.times(i),l);return f.precision=d,t==null?(Pe=!0,je(i,d)):i}i=s}}function qe(e){for(var t=e.e*Ee,r=e.d[0];r>=10;r/=10)t++;return t}function Bc(e,t,r){if(t>e.LN10.sd())throw Pe=!0,r&&(e.precision=r),Error(mt+"LN10 precision limit exceeded");return je(new e(e.LN10),t)}function zt(e){for(var t="";e--;)t+="0";return t}function Bn(e,t){var r,n,a,i,s,l,c,u,f,d=1,p=10,m=e,v=m.d,y=m.constructor,h=y.precision;if(m.s<1)throw Error(mt+(m.s?"NaN":"-Infinity"));if(m.eq(at))return new y(0);if(t==null?(Pe=!1,u=h):u=t,m.eq(10))return t==null&&(Pe=!0),Bc(y,u);if(u+=p,y.precision=u,r=_t(v),n=r.charAt(0),i=qe(m),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=_t(m.d),n=r.charAt(0),d++;i=qe(m),n>1?(m=new y("0."+r),i++):m=new y(n+"."+r.slice(1))}else return c=Bc(y,u+2,h).times(i+""),m=Bn(new y(n+"."+r.slice(1)),u-p).plus(c),y.precision=h,t==null?(Pe=!0,je(m,h)):m;for(l=s=m=Lt(m.minus(at),m.plus(at),u),f=je(m.times(m),u),a=3;;){if(s=je(s.times(f),u),c=l.plus(Lt(s,new y(a),u)),_t(c.d).slice(0,u)===_t(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(Bc(y,u+2,h).times(i+""))),l=Lt(l,new y(d),u),y.precision=h,t==null?(Pe=!0,je(l,h)):l;l=c,a+=2}}function Lv(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=an(r/Ee),e.d=[],n=(r+1)%Ee,r<0&&(n+=Ee),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=Ee;n<a;)e.d.push(+t.slice(n,n+=Ee));t=t.slice(n),n=Ee-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Pe&&(e.e>ii||e.e<-ii))throw Error(Bf+r)}else e.s=0,e.e=0,e.d=[0];return e}function je(e,t,r){var n,a,i,s,l,c,u,f,d=e.d;for(s=1,i=d[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=Ee,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/Ee),i=d.length,f>=i)return e;for(u=i=d[f],s=1;i>=10;i/=10)s++;n%=Ee,a=n-Ee+s}if(r!==void 0&&(i=ir(10,s-a-1),l=u/i%10|0,c=t<0||d[f+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/ir(10,s-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=qe(e),d.length=1,t=t-i-1,d[0]=ir(10,(Ee-t%Ee)%Ee),e.e=an(-t/Ee)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=ir(10,Ee-n),d[f]=a>0?(u/ir(10,s-a)%ir(10,a)|0)*i:0),c)for(;;)if(f==0){(d[0]+=i)==We&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=We)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(Pe&&(e.e>ii||e.e<-ii))throw Error(Bf+qe(e));return e}function I0(e,t){var r,n,a,i,s,l,c,u,f,d,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Pe?je(t,m):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(f=s<0,f?(r=c,s=-s,l=d.length):(r=d,n=u,l=c.length),a=Math.max(Math.ceil(m/Ee),l)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=d.length,f=a<l,f&&(l=a),a=0;a<l;a++)if(c[a]!=d[a]){f=c[a]<d[a];break}s=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,a=d.length-l;a>0;--a)c[l++]=0;for(a=d.length;a>s;){if(c[--a]<d[a]){for(i=a;i&&c[--i]===0;)c[i]=We-1;--c[i],c[a]+=We}c[a]-=d[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Pe?je(t,m):t):new p(0)}function hr(e,t,r){var n,a=qe(e),i=_t(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+zt(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+zt(-a-1)+i,r&&(n=r-s)>0&&(i+=zt(n))):a>=s?(i+=zt(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+zt(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=zt(n))),e.s<0?"-"+i:i}function qv(e,t){if(e.length>t)return e.length=t,!0}function R0(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(fr+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return Lv(s,i.toString())}else if(typeof i!="string")throw Error(fr+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,PE.test(i))Lv(s,i);else throw Error(fr+i)}if(a.prototype=Q,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=R0,a.config=a.set=CE,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function CE(e){if(!e||typeof e!="object")throw Error(mt+"Object expected");var t,r,n,a=["precision",1,nn,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(an(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(fr+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(fr+r+": "+n);return this}var Ff=R0(TE);at=new Ff(1);const we=Ff;function ME(e){return DE(e)||$E(e)||RE(e)||IE()}function IE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RE(e,t){if(e){if(typeof e=="string")return ed(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ed(e,t)}}function $E(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function DE(e){if(Array.isArray(e))return ed(e)}function ed(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var LE=function(t){return t},$0={},D0=function(t){return t===$0},Bv=function(t){return function r(){return arguments.length===0||arguments.length===1&&D0(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},qE=function e(t,r){return t===1?r:Bv(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.filter(function(l){return l!==$0}).length;return s>=t?r.apply(void 0,a):e(t-s,Bv(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=a.map(function(d){return D0(d)?c.shift():d});return r.apply(void 0,ME(f).concat(c))}))})},Qi=function(t){return qE(t.length,t)},td=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},BE=Qi(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),FE=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return LE;var a=r.reverse(),i=a[0],s=a.slice(1);return function(){return s.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},rd=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},L0=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function UE(e){var t;return e===0?t=1:t=Math.floor(new we(e).abs().log(10).toNumber())+1,t}function KE(e,t,r){for(var n=new we(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var HE=Qi(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),WE=Qi(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),GE=Qi(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const es={rangeStep:KE,getDigitCount:UE,interpolateNumber:HE,uninterpolateNumber:WE,uninterpolateTruncation:GE};function nd(e){return XE(e)||VE(e)||q0(e)||zE()}function zE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
14In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VE(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function XE(e){if(Array.isArray(e))return ad(e)}function Fn(e,t){return JE(e)||ZE(e,t)||q0(e,t)||YE()}function YE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q0(e,t){if(e){if(typeof e=="string")return ad(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ad(e,t)}}function ad(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZE(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function JE(e){if(Array.isArray(e))return e}function B0(e){var t=Fn(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function F0(e,t,r){if(e.lte(0))return new we(0);var n=es.getDigitCount(e.toNumber()),a=new we(10).pow(n),i=e.div(a),s=n!==1?.05:.1,l=new we(Math.ceil(i.div(s).toNumber())).add(r).mul(s),c=l.mul(a);return t?c:new we(Math.ceil(c))}function QE(e,t,r){var n=1,a=new we(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new we(10).pow(es.getDigitCount(e)-1),a=new we(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new we(Math.floor(e)))}else e===0?a=new we(Math.floor((t-1)/2)):r||(a=new we(Math.floor(e)));var s=Math.floor((t-1)/2),l=FE(BE(function(c){return a.add(new we(c-s).mul(n)).toNumber()}),td);return l(0,t)}function U0(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new we(0),tickMin:new we(0),tickMax:new we(0)};var i=F0(new we(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new we(0):(s=new we(e).add(t).div(2),s=s.sub(new we(s).mod(i)));var l=Math.ceil(s.sub(e).div(i).toNumber()),c=Math.ceil(new we(t).sub(s).div(i).toNumber()),u=l+c+1;return u>r?U0(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:s.sub(new we(l).mul(i)),tickMax:s.add(new we(c).mul(i))})}function eT(e){var t=Fn(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),l=B0([r,n]),c=Fn(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(nd(td(0,a-1).map(function(){return 1/0}))):[].concat(nd(td(0,a-1).map(function(){return-1/0})),[f]);return r>n?rd(d):d}if(u===f)return QE(u,a,i);var p=U0(u,f,s,i),m=p.step,v=p.tickMin,y=p.tickMax,h=es.rangeStep(v,y.add(new we(.1).mul(m)),m);return r>n?rd(h):h}function tT(e,t){var r=Fn(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=B0([n,a]),l=Fn(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var f=Math.max(t,2),d=F0(new we(u).sub(c).div(f-1),i,0),p=[].concat(nd(es.rangeStep(new we(c),new we(u).sub(new we(.99).mul(d)),d)),[u]);return n>a?rd(p):p}var rT=L0(eT),nT=L0(tT),aT="Invariant failed";function Br(e,t){throw new Error(aT)}var iT=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Fr(e){"@babel/helpers - typeof";return Fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fr(e)}function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},si.apply(this,arguments)}function sT(e,t){return uT(e)||cT(e,t)||lT(e,t)||oT()}function oT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lT(e,t){if(e){if(typeof e=="string")return Fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fv(e,t)}}function Fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function uT(e){if(Array.isArray(e))return e}function dT(e,t){if(e==null)return{};var r=fT(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fT(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W0(n.key),n)}}function mT(e,t,r){return t&&hT(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gT(e,t,r){return t=oi(t),vT(e,K0()?Reflect.construct(t,r||[],oi(e).constructor):t.apply(e,r))}function vT(e,t){if(t&&(Fr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yT(e)}function yT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K0(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K0=function(){return!!e})()}function oi(e){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oi(e)}function xT(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&id(e,t)}function id(e,t){return id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},id(e,t)}function H0(e,t,r){return t=W0(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W0(e){var t=bT(e,"string");return Fr(t)=="symbol"?t:t+""}function bT(e,t){if(Fr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Uf=(function(e){function t(){return pT(this,t),gT(this,t,arguments)}return xT(t,e),mT(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,p=dT(n,iT),m=le(p,!1);this.props.direction==="x"&&f.type!=="number"&&Br();var v=c.map(function(y){var h=u(y,l),w=h.x,j=h.y,x=h.value,k=h.errorVal;if(!k)return null;var g=[],b,S;if(Array.isArray(k)){var O=sT(k,2);b=O[0],S=O[1]}else b=S=k;if(i==="vertical"){var E=f.scale,T=j+a,N=T+s,A=T-s,C=E(x-b),I=E(x+S);g.push({x1:I,y1:N,x2:I,y2:A}),g.push({x1:C,y1:T,x2:I,y2:T}),g.push({x1:C,y1:N,x2:C,y2:A})}else if(i==="horizontal"){var P=d.scale,L=w+a,D=L-s,R=L+s,F=P(x-b),V=P(x+S);g.push({x1:D,y1:V,x2:R,y2:V}),g.push({x1:L,y1:F,x2:L,y2:V}),g.push({x1:D,y1:F,x2:R,y2:F})}return $.createElement(Re,si({className:"recharts-errorBar",key:"bar-".concat(g.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},m),g.map(function(Z){return $.createElement("line",si({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return $.createElement(Re,{className:"recharts-errorBars"},v)}}])})($.Component);H0(Uf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});H0(Uf,"displayName","ErrorBar");function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function Uv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uv(Object(r),!0).forEach(function(n){wT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wT(e,t,r){return t=jT(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jT(e){var t=kT(e,"string");return Un(t)=="symbol"?t:t+""}function kT(e,t){if(Un(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var G0=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,s=ut(r,Ar);if(!s)return null;var l=Ar.defaultProps,c=l!==void 0?tr(tr({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:i==="children"?u=(n||[]).reduce(function(f,d){var p=d.item,m=d.props,v=m.sectors||m.data||[];return f.concat(v.map(function(y){return{type:s.props.iconType||p.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):u=(n||[]).map(function(f){var d=f.item,p=d.type.defaultProps,m=p!==void 0?tr(tr({},p),d.props):{},v=m.dataKey,y=m.name,h=m.legendType,w=m.hide;return{inactive:w,dataKey:v,type:c.iconType||h||"square",color:Kf(d),value:y||v,payload:m}}),tr(tr(tr({},c),Ar.getWithHeight(s,a)),{},{payload:u,item:s})};function Kn(e){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(e)}function Kv(e){return AT(e)||OT(e)||ST(e)||_T()}function _T(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ST(e,t){if(e){if(typeof e=="string")return sd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sd(e,t)}}function OT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AT(e){if(Array.isArray(e))return sd(e)}function sd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hv(Object(r),!0).forEach(function(n){Er(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Er(e,t,r){return t=NT(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NT(e){var t=ET(e,"string");return Kn(t)=="symbol"?t:t+""}function ET(e,t){if(Kn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function it(e,t,r){return he(e)||he(t)?r:Fe(t)?wt(e,t,r):de(t)?t(e):r}function _n(e,t,r,n){var a=AE(e,function(l){return it(l,t)});if(r==="number"){var i=a.filter(function(l){return Y(l)||parseFloat(l)});return i.length?[Ji(i),Zi(i)]:[1/0,-1/0]}var s=n?a.filter(function(l){return!he(l)}):a;return s.map(function(l){return Fe(l)||l instanceof Date?l:""})}var TT=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n?.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var f=u>0?a[u-1].coordinate:a[l-1].coordinate,d=a[u].coordinate,p=u>=l-1?a[0].coordinate:a[u+1].coordinate,m=void 0;if(pt(d-f)!==pt(p-d)){var v=[];if(pt(p-d)===pt(c[1]-c[0])){m=p;var y=d+c[1]-c[0];v[0]=Math.min(y,(y+f)/2),v[1]=Math.max(y,(y+f)/2)}else{m=f;var h=p+c[1]-c[0];v[0]=Math.min(d,(h+d)/2),v[1]=Math.max(d,(h+d)/2)}var w=[Math.min(d,(m+d)/2),Math.max(d,(m+d)/2)];if(t>w[0]&&t<=w[1]||t>=v[0]&&t<=v[1]){s=a[u].index;break}}else{var j=Math.min(f,p),x=Math.max(f,p);if(t>(j+d)/2&&t<=(x+d)/2){s=a[u].index;break}}}else for(var k=0;k<l;k++)if(k===0&&t<=(n[k].coordinate+n[k+1].coordinate)/2||k>0&&k<l-1&&t>(n[k].coordinate+n[k-1].coordinate)/2&&t<=(n[k].coordinate+n[k+1].coordinate)/2||k===l-1&&t>(n[k].coordinate+n[k-1].coordinate)/2){s=n[k].index;break}return s},Kf=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,s=i.stroke,l=i.fill,c;switch(a){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},PT=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var f=i[l[c]].stackGroups,d=Object.keys(f),p=0,m=d.length;p<m;p++){var v=f[d[p]],y=v.items,h=v.cateAxisId,w=y.filter(function(S){return $t(S.type).indexOf("Bar")>=0});if(w&&w.length){var j=w[0].type.defaultProps,x=j!==void 0?Ie(Ie({},j),w[0].props):w[0].props,k=x.barSize,g=x[h];s[g]||(s[g]=[]);var b=he(k)?r:k;s[g].push({item:w[0],stackList:w.slice(1),barSize:he(b)?void 0:Je(b,n,0)})}}return s},CT=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=Je(r,a,0,!0),f,d=[];if(s[0].barSize===+s[0].barSize){var p=!1,m=a/c,v=s.reduce(function(k,g){return k+g.barSize||0},0);v+=(c-1)*u,v>=a&&(v-=(c-1)*u,u=0),v>=a&&m>0&&(p=!0,m*=.9,v=c*m);var y=(a-v)/2>>0,h={offset:y-u,size:0};f=s.reduce(function(k,g){var b={item:g.item,position:{offset:h.offset+h.size+u,size:p?m:g.barSize}},S=[].concat(Kv(k),[b]);return h=S[S.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(O){S.push({item:O,position:h})}),S},d)}else{var w=Je(n,a,0,!0);a-2*w-(c-1)*u<=0&&(u=0);var j=(a-2*w-(c-1)*u)/c;j>1&&(j>>=0);var x=l===+l?Math.min(j,l):j;f=s.reduce(function(k,g,b){var S=[].concat(Kv(k),[{item:g.item,position:{offset:w+(j+u)*b+(j-x)/2,size:x}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(O){S.push({item:O,position:S[S.length-1].position})}),S},d)}return f},MT=function(t,r,n,a){var i=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=G0({children:i,legendWidth:c});if(u){var f=a||{},d=f.width,p=f.height,m=u.align,v=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&v==="middle")&&m!=="center"&&Y(t[m]))return Ie(Ie({},t),{},Er({},m,t[m]+(d||0)));if((y==="horizontal"||y==="vertical"&&m==="center")&&v!=="middle"&&Y(t[v]))return Ie(Ie({},t),{},Er({},v,t[v]+(p||0)))}return t},IT=function(t,r,n){return he(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},z0=function(t,r,n,a,i){var s=r.props.children,l=St(s,Uf).filter(function(u){return IT(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=it(f,n);if(he(d))return u;var p=Array.isArray(d)?[Ji(d),Zi(d)]:[d,d],m=c.reduce(function(v,y){var h=it(f,y,0),w=p[0]-Math.abs(Array.isArray(h)?h[0]:h),j=p[1]+Math.abs(Array.isArray(h)?h[1]:h);return[Math.min(w,v[0]),Math.max(j,v[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},RT=function(t,r,n,a,i){var s=r.map(function(l){return z0(t,l,n,i,a)}).filter(function(l){return!he(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},V0=function(t,r,n,a,i){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&z0(t,c,u,a)||_n(t,u,n,i)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},X0=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},wn=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&s==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&l?.length>=2?pt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var p=i?i.indexOf(d):d;return{coordinate:a(p)+u,value:d,offset:u}});return f.filter(function(d){return!ca(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,p){return{coordinate:a(d)+u,value:d,index:p,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,p){return{coordinate:a(d)+u,value:i?i[d]:d,index:p,offset:u}})},Fc=new WeakMap,Oa=function(t,r){if(typeof r!="function")return t;Fc.has(t)||Fc.set(t,new WeakMap);var n=Fc.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},$T=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,l=t.axisType;if(a==="auto")return s==="radial"&&l==="radiusAxis"?{scale:Rn(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:ti(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0)?{scale:kn(),realScaleType:"point"}:i==="category"?{scale:Rn(),realScaleType:"band"}:{scale:ti(),realScaleType:"linear"};if(la(a)){var c="scale".concat($i(a));return{scale:(Ev[c]||kn)(),realScaleType:Ev[c]?c:"point"}}return de(a)?{scale:a}:{scale:kn(),realScaleType:"point"}},Wv=1e-4,DT=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-Wv,s=Math.max(a[0],a[1])+Wv,l=t(r[0]),c=t(r[n-1]);(l<i||l>s||c<i||c>s)&&t.domain([r[0],r[n-1]])}},LT=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0,l=0;l<r;++l){var c=ca(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},qT=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0;s<r;++s){var l=ca(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},BT={sign:LT,expand:Ok,none:Pr,silhouette:Ak,wiggle:Nk,positive:qT},FT=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=BT[n],s=Sk().keys(a).value(function(l,c){return+it(l,c,0)}).order($u).offset(i);return s(t)},UT=function(t,r,n,a,i,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(d,p){var m,v=(m=p.type)!==null&&m!==void 0&&m.defaultProps?Ie(Ie({},p.type.defaultProps),p.props):p.props,y=v.stackId,h=v.hide;if(h)return d;var w=v[n],j=d[w]||{hasStack:!1,stackGroups:{}};if(Fe(y)){var x=j.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};x.items.push(p),j.hasStack=!0,j.stackGroups[y]=x}else j.stackGroups[Ii("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return Ie(Ie({},d),{},Er({},w,j))},c),f={};return Object.keys(u).reduce(function(d,p){var m=u[p];if(m.hasStack){var v={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(y,h){var w=m.stackGroups[h];return Ie(Ie({},y),{},Er({},h,{numericAxisId:n,cateAxisId:a,items:w.items,stackedData:FT(t,w.items,i)}))},v)}return Ie(Ie({},d),{},Er({},p,m))},f)},KT=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=rT(u,i,l);return t.domain([Ji(f),Zi(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),p=nT(d,i,l);return{niceTicks:p}}return null},HT=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Fe(i)){var s=r[i];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},WT=function(t){return t.reduce(function(r,n){return[Ji(n.concat([r[0]]).filter(Y)),Zi(n.concat([r[1]]).filter(Y))]},[1/0,-1/0])},Y0=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],l=s.stackedData,c=l.reduce(function(u,f){var d=WT(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},Gv=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,zv=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,od=function(t,r,n){if(de(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(Y(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(Gv.test(t[0])){var i=+Gv.exec(t[0])[1];a[0]=r[0]-i}else de(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(Y(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(zv.test(t[1])){var s=+zv.exec(t[1])[1];a[1]=r[1]+s}else de(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},ld=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=hf(r,function(d){return d.coordinate}),s=1/0,l=1,c=i.length;l<c;l++){var u=i[l],f=i[l-1];s=Math.min((u.coordinate||0)-(f.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},Vv=function(t,r,n){return!t||!t.length||qf(t,wt(n,"type.defaultProps.domain"))?r:t},GT=function(t,r){var n=t.type.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return Ie(Ie({},le(t,!1)),{},{dataKey:a,unit:s,formatter:l,name:i||a,color:Kf(t),value:it(r,a),type:c,payload:r,chartType:u,hide:f})};function Hn(e){"@babel/helpers - typeof";return Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(e)}function Xv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xv(Object(r),!0).forEach(function(n){Z0(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Z0(e,t,r){return t=zT(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zT(e){var t=VT(e,"string");return Hn(t)=="symbol"?t:t+""}function VT(e,t){if(Hn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XT(e,t){return QT(e)||JT(e,t)||ZT(e,t)||YT()}function YT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZT(e,t){if(e){if(typeof e=="string")return Yv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yv(e,t)}}function Yv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JT(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function QT(e){if(Array.isArray(e))return e}var li=Math.PI/180,eP=function(t){return t*180/Math.PI},Ne=function(t,r,n,a){return{x:t+Math.cos(-li*a)*n,y:r+Math.sin(-li*a)*n}},J0=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},tP=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,f=Je(t.cx,s,s/2),d=Je(t.cy,l,l/2),p=J0(s,l,n),m=Je(t.innerRadius,p,0),v=Je(t.outerRadius,p,p*.8),y=Object.keys(r);return y.reduce(function(h,w){var j=r[w],x=j.domain,k=j.reversed,g;if(he(j.range))a==="angleAxis"?g=[c,u]:a==="radiusAxis"&&(g=[m,v]),k&&(g=[g[1],g[0]]);else{g=j.range;var b=g,S=XT(b,2);c=S[0],u=S[1]}var O=$T(j,i),E=O.realScaleType,T=O.scale;T.domain(x).range(g),DT(T);var N=KT(T,Mt(Mt({},j),{},{realScaleType:E})),A=Mt(Mt(Mt({},j),N),{},{range:g,radius:v,realScaleType:E,scale:T,cx:f,cy:d,innerRadius:m,outerRadius:v,startAngle:c,endAngle:u});return Mt(Mt({},h),{},Z0({},w,A))},{})},rP=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},nP=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,l=rP({x:n,y:a},{x:i,y:s});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>s&&(u=2*Math.PI-u),{radius:l,angle:eP(u),angleInRadian:u}},aP=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},iP=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),l=Math.min(i,s);return t+l*360},Zv=function(t,r){var n=t.x,a=t.y,i=nP({x:n,y:a},r),s=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var f=aP(r),d=f.startAngle,p=f.endAngle,m=l,v;if(d<=p){for(;m>p;)m-=360;for(;m<d;)m+=360;v=m>=d&&m<=p}else{for(;m>d;)m-=360;for(;m<p;)m+=360;v=m>=p&&m<=d}return v?Mt(Mt({},r),{},{radius:s,angle:iP(m,r)}):null},Q0=function(t){return!_.isValidElement(t)&&!de(t)&&typeof t!="boolean"?t.className:""};function Wn(e){"@babel/helpers - typeof";return Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(e)}var sP=["offset"];function oP(e){return dP(e)||uP(e)||cP(e)||lP()}function lP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
19In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cP(e,t){if(e){if(typeof e=="string")return cd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cd(e,t)}}function uP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dP(e){if(Array.isArray(e))return cd(e)}function cd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fP(e,t){if(e==null)return{};var r=pP(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jv(Object(r),!0).forEach(function(n){hP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hP(e,t,r){return t=mP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mP(e){var t=gP(e,"string");return Wn(t)=="symbol"?t:t+""}function gP(e,t){if(Wn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gn.apply(this,arguments)}var vP=function(t){var r=t.value,n=t.formatter,a=he(t.children)?r:t.children;return de(n)?n(a):a},yP=function(t,r){var n=pt(r-t),a=Math.min(Math.abs(r-t),360);return n*a},xP=function(t,r,n){var a=t.position,i=t.viewBox,s=t.offset,l=t.className,c=i,u=c.cx,f=c.cy,d=c.innerRadius,p=c.outerRadius,m=c.startAngle,v=c.endAngle,y=c.clockWise,h=(d+p)/2,w=yP(m,v),j=w>=0?1:-1,x,k;a==="insideStart"?(x=m+j*s,k=y):a==="insideEnd"?(x=v-j*s,k=!y):a==="end"&&(x=v+j*s,k=y),k=w<=0?k:!k;var g=Ne(u,f,h,x),b=Ne(u,f,h,x+(k?1:-1)*359),S="M".concat(g.x,",").concat(g.y,`
20    A`).concat(h,",").concat(h,",0,1,").concat(k?0:1,`,
21    `).concat(b.x,",").concat(b.y),O=he(t.id)?Ii("recharts-radial-line-"):t.id;return $.createElement("text",Gn({},n,{dominantBaseline:"central",className:me("recharts-radial-bar-label",l)}),$.createElement("defs",null,$.createElement("path",{id:O,d:S})),$.createElement("textPath",{xlinkHref:"#".concat(O)},r))},bP=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,p=(f+d)/2;if(a==="outside"){var m=Ne(s,l,u+n,p),v=m.x,y=m.y;return{x:v,y,textAnchor:v>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var h=(c+u)/2,w=Ne(s,l,h,p),j=w.x,x=w.y;return{x:j,y:x,textAnchor:"middle",verticalAnchor:"middle"}},wP=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,l=s.x,c=s.y,u=s.width,f=s.height,d=f>=0?1:-1,p=d*a,m=d>0?"end":"start",v=d>0?"start":"end",y=u>=0?1:-1,h=y*a,w=y>0?"end":"start",j=y>0?"start":"end";if(i==="top"){var x={x:l+u/2,y:c-d*a,textAnchor:"middle",verticalAnchor:m};return Be(Be({},x),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var k={x:l+u/2,y:c+f+p,textAnchor:"middle",verticalAnchor:v};return Be(Be({},k),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(i==="left"){var g={x:l-h,y:c+f/2,textAnchor:w,verticalAnchor:"middle"};return Be(Be({},g),n?{width:Math.max(g.x-n.x,0),height:f}:{})}if(i==="right"){var b={x:l+u+h,y:c+f/2,textAnchor:j,verticalAnchor:"middle"};return Be(Be({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:f}:{})}var S=n?{width:u,height:f}:{};return i==="insideLeft"?Be({x:l+h,y:c+f/2,textAnchor:j,verticalAnchor:"middle"},S):i==="insideRight"?Be({x:l+u-h,y:c+f/2,textAnchor:w,verticalAnchor:"middle"},S):i==="insideTop"?Be({x:l+u/2,y:c+p,textAnchor:"middle",verticalAnchor:v},S):i==="insideBottom"?Be({x:l+u/2,y:c+f-p,textAnchor:"middle",verticalAnchor:m},S):i==="insideTopLeft"?Be({x:l+h,y:c+p,textAnchor:j,verticalAnchor:v},S):i==="insideTopRight"?Be({x:l+u-h,y:c+p,textAnchor:w,verticalAnchor:v},S):i==="insideBottomLeft"?Be({x:l+h,y:c+f-p,textAnchor:j,verticalAnchor:m},S):i==="insideBottomRight"?Be({x:l+u-h,y:c+f-p,textAnchor:w,verticalAnchor:m},S):en(i)&&(Y(i.x)||lr(i.x))&&(Y(i.y)||lr(i.y))?Be({x:l+Je(i.x,u),y:c+Je(i.y,f),textAnchor:"end",verticalAnchor:"end"},S):Be({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},S)},jP=function(t){return"cx"in t&&Y(t.cx)};function Xe(e){var t=e.offset,r=t===void 0?5:t,n=fP(e,sP),a=Be({offset:r},n),i=a.viewBox,s=a.position,l=a.value,c=a.children,u=a.content,f=a.className,d=f===void 0?"":f,p=a.textBreakAll;if(!i||he(l)&&he(c)&&!_.isValidElement(u)&&!de(u))return null;if(_.isValidElement(u))return _.cloneElement(u,a);var m;if(de(u)){if(m=_.createElement(u,a),_.isValidElement(m))return m}else m=vP(a);var v=jP(i),y=le(a,!0);if(v&&(s==="insideStart"||s==="insideEnd"||s==="end"))return xP(a,m,y);var h=v?bP(a):wP(a);return $.createElement($r,Gn({className:me("recharts-label",d)},y,h,{breakAll:p}),m)}Xe.displayName="Label";var e1=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,p=t.y,m=t.top,v=t.left,y=t.width,h=t.height,w=t.clockWise,j=t.labelViewBox;if(j)return j;if(Y(y)&&Y(h)){if(Y(d)&&Y(p))return{x:d,y:p,width:y,height:h};if(Y(m)&&Y(v))return{x:m,y:v,width:y,height:h}}return Y(d)&&Y(p)?{x:d,y:p,width:0,height:0}:Y(r)&&Y(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:w}:t.viewBox?t.viewBox:{}},kP=function(t,r){return t?t===!0?$.createElement(Xe,{key:"label-implicit",viewBox:r}):Fe(t)?$.createElement(Xe,{key:"label-implicit",viewBox:r,value:t}):_.isValidElement(t)?t.type===Xe?_.cloneElement(t,{key:"label-implicit",viewBox:r}):$.createElement(Xe,{key:"label-implicit",content:t,viewBox:r}):de(t)?$.createElement(Xe,{key:"label-implicit",content:t,viewBox:r}):en(t)?$.createElement(Xe,Gn({viewBox:r},t,{key:"label-implicit"})):null:null},_P=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=e1(t),s=St(a,Xe).map(function(c,u){return _.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return s;var l=kP(t.label,r||i);return[l].concat(oP(s))};Xe.parseViewBox=e1;Xe.renderCallByParent=_P;var Uc,Qv;function SP(){if(Qv)return Uc;Qv=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Uc=e,Uc}var OP=SP();const AP=Se(OP);function zn(e){"@babel/helpers - typeof";return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(e)}var NP=["valueAccessor"],EP=["data","dataKey","clockWise","id","textBreakAll"];function TP(e){return IP(e)||MP(e)||CP(e)||PP()}function PP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
22In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CP(e,t){if(e){if(typeof e=="string")return ud(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ud(e,t)}}function MP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IP(e){if(Array.isArray(e))return ud(e)}function ud(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ci.apply(this,arguments)}function ey(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ty(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ey(Object(r),!0).forEach(function(n){RP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ey(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RP(e,t,r){return t=$P(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $P(e){var t=DP(e,"string");return zn(t)=="symbol"?t:t+""}function DP(e,t){if(zn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ry(e,t){if(e==null)return{};var r=LP(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var qP=function(t){return Array.isArray(t.value)?AP(t.value):t.value};function pr(e){var t=e.valueAccessor,r=t===void 0?qP:t,n=ry(e,NP),a=n.data,i=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=ry(n,EP);return!a||!a.length?null:$.createElement(Re,{className:"recharts-label-list"},a.map(function(f,d){var p=he(i)?r(f,d):it(f&&f.payload,i),m=he(l)?{}:{id:"".concat(l,"-").concat(d)};return $.createElement(Xe,ci({},le(f,!0),u,m,{parentViewBox:f.parentViewBox,value:p,textBreakAll:c,viewBox:Xe.parseViewBox(he(s)?f:ty(ty({},f),{},{clockWise:s})),key:"label-".concat(d),index:d}))}))}pr.displayName="LabelList";function BP(e,t){return e?e===!0?$.createElement(pr,{key:"labelList-implicit",data:t}):$.isValidElement(e)||de(e)?$.createElement(pr,{key:"labelList-implicit",data:t,content:e}):en(e)?$.createElement(pr,ci({data:t},e,{key:"labelList-implicit"})):null:null}function FP(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=St(n,pr).map(function(s,l){return _.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=BP(e.label,t);return[i].concat(TP(a))}pr.renderCallByParent=FP;function Vn(e){"@babel/helpers - typeof";return Vn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vn(e)}function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(this,arguments)}function ny(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ay(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ny(Object(r),!0).forEach(function(n){UP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ny(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UP(e,t,r){return t=KP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KP(e){var t=HP(e,"string");return Vn(t)=="symbol"?t:t+""}function HP(e,t){if(Vn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WP=function(t,r){var n=pt(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Aa=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+a,d=Math.asin(c/f)/li,p=u?i:i+s*d,m=Ne(r,n,f,p),v=Ne(r,n,a,p),y=u?i-s*d:i,h=Ne(r,n,f*Math.cos(d*li),y);return{center:m,circleTangency:v,lineTangency:h,theta:d}},t1=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.startAngle,l=t.endAngle,c=WP(s,l),u=s+c,f=Ne(r,n,i,s),d=Ne(r,n,i,u),p="M ".concat(f.x,",").concat(f.y,`
23    A `).concat(i,",").concat(i,`,0,
24    `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
25    `).concat(d.x,",").concat(d.y,`
26  `);if(a>0){var m=Ne(r,n,a,s),v=Ne(r,n,a,u);p+="L ".concat(v.x,",").concat(v.y,`
27            A `).concat(a,",").concat(a,`,0,
28            `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
29            `).concat(m.x,",").concat(m.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},GP=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=pt(f-u),p=Aa({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:s,cornerIsExternal:c}),m=p.circleTangency,v=p.lineTangency,y=p.theta,h=Aa({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:s,cornerIsExternal:c}),w=h.circleTangency,j=h.lineTangency,x=h.theta,k=c?Math.abs(u-f):Math.abs(u-f)-y-x;if(k<0)return l?"M ".concat(v.x,",").concat(v.y,`
30        a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
31        a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
32      `):t1({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var g="M ".concat(v.x,",").concat(v.y,`
33    A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,`
34    A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d<0),",").concat(w.x,",").concat(w.y,`
35    A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(j.x,",").concat(j.y,`
36  `);if(a>0){var b=Aa({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),S=b.circleTangency,O=b.lineTangency,E=b.theta,T=Aa({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),N=T.circleTangency,A=T.lineTangency,C=T.theta,I=c?Math.abs(u-f):Math.abs(u-f)-E-C;if(I<0&&s===0)return"".concat(g,"L").concat(r,",").concat(n,"Z");g+="L".concat(A.x,",").concat(A.y,`
37      A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,`
38      A`).concat(a,",").concat(a,",0,").concat(+(I>180),",").concat(+(d>0),",").concat(S.x,",").concat(S.y,`
39      A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},zP={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},r1=function(t){var r=ay(ay({},zP),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,p=r.className;if(s<i||f===d)return null;var m=me("recharts-sector",p),v=s-i,y=Je(l,v,0,!0),h;return y>0&&Math.abs(f-d)<360?h=GP({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):h=t1({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:f,endAngle:d}),$.createElement("path",dd({},le(r,!0),{className:m,d:h,role:"img"}))};function Xn(e){"@babel/helpers - typeof";return Xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(e)}function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fd.apply(this,arguments)}function iy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function sy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iy(Object(r),!0).forEach(function(n){VP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VP(e,t,r){return t=XP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XP(e){var t=YP(e,"string");return Xn(t)=="symbol"?t:t+""}function YP(e,t){if(Xn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oy={curveBasisClosed:hk,curveBasisOpen:mk,curveBasis:pk,curveBumpX:Qj,curveBumpY:ek,curveLinearClosed:gk,curveLinear:Li,curveMonotoneX:vk,curveMonotoneY:yk,curveNatural:xk,curveStep:bk,curveStepAfter:jk,curveStepBefore:wk},Na=function(t){return t.x===+t.x&&t.y===+t.y},hn=function(t){return t.x},mn=function(t){return t.y},ZP=function(t,r){if(de(t))return t;var n="curve".concat($i(t));return(n==="curveMonotone"||n==="curveBump")&&r?oy["".concat(n).concat(r==="vertical"?"Y":"X")]:oy[n]||Li},JP=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=ZP(n,l),d=u?i.filter(function(y){return Na(y)}):i,p;if(Array.isArray(s)){var m=u?s.filter(function(y){return Na(y)}):s,v=d.map(function(y,h){return sy(sy({},y),{},{base:m[h]})});return l==="vertical"?p=xa().y(mn).x1(hn).x0(function(y){return y.base.x}):p=xa().x(hn).y1(mn).y0(function(y){return y.base.y}),p.defined(Na).curve(f),p(v)}return l==="vertical"&&Y(s)?p=xa().y(mn).x1(hn).x0(s):Y(s)?p=xa().x(hn).y1(mn).y0(s):p=sb().x(hn).y(mn),p.defined(Na).curve(f),p(d)},pd=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var s=n&&n.length?JP(t):a;return _.createElement("path",fd({},le(t,!1),Da(t),{className:me("recharts-curve",r),d:s,ref:i}))},Kc={exports:{}},Hc,ly;function QP(){if(ly)return Hc;ly=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Hc=e,Hc}var Wc,cy;function e2(){if(cy)return Wc;cy=1;var e=QP();function t(){}function r(){}return r.resetWarningCache=t,Wc=function(){function n(s,l,c,u,f,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function a(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i},Wc}var uy;function t2(){return uy||(uy=1,Kc.exports=e2()()),Kc.exports}var r2=t2();const be=Se(r2),{getOwnPropertyNames:n2,getOwnPropertySymbols:a2}=Object,{hasOwnProperty:i2}=Object.prototype;function Gc(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Ea(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);const{cache:i}=a,s=i.get(r),l=i.get(n);if(s&&l)return s===n&&l===r;i.set(r,n),i.set(n,r);const c=e(r,n,a);return i.delete(r),i.delete(n),c}}function s2(e){return e?.[Symbol.toStringTag]}function dy(e){return n2(e).concat(a2(e))}const o2=Object.hasOwn||((e,t)=>i2.call(e,t));function yr(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const l2="__v",c2="__o",u2="_owner",{getOwnPropertyDescriptor:fy,keys:py}=Object;function d2(e,t){return e.byteLength===t.byteLength&&ui(new Uint8Array(e),new Uint8Array(t))}function f2(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function p2(e,t){return e.byteLength===t.byteLength&&ui(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function h2(e,t){return yr(e.getTime(),t.getTime())}function m2(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function g2(e,t){return e===t}function hy(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let s,l,c=0;for(;(s=i.next())&&!s.done;){const u=t.entries();let f=!1,d=0;for(;(l=u.next())&&!l.done;){if(a[d]){d++;continue}const p=s.value,m=l.value;if(r.equals(p[0],m[0],c,d,e,t,r)&&r.equals(p[1],m[1],p[0],m[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;c++}return!0}const v2=yr;function y2(e,t,r){const n=py(e);let a=n.length;if(py(t).length!==a)return!1;for(;a-- >0;)if(!n1(e,t,r,n[a]))return!1;return!0}function gn(e,t,r){const n=dy(e);let a=n.length;if(dy(t).length!==a)return!1;let i,s,l;for(;a-- >0;)if(i=n[a],!n1(e,t,r,i)||(s=fy(e,i),l=fy(t,i),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function x2(e,t){return yr(e.valueOf(),t.valueOf())}function b2(e,t){return e.source===t.source&&e.flags===t.flags}function my(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let s,l;for(;(s=i.next())&&!s.done;){const c=t.values();let u=!1,f=0;for(;(l=c.next())&&!l.done;){if(!a[f]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function ui(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function w2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function n1(e,t,r,n){return(n===u2||n===c2||n===l2)&&(e.$$typeof||t.$$typeof)?!0:o2(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const j2="[object ArrayBuffer]",k2="[object Arguments]",_2="[object Boolean]",S2="[object DataView]",O2="[object Date]",A2="[object Error]",N2="[object Map]",E2="[object Number]",T2="[object Object]",P2="[object RegExp]",C2="[object Set]",M2="[object String]",I2={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
39]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R2="[object URL]",$2=Object.prototype.toString;function D2({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:m,unknownTagComparators:v}){return function(h,w,j){if(h===w)return!0;if(h==null||w==null)return!1;const x=typeof h;if(x!==typeof w)return!1;if(x!=="object")return x==="number"?l(h,w,j):x==="function"?i(h,w,j):!1;const k=h.constructor;if(k!==w.constructor)return!1;if(k===Object)return c(h,w,j);if(Array.isArray(h))return t(h,w,j);if(k===Date)return n(h,w,j);if(k===RegExp)return f(h,w,j);if(k===Map)return s(h,w,j);if(k===Set)return d(h,w,j);const g=$2.call(h);if(g===O2)return n(h,w,j);if(g===P2)return f(h,w,j);if(g===N2)return s(h,w,j);if(g===C2)return d(h,w,j);if(g===T2)return typeof h.then!="function"&&typeof w.then!="function"&&c(h,w,j);if(g===R2)return m(h,w,j);if(g===A2)return a(h,w,j);if(g===k2)return c(h,w,j);if(I2[g])return p(h,w,j);if(g===j2)return e(h,w,j);if(g===S2)return r(h,w,j);if(g===_2||g===E2||g===M2)return u(h,w,j);if(v){let b=v[g];if(!b){const S=s2(h);S&&(b=v[S])}if(b)return b(h,w,j)}return!1}}function L2({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:d2,areArraysEqual:r?gn:f2,areDataViewsEqual:p2,areDatesEqual:h2,areErrorsEqual:m2,areFunctionsEqual:g2,areMapsEqual:r?Gc(hy,gn):hy,areNumbersEqual:v2,areObjectsEqual:r?gn:y2,arePrimitiveWrappersEqual:x2,areRegExpsEqual:b2,areSetsEqual:r?Gc(my,gn):my,areTypedArraysEqual:r?Gc(ui,gn):ui,areUrlsEqual:w2,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Ea(n.areArraysEqual),i=Ea(n.areMapsEqual),s=Ea(n.areObjectsEqual),l=Ea(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:s,areSetsEqual:l})}return n}function q2(e){return function(t,r,n,a,i,s,l){return e(t,r,l)}}function B2({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(l,c,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return t(l,c,i)}}const F2=Qt();Qt({strict:!0});Qt({circular:!0});Qt({circular:!0,strict:!0});Qt({createInternalComparator:()=>yr});Qt({strict:!0,createInternalComparator:()=>yr});Qt({circular:!0,createInternalComparator:()=>yr});Qt({circular:!0,createInternalComparator:()=>yr,strict:!0});function Qt(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=L2(e),s=D2(i),l=r?r(s):q2(s);return B2({circular:t,comparator:s,createState:n,equals:l,strict:a})}function U2(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):U2(a)};requestAnimationFrame(n)}function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}function K2(e){return z2(e)||G2(e)||W2(e)||H2()}function H2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
40In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W2(e,t){if(e){if(typeof e=="string")return vy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vy(e,t)}}function vy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z2(e){if(Array.isArray(e))return e}function V2(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var s=i,l=K2(s),c=l[0],u=l.slice(1);if(typeof c=="number"){gy(a.bind(null,u),c);return}a(c),gy(a.bind(null,u));return}hd(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Yn(e){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function yy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,498 bytes, lines 40-58
40t%2?yy(Object(r),!0).forEach(function(n){a1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a1(e,t,r){return t=X2(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X2(e){var t=Y2(e,"string");return Yn(t)==="symbol"?t:String(t)}function Y2(e,t){if(Yn(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z2=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},J2=function(t){return t},Q2=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Sn=function(t,r){return Object.keys(r).reduce(function(n,a){return xy(xy({},n),{},a1({},a,t(a,r[a])))},{})},by=function(t,r,n){return t.map(function(a){return"".concat(Q2(a)," ").concat(r,"ms ").concat(n)}).join(",")};function eC(e,t){return nC(e)||rC(e,t)||i1(e,t)||tC()}function tC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function nC(e){if(Array.isArray(e))return e}function aC(e){return oC(e)||sC(e)||i1(e)||iC()}function iC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
42In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i1(e,t){if(e){if(typeof e=="string")return md(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return md(e,t)}}function sC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oC(e){if(Array.isArray(e))return md(e)}function md(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var di=1e-4,s1=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},o1=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},wy=function(t,r){return function(n){var a=s1(t,r);return o1(a,n)}},lC=function(t,r){return function(n){var a=s1(t,r),i=[].concat(aC(a.map(function(s,l){return s*l}).slice(1)),[0]);return o1(i,n)}},jy=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,s=1,l=1;break;case"ease":a=.25,i=.1,s=.25,l=1;break;case"ease-in":a=.42,i=0,s=1,l=1;break;case"ease-out":a=.42,i=0,s=.58,l=1;break;case"ease-in-out":a=0,i=0,s=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(h){return parseFloat(h)}),f=eC(u,4);a=f[0],i=f[1],s=f[2],l=f[3]}}}var d=wy(a,s),p=wy(i,l),m=lC(a,s),v=function(w){return w>1?1:w<0?0:w},y=function(w){for(var j=w>1?1:w,x=j,k=0;k<8;++k){var g=d(x)-j,b=m(x);if(Math.abs(g-j)<di||b<di)return p(x);x=v(x-g/b)}return p(x)};return y.isStepper=!1,y},cC=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,l=s===void 0?17:s,c=function(f,d,p){var m=-(f-d)*n,v=p*i,y=p+(m-v)*l/1e3,h=p*l/1e3+f;return Math.abs(h-d)<di&&Math.abs(y)<di?[d,0]:[h,y]};return c.isStepper=!0,c.dt=l,c},uC=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return jy(a);case"spring":return cC();default:if(a.split("(")[0]==="cubic-bezier")return jy(a)}return typeof a=="function"?a:null};function Zn(e){"@babel/helpers - typeof";return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}function ky(e){return pC(e)||fC(e)||l1(e)||dC()}function dC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
43In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pC(e){if(Array.isArray(e))return vd(e)}function _y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_y(Object(r),!0).forEach(function(n){gd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_y(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gd(e,t,r){return t=hC(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hC(e){var t=mC(e,"string");return Zn(t)==="symbol"?t:String(t)}function mC(e,t){if(Zn(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zn(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gC(e,t){return xC(e)||yC(e,t)||l1(e,t)||vC()}function vC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l1(e,t){if(e){if(typeof e=="string")return vd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vd(e,t)}}function vd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function xC(e){if(Array.isArray(e))return e}var fi=function(t,r,n){return t+(r-t)*n},yd=function(t){var r=t.from,n=t.to;return r!==n},bC=function e(t,r,n){var a=Sn(function(i,s){if(yd(s)){var l=t(s.from,s.to,s.velocity),c=gC(l,2),u=c[0],f=c[1];return Ve(Ve({},s),{},{from:u,velocity:f})}return s},r);return n<1?Sn(function(i,s){return yd(s)?Ve(Ve({},s),{},{velocity:fi(s.velocity,a[i].velocity,n),from:fi(s.from,a[i].from,n)}):s},r):e(t,a,n-1)};const wC=(function(e,t,r,n,a){var i=Z2(e,t),s=i.reduce(function(h,w){return Ve(Ve({},h),{},gd({},w,[e[w],t[w]]))},{}),l=i.reduce(function(h,w){return Ve(Ve({},h),{},gd({},w,{from:e[w],velocity:0,to:t[w]}))},{}),c=-1,u,f,d=function(){return null},p=function(){return Sn(function(w,j){return j.from},l)},m=function(){return!Object.values(l).filter(yd).length},v=function(w){u||(u=w);var j=w-u,x=j/r.dt;l=bC(r,l,x),a(Ve(Ve(Ve({},e),t),p())),u=w,m()||(c=requestAnimationFrame(d))},y=function(w){f||(f=w);var j=(w-f)/n,x=Sn(function(g,b){return fi.apply(void 0,ky(b).concat([r(j)]))},s);if(a(Ve(Ve(Ve({},e),t),x)),j<1)c=requestAnimationFrame(d);else{var k=Sn(function(g,b){return fi.apply(void 0,ky(b).concat([r(1)]))},s);a(Ve(Ve(Ve({},e),t),k))}};return d=r.isStepper?v:y,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}});function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}var jC=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function kC(e,t){if(e==null)return{};var r=_C(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _C(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function zc(e){return NC(e)||AC(e)||OC(e)||SC()}function SC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
45In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OC(e,t){if(e){if(typeof e=="string")return xd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xd(e,t)}}function AC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NC(e){if(Array.isArray(e))return xd(e)}function xd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sy(Object(r),!0).forEach(function(n){jn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jn(e,t,r){return t=c1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c1(n.key),n)}}function PC(e,t,r){return t&&TC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function c1(e){var t=CC(e,"string");return Ur(t)==="symbol"?t:String(t)}function CC(e,t){if(Ur(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ur(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bd(e,t)}function bd(e,t){return bd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},bd(e,t)}function IC(e){var t=RC();return function(){var n=pi(e),a;if(t){var i=pi(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return wd(this,a)}}function wd(e,t){if(t&&(Ur(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jd(e)}function jd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pi(e){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pi(e)}var Xt=(function(e){MC(r,e);var t=IC(r);function r(n,a){var i;EC(this,r),i=t.call(this,n,a);var s=i.props,l=s.isActive,c=s.attributeName,u=s.from,f=s.to,d=s.steps,p=s.children,m=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(jd(i)),i.changeStyle=i.changeStyle.bind(jd(i)),!l||m<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:f}),wd(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof p=="function")return i.state={style:u},wd(i);i.state={style:c?jn({},c,u):u}}else i.state={style:{}};return i}return PC(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,p=this.state.style;if(l){if(!s){var m={style:c?jn({},c,f):f};this.state&&p&&(c&&p[c]!==f||!c&&p!==f)&&this.setState(m);return}if(!(F2(a.to,f)&&a.canBegin&&a.isActive)){var v=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=v||u?d:a.to;if(this.state&&p){var h={style:c?jn({},c,y):y};(c&&p[c]!==y||!c&&p!==y)&&this.setState(h)}this.runAnimation(xt(xt({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,s=a.from,l=a.to,c=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,p=a.onAnimationStart,m=wC(s,l,uC(u),c,this.changeStyle),v=function(){i.stopJSAnimation=m()};this.manager.start([p,f,v,c,d])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,l=a.begin,c=a.onAnimationStart,u=s[0],f=u.style,d=u.duration,p=d===void 0?0:d,m=function(y,h,w){if(w===0)return y;var j=h.duration,x=h.easing,k=x===void 0?"ease":x,g=h.style,b=h.properties,S=h.onAnimationEnd,O=w>0?s[w-1]:h,E=b||Object.keys(g);if(typeof k=="function"||k==="spring")return[].concat(zc(y),[i.runJSAnimation.bind(i,{from:O.style,to:g,duration:j,easing:k}),j]);var T=by(E,j,k),N=xt(xt(xt({},O.style),g),{},{transition:T});return[].concat(zc(y),[N,j,S]).filter(J2)};return this.manager.start([c].concat(zc(s.reduce(m,[f,Math.max(p,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=V2());var i=a.begin,s=a.duration,l=a.attributeName,c=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,p=a.steps,m=a.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=l?jn({},l,c):c,h=by(Object.keys(y),s,u);v.start([f,i,xt(xt({},y),{},{transition:h}),s,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=kC(a,jC),u=_.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!l||u===0||s<=0)return i;var d=function(m){var v=m.props,y=v.style,h=y===void 0?{}:y,w=v.className,j=_.cloneElement(m,xt(xt({},c),{},{style:xt(xt({},h),f),className:w}));return j};return u===1?d(_.Children.only(i)):$.createElement("div",null,_.Children.map(i,function(p){return d(p)}))}}]),r})(_.PureComponent);Xt.displayName="Animate";Xt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Xt.propTypes={from:be.oneOfType([be.object,be.string]),to:be.oneOfType([be.object,be.string]),attributeName:be.string,duration:be.number,begin:be.number,easing:be.oneOfType([be.string,be.func]),steps:be.arrayOf(be.shape({duration:be.number.isRequired,style:be.object.isRequired,easing:be.oneOfType([be.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),be.func]),properties:be.arrayOf("string"),onAnimationEnd:be.func})),children:be.oneOfType([be.node,be.func]),isActive:be.bool,canBegin:be.bool,onAnimationEnd:be.func,shouldReAnimate:be.bool,onAnimationStart:be.func,onAnimationReStart:be.func};function Jn(e){"@babel/helpers - typeof";return Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(e)}function hi(){return hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hi.apply(this,arguments)}function $C(e,t){return BC(e)||qC(e,t)||LC(e,t)||DC()}function DC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LC(e,t){if(e){if(typeof e=="string")return Oy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oy(e,t)}}function Oy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function BC(e){if(Array.isArray(e))return e}function Ay(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ny(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ay(Object(r),!0).forEach(function(n){FC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ay(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FC(e,t,r){return t=UC(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UC(e){var t=KC(e,"string");return Jn(t)=="symbol"?t:t+""}function KC(e,t){if(Jn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ey=function(t,r,n,a,i){var s=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(s>0&&i instanceof Array){for(var d=[0,0,0,0],p=0,m=4;p<m;p++)d[p]=i[p]>s?s:i[p];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
47        `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+a-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
48        `).concat(t+n-c*d[2],",").concat(r+a)),f+="L ".concat(t+c*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
49        `).concat(t,",").concat(r+a-l*d[3])),f+="Z"}else if(s>0&&i===+i&&i>0){var v=Math.min(s,i);f="M ".concat(t,",").concat(r+l*v,`
50            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(r,`
51            L `).concat(t+n-c*v,",").concat(r,`
52            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*v,`
53            L `).concat(t+n,",").concat(r+a-l*v,`
54            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-c*v,",").concat(r+a,`
55            L `).concat(t+c*v,",").concat(r+a,`
56            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*v," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},HC=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),f=Math.max(i,i+l),d=Math.min(s,s+c),p=Math.max(s,s+c);return n>=u&&n<=f&&a>=d&&a<=p}return!1},WC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Hf=function(t){var r=Ny(Ny({},WC),t),n=_.useRef(),a=_.useState(-1),i=$C(a,2),s=i[0],l=i[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var k=n.current.getTotalLength();k&&l(k)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,p=r.radius,m=r.className,v=r.animationEasing,y=r.animationDuration,h=r.animationBegin,w=r.isAnimationActive,j=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=me("recharts-rectangle",m);return j?$.createElement(Xt,{canBegin:s>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:y,animationEasing:v,isActive:j},function(k){var g=k.width,b=k.height,S=k.x,O=k.y;return $.createElement(Xt,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:y,isActive:w,easing:v},$.createElement("path",hi({},le(r,!0),{className:x,d:Ey(S,O,g,b,p),ref:n})))}):$.createElement("path",hi({},le(r,!0),{className:x,d:Ey(c,u,f,d,p)}))},GC=["points","className","baseLinePoints","connectNulls"];function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_r.apply(this,arguments)}function zC(e,t){if(e==null)return{};var r=VC(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VC(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ty(e){return JC(e)||ZC(e)||YC(e)||XC()}function XC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
57In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YC(e,t){if(e){if(typeof e=="string")return kd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kd(e,t)}}function ZC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JC(e){if(Array.isArray(e))return kd(e)}function kd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Py=function(t){return t&&t.x===+t.x&&t.y===+t.y},QC=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Py(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Py(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},On=function(t,r){var n=QC(t);r&&(n=[n.reduce(function(i,s){return[].concat(Ty(i),Ty(s))},[])]);var a=n.map(function(i){return i.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},eM=function(t,r,n){var a=On(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(On(r.reverse(),n).slice(1))},tM=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,s=zC(t,GC);if(!r||!r.length)return null;var l=me("recharts-polygon",n);if(a&&a.length){var c=s.stroke&&s.stroke!=="none",u=eM(r,a,i);return $.createElement("g",{className:l},$.createElement("path",_r({},le(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?$.createElement("path",_r({},le(s,!0),{fill:"none",d:On(r,i)})):null,c?$.createElement("path",_r({},le(s,!0),{fill:"none",d:On(a,i)})):null)}var f=On(r,i);return $.createElement("path",_r({},le(s,!0),{fill:f.slice(-1)==="Z"?s.fill:"none",className:l,d:f}))};function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_d.apply(this,arguments)}var Wf=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,s=me("recharts-dot",i);return r===+r&&n===+n&&a===+a?_.createElement("circle",_d({},le(t,!1),Da(t),{className:s,cx:r,cy:n,r:a})):null};function Qn(e){"@babel/helpers - typeof";return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(e)}var rM=["x","y","top","left","width","height","className"];function Sd(){return Sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sd.apply(this,arguments)}function Cy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cy(Object(r),!0).forEach(function(n){aM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aM(e,t,r){return t=iM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iM(e){var t=sM(e,"string");return Qn(t)=="symbol"?t:t+""}function sM(e,t){if(Qn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oM(e,t){if(e==null)return{};var r=lM(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cM=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},uM=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,p=t.height,m=p===void 0?0:p,v=t.className,y=oM(t,rM),h=nM({x:n,y:i,top:l,left:u,width:d,height:m},y);return!Y(n)||!Y(i)||!Y(d)||!Y(m)||!Y(l)||!Y(u)?null:$.createElement("path",Sd({},le(h,!0),{className:me("recharts-cross",v),d:cM(n,i,d,m,l,u)}))},Vc,My;function dM(){if(My)return Vc;My=1;var e=Yi(),t=E0(),r=Pt();function n(a,i){return a&&a.length?e(a,r(i,2),t):void 0}return Vc=n,Vc}var fM=dM();const pM=Se(fM);var Xc,Iy;function hM(){if(Iy)return Xc;Iy=1;var e=Yi(),t=Pt(),r=T0();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return Xc=n,Xc}var mM=hM();const gM=Se(mM);var vM=["cx","cy","angle","ticks","axisLine"],yM=["ticks","tick","angle","tickFormatter","stroke"];function Kr(e){"@babel/helpers - typeof";return Kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(e)}function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},An.apply(this,arguments)}function Ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ry(Object(r),!0).forEach(function(n){ts(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ry(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $y(e,t){if(e==null)return{};var r=xM(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d1(n.key),n)}}function wM(e,t,r){return t&&Dy(e.prototype,t),r&&Dy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jM(e,t,r){return t=mi(t),kM(e,u1()?Reflect.construct(t,r||[],mi(e).constructor):t.apply(e,r))}function kM(e,t){if(t&&(Kr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _M(e)}function _M(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u1=function(){return!!e})()}function mi(e){return mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mi(e)}function SM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Od(e,t)}function Od(e,t){return Od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Od(e,t)}function ts(e,t,r){return t=d1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d1(e){var t=OM(e,"string");return Kr(t)=="symbol"?t:t+""}function OM(e,t){if(Kr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rs=(function(e){function t(){return bM(this,t),jM(this,t,arguments)}return SM(t,e),wM(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,s=i.angle,l=i.cx,c=i.cy;return Ne(l,c,a,s)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=pM(l,function(f){return f.coordinate||0}),u=gM(l,function(f){return f.coordinate||0});return{cx:a,cy:i,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=n.axisLine,u=$y(n,vM),f=l.reduce(function(v,y){return[Math.min(v[0],y.coordinate),Math.max(v[1],y.coordinate)]},[1/0,-1/0]),d=Ne(a,i,f[0],s),p=Ne(a,i,f[1],s),m=rr(rr(rr({},le(u,!1)),{},{fill:"none"},le(c,!1)),{},{x1:d.x,y1:d.y,x2:p.x,y2:p.y});return $.createElement("line",An({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,f=$y(a,yM),d=this.getTickTextAnchor(),p=le(f,!1),m=le(s,!1),v=i.map(function(y,h){var w=n.getTickValueCoord(y),j=rr(rr(rr(rr({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(w.x,", ").concat(w.y,")")},p),{},{stroke:"none",fill:u},m),{},{index:h},w),{},{payload:y});return $.createElement(Re,An({className:me("recharts-polar-radius-axis-tick",Q0(s)),key:"tick-".concat(y.coordinate)},Ri(n.props,y,h)),t.renderTickItem(s,j,c?c(y.value,h):y.value))});return $.createElement(Re,{className:"recharts-polar-radius-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,s=n.tick;return!a||!a.length?null:$.createElement(Re,{className:me("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),s&&this.renderTicks(),Xe.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):de(n)?s=n(a):s=$.createElement($r,An({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),s}}])})(_.PureComponent);ts(rs,"displayName","PolarRadiusAxis");ts(rs,"axisType","radiusAxis");ts(rs,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Hr(e){"@babel/helpers - typeof";return Hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(e)}function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sr.apply(this,arguments)}function Ly(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(r),!0).forEach(function(n){ns(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ly(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p1(n.key),n)}}function NM(e,t,r){return t&&qy(e.prototype,t),r&&qy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function EM(e,t,r){return t=gi(t),TM(e,f1()?Reflect.construct(t,r||[],gi(e).constructor):t.apply(e,r))}function TM(e,t){if(t&&(Hr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PM(e)}function PM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f1=function(){return!!e})()}function gi(e){return gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gi(e)}function CM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ad(e,t)}function Ad(e,t){return Ad=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ad(e,t)}function ns(e,t,r){return t=p1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p1(e){var t=MM(e,"string");return Hr(t)=="symbol"?t:t+""}function MM(e,t){if(Hr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IM=Math.PI/180,By=1e-5,as=(function(e){function t(){return AM(this,t),EM(this,t,arguments)}return CM(t,e),NM(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,s=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,f=u||8,d=Ne(i,s,l,n.coordinate),p=Ne(i,s,l+(c==="inner"?-1:1)*f,n.coordinate);return{x1:d.x,y1:d.y,x2:p.x,y2:p.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*IM),s;return i>By?s=a==="outer"?"start":"end":i<-By?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.radius,l=n.axisLine,c=n.axisLineType,u=nr(nr({},le(this.props,!1)),{},{fill:"none"},le(l,!1));if(c==="circle")return $.createElement(Wf,sr({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:s}));var f=this.props.ticks,d=f.map(function(p){return Ne(a,i,s,p.coordinate)});return $.createElement(tM,sr({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,f=le(this.props,!1),d=le(s,!1),p=nr(nr({},f),{},{fill:"none"},le(l,!1)),m=i.map(function(v,y){var h=n.getTickLineCoord(v),w=n.getTickTextAnchor(v),j=nr(nr(nr({textAnchor:w},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:v,x:h.x2,y:h.y2});return $.createElement(Re,sr({className:me("recharts-polar-angle-axis-tick",Q0(s)),key:"tick-".concat(v.coordinate)},Ri(n.props,v,y)),l&&$.createElement("line",sr({className:"recharts-polar-angle-axis-tick-line"},p,h)),s&&t.renderTickItem(s,j,c?c(v.value,y):v.value))});return $.createElement(Re,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,s=n.axisLine;return i<=0||!a||!a.length?null:$.createElement(Re,{className:me("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):de(n)?s=n(a):s=$.createElement($r,sr({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),s}}])})(_.PureComponent);ns(as,"displayName","PolarAngleAxis");ns(as,"axisType","angleAxis");ns(as,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Yc,Fy;function RM(){if(Fy)return Yc;Fy=1;var e=Eb(),t=e(Object.getPrototypeOf,Object);return Yc=t,Yc}var Zc,Uy;function $M(){if(Uy)return Zc;Uy=1;var e=Ut(),t=RM(),r=Kt(),n="[object Object]",a=Function.prototype,i=Object.prototype,s=a.toString,l=i.hasOwnProperty,c=s.call(Object);function u(f){if(!r(f)||e(f)!=n)return!1;var d=t(f);if(d===null)return!0;var p=l.call(d,"constructor")&&d.constructor;return typeof p=="function"&&p instanceof p&&s.call(p)==c}return Zc=u,Zc}var DM=$M();const LM=Se(DM);var Jc,Ky;function qM(){if(Ky)return Jc;Ky=1;var e=Ut(),t=Kt(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return Jc=n,Jc}var BM=qM();const FM=Se(BM);function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vi.apply(this,arguments)}function UM(e,t){return GM(e)||WM(e,t)||HM(e,t)||KM()}function KM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
58In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HM(e,t){if(e){if(typeof e=="string")return Hy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hy(e,t)}}function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function WM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function GM(e){if(Array.isArray(e))return e}function Wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wy(Object(r),!0).forEach(function(n){zM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zM(e,t,r){return t=VM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VM(e){var t=XM(e,"string");return ea(t)=="symbol"?t:t+""}function XM(e,t){if(ea(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ea(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zy=function(t,r,n,a,i){var s=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+i),l+="L ".concat(t+n-s/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},YM={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ZM=function(t){var r=Gy(Gy({},YM),t),n=_.useRef(),a=_.useState(-1),i=UM(a,2),s=i[0],l=i[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var x=n.current.getTotalLength();x&&l(x)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,p=r.height,m=r.className,v=r.animationEasing,y=r.animationDuration,h=r.animationBegin,w=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||p!==+p||f===0&&d===0||p===0)return null;var j=me("recharts-trapezoid",m);return w?$.createElement(Xt,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:p,x:c,y:u},duration:y,animationEasing:v,isActive:w},function(x){var k=x.upperWidth,g=x.lowerWidth,b=x.height,S=x.x,O=x.y;return $.createElement(Xt,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:y,easing:v},$.createElement("path",vi({},le(r,!0),{className:j,d:zy(S,O,k,g,b),ref:n})))}):$.createElement("g",null,$.createElement("path",vi({},le(r,!0),{className:j,d:zy(c,u,f,d,p)})))},JM=["option","shapeType","propTransformer","activeClassName","isActive"];function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}function QM(e,t){if(e==null)return{};var r=eI(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vy(Object(r),!0).forEach(function(n){tI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tI(e,t,r){return t=rI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rI(e){var t=nI(e,"string");return ta(t)=="symbol"?t:t+""}function nI(e,t){if(ta(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ta(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aI(e,t){return yi(yi({},t),e)}function iI(e,t){return e==="symbols"}function Xy(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return $.createElement(Hf,r);case"trapezoid":return $.createElement(ZM,r);case"sector":return $.createElement(r1,r);case"symbols":if(iI(t))return $.createElement(sf,r);break;default:return null}}function sI(e){return _.isValidElement(e)?e.props:e}function oI(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?aI:n,i=e.activeClassName,s=i===void 0?"recharts-active-shape":i,l=e.isActive,c=QM(e,JM),u;if(_.isValidElement(t))u=_.cloneElement(t,yi(yi({},c),sI(t)));else if(de(t))u=t(c);else if(LM(t)&&!FM(t)){var f=a(t,c);u=$.createElement(Xy,{shapeType:r,elementProps:f})}else{var d=c;u=$.createElement(Xy,{shapeType:r,elementProps:d})}return l?$.createElement(Re,{className:s},u):u}function is(e,t){return t!=null&&"trapezoids"in e.props}function ss(e,t){return t!=null&&"sectors"in e.props}function ra(e,t){return t!=null&&"points"in e.props}function lI(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function cI(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function uI(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function dI(e,t){var r;return is(e,t)?r=lI:ss(e,t)?r=cI:ra(e,t)&&(r=uI),r}function fI(e,t){var r;return is(e,t)?r="trapezoids":ss(e,t)?r="sectors":ra(e,t)&&(r="points"),r}function pI(e,t){if(is(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(ss(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return ra(e,t)?t.payload:{}}function hI(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=fI(r,t),i=pI(r,t),s=n.filter(function(c,u){var f=qf(i,c),d=r.props[a].filter(function(v){var y=dI(r,t);return y(v,t)}),p=r.props[a].indexOf(d[d.length-1]),m=u===p;return f&&m}),l=n.indexOf(s[s.length-1]);return l}var Ra;function Wr(e){"@babel/helpers - typeof";return Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr(e)}function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sr.apply(this,arguments)}function Yy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yy(Object(r),!0).forEach(function(n){ft(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,m1(n.key),n)}}function gI(e,t,r){return t&&Zy(e.prototype,t),r&&Zy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vI(e,t,r){return t=xi(t),yI(e,h1()?Reflect.construct(t,r||[],xi(e).constructor):t.apply(e,r))}function yI(e,t){if(t&&(Wr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xI(e)}function xI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h1=function(){return!!e})()}function xi(e){return xi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xi(e)}function bI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nd(e,t)}function Nd(e,t){return Nd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Nd(e,t)}function ft(e,t,r){return t=m1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m1(e){var t=wI(e,"string");return Wr(t)=="symbol"?t:t+""}function wI(e,t){if(Wr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wt=(function(e){function t(r){var n;return mI(this,t),n=vI(this,t,[r]),ft(n,"pieRef",null),ft(n,"sectorRefs",[]),ft(n,"id",Ii("recharts-pie-")),ft(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),de(a)&&a()}),ft(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),de(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return bI(t,e),gI(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,f=le(this.props,!1),d=le(s,!1),p=le(l,!1),m=s&&s.offsetRadius||20,v=n.map(function(y,h){var w=(y.startAngle+y.endAngle)/2,j=Ne(y.cx,y.cy,y.outerRadius+m,w),x=Oe(Oe(Oe(Oe({},f),y),{},{stroke:"none"},d),{},{index:h,textAnchor:t.getTextAnchor(j.x,y.cx)},j),k=Oe(Oe(Oe(Oe({},f),y),{},{fill:"none",stroke:y.fill},p),{},{index:h,points:[Ne(y.cx,y.cy,y.outerRadius,w),j]}),g=c;return he(c)&&he(u)?g="value":he(c)&&(g=u),$.createElement(Re,{key:"label-".concat(y.startAngle,"-").concat(y.endAngle,"-").concat(y.midAngle,"-").concat(h)},l&&t.renderLabelLineItem(l,k,"line"),t.renderLabelItem(s,x,it(y,g)))});return $.createElement(Re,{className:"recharts-pie-labels"},v)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,s=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,f){if(u?.startAngle===0&&u?.endAngle===0&&n.length!==1)return null;var d=a.isActiveIndex(f),p=c&&a.hasActiveIndex()?c:null,m=d?s:p,v=Oe(Oe({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return $.createElement(Re,Sr({ref:function(h){h&&!a.sectorRefs.includes(h)&&a.sectorRefs.push(h)},tabIndex:-1,className:"recharts-pie-sector"},Ri(a.props,u,f),{key:"sector-".concat(u?.startAngle,"-").concat(u?.endAngle,"-").concat(u.midAngle,"-").concat(f)}),$.createElement(oI,Sr({option:m,isActive:d,shapeType:"sector"},v)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,s=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state,p=d.prevSectors,m=d.prevIsAnimationActive;return $.createElement(Xt,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(f,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(v){var y=v.t,h=[],w=i&&i[0],j=w.startAngle;return i.forEach(function(x,k){var g=p&&p[k],b=k>0?wt(x,"paddingAngle",0):0;if(g){var S=ah(g.endAngle-g.startAngle,x.endAngle-x.startAngle),O=Oe(Oe({},x),{},{startAngle:j+b,endAngle:j+S(y)+b});h.push(O),j=O.endAngle}else{var E=x.endAngle,T=x.startAngle,N=ah(0,E-T),A=N(y),C=Oe(Oe({},x),{},{startAngle:j+b,endAngle:j+A+b});h.push(C),j=C.endAngle}}),$.createElement(Re,null,n.renderSectorsStatically(h))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,s=this.state.prevSectors;return i&&a&&a.length&&(!s||!qf(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,s=a.sectors,l=a.className,c=a.label,u=a.cx,f=a.cy,d=a.innerRadius,p=a.outerRadius,m=a.isAnimationActive,v=this.state.isAnimationFinished;if(i||!s||!s.length||!Y(u)||!Y(f)||!Y(d)||!Y(p))return null;var y=me("recharts-pie",l);return $.createElement(Re,{tabIndex:this.props.rootTabIndex,className:y,ref:function(w){n.pieRef=w}},this.renderSectors(),c&&this.renderLabels(s),Xe.renderCallByParent(this.props,null,!1),(!m||v)&&pr.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);if(de(n))return n(a);var s=me("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return $.createElement(pd,Sr({},a,{key:i,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);var s=i;if(de(n)&&(s=n(a),$.isValidElement(s)))return s;var l=me("recharts-pie-label-text",typeof n!="boolean"&&!de(n)?n.className:"");return $.createElement($r,Sr({},a,{alignmentBaseline:"middle",className:l}),s)}}])})(_.PureComponent);Ra=Wt;ft(Wt,"displayName","Pie");ft(Wt,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Ki.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ft(Wt,"parseDeltaAngle",function(e,t){var r=pt(t-e),n=Math.min(Math.abs(t-e),360);return r*n});ft(Wt,"getRealPieData",function(e){var t=e.data,r=e.children,n=le(e,!1),a=St(r,gf);return t&&t.length?t.map(function(i,s){return Oe(Oe(Oe({payload:i},n),i),a&&a[s]&&a[s].props)}):a&&a.length?a.map(function(i){return Oe(Oe({},n),i.props)}):[]});ft(Wt,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,s=J0(a,i),l=n+Je(e.cx,a,a/2),c=r+Je(e.cy,i,i/2),u=Je(e.innerRadius,s,0),f=Je(e.outerRadius,s,s*.8),d=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:f,maxRadius:d}});ft(Wt,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?Oe(Oe({},t.type.defaultProps),t.props):t.props,a=Ra.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,s=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,f=n.nameKey,d=n.valueKey,p=n.tooltipType,m=Math.abs(n.minAngle),v=Ra.parseCoordinateOfPie(n,r),y=Ra.parseDeltaAngle(s,l),h=Math.abs(y),w=u;he(u)&&he(d)?(Dt(!1,`Use "dataKey" to specify the value of pie,
59      the props "valueKey" will be deprecated in 1.1.0`),w="value"):he(u)&&(Dt(!1,`Use "dataKey" to specify the value of pie,
60      the props "valueKey" will be deprecated in 1.1.0`),w=d);var j=a.filter(function(O){return it(O,w,0)!==0}).length,x=(h>=360?j:j-1)*c,k=h-j*m-x,g=a.reduce(function(O,E){var T=it(E,w,0);return O+(Y(T)?T:0)},0),b;if(g>0){var S;b=a.map(function(O,E){var T=it(O,w,0),N=it(O,f,E),A=(Y(T)?T:0)/g,C;E?C=S.endAngle+pt(y)*c*(T!==0?1:0):C=s;var I=C+pt(y)*((T!==0?m:0)+A*k),P=(C+I)/2,L=(v.innerRadius+v.outerRadius)/2,D=[{name:N,value:T,payload:O,dataKey:w,type:p}],R=Ne(v.cx,v.cy,L,P);return S=Oe(Oe(Oe({percent:A,cornerRadius:i,name:N,tooltipPayload:D,midAngle:P,middleRadius:L,tooltipPosition:R},O),v),{},{value:it(O,w),startAngle:C,endAngle:I,payload:O,paddingAngle:pt(y)*c}),S})}return Oe(Oe({},v),{},{sectors:b,data:a})});var Qc,Jy;function jI(){if(Jy)return Qc;Jy=1;var e=Math.ceil,t=Math.max;function r(n,a,i,s){for(var l=-1,c=t(e((a-n)/(i||1)),0),u=Array(c);c--;)u[s?c:++l]=n,n+=i;return u}return Qc=r,Qc}var eu,Qy;function g1(){if(Qy)return eu;Qy=1;var e=Wb(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return eu=n,eu}var tu,ex;function kI(){if(ex)return tu;ex=1;var e=jI(),t=Ui(),r=g1();function n(a){return function(i,s,l){return l&&typeof l!="number"&&t(i,s,l)&&(s=l=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),l=l===void 0?i<s?1:-1:r(l),e(i,s,l,a)}}return tu=n,tu}var ru,tx;function _I(){if(tx)return ru;tx=1;var e=kI(),t=e();return ru=t,ru}var SI=_I();const bi=Se(SI);function na(e){"@babel/helpers - typeof";return na=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(e)}function rx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rx(Object(r),!0).forEach(function(n){v1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function v1(e,t,r){return t=OI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OI(e){var t=AI(e,"string");return na(t)=="symbol"?t:t+""}function AI(e,t){if(na(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(na(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NI=["Webkit","Moz","O","ms"],EI=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=NI.reduce(function(i,s){return nx(nx({},i),{},v1({},s+n,r))},{});return a[t]=r,a};function Gr(e){"@babel/helpers - typeof";return Gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(e)}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wi.apply(this,arguments)}function ax(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ax(Object(r),!0).forEach(function(n){nt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ax(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ix(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x1(n.key),n)}}function PI(e,t,r){return t&&ix(e.prototype,t),r&&ix(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CI(e,t,r){return t=ji(t),MI(e,y1()?Reflect.construct(t,r||[],ji(e).constructor):t.apply(e,r))}function MI(e,t){if(t&&(Gr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return II(e)}function II(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y1=function(){return!!e})()}
vendor: 71,587 bytes, lines 60-64
60function ji(e){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ji(e)}function RI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ed(e,t)}function Ed(e,t){return Ed=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ed(e,t)}function nt(e,t,r){return t=x1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x1(e){var t=$I(e,"string");return Gr(t)=="symbol"?t:t+""}function $I(e,t){if(Gr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var DI=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=kn().domain(bi(0,c)).range([i,i+s-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:f}},sx=function(t){return t.changedTouches&&!!t.changedTouches.length},zr=(function(e){function t(r){var n;return TI(this,t),n=CI(this,t,[r]),nt(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),nt(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),nt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,l=a.startIndex;s?.({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),nt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),nt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),nt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),nt(n,"handleSlideDragStart",function(a){var i=sx(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return RI(t,e),PI(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(a,i),p=Math.max(a,i),m=t.getIndexInRange(s,d),v=t.getIndexInRange(s,p);return{startIndex:m-m%c,endIndex:v===f?f:v-v%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,l=a.dataKey,c=it(i[n],l,n);return de(s)?s(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,s=a.startX,l=a.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,p=c.startIndex,m=c.endIndex,v=c.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-l,u+f-d-s):y<0&&(y=Math.max(y,u-s,u-l));var h=this.getIndex({startX:s+y,endX:l+y});(h.startIndex!==p||h.endIndex!==m)&&v&&v(h),this.setState({startX:s+y,endX:l+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=sx(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[s],f=this.props,d=f.x,p=f.width,m=f.travellerWidth,v=f.onChange,y=f.gap,h=f.data,w={startX:this.state.startX,endX:this.state.endX},j=n.pageX-i;j>0?j=Math.min(j,d+p-m-u):j<0&&(j=Math.max(j,d-u)),w[s]=u+j;var x=this.getIndex(w),k=x.startIndex,g=x.endIndex,b=function(){var O=h.length-1;return s==="startX"&&(l>c?k%y===0:g%y===0)||l<c&&g===O||s==="endX"&&(l>c?g%y===0:k%y===0)||l>c&&g===O};this.setState(nt(nt({},s,u+j),"brushMoveStartX",n.pageX),function(){v&&b()&&v(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,f=this.state[a],d=l.indexOf(f);if(d!==-1){var p=d+n;if(!(p===-1||p>=l.length)){var m=l[p];a==="startX"&&m>=u||a==="endX"&&m<=c||this.setState(nt({},a,m),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return $.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=_.Children.only(u);return d?$.cloneElement(d,{x:a,y:i,width:s,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,p=c.traveller,m=c.ariaLabel,v=c.data,y=c.startIndex,h=c.endIndex,w=Math.max(n,this.props.x),j=nu(nu({},le(this.props,!1)),{},{x:w,y:u,width:f,height:d}),x=m||"Min value: ".concat((i=v[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=v[h])===null||s===void 0?void 0:s.name);return $.createElement(Re,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),l.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,j))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return $.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:s,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,p=f.endX,m=5,v={pointerEvents:"none",fill:u};return $.createElement(Re,{className:"recharts-brush-texts"},$.createElement($r,wi({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-m,y:s+l/2},v),this.getTextOfTick(a)),$.createElement($r,wi({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+c+m,y:s+l/2},v),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,p=this.state,m=p.startX,v=p.endX,y=p.isTextActive,h=p.isSlideMoving,w=p.isTravellerMoving,j=p.isTravellerFocused;if(!a||!a.length||!Y(l)||!Y(c)||!Y(u)||!Y(f)||u<=0||f<=0)return null;var x=me("recharts-brush",i),k=$.Children.count(s)===1,g=EI("userSelect","none");return $.createElement(Re,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(m,v),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(v,"endX"),(y||h||w||j||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return $.createElement($.Fragment,null,$.createElement("rect",{x:a,y:i,width:s,height:l,fill:c,stroke:"none"}),$.createElement("line",{x1:a+1,y1:u,x2:a+s-1,y2:u,fill:"none",stroke:"#fff"}),$.createElement("line",{x1:a+1,y1:u+2,x2:a+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return $.isValidElement(n)?i=$.cloneElement(n,a):de(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return nu({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},i&&i.length?DI({data:i,width:s,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+s-c]);var p=a.scale.domain().map(function(m){return a.scale(m)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,l=i-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>a?l=c:s=c}return a>=n[l]?l:s}}])})(_.PureComponent);nt(zr,"displayName","Brush");nt(zr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var au,ox;function LI(){if(ox)return au;ox=1;var e=pf();function t(r,n){var a;return e(r,function(i,s,l){return a=n(i,s,l),!a}),!!a}return au=t,au}var iu,lx;function qI(){if(lx)return iu;lx=1;var e=jb(),t=Pt(),r=LI(),n=et(),a=Ui();function i(s,l,c){var u=n(s)?e:r;return c&&a(s,l,c)&&(l=void 0),u(s,t(l,3))}return iu=i,iu}var BI=qI();const FI=Se(BI);var At=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},su,cx;function UI(){if(cx)return su;cx=1;var e=Bb();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return su=t,su}var ou,ux;function KI(){if(ux)return ou;ux=1;var e=UI(),t=Lb(),r=Pt();function n(a,i){var s={};return i=r(i,3),t(a,function(l,c,u){e(s,c,i(l,c,u))}),s}return ou=n,ou}var HI=KI();const WI=Se(HI);var lu,dx;function GI(){if(dx)return lu;dx=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a;)if(!r(t[n],n,t))return!1;return!0}return lu=e,lu}var cu,fx;function zI(){if(fx)return cu;fx=1;var e=pf();function t(r,n){var a=!0;return e(r,function(i,s,l){return a=!!n(i,s,l),a}),a}return cu=t,cu}var uu,px;function VI(){if(px)return uu;px=1;var e=GI(),t=zI(),r=Pt(),n=et(),a=Ui();function i(s,l,c){var u=n(s)?e:t;return c&&a(s,l,c)&&(l=void 0),u(s,r(l,3))}return uu=i,uu}var XI=VI();const YI=Se(XI);function aa(e){"@babel/helpers - typeof";return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(e)}function ZI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,b1(n.key),n)}}function JI(e,t,r){return t&&hx(e.prototype,t),r&&hx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mx(Object(r),!0).forEach(function(n){Gf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gf(e,t,r){return t=b1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b1(e){var t=QI(e,"string");return aa(t)=="symbol"?t:t+""}function QI(e,t){if(aa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(aa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w1=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},e5=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return w1({x:r,y:n},{x:a,y:i})},j1=(function(){function e(t){ZI(this,e),this.scale=t}return JI(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])})();Gf(j1,"EPS",1e-4);var zf=function(t){var r=Object.keys(t).reduce(function(n,a){return Ta(Ta({},n),{},Gf({},a,j1.create(t[a])))},{});return Ta(Ta({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,l=i.position;return WI(a,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(a){return YI(a,function(i,s){return r[s].isInRange(i)})}})},du,gx;function t5(){if(gx)return du;gx=1;var e=Pt(),t=ua(),r=Bi();function n(a){return function(i,s,l){var c=Object(i);if(!t(i)){var u=e(s,3);i=r(i),s=function(d){return u(c[d],d,c)}}var f=a(i,s,l);return f>-1?c[u?i[f]:f]:void 0}}return du=n,du}var fu,vx;function r5(){if(vx)return fu;vx=1;var e=g1();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return fu=t,fu}var pu,yx;function n5(){if(yx)return pu;yx=1;var e=Mb(),t=Pt(),r=r5(),n=Math.max;function a(i,s,l){var c=i==null?0:i.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),e(i,t(s,3),u)}return pu=a,pu}var hu,xx;function a5(){if(xx)return hu;xx=1;var e=t5(),t=n5(),r=e(t);return hu=r,hu}a5();var i5=Xx();const s5=Se(i5);var o5=s5(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),k1=_.createContext(void 0),_1=_.createContext(void 0),S1=_.createContext(void 0),l5=_.createContext({}),O1=_.createContext(void 0),c5=_.createContext(0),u5=_.createContext(0),bx=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,f=o5(i);return $.createElement(k1.Provider,{value:n},$.createElement(_1.Provider,{value:a},$.createElement(l5.Provider,{value:i},$.createElement(S1.Provider,{value:f},$.createElement(O1.Provider,{value:s},$.createElement(c5.Provider,{value:u},$.createElement(u5.Provider,{value:c},l)))))))},d5=function(){return _.useContext(O1)},f5=function(t){var r=_.useContext(k1);r==null&&Br();var n=r[t];return n==null&&Br(),n},p5=function(t){var r=_.useContext(_1);r==null&&Br();var n=r[t];return n==null&&Br(),n},h5=function(){var t=_.useContext(S1);return t};function Vr(e){"@babel/helpers - typeof";return Vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(e)}function m5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,N1(n.key),n)}}function v5(e,t,r){return t&&g5(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y5(e,t,r){return t=ki(t),x5(e,A1()?Reflect.construct(t,r||[],ki(e).constructor):t.apply(e,r))}function x5(e,t){if(t&&(Vr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b5(e)}function b5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A1=function(){return!!e})()}function ki(e){return ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ki(e)}function w5(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Td(e,t)}function Td(e,t){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Td(e,t)}function wx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wx(Object(r),!0).forEach(function(n){Vf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vf(e,t,r){return t=N1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N1(e){var t=j5(e,"string");return Vr(t)=="symbol"?t:t+""}function j5(e,t){if(Vr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function k5(e,t){return A5(e)||O5(e,t)||S5(e,t)||_5()}function _5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S5(e,t){if(e){if(typeof e=="string")return kx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kx(e,t)}}function kx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O5(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function A5(e){if(Array.isArray(e))return e}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pd.apply(this,arguments)}var N5=function(t,r){var n;return $.isValidElement(t)?n=$.cloneElement(t,r):de(t)?n=t(r):n=$.createElement("line",Pd({},r,{className:"recharts-reference-line-line"})),n},E5=function(t,r,n,a,i,s,l,c,u){var f=i.x,d=i.y,p=i.width,m=i.height;if(n){var v=u.y,y=t.y.apply(v,{position:s});if(At(u,"discard")&&!t.y.isInRange(y))return null;var h=[{x:f+p,y},{x:f,y}];return c==="left"?h.reverse():h}if(r){var w=u.x,j=t.x.apply(w,{position:s});if(At(u,"discard")&&!t.x.isInRange(j))return null;var x=[{x:j,y:d+m},{x:j,y:d}];return l==="top"?x.reverse():x}if(a){var k=u.segment,g=k.map(function(b){return t.apply(b,{position:s})});return At(u,"discard")&&FI(g,function(b){return!t.isInRange(b)})?null:g}return null};function T5(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=d5(),f=f5(a),d=p5(i),p=h5();if(!u||!p)return null;Dt(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=zf({x:f.scale,y:d.scale}),v=Fe(t),y=Fe(r),h=n&&n.length===2,w=E5(m,v,y,h,p,e.position,f.orientation,d.orientation,e);if(!w)return null;var j=k5(w,2),x=j[0],k=x.x,g=x.y,b=j[1],S=b.x,O=b.y,E=At(e,"hidden")?"url(#".concat(u,")"):void 0,T=jx(jx({clipPath:E},le(e,!0)),{},{x1:k,y1:g,x2:S,y2:O});return $.createElement(Re,{className:me("recharts-reference-line",l)},N5(s,T),Xe.renderCallByParent(e,e5({x1:k,y1:g,x2:S,y2:O})))}var Xf=(function(e){function t(){return m5(this,t),y5(this,t,arguments)}return w5(t,e),v5(t,[{key:"render",value:function(){return $.createElement(T5,this.props)}}])})($.Component);Vf(Xf,"displayName","ReferenceLine");Vf(Xf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Cd(){return Cd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cd.apply(this,arguments)}function Xr(e){"@babel/helpers - typeof";return Xr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(e)}function _x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_x(Object(r),!0).forEach(function(n){os(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T1(n.key),n)}}function M5(e,t,r){return t&&C5(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I5(e,t,r){return t=_i(t),R5(e,E1()?Reflect.construct(t,r||[],_i(e).constructor):t.apply(e,r))}function R5(e,t){if(t&&(Xr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $5(e)}function $5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E1=function(){return!!e})()}function _i(e){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_i(e)}function D5(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Md(e,t)}function Md(e,t){return Md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Md(e,t)}function os(e,t,r){return t=T1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T1(e){var t=L5(e,"string");return Xr(t)=="symbol"?t:t+""}function L5(e,t){if(Xr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var q5=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,s=zf({x:a.scale,y:i.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return At(t,"discard")&&!s.isInRange(l)?null:l},ls=(function(e){function t(){return P5(this,t),I5(this,t,arguments)}return D5(t,e),M5(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=Fe(a),f=Fe(i);if(Dt(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=q5(this.props);if(!d)return null;var p=d.x,m=d.y,v=this.props,y=v.shape,h=v.className,w=At(this.props,"hidden")?"url(#".concat(c,")"):void 0,j=Sx(Sx({clipPath:w},le(this.props,!0)),{},{cx:p,cy:m});return $.createElement(Re,{className:me("recharts-reference-dot",h)},t.renderDot(y,j),Xe.renderCallByParent(this.props,{x:p-s,y:m-s,width:2*s,height:2*s}))}}])})($.Component);os(ls,"displayName","ReferenceDot");os(ls,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});os(ls,"renderDot",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):de(e)?r=e(t):r=$.createElement(Wf,Cd({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(this,arguments)}function Yr(e){"@babel/helpers - typeof";return Yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(e)}function Ox(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ax(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ox(Object(r),!0).forEach(function(n){cs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ox(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C1(n.key),n)}}function U5(e,t,r){return t&&F5(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K5(e,t,r){return t=Si(t),H5(e,P1()?Reflect.construct(t,r||[],Si(e).constructor):t.apply(e,r))}function H5(e,t){if(t&&(Yr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W5(e)}function W5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!e})()}function Si(e){return Si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Si(e)}function G5(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rd(e,t)}function Rd(e,t){return Rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Rd(e,t)}function cs(e,t,r){return t=C1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C1(e){var t=z5(e,"string");return Yr(t)=="symbol"?t:t+""}function z5(e,t){if(Yr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var V5=function(t,r,n,a,i){var s=i.x1,l=i.x2,c=i.y1,u=i.y2,f=i.xAxis,d=i.yAxis;if(!f||!d)return null;var p=zf({x:f.scale,y:d.scale}),m={x:t?p.x.apply(s,{position:"start"}):p.x.rangeMin,y:n?p.y.apply(c,{position:"start"}):p.y.rangeMin},v={x:r?p.x.apply(l,{position:"end"}):p.x.rangeMax,y:a?p.y.apply(u,{position:"end"}):p.y.rangeMax};return At(i,"discard")&&(!p.isInRange(m)||!p.isInRange(v))?null:w1(m,v)},us=(function(e){function t(){return B5(this,t),K5(this,t,arguments)}return G5(t,e),U5(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;Dt(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=Fe(a),p=Fe(i),m=Fe(s),v=Fe(l),y=this.props.shape;if(!d&&!p&&!m&&!v&&!y)return null;var h=V5(d,p,m,v,this.props);if(!h&&!y)return null;var w=At(this.props,"hidden")?"url(#".concat(f,")"):void 0;return $.createElement(Re,{className:me("recharts-reference-area",c)},t.renderRect(y,Ax(Ax({clipPath:w},le(this.props,!0)),h)),Xe.renderCallByParent(this.props,h))}}])})($.Component);cs(us,"displayName","ReferenceArea");cs(us,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});cs(us,"renderRect",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):de(e)?r=e(t):r=$.createElement(Hf,Id({},t,{className:"recharts-reference-area-rect"})),r});function Nx(e){return J5(e)||Z5(e)||Y5(e)||X5()}function X5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
62In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y5(e,t){if(e){if(typeof e=="string")return $d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $d(e,t)}}function Z5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function J5(e){if(Array.isArray(e))return $d(e)}function $d(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Dd=function(t,r,n,a,i){var s=St(t,Xf),l=St(t,ls),c=[].concat(Nx(s),Nx(l)),u=St(t,us),f="".concat(a,"Id"),d=a[0],p=r;if(c.length&&(p=c.reduce(function(y,h){if(h.props[f]===n&&At(h.props,"extendDomain")&&Y(h.props[d])){var w=h.props[d];return[Math.min(y[0],w),Math.max(y[1],w)]}return y},p)),u.length){var m="".concat(d,"1"),v="".concat(d,"2");p=u.reduce(function(y,h){if(h.props[f]===n&&At(h.props,"extendDomain")&&Y(h.props[m])&&Y(h.props[v])){var w=h.props[m],j=h.props[v];return[Math.min(y[0],w,j),Math.max(y[1],w,j)]}return y},p)}return i&&i.length&&(p=i.reduce(function(y,h){return Y(h)?[Math.min(y[0],h),Math.max(y[1],h)]:y},p)),p},mu={exports:{}},Ex;function Q5(){return Ex||(Ex=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new a(f,d||c,p),v=r?r+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],m]:c._events[v].push(m):(c._events[v]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,m=d.length,v=new Array(m);p<m;p++)v[p]=d[p].fn;return v},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,p,m,v){var y=r?r+u:u;if(!this._events[y])return!1;var h=this._events[y],w=arguments.length,j,x;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),w){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,f),!0;case 3:return h.fn.call(h.context,f,d),!0;case 4:return h.fn.call(h.context,f,d,p),!0;case 5:return h.fn.call(h.context,f,d,p,m),!0;case 6:return h.fn.call(h.context,f,d,p,m,v),!0}for(x=1,j=new Array(w-1);x<w;x++)j[x-1]=arguments[x];h.fn.apply(h.context,j)}else{var k=h.length,g;for(x=0;x<k;x++)switch(h[x].once&&this.removeListener(u,h[x].fn,void 0,!0),w){case 1:h[x].fn.call(h[x].context);break;case 2:h[x].fn.call(h[x].context,f);break;case 3:h[x].fn.call(h[x].context,f,d);break;case 4:h[x].fn.call(h[x].context,f,d,p);break;default:if(!j)for(g=1,j=new Array(w-1);g<w;g++)j[g-1]=arguments[g];h[x].fn.apply(h[x].context,j)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,p){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return s(this,m),this;var v=this._events[m];if(v.fn)v.fn===f&&(!p||v.once)&&(!d||v.context===d)&&s(this,m);else{for(var y=0,h=[],w=v.length;y<w;y++)(v[y].fn!==f||p&&!v[y].once||d&&v[y].context!==d)&&h.push(v[y]);h.length?this._events[m]=h.length===1?h[0]:h:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(mu)),mu.exports}var eR=Q5();const tR=Se(eR);var gu=new tR,vu="recharts.syncMouseEvents";function ia(e){"@babel/helpers - typeof";return ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(e)}function rR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,M1(n.key),n)}}function aR(e,t,r){return t&&nR(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yu(e,t,r){return t=M1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M1(e){var t=iR(e,"string");return ia(t)=="symbol"?t:t+""}function iR(e,t){if(ia(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ia(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sR=(function(){function e(){rR(this,e),yu(this,"activeIndex",0),yu(this,"coordinateList",[]),yu(this,"layout","horizontal")}return aR(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,p=r.mouseHandlerCallback,m=p===void 0?null:p;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,s=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=i+c+u,p=s+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:p})}}}])})();function oR(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e?.[0],a=e?.[1];if(n&&a&&Y(n)&&Y(a))return!0}return!1}function lR(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function I1(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,s=Ne(t,r,n,a),l=Ne(t,r,n,i);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function cR(e,t,r){var n,a,i,s;if(e==="horizontal")n=t.x,i=n,a=r.top,s=r.top+r.height;else if(e==="vertical")a=t.y,s=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,p=Ne(l,c,u,d),m=Ne(l,c,f,d);n=p.x,a=p.y,i=m.x,s=m.y}else return I1(t);return[{x:n,y:a},{x:i,y:s}]}function sa(e){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sa(e)}function Tx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tx(Object(r),!0).forEach(function(n){uR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uR(e,t,r){return t=dR(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dR(e){var t=fR(e,"string");return sa(t)=="symbol"?t:t+""}function fR(e,t){if(sa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pR(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,p=e.chartName,m=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!i||!s||p!=="ScatterChart"&&a!=="axis")return null;var v,y=pd;if(p==="ScatterChart")v=s,y=uM;else if(p==="BarChart")v=lR(d,s,c,f),y=Hf;else if(d==="radial"){var h=I1(s),w=h.cx,j=h.cy,x=h.radius,k=h.startAngle,g=h.endAngle;v={cx:w,cy:j,startAngle:k,endAngle:g,innerRadius:x,outerRadius:x},y=r1}else v={points:cR(d,s,c)},y=pd;var b=Pa(Pa(Pa(Pa({stroke:"#ccc",pointerEvents:"none"},c),v),le(m,!1)),{},{payload:l,payloadIndex:u,className:me("recharts-tooltip-cursor",m.className)});return _.isValidElement(m)?_.cloneElement(m,b):_.createElement(y,b)}var hR=["item"],mR=["children","className","width","height","style","compact","title","desc"];function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}function Or(){return Or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Or.apply(this,arguments)}function Px(e,t){return yR(e)||vR(e,t)||$1(e,t)||gR()}function gR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
63In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function yR(e){if(Array.isArray(e))return e}function Cx(e,t){if(e==null)return{};var r=xR(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D1(n.key),n)}}function jR(e,t,r){return t&&wR(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kR(e,t,r){return t=Oi(t),_R(e,R1()?Reflect.construct(t,r||[],Oi(e).constructor):t.apply(e,r))}function _R(e,t){if(t&&(Zr(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SR(e)}function SR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R1=function(){return!!e})()}function Oi(e){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oi(e)}function OR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ld(e,t)}function Ld(e,t){return Ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ld(e,t)}function Jr(e){return ER(e)||NR(e)||$1(e)||AR()}function AR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
64In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $1(e,t){if(e){if(typeof e=="string")return qd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qd(e,t)}}function NR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ER(e){if(Array.isArray(e))return qd(e)}function qd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mx(Object(r),!0).forEach(function(n){ne(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ne(e,t,r){return t=D1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D1(e){var t=TR(e,"string");return Zr(t)=="symbol"?t:t+""}function TR(e,t){if(Zr(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PR={xAxis:["bottom","top"],yAxis:["left","right"]},CR={width:"100%",height:"100%"},L1={x:0,y:0};function Ca(e){return e}var MR=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},IR=function(t,r,n,a){var i=r.find(function(f){return f&&f.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var s=i.coordinate,l=a.radius;return q(q(q({},a),Ne(a.cx,a.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,u=a.angle;return q(q(q({},a),Ne(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return L1},ds=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Jr(l),Jr(u)):l},[]);return s.length>0?s:t&&t.length&&Y(a)&&Y(i)?t.slice(a,i+1):[]};function q1(e){return e==="number"?[0,"auto"]:void 0}var Bd=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,l=ds(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(s.dataKey&&!s.allowDuplicatedCategory){var m=d===void 0?l:d;p=Ou(m,s.dataKey,a)}else p=d&&d[n]||l[n];return p?[].concat(Jr(c),[GT(u,p)]):c},[])},Ix=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=MR(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=TT(s,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,p=Bd(t,r,f,d),m=IR(n,l,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:p,activeCoordinate:m}}return null},RR=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=t.stackOffset,m=X0(f,i);return n.reduce(function(v,y){var h,w=y.type.defaultProps!==void 0?q(q({},y.type.defaultProps),y.props):y.props,j=w.type,x=w.dataKey,k=w.allowDataOverflow,g=w.allowDuplicatedCategory,b=w.scale,S=w.ticks,O=w.includeHidden,E=w[s];if(v[E])return v;var T=ds(t.data,{graphicalItems:a.filter(function(W){var re,ce=s in W.props?W.props[s]:(re=W.type.defaultProps)===null||re===void 0?void 0:re[s];return ce===E}),dataStartIndex:c,dataEndIndex:u}),N=T.length,A,C,I;oR(w.domain,k,j)&&(A=od(w.domain,null,k),m&&(j==="number"||b!=="auto")&&(I=_n(T,x,"category")));var P=q1(j);if(!A||A.length===0){var L,D=(L=w.domain)!==null&&L!==void 0?L:P;if(x){if(A=_n(T,x,j),j==="category"&&m){var R=_j(A);g&&R?(C=A,A=bi(0,N)):g||(A=Vv(D,A,y).reduce(function(W,re){return W.indexOf(re)>=0?W:[].concat(Jr(W),[re])},[]))}else if(j==="category")g?A=A.filter(function(W){return W!==""&&!he(W)}):A=Vv(D,A,y).reduce(function(W,re){return W.indexOf(re)>=0||re===""||he(re)?W:[].concat(Jr(W),[re])},[]);else if(j==="number"){var F=RT(T,a.filter(function(W){var re,ce,H=s in W.props?W.props[s]:(re=W.type.defaultProps)===null||re===void 0?void 0:re[s],ae="hide"in W.props?W.props.hide:(ce=W.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return H===E&&(O||!ae)}),x,i,f);F&&(A=F)}m&&(j==="number"||b!=="auto")&&(I=_n(T,x,"category"))}else m?A=bi(0,N):l&&l[E]&&l[E].hasStack&&j==="number"?A=p==="expand"?[0,1]:Y0(l[E].stackGroups,c,u):A=V0(T,a.filter(function(W){var re=s in W.props?W.props[s]:W.type.defaultProps[s],ce="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return re===E&&(O||!ce)}),j,f,!0);if(j==="number")A=Dd(d,A,E,i,S),D&&(A=od(D,A,k));else if(j==="category"&&D){var V=D,Z=A.every(function(W){return V.indexOf(W)>=0});Z&&(A=V)}}return q(q({},v),{},ne({},E,q(q({},w),{},{axisType:i,domain:A,categoricalDomain:I,duplicateDomain:C,originalDomain:(h=w.domain)!==null&&h!==void 0?h:P,isCategorical:m,layout:f})))},{})},$R=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,p=ds(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=p.length,v=X0(f,i),y=-1;return n.reduce(function(h,w){var j=w.type.defaultProps!==void 0?q(q({},w.type.defaultProps),w.props):w.props,x=j[s],k=q1("number");if(!h[x]){y++;var g;return v?g=bi(0,m):l&&l[x]&&l[x].hasStack?(g=Y0(l[x].stackGroups,c,u),g=Dd(d,g,x,i)):(g=od(k,V0(p,n.filter(function(b){var S,O,E=s in b.props?b.props[s]:(S=b.type.defaultProps)===null||S===void 0?void 0:S[s],T="hide"in b.props?b.props.hide:(O=b.type.defaultProps)===null||O===void 0?void 0:O.hide;return E===x&&!T}),"number",f),a.defaultProps.allowDataOverflow),g=Dd(d,g,x,i)),q(q({},h),{},ne({},x,q(q({axisType:i},a.defaultProps),{},{hide:!0,orientation:wt(PR,"".concat(i,".").concat(y%2),null),domain:g,originalDomain:k,isCategorical:v,layout:f})))}return h},{})},DR=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),p=St(f,i),m={};return p&&p.length?m=RR(t,{axes:p,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(m=$R(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},LR=function(t){var r=jr(t),n=wn(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:hf(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ld(r,n)}},Rx=function(t){var r=t.children,n=t.defaultShowTooltip,a=ut(r,zr),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},qR=function(t){return!t||!t.length?!1:t.some(function(r){var n=$t(r&&r.type);return n&&n.indexOf("Bar")>=0})},$x=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},BR=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,p=n.margin||{},m=ut(d,zr),v=ut(d,Ar),y=Object.keys(c).reduce(function(g,b){var S=c[b],O=S.orientation;return!S.mirror&&!S.hide?q(q({},g),{},ne({},O,g[O]+S.width)):g},{left:p.left||0,right:p.right||0}),h=Object.keys(s).reduce(function(g,b){var S=s[b],O=S.orientation;return!S.mirror&&!S.hide?q(q({},g),{},ne({},O,wt(g,"".concat(O))+S.height)):g},{top:p.top||0,bottom:p.bottom||0}),w=q(q({},h),y),j=w.bottom;m&&(w.bottom+=m.props.height||zr.defaultProps.height),v&&r&&(w=MT(w,a,n,r));var x=u-w.left-w.right,k=f-w.top-w.bottom;return q(q({brushBottom:j},w),{},{width:Math.max(x,0),height:Math.max(k,0)})},FR=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},UR=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(w,j){var x=j.graphicalItems,k=j.stackGroups,g=j.offset,b=j.updateId,S=j.dataStartIndex,O=j.dataEndIndex,E=w.barSize,T=w.layout,N=w.barGap,A=w.barCategoryGap,C=w.maxBarSize,I=$x(T),P=I.numericAxisName,L=I.cateAxisName,D=qR(x),R=[];return x.forEach(function(F,V){var Z=ds(w.data,{graphicalItems:[F],dataStartIndex:S,dataEndIndex:O}),W=F.type.defaultProps!==void 0?q(q({},F.type.defaultProps),F.props):F.props,re=W.dataKey,ce=W.maxBarSize,H=W["".concat(P,"Id")],ae=W["".concat(L,"Id")],K={},z=c.reduce(function(yt,st){var Gt=j["".concat(st.axisType,"Map")],sn=W["".concat(st.axisType,"Id")];Gt&&Gt[sn]||st.axisType==="zAxis"||Br();var on=Gt[sn];return q(q({},yt),{},ne(ne({},st.axisType,on),"".concat(st.axisType,"Ticks"),wn(on)))},K),B=z[L],X=z["".concat(L,"Ticks")],J=k&&k[H]&&k[H].hasStack&&HT(F,k[H].stackGroups),U=$t(F.type).indexOf("Bar")>=0,ye=ld(B,X),ue=[],$e=D&&PT({barSize:E,stackGroups:k,totalSize:FR(z,L)});if(U){var Me,De,tt=he(ce)?C:ce,vt=(Me=(De=ld(B,X,!0))!==null&&De!==void 0?De:tt)!==null&&Me!==void 0?Me:0;ue=CT({barGap:N,barCategoryGap:A,bandSize:vt!==ye?vt:ye,sizeList:$e[ae],maxBarSize:tt}),vt!==ye&&(ue=ue.map(function(yt){return q(q({},yt),{},{position:q(q({},yt.position),{},{offset:yt.position.offset-vt/2})})}))}var rt=F&&F.type&&F.type.getComposedData;rt&&R.push({props:q(q({},rt(q(q({},z),{},{displayedData:Z,props:w,dataKey:re,item:F,bandSize:ye,barPosition:ue,offset:g,stackedData:J,layout:T,dataStartIndex:S,dataEndIndex:O}))),{},ne(ne(ne({key:F.key||"item-".concat(V)},P,z[P]),L,z[L]),"animationId",b)),childIndex:Rj(F,w.children),item:F})}),R},m=function(w,j){var x=w.props,k=w.dataStartIndex,g=w.dataEndIndex,b=w.updateId;if(!ch({props:x}))return null;var S=x.children,O=x.layout,E=x.stackOffset,T=x.data,N=x.reverseStackOrder,A=$x(O),C=A.numericAxisName,I=A.cateAxisName,P=St(S,n),L=UT(T,P,"".concat(C,"Id"),"".concat(I,"Id"),E,N),D=c.reduce(function(W,re){var ce="".concat(re.axisType,"Map");return q(q({},W),{},ne({},ce,DR(x,q(q({},re),{},{graphicalItems:P,stackGroups:re.axisType===C&&L,dataStartIndex:k,dataEndIndex:g}))))},{}),R=BR(q(q({},D),{},{props:x,graphicalItems:P}),j?.legendBBox);Object.keys(D).forEach(function(W){D[W]=f(x,D[W],R,W.replace("Map",""),r)});var F=D["".concat(I,"Map")],V=LR(F),Z=p(x,q(q({},D),{},{dataStartIndex:k,dataEndIndex:g,updateId:b,graphicalItems:P,stackGroups:L,offset:R}));return q(q({formattedGraphicalItems:Z,graphicalItems:P,offset:R,stackGroups:L},V),D)},v=(function(h){function w(j){var x,k,g;return bR(this,w),g=kR(this,w,[j]),ne(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ne(g,"accessibilityManager",new sR),ne(g,"handleLegendBBoxUpdate",function(b){if(b){var S=g.state,O=S.dataStartIndex,E=S.dataEndIndex,T=S.updateId;g.setState(q({legendBBox:b},m({props:g.props,dataStartIndex:O,dataEndIndex:E,updateId:T},q(q({},g.state),{},{legendBBox:b}))))}}),ne(g,"handleReceiveSyncEvent",function(b,S,O){if(g.props.syncId===b){if(O===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(S)}}),ne(g,"handleBrushChange",function(b){var S=b.startIndex,O=b.endIndex;if(S!==g.state.dataStartIndex||O!==g.state.dataEndIndex){var E=g.state.updateId;g.setState(function(){return q({dataStartIndex:S,dataEndIndex:O},m({props:g.props,dataStartIndex:S,dataEndIndex:O,updateId:E},g.state))}),g.triggerSyncEvent({dataStartIndex:S,dataEndIndex:O})}}),ne(g,"handleMouseEnter",function(b){var S=g.getMouseInfo(b);if(S){var O=q(q({},S),{},{isTooltipActive:!0});g.setState(O),g.triggerSyncEvent(O);var E=g.props.onMouseEnter;de(E)&&E(O,b)}}),ne(g,"triggeredAfterMouseMove",function(b){var S=g.getMouseInfo(b),O=S?q(q({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(O),g.triggerSyncEvent(O);var E=g.props.onMouseMove;de(E)&&E(O,b)}),ne(g,"handleItemMouseEnter",function(b){g.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),ne(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),ne(g,"handleMouseMove",function(b){b.persist(),g.throttleTriggeredAfterMouseMove(b)}),ne(g,"handleMouseLeave",function(b){g.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};g.setState(S),g.triggerSyncEvent(S);var O=g.props.onMouseLeave;de(O)&&O(S,b)}),ne(g,"handleOuterEvent",function(b){var S=Ij(b),O=wt(g.props,"".concat(S));if(S&&de(O)){var E,T;/.*touch.*/i.test(S)?T=g.getMouseInfo(b.changedTouches[0]):T=g.getMouseInfo(b),O((E=T)!==null&&E!==void 0?E:{},b)}}),ne(g,"handleClick",function(b){var S=g.getMouseInfo(b);if(S){var O=q(q({},S),{},{isTooltipActive:!0});g.setState(O),g.triggerSyncEvent(O);var E=g.props.onClick;de(E)&&E(O,b)}}),ne(g,"handleMouseDown",function(b){var S=g.props.onMouseDown;if(de(S)){var O=g.getMouseInfo(b);S(O,b)}}),ne(g,"handleMouseUp",function(b){var S=g.props.onMouseUp;if(de(S)){var O=g.getMouseInfo(b);S(O,b)}}),ne(g,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),ne(g,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseDown(b.changedTouches[0])}),ne(g,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseUp(b.changedTouches[0])}),ne(g,"handleDoubleClick",function(b){var S=g.props.onDoubleClick;if(de(S)){var O=g.getMouseInfo(b);S(O,b)}}),ne(g,"handleContextMenu",function(b){var S=g.props.onContextMenu;if(de(S)){var O=g.getMouseInfo(b);S(O,b)}}),ne(g,"triggerSyncEvent",function(b){g.props.syncId!==void 0&&gu.emit(vu,g.props.syncId,b,g.eventEmitterSymbol)}),ne(g,"applySyncEvent",function(b){var S=g.props,O=S.layout,E=S.syncMethod,T=g.state.updateId,N=b.dataStartIndex,A=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)g.setState(q({dataStartIndex:N,dataEndIndex:A},m({props:g.props,dataStartIndex:N,dataEndIndex:A,updateId:T},g.state)));else if(b.activeTooltipIndex!==void 0){var C=b.chartX,I=b.chartY,P=b.activeTooltipIndex,L=g.state,D=L.offset,R=L.tooltipTicks;if(!D)return;if(typeof E=="function")P=E(R,b);else if(E==="value"){P=-1;for(var F=0;F<R.length;F++)if(R[F].value===b.activeLabel){P=F;break}}var V=q(q({},D),{},{x:D.left,y:D.top}),Z=Math.min(C,V.x+V.width),W=Math.min(I,V.y+V.height),re=R[P]&&R[P].value,ce=Bd(g.state,g.props.data,P),H=R[P]?{x:O==="horizontal"?R[P].coordinate:Z,y:O==="horizontal"?W:R[P].coordinate}:L1;g.setState(q(q({},b),{},{activeLabel:re,activeCoordinate:H,activePayload:ce,activeTooltipIndex:P}))}else g.setState(b)}),ne(g,"renderCursor",function(b){var S,O=g.state,E=O.isTooltipActive,T=O.activeCoordinate,N=O.activePayload,A=O.offset,C=O.activeTooltipIndex,I=O.tooltipAxisBandSize,P=g.getTooltipEventType(),L=(S=b.props.active)!==null&&S!==void 0?S:E,D=g.props.layout,R=b.key||"_recharts-cursor";return $.createElement(pR,{key:R,activeCoordinate:T,activePayload:N,activeTooltipIndex:C,chartName:r,element:b,isActive:L,layout:D,offset:A,tooltipAxisBandSize:I,tooltipEventType:P})}),ne(g,"renderPolarAxis",function(b,S,O){var E=wt(b,"type.axisType"),T=wt(g.state,"".concat(E,"Map")),N=b.type.defaultProps,A=N!==void 0?q(q({},N),b.props):b.props,C=T&&T[A["".concat(E,"Id")]];return _.cloneElement(b,q(q({},C),{},{className:me(E,C.className),key:b.key||"".concat(S,"-").concat(O),ticks:wn(C,!0)}))}),ne(g,"renderPolarGrid",function(b){var S=b.props,O=S.radialLines,E=S.polarAngles,T=S.polarRadius,N=g.state,A=N.radiusAxisMap,C=N.angleAxisMap,I=jr(A),P=jr(C),L=P.cx,D=P.cy,R=P.innerRadius,F=P.outerRadius;return _.cloneElement(b,{polarAngles:Array.isArray(E)?E:wn(P,!0).map(function(V){return V.coordinate}),polarRadius:Array.isArray(T)?T:wn(I,!0).map(function(V){return V.coordinate}),cx:L,cy:D,innerRadius:R,outerRadius:F,key:b.key||"polar-grid",radialLines:O})}),ne(g,"renderLegend",function(){var b=g.state.formattedGraphicalItems,S=g.props,O=S.children,E=S.width,T=S.height,N=g.props.margin||{},A=E-(N.left||0)-(N.right||0),C=G0({children:O,formattedGraphicalItems:b,legendWidth:A,legendContent:u});if(!C)return null;var I=C.item,P=Cx(C,hR);return _.cloneElement(I,q(q({},P),{},{chartWidth:E,chartHeight:T,margin:N,onBBoxUpdate:g.handleLegendBBoxUpdate}))}),ne(g,"renderTooltip",function(){var b,S=g.props,O=S.children,E=S.accessibilityLayer,T=ut(O,kt);if(!T)return null;var N=g.state,A=N.isTooltipActive,C=N.activeCoordinate,I=N.activePayload,P=N.activeLabel,L=N.offset,D=(b=T.props.active)!==null&&b!==void 0?b:A;return _.cloneElement(T,{viewBox:q(q({},L),{},{x:L.left,y:L.top}),active:D,label:P,payload:D?I:[],coordinate:C,accessibilityLayer:E})}),ne(g,"renderBrush",function(b){var S=g.props,O=S.margin,E=S.data,T=g.state,N=T.offset,A=T.dataStartIndex,C=T.dataEndIndex,I=T.updateId;return _.cloneElement(b,{key:b.key||"_recharts-brush",onChange:Oa(g.handleBrushChange,b.props.onChange),data:E,x:Y(b.props.x)?b.props.x:N.left,y:Y(b.props.y)?b.props.y:N.top+N.height+N.brushBottom-(O.bottom||0),width:Y(b.props.width)?b.props.width:N.width,startIndex:A,endIndex:C,updateId:"brush-".concat(I)})}),ne(g,"renderReferenceElement",function(b,S,O){if(!b)return null;var E=g,T=E.clipPathId,N=g.state,A=N.xAxisMap,C=N.yAxisMap,I=N.offset,P=b.type.defaultProps||{},L=b.props,D=L.xAxisId,R=D===void 0?P.xAxisId:D,F=L.yAxisId,V=F===void 0?P.yAxisId:F;return _.cloneElement(b,{key:b.key||"".concat(S,"-").concat(O),xAxis:A[R],yAxis:C[V],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:T})}),ne(g,"renderActivePoints",function(b){var S=b.item,O=b.activePoint,E=b.basePoint,T=b.childIndex,N=b.isRange,A=[],C=S.props.key,I=S.item.type.defaultProps!==void 0?q(q({},S.item.type.defaultProps),S.item.props):S.item.props,P=I.activeDot,L=I.dataKey,D=q(q({index:T,dataKey:L,cx:O.x,cy:O.y,r:4,fill:Kf(S.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},le(P,!1)),Da(P));return A.push(w.renderActiveDot(P,D,"".concat(C,"-activePoint-").concat(T))),E?A.push(w.renderActiveDot(P,q(q({},D),{},{cx:E.x,cy:E.y}),"".concat(C,"-basePoint-").concat(T))):N&&A.push(null),A}),ne(g,"renderGraphicChild",function(b,S,O){var E=g.filterFormatItem(b,S,O);if(!E)return null;var T=g.getTooltipEventType(),N=g.state,A=N.isTooltipActive,C=N.tooltipAxis,I=N.activeTooltipIndex,P=N.activeLabel,L=g.props.children,D=ut(L,kt),R=E.props,F=R.points,V=R.isRange,Z=R.baseLine,W=E.item.type.defaultProps!==void 0?q(q({},E.item.type.defaultProps),E.item.props):E.item.props,re=W.activeDot,ce=W.hide,H=W.activeBar,ae=W.activeShape,K=!!(!ce&&A&&D&&(re||H||ae)),z={};T!=="axis"&&D&&D.props.trigger==="click"?z={onClick:Oa(g.handleItemMouseEnter,b.props.onClick)}:T!=="axis"&&(z={onMouseLeave:Oa(g.handleItemMouseLeave,b.props.onMouseLeave),onMouseEnter:Oa(g.handleItemMouseEnter,b.props.onMouseEnter)});var B=_.cloneElement(b,q(q({},E.props),z));function X(st){return typeof C.dataKey=="function"?C.dataKey(st.payload):null}if(K)if(I>=0){var J,U;if(C.dataKey&&!C.allowDuplicatedCategory){var ye=typeof C.dataKey=="function"?X:"payload.".concat(C.dataKey.toString());J=Ou(F,ye,P),U=V&&Z&&Ou(Z,ye,P)}else J=F?.[I],U=V&&Z&&Z[I];if(ae||H){var ue=b.props.activeIndex!==void 0?b.props.activeIndex:I;return[_.cloneElement(b,q(q(q({},E.props),z),{},{activeIndex:ue})),null,null]}if(!he(J))return[B].concat(Jr(g.renderActivePoints({item:E,activePoint:J,basePoint:U,childIndex:I,isRange:V})))}else{var $e,Me=($e=g.getItemByXY(g.state.activeCoordinate))!==null&&$e!==void 0?$e:{graphicalItem:B},De=Me.graphicalItem,tt=De.item,vt=tt===void 0?b:tt,rt=De.childIndex,yt=q(q(q({},E.props),z),{},{activeIndex:rt});return[_.cloneElement(vt,yt),null,null]}return V?[B,null,null]:[B,null]}),ne(g,"renderCustomized",function(b,S,O){return _.cloneElement(b,q(q({key:"recharts-customized-".concat(O)},g.props),g.state))}),ne(g,"renderMap",{CartesianGrid:{handler:Ca,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:Ca},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:Ca},YAxis:{handler:Ca},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((x=j.id)!==null&&x!==void 0?x:Ii("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=Gb(g.triggeredAfterMouseMove,(k=j.throttleDelay)!==null&&k!==void 0?k:1e3/60),g.state={},g}return OR(w,h),jR(w,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,g=x.data,b=x.height,S=x.layout,O=ut(k,kt);if(O){var E=O.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,N=Bd(this.state,g,E,T),A=this.state.tooltipTicks[E].coordinate,C=(this.state.offset.top+b)/2,I=S==="horizontal",P=I?{x:A,y:C}:{y:A,x:C},L=this.state.formattedGraphicalItems.find(function(R){var F=R.item;return F.type.name==="Scatter"});L&&(P=q(q({},P),L.props.points[E].tooltipPosition),N=L.props.points[E].tooltipPayload);var D={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:T,activePayload:N,activeCoordinate:P};this.setState(D),this.renderCursor(O),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var g,b;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(x){Eu([ut(x.children,kt)],[ut(this.props.children,kt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=ut(this.props.children,kt);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return l.indexOf(k)>=0?k:i}return i}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,g=k.getBoundingClientRect(),b=jO(g),S={chartX:Math.round(x.pageX-b.left),chartY:Math.round(x.pageY-b.top)},O=g.width/k.offsetWidth||1,E=this.inRange(S.chartX,S.chartY,O);if(!E)return null;var T=this.state,N=T.xAxisMap,A=T.yAxisMap,C=this.getTooltipEventType(),I=Ix(this.state,this.props.data,this.props.layout,E);if(C!=="axis"&&N&&A){var P=jr(N).scale,L=jr(A).scale,D=P&&P.invert?P.invert(S.chartX):null,R=L&&L.invert?L.invert(S.chartY):null;return q(q({},S),{},{xValue:D,yValue:R},I)}return I?q(q({},S),I):null}},{key:"inRange",value:function(x,k){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,S=x/g,O=k/g;if(b==="horizontal"||b==="vertical"){var E=this.state.offset,T=S>=E.left&&S<=E.left+E.width&&O>=E.top&&O<=E.top+E.height;return T?{x:S,y:O}:null}var N=this.state,A=N.angleAxisMap,C=N.radiusAxisMap;if(A&&C){var I=jr(A);return Zv({x:S,y:O},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),g=ut(x,kt),b={};g&&k==="axis"&&(g.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=Da(this.props,this.handleOuterEvent);return q(q({},S),b)}},{key:"addListener",value:function(){gu.on(vu,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){gu.removeListener(vu,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,g){for(var b=this.state.formattedGraphicalItems,S=0,O=b.length;S<O;S++){var E=b[S];if(E.item===x||E.props.key===x.key||k===$t(E.item.type)&&g===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,g=k.left,b=k.top,S=k.height,O=k.width;return $.createElement("defs",null,$.createElement("clipPath",{id:x},$.createElement("rect",{x:g,y:b,height:S,width:O})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,g){var b=Px(g,2),S=b[0],O=b[1];return q(q({},k),{},ne({},S,O.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,g){var b=Px(g,2),S=b[0],O=b[1];return q(q({},k),{},ne({},S,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,g=k.formattedGraphicalItems,b=k.activeItem;if(g&&g.length)for(var S=0,O=g.length;S<O;S++){var E=g[S],T=E.props,N=E.item,A=N.type.defaultProps!==void 0?q(q({},N.type.defaultProps),N.props):N.props,C=$t(N.type);if(C==="Bar"){var I=(T.data||[]).find(function(R){return HC(x,R)});if(I)return{graphicalItem:E,payload:I}}else if(C==="RadialBar"){var P=(T.data||[]).find(function(R){return Zv(x,R)});if(P)return{graphicalItem:E,payload:P}}else if(is(E,b)||ss(E,b)||ra(E,b)){var L=hI({graphicalItem:E,activeTooltipItem:b,itemData:A.data}),D=A.activeIndex===void 0?L:A.activeIndex;return{graphicalItem:q(q({},E),{},{childIndex:D}),payload:ra(E,b)?A.data[L]:E.props.data[L]}}}return null}},{key:"render",value:function(){var x=this;if(!ch(this))return null;var k=this.props,g=k.children,b=k.className,S=k.width,O=k.height,E=k.style,T=k.compact,N=k.title,A=k.desc,C=Cx(k,mR),I=le(C,!1);if(T)return $.createElement(bx,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement(Pu,Or({},I,{width:S,height:O,title:N,desc:A}),this.renderClipPath(),dh(g,this.renderMap)));if(this.props.accessibilityLayer){var P,L;I.tabIndex=(P=this.props.tabIndex)!==null&&P!==void 0?P:0,I.role=(L=this.props.role)!==null&&L!==void 0?L:"application",I.onKeyDown=function(R){x.accessibilityManager.keyboardEvent(R)},I.onFocus=function(){x.accessibilityManager.focus()}}var D=this.parseEventsOfWrapper();return $.createElement(bx,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement("div",Or({className:me("recharts-wrapper",b),style:q({position:"relative",curs
64or:"default",width:S,height:O},E)},D,{ref:function(F){x.container=F}}),$.createElement(Pu,Or({},I,{width:S,height:O,title:N,desc:A,style:CR}),this.renderClipPath(),dh(g,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(_.Component);ne(v,"displayName",r),ne(v,"defaultProps",q({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),ne(v,"getDerivedStateFromProps",function(h,w){var j=h.dataKey,x=h.data,k=h.children,g=h.width,b=h.height,S=h.layout,O=h.stackOffset,E=h.margin,T=w.dataStartIndex,N=w.dataEndIndex;if(w.updateId===void 0){var A=Rx(h);return q(q(q({},A),{},{updateId:0},m(q(q({props:h},A),{},{updateId:0}),w)),{},{prevDataKey:j,prevData:x,prevWidth:g,prevHeight:b,prevLayout:S,prevStackOffset:O,prevMargin:E,prevChildren:k})}if(j!==w.prevDataKey||x!==w.prevData||g!==w.prevWidth||b!==w.prevHeight||S!==w.prevLayout||O!==w.prevStackOffset||!Au(E,w.prevMargin)){var C=Rx(h),I={chartX:w.chartX,chartY:w.chartY,isTooltipActive:w.isTooltipActive},P=q(q({},Ix(w,x,S)),{},{updateId:w.updateId+1}),L=q(q(q({},C),I),P);return q(q(q({},L),m(q({props:h},L),w)),{},{prevDataKey:j,prevData:x,prevWidth:g,prevHeight:b,prevLayout:S,prevStackOffset:O,prevMargin:E,prevChildren:k})}if(!Eu(k,w.prevChildren)){var D,R,F,V,Z=ut(k,zr),W=Z&&(D=(R=Z.props)===null||R===void 0?void 0:R.startIndex)!==null&&D!==void 0?D:T,re=Z&&(F=(V=Z.props)===null||V===void 0?void 0:V.endIndex)!==null&&F!==void 0?F:N,ce=W!==T||re!==N,H=!he(x),ae=H&&!ce?w.updateId:w.updateId+1;return q(q({updateId:ae},m(q(q({props:h},w),{},{updateId:ae,dataStartIndex:W,dataEndIndex:re}),w)),{},{prevChildren:k,dataStartIndex:W,dataEndIndex:re})}return null}),ne(v,"renderActiveDot",function(h,w,j){var x;return _.isValidElement(h)?x=_.cloneElement(h,w):de(h)?x=h(w):x=$.createElement(Wf,w),$.createElement(Re,{className:"recharts-active-dot",key:j},x)});var y=_.forwardRef(function(w,j){return $.createElement(v,Or({},w,{ref:j}))});return y.displayName=v.displayName,y},KR=UR({chartName:"PieChart",GraphicalChild:Wt,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:as},{axisType:"radiusAxis",AxisComp:rs}],formatAxisMap:tP,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});Ue({method:"GET"}).handler(Ke("ddb1cd1c86623a3c0d71f258d949f1083a0abc85366f289abb5d76b666564161"));const HR=Ue({method:"POST"}).middleware([Et]).handler(Ke("0c86cdcef3bcfefd09ca6cd09a179d926566de2904311346182508b3c1e190be")),WR=Ue({method:"POST"}).middleware([Et]).handler(Ke("a9e54ce1a14b85e10cfc84c9b505dab03388a77bc8f76d787f19f1ae9a8a9495")),ma=z1({type:"function"}).middleware([V1]),GR=Ue({method:"POST"}).middleware([ma]).handler(Ke("ee27fa2d203c4c9c989efa492f0d7c9e35deaea8071087ef23bea548fdb97c1c")),zR=Ue({method:"POST"}).middleware([ma]).handler(Ke("47f5f865537193b412113d832df7f82929b35bd0aa6b4afb85b9e481a533f923")),VR=Ue({method:"POST"}).middleware([ma]).handler(Ke("305fd1482f2e6d471ac6b3956b8e957c1ce36545ed10f24e0039ad94148360cc")),XR=Ue({method:"POST"}).middleware([ma]).handler(Ke("be6482352a926581063f2ca19a946a13f57a8f16a07021b80d6c3cb22fd76994")),YR=Ue({method:"POST"}).middleware([ma]).handler(Ke("f0f415228488a2304335a9588efcd53cd0f9e57bd70fb725d37a763da7803db8")),ZR=Ue({method:"POST"}).middleware([Et]).handler(Ke("58ad894e80b58edfea9b26a93a05a121ceeb3325a5460a275e30c92495b28279")),JR=Ue({method:"POST"}).middleware([Et]).handler(Ke("8750e372b14ad23b99f6074ef78e68cd45681d06deb3c0c68be5ce1920f14ccb")),QR=Ue({method:"POST"}).middleware([Et]).handler(Ke("25eb14d96600fb93155b40f982f1fbf571299652ab8a1c77f1eb3a5cb75bea3d")),e$=Ue({method:"POST"}).middleware([Et]).handler(Ke("11f710ba4df18b05f3f7f6ce5ee6b23079274930c3f5bdcbb24f8253e34a3c1d")),t$=[{day:"Esmaspäev",time:"17:30",trainer:"Erik",category:"Kalisteenika",bookingTypeKey:"kalisteenikaErik"},{day:"Esmaspäev",time:"19:00",trainer:"Erik",category:"Kalisteenika",bookingTypeKey:"kalisteenikaErikHiline"},{day:"Teisipäev",time:"18:30",trainer:"Kadi",category:"Kalisteenika",bookingTypeKey:"kalisteenikaKadi"},{day:"Kolmapäev",time:"17:30",trainer:"Erik",category:"Kalisteenika",bookingTypeKey:"kalisteenikaErik"},{day:"Kolmapäev",time:"19:00",trainer:"Erik",category:"Kalisteenika",bookingTypeKey:"kalisteenikaErikHiline"},{day:"Neljapäev",time:"18:30",trainer:"Kadi",category:"Kalisteenika",bookingTypeKey:"kalisteenikaKadi"},{day:"Teisipäev",time:"16:00",trainer:"Erik",category:"Laste kalisteenika",bookingTypeKey:"lasteKalisteenika"},{day:"Neljapäev",time:"16:00",trainer:"Erik",category:"Laste kalisteenika",bookingTypeKey:"lasteKalisteenika"},{day:"Pühapäev",time:"11:00",trainer:"Villem",category:"Kätelseis",bookingTypeKey:"katelseis"},{day:"Laupäev",time:"10:00",trainer:"Alex",category:"Total Body Performance",bookingTypeKey:"totalBodyPerformance"},{day:"Reede",time:"17:00",trainer:"Erik",category:"Alfa kolmik",bookingTypeKey:"alfaKolmik"}],B1={Pühapäev:0,Esmaspäev:1,Teisipäev:2,Kolmapäev:3,Neljapäev:4,Reede:5,Laupäev:6};function r$(e,t,r){const n=Date.parse(`${e}T${t}:00Z`),a=new Intl.DateTimeFormat("en-US",{timeZone:r,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),i={};for(const l of a.formatToParts(new Date(n)))l.type!=="literal"&&(i[l.type]=l.value);const s=Date.UTC(Number(i.year),Number(i.month)-1,Number(i.day),Number(i.hour==="24"?"00":i.hour),Number(i.minute),Number(i.second));return new Date(n-(s-n)).toISOString()}
64function X$(){const e=X1(),t=pe(GR),[r,n]=_.useState(!0),[a,i]=_.useState(null),[s,l]=_.useState(null);_.useEffect(()=>{let u=!1;return(async()=>{const{data:f}=await ie.auth.getSession();if(!f.session){e({to:"/admin/login"});return}l(f.session.user.email??null);try{const d=await t();if(u)return;i(d??null)}catch{if(u)return;i(null)}u||n(!1)})(),()=>{u=!0}},[e]);const c=async()=>{await ie.auth.signOut(),e({to:"/admin/login"})};return r?o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-paper",children:"Kontrollin…"}):a?a.role==="trainer"?o.jsx(i$,{email:s,trainerName:a.trainerName,onSignOut:c}):o.jsx(s$,{email:s,onSignOut:c}):o.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center paper-texture px-6 gap-4",children:[o.jsx("h1",{className:"t-headline text-2xl",children:"Juurdepääs keelatud"}),o.jsxs("p",{className:"text-sm text-ink/70",children:["Kasutajal ",s," pole admini õigusi."]}),o.jsx("button",{onClick:c,className:"bg-ink text-paper text-xs uppercase tracking-wider px-4 py-2",children:"Logi välja"})]})}const Dx="https://stuudioyksus.fit",n$={Erik:{classPath:"klass-kalisteenika-erik",profilePath:"trainer-erik"},Kadi:{classPath:"klass-kalisteenika-kadi",profilePath:"trainer-kadi"},Villem:{classPath:"klass-handstand",profilePath:"trainer-villem"},Alex:{classPath:"klass-total-body-performance",profilePath:"trainer-alex"}};function a$({trainerName:e,locale:t}){const r=Hx[t],n=n$[e],[a,i]=_.useState(null);if(!n)return null;const s=t==="en"?"/en":"",l=[{label:r.classLink,url:`${Dx}${s}/trennid#${n.classPath}`},{label:r.profileLink,url:`${Dx}${s}/treenerid#${n.profilePath}`}],c=async(u,f)=>{try{await navigator.clipboard.writeText(f)}catch{}i(u),setTimeout(()=>i(d=>d===u?null:d),2e3)};return o.jsx(_e,{title:r.linksTitle,description:r.linksDescription,children:o.jsx("div",{className:"space-y-2",children:l.map(u=>o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60 gap-1",children:[u.label,o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",readOnly:!0,value:u.url,onFocus:f=>f.currentTarget.select(),className:"flex-1 min-w-0 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink font-mono"}),o.jsx("button",{type:"button",onClick:()=>c(u.label,u.url),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 shrink-0",children:a===u.label?r.copied:r.copy})]})]},u.label))})})}function i$({email:e,trainerName:t,onSignOut:r}){const[n,a]=bw(),i=Hx[n],s=pe(xw),[l,c]=_.useState(null),[u,f]=_.useState(!1),d=async()=>{if(!(!e||u)){f(!0);try{await s({data:{email:e}})}finally{f(!1),c(i.resetSent)}}};return o.jsxs("div",{className:"min-h-screen paper-texture text-ink font-sans",children:[o.jsx("header",{className:"border-b border-ink/15 bg-ink text-paper",children:o.jsxs("div",{className:"max-w-[1360px] mx-auto px-3 sm:px-5 py-3 flex items-center justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-paper/60",children:"Üksus · admin"}),o.jsx("h1",{className:"text-[15px] font-medium leading-tight",children:i.heading(t)})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[o.jsx(ww,{locale:n,onChange:a}),o.jsx("span",{className:"text-paper/70 hidden sm:inline",children:e}),o.jsx("button",{onClick:d,disabled:u,className:"border border-paper/30 px-2.5 py-1 uppercase tracking-wider hover:bg-paper hover:text-ink transition-colors disabled:opacity-50",children:i.changePassword}),o.jsx("button",{onClick:r,className:"border border-paper/30 px-2.5 py-1 uppercase tracking-wider hover:bg-paper hover:text-ink transition-colors",children:i.logOut})]})]})}),o.jsxs("main",{className:"max-w-[1360px] mx-auto px-3 sm:px-5 py-5 space-y-3 overflow-x-hidden",children:[l&&o.jsxs("p",{className:"text-[12px] text-ink bg-ink/5 border border-ink/15 px-2.5 py-1.5 flex items-center justify-between gap-2",children:[o.jsx("span",{children:l}),o.jsx("button",{type:"button",onClick:()=>c(null),className:"text-[10px] uppercase tracking-wider text-ink/60 hover:text-ink",children:i.close})]}),o.jsx(K1,{trainerScope:{trainerName:t,locale:n}}),o.jsx(a$,{trainerName:t,locale:n})]})]})}function s$({email:e,onSignOut:t}){const r=pe(Y1),a=F1()==="summer",i=_.useMemo(()=>new Set(["kalisteenika-kadiga","laste-kalisteenika","alfa-kolmik"]),[]),[s,l]=_.useState([]),[c,u]=_.useState(!1),[f,d]=_.useState({done:0,total:0}),[p,m]=_.useState([]),[v,y]=_.useState(!1),h=_.useMemo(()=>{const O=[],E=new Date;E.setHours(0,0,0,0);for(let T=0;T<14;T++){const N=new Date(E);N.setDate(E.getDate()+T);const A=N.getDay(),C=`${N.getFullYear()}
64-${String(N.getMonth()+1).padStart(2,"0")}-${String(N.getDate()).padStart(2,"0")}`;for(const I of t$){if(B1[I.day]!==A)continue;const P=a&&I.bookingTypeKey==="kalisteenikaErikHiline"&&I.time==="19:00"?{...I,time:"18:45"}:I;O.push({iso:C,row:P})}}return O},[a]),w=async()=>{y(!0);const{data:O,error:E}=await ie.from("booking_errors").select("id, created_at, event_type_slug, username, start_time, attendee_email, status_code, error_code, error_message").order("created_at",{ascending:!1}).limit(50);!E&&O&&m(O),y(!1)};_.useEffect(()=>{w()},[]);const j=O=>new Date(`${O}T12:00:00Z`).toLocaleDateString("et-EE",{weekday:"short",day:"numeric",month:"long"}),x=async()=>{u(!0),l([]),d({done:0,total:h.length});const O=new Map;for(const N of h){const A=or[N.row.bookingTypeKey],C=`${A.username}|${A.eventTypeSlug}`;O.has(C)||O.set(C,{bt:A,targets:[]}),O.get(C).targets.push(N)}const E=[];let T=0;for(const{bt:N,targets:A}of O.values()){const C=A[Math.floor(A.length/2)];let I=[],P;try{const R=r$(C.iso,"12:00","Europe/Tallinn"),F=await r({data:{eventTypeSlug:N.eventTypeSlug,username:N.username,start:R,timeZone:"Europe/Tallinn"}});I=Array.isArray(F?.starts)?F.starts:[],F?.ok||(P=F?.error||`status ${F?.status}`)}catch(R){P=R instanceof Error?R.message:"request failed"}const L=new Map;for(const R of I){const F=new Intl.DateTimeFormat("en-CA",{timeZone:"Europe/Tallinn",year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(R)),V=new Intl.DateTimeFormat("en-GB",{timeZone:"Europe/Tallinn",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(R));L.has(F)||L.set(F,[]),L.get(F).push({hhmm:V,iso:R})}for(const R of A){const F=R.row.time.match(/(\d{1,2}):(\d{2})/),V=F?`${F[1].padStart(2,"0")}:${F[2]}`:"",Z=L.get(R.iso)??[],W=Z.find(H=>H.hhmm===V),re=a&&i.has(N.eventTypeSlug),ce={iso:R.iso,date:j(R.iso),scheduleTime:V,category:R.row.category,trainer:R.row.trainer,slug:N.eventTypeSlug};if(re)E.push({...ce,status:"skipped",note:"Suvepausil — ei kontrollita"});else if(P)E.push({...ce,status:"error",note:P});else if(W)E.push({...ce,status:"match",calTime:W.hhmm});else if(Z.length===0)E.push({...ce,status:"missing",note:"Cal.com ei tagasta seda päeva"});else{const H=V?Number(V.replace(":","")):0;let ae=Z[0],K=Math.abs(Number(ae.hhmm.replace(":",""))-H);for(const z of Z){const B=Math.abs(Number(z.hhmm.replace(":",""))-H);B<K&&(ae=z,K=B)}E.push({...ce,status:"changed",calTime:ae.hhmm,note:"Aeg muudetud Cal.com'is"})}T+=1}const D=new Set(A.map(R=>R.iso));for(const R of D){const F=L.get(R)??[],V=new Set(A.filter(Z=>Z.iso===R).map(Z=>{const W=Z.row.time.match(/(\d{1,2}):(\d{2})/);return W?`${W[1].padStart(2,"0")}:${W[2]}`:""}));for(const Z of F)if(!V.has(Z.hhmm)){const W=Number(Z.hhmm.replace(":",""));let re=!1;for(const ce of V)if(Math.abs(Number(ce.replace(":",""))-W)<=130){re=!0;break}re||E.push({iso:R,date:j(R),scheduleTime:"—",category:or[A[0].row.bookingTypeKey].label,trainer:A[0].row.trainer,slug:N.eventTypeSlug,status:"added",calTime:Z.hhmm,note:"Lisatud aeg"})}}d({done:T,total:h.length}),l([...E].sort((R,F)=>(R.iso+R.scheduleTime).localeCompare(F.iso+F.scheduleTime)))}u(!1)},k=s.filter(O=>O.status!=="match"),g=s.filter(O=>O.status==="missing"),b=s.filter(O=>O.status==="changed"),S=s.filter(O=>O.status==="added");return o.jsxs("div",{className:"min-h-screen paper-texture text-ink font-sans",children:[o.jsx("header",{className:"border-b border-ink/15 bg-ink text-paper",children:o.jsxs("div",{className:"max-w-[1360px] mx-auto px-3 sm:px-5 py-3 flex items-center justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-paper/60",children:"Üksus · admin"}),o.jsx("h1",{className:"text-[15px] font-medium leading-tight",children:"Control panel"})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[o.jsx("span",{className:"text-paper/70 hidden sm:inline",children:e}),o.jsx("button",{onClick:t,className:"border border-paper/30 px-2.5 py-1 uppercase tracking-wider hover:bg-paper hover:text-ink transition-colors",children:"Logi välja"})]})]})}),o.jsxs("main",{className:"max-w-[1360px] mx-auto px-3 sm:px-5 py-5 space-y-3 overflow-x-hidden",children:[o.jsx(K1,{}),o.jsx(T$,{}),o.jsx(S$,{}),o.jsx(O$,{}),o.jsx(H$,{}),o.jsx(I$,{}),o.jsx(y$,{}),o.jsx(c$,{}),o.jsx(d$,{}),o.jsx(p$,{}),o.jsx(_e,{title:"Arhiveeritud trennid",description:"Avalehelt eemaldatud trennide kaardid ja pikad kirjeldused on siin alles. Vajuta kaardil „loe edasi“, et näha kogu sisu.",children:o.jsx("div",{className:"paper-texture",children:o.jsx(Z1,{})})}),o.jsxs(K$,{children:[o.jsx(W$,{}),o.jsx(h$,{}),o.jsx(m$,{}),o.jsx(q$,{}),o.jsx(B$,{}),o.jsx(F$,{}),o.jsx(U$,{}),o.jsx(g$,{}),o.jsx(v$,{}
64),o.jsxs(_e,{title:"Schedule vs Cal.com audit",description:"Järgmise 14 päeva tunnid, võrreldud Cal.com saadavusega.",headerAction:o.jsx("button",{onClick:x,disabled:c,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:c?`Kontrollin… ${f.done}/${f.total}`:"Refresh Cal.com check"}),children:[s.length>0&&o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:s.length}),o.jsx(ke,{label:"Erinevusi",value:k.length,accent:k.length>0}),o.jsx(ke,{label:"Puuduvad",value:g.length}),o.jsx(ke,{label:"Muudetud / Lisatud",value:b.length+S.length})]}),s.length===0?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:'Vajuta "Refresh Cal.com check" et alustada.'}):o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[13px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Kuupäev"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tund"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Treener"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Plaani aeg"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Cal.com aeg"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Staatus"})]})}),o.jsx("tbody",{children:s.map((O,E)=>{const T=O.status==="missing";return o.jsxs("tr",{className:`border-b border-ink/10 ${T?"opacity-40":""}`,style:{backgroundColor:E%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 whitespace-nowrap",children:O.date}),o.jsx("td",{className:"px-2.5 py-1.5",children:O.category}),o.jsx("td",{className:"px-2.5 py-1.5",children:O.trainer}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:O.scheduleTime}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:O.calTime??"—"}),o.jsx("td",{className:"px-2.5 py-1.5",children:o.jsx(o$,{status:O.status,note:O.note})})]},E)})})]})})]}),o.jsx(_e,{title:"Viimased booking API vead",description:"Cal.com booking endpoint'i viimased 50 viga.",headerAction:o.jsx("button",{onClick:w,disabled:v,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 disabled:opacity-50",children:v?"Laen…":"Värskenda"}),children:p.length===0?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Vigu pole logitud."}):o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Aeg"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Slug"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Algus"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Email"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Kood"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Sõnum"})]})}),o.jsx("tbody",{children:p.map((O,E)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:E%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 whitespace-nowrap font-mono",children:new Date(O.created_at).toLocaleString("et-EE",{timeZone:"Europe/Tallinn"})}),o.jsx("td",{className:"px-2.5 py-1.5",children:O.event_type_slug??"—"}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:O.start_time?new Date(O.start_time).toLocaleString("et-EE",{timeZone:"Europe/Tallinn"}):"—"}),o.jsx("td",{className:"px-2.5 py-1.5",children:O.attendee_email??"—"}),o.jsx("td",{className:"px-2.5 py-1.5",children:o.jsxs("span",{className:"bg-red-700/10 text-red-800 px-1.5 py-0.5",children:[O.status_code??"?"," ",O.error_code??""]})}),o.jsx("td",{className:"px-2.5 py-1.5 max-w-md truncate",title:O.error_message??"",children:O.error_message??"—"})]},O.id))})]})})}),o.jsx(R$,{}),o.jsx($$,{}),o.jsx(D$,{}),o.jsx(L$,{})]})]})]})}function _e({title:e,description:t,defaultOpen:r=!1,headerAction:n,children:a}){const[i,s]=_.useState(r);return o.jsxs("section",{className:"border border-ink/15 bg-paper",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2 px-3 sm:px-4 py-2.5",children:[o.jsxs("button",{type:"button",onClick:()=>s(l=>!l),className:"flex items-start gap-2 text-left w-full md:w-auto md:flex-1 min-w-0","aria-expanded":i,children:[o.jsx("span",{className:"text-ink/50 text-[10px] mt-1 w-3 inline-block",children:i?"▾":"▸"}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-[14px] font-medium leading-tight",children:e}),t&&o.jsx("span",{className:"block text-[11px] text-ink/55 mt-0.5 leading-snug",children:t})]})]}),i&&n&&o.jsx("div",{className:"w-full md:w-auto md:shrink-0",children:n})]}),i&&o.jsxs("div",{className:"px-3 sm:px-4 pb-4 pt-1 border-t border-ink/10 space-y-3",children:[a,o.jsx("div",{className:"pt-2 flex justify-end",children:o.jsx("button",{type:"button",onClick:()=>s(!1),className:"text-[10px] uppercase tracking-wider border border-ink/30 px-2.5 py-1 hover:bg-ink hover:text-paper transition-colors",children:"Sulge"})})]})]})}function ke({label:e,value:t,accent:r}){return o.jsxs("div",{className:`border border-ink/15 px-3 py-2 ${r?"bg-sienna/10":""}`,children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wider text-ink/60",children:e}),o.jsx("p",{className:"text-lg font-medium leading-tight mt-0.5",children:t})]})}function Le({label:e,value:t}){return o.jsxs("div",{className:"flex items-baseline gap-1.5",children:[o.jsx("span",{className:"text-ink/55 uppercase text-[10px] tracking-wider w-[68px] shrink-0",children:e}),o.jsx("span",{className:"min-w-0 break-words",children:t})]})}function o$({status:e,note:t}){const r={match:"bg-emerald-700/10 text-emerald-800",missing:"bg-ink/10 text-ink/70",changed:"bg-sienna/15 text-sienna",added:"bg-sienna/15 text-sienna",error:"bg-red-700/10 text-red-800",skipped:"bg-ink/5 text-ink/50"},n={match:"OK",missing:"VIGA",changed:"Muudetud aeg",added:"Lisatud aeg",error:"ERROR",skipped:"SUVEPAUS"};return o.jsx("span",{className:`inline-block px-2 py-0.5 text-[10px] uppercase tracking-wider ${r[e]}`,title:t,children:n[e]})}function l$(e){const t=()=>e();return window.addEventListener("yksus-season-mode-change",t),window.addEventListener("storage",t),()=>{window.removeEventListener("yksus-season-mode-change",t),window.removeEventListener("storage",t)}}function F1(){return _.useSyncExternalStore(l$,()=>Q1(),()=>ew.fallbackMode)}function c$(){const e=F1(),t=tw(),r=pe(HR),[n,a]=_.useState(null),[i,s]=_.useState(null),l=[{value:"summer",label:"Summer mode",desc:"Suvepausi käitumine on aktiivne."},{value:"autumn",label:"Autumn mode",desc:"Sügisene broneerimisrežiim on aktiivne."}],c=async u=>{s(null),a(u);try{await r({data:{mode:u}}),await gw()}catch(f){s(f instanceof Error?f.message:"Failed to update season mode")}finally{a(null)}};return o.jsxs(_e,{title:"Website season mode",description:"Valitud režiim mõjutab kogu veebisaiti kõikidele külastajatele (salvestub serverisse).",children:[o.jsxs("div",{className:"border border-ink/15 px-3 py-2 text-[13px] bg-paper-deep flex flex-wrap gap-x-6 gap-y-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60 mr-2",children:"Current setting"}),o.jsx("span",{className:"font-medium uppercase tracking-wider text-[11px]",children:u$(e)})]}),o.jsxs("p",{children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60 mr-2",children:"Currently active"}),o.jsx("span",{className:"font-medium uppercase tracking-wider text-[11px]",children:t==="summer"?"Summer mode":"Autumn mode"})]})]}),i&&o.jsx("p",{className:"text-[11px] text-red-700 border border-red-300 bg-red-50 px-2 py-1",children:i}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:l.map(u=>{const f=e===u.value,d=n===u.value;return o.jsxs("button",{disabled:n!==null,onClick:()=>c(u.value),className:`text-left border px-3 py-2 transition-colors ${f?"bg-sienna text-white border-sienna":"border-ink/20 hover:border-ink bg-paper"} ${n!==null?"opacity-70 cursor-wait":""}`,children:[o.jsx("p",{className:"text-[10px] uppercase tracking-wider opacity-80",children:d?"Salvestan…":f?"Aktiivne":"Lülita sisse"}),o.jsx("p",{className:"font-medium text-[13px] mt-0.5",children:u.label}),o.jsx("p",{className:`text-[11px] mt-0.5 ${f?"text-white/80":"text-ink/60"}`,children:u.desc})]},u.value)})})]})}function u$(e){return e==="summer"?"Summer mode":"Autumn mode"}function d$(){const e=rw(),t=pe(WR),[r,n]=_.useState(!1),[a,i]=_.useState(null),s=async()=>{i(null),n(!0);try{await t({data:{visible:!e}}),await vw()}catch(l){i(l instanceof Error?l.message:"Failed to update visibility")}finally{n(!1)}};return o.jsxs(_e,{title:"Alfa kolmik — nähtavus",description:"Peidab või taastab Alfa kolmiku „Broneeri tund“ sektsioonis ja Hinnad lehel (alati kaartide lõpus). Sisu ja Cal.com broneering jäävad alles — sisselülitamisel töötab kõik täpselt nagu enne.",children:[o.jsxs("div",{className:"border border-ink/15 px-3 py-2 text-[13px] bg-paper-deep",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60 mr-2",children:"Praegu"}),o.jsx("span",{className:"font-medium uppercase tracking-wider text-[11px]",children:e?"NÃ
64¤htav (broneerimine + hinnad)":"Peidetud"})]}),a&&o.jsx("p",{className:"text-[11px] text-red-700 border border-red-300 bg-red-50 px-2 py-1",children:a}),o.jsx("button",{disabled:r,onClick:s,className:`text-left border px-3 py-2 transition-colors ${e?"border-ink/20 hover:border-ink bg-paper":"bg-sienna text-white border-sienna"} ${r?"opacity-70 cursor-wait":""}`,children:o.jsx("p",{className:"font-medium text-[13px]",children:r?"Salvestan…":e?"Peida Alfa kolmik":"Taasta Alfa kolmik"})})]})}const f$=[{label:"Kalisteenika (Erik)",path:"/trennid#klass-kalisteenika-erik"},{label:"Kalisteenika (Kadi)",path:"/trennid#klass-kalisteenika-kadi"},{label:"Laste kalisteenika",path:"/trennid#klass-kalisteenika-lapsed"},{label:"Algajate kalisteenika",path:"/trennid#klass-kalisteenika-algajad"},{label:"Käteseis (Handstand)",path:"/trennid#klass-handstand"},{label:"Total Body Performance",path:"/trennid#klass-total-body-performance"},{label:"Treener Erik",path:"/treenerid#trainer-erik"},{label:"Treener Kadri",path:"/treenerid#trainer-kadri"},{label:"Treener Kadi",path:"/treenerid#trainer-kadi"},{label:"Treener Villem",path:"/treenerid#trainer-villem"},{label:"Treener Alex",path:"/treenerid#trainer-alex"}];function p$(){const[e,t]=_.useState(null),r=typeof window<"u"?window.location.origin:"https://stuudioyksus.fit",n=a=>{const i=`${r}${a}`;typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(i).then(()=>{t(a),setTimeout(()=>t(s=>s===a?null:s),1500)}).catch(()=>{})};return o.jsx(_e,{title:"Otselingid trennidele ja treeneritele",description:"Link avab lehe konkreetse kaardiga juba avatuna. Lisa eesotsa /en/ inglise keele jaoks (nt stuudioyksus.fit/en/trennid#klass-handstand).",children:o.jsx("div",{className:"border border-ink/15 divide-y divide-ink/10",children:f$.map(a=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 bg-paper",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-[13px] font-medium",children:a.label}),o.jsxs("p",{className:"text-[11px] text-ink/60 font-mono truncate",children:[r,a.path]})]}),o.jsx("button",{onClick:()=>n(a.path),className:"shrink-0 border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 hover:border-ink transition-colors",children:e===a.path?"Kopeeritud ✓":"Kopeeri"})]},a.path))})})}function dt(e){return e===!0?"yes":e===!1?"no":"—"}function Lx(e,t){return e===!1?"not attempted":dt(t)}function qx(e,t){return e===!1?"not attempted":typeof t=="number"?String(t):"no response"}function U1(e){const t=(e||"").toLowerCase();return e?t.includes("unauthorized")||t.includes("401")?"Unauthorized — your admin session expired. Sign out and back in.":t.includes("forbidden")||t.includes("403")?"Admin-only — this account does not have the admin role.":t.includes("failed to fetch")||t.includes("network")||t.includes("typeerror")?"Server function did not run — network error reaching server.":t.includes("500")?"Server function crashed — check server logs.":"Server function call failed.":"Server function did not return a response."}function h$(){const e=pe(nw),[t,r]=_.useState(!1),[n,a]=_.useState(null),[i,s]=_.useState(null),l=async()=>{r(!0),s(null),a(null);try{const u=await e({data:void 0});a(u)}catch(u){s(u instanceof Error?u.message:String(u))}finally{r(!1)}}
64,c={display:"flex",justifyContent:"space-between",gap:12,padding:"6px 0",borderBottom:"1px solid var(--paper-deep, #eee)",fontSize:13};return o.jsxs(_e,{title:"Cal.com diagnostika",description:"Testib CAL_API_KEY ja Cal.com endpoint'e. API võtit ennast ei kuvata.",headerAction:o.jsx("button",{type:"button",onClick:l,disabled:t,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:t?"Testin…":"Test Cal.com"}),children:[i&&o.jsxs("div",{className:"border border-red-300 bg-red-50 px-3 py-2",children:[o.jsx("p",{className:"text-[12px] font-medium text-red-800",children:U1(i)}),o.jsx("p",{className:"text-[11px] text-red-700/80 mt-1 font-mono break-all",children:i})]}),n&&o.jsxs("div",{className:"border border-ink/15 p-3",style:{background:"var(--paper)"},children:[o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mb-1.5 text-ink/60",children:"Diagnostic stage"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Reached server?"}),o.jsx("strong",{children:dt(n.reachedServer)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Stage"}),o.jsx("strong",{style:{fontFamily:"ui-monospace, monospace"},children:n.stage??"—"})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Admin check started?"}),o.jsx("strong",{children:dt(n.adminCheckStarted)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Admin check passed?"}),o.jsx("strong",{children:dt(n.adminCheckPassed)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Summary"}),o.jsx("strong",{children:n.summary??"—"})]}),n.error&&o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Error"}),o.jsx("strong",{children:n.error})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Token"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"CAL_API_KEY detected?"}),o.jsx("strong",{children:dt(n.token?.exists)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Token length"}),o.jsx("strong",{children:n.token?.length??"—"})]}),o.jsxs("div",{style:c,children:[o.jsxs("span",{children:["Starts with ",o.jsx("code",{children:"cal_"}),"?"]}),o.jsx("strong",{children:dt(n.token?.startsWithCalPrefix)})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Slots endpoint"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Can fetch slots?"}),o.jsx("strong",{children:Lx(n.slots?.attempted,n.slots?.ok)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"HTTP status"}),o.jsx("strong",{children:qx(n.slots?.attempted,n.slots?.httpStatus)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Available slots returned"}),o.jsx("strong",{children:n.slots?.returnedCount??"—"})]}),n.slots?.error&&o.jsxs("div",{style:{...c,color:"#b91c1c"},children:[o.jsx("span",{children:"Error"}),o.jsx("strong",{style:{textAlign:"right",maxWidth:380},children:n.slots.error})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Booking endpoint"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Can create a test booking?"}),o.jsx("strong",{children:Lx(n.booking?.attempted,n.booking?.ok)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Auth accepted by Cal.com?"}),o.jsx("strong",{children:n.booking?.attempted===!1?"not attempted":dt(n.booking?.authAccepted)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"HTTP status"}),o.jsx("strong",{children:qx(n.booking?.attempted,n.booking?.httpStatus)})]}),n.booking?.error&&o.jsxs("div",{style:{...c,color:"#b91c1c"},children:[o.jsx("span",{children:"Error"}),o.jsx("strong",{style:{textAlign:"right",maxWidth:380},children:n.booking.error})]}),o.jsx("p",{className:"text-[11px] text-ink/60 mt-3 leading-snug",children:"Booking test saadab makse aegunud ajatempliga, nii Cal.com teeb auth kontrolli aga ei loo päris broneeringut. Kui auth on OK, vastab Cal.com 400/422-ga ja Auth accepted: yes. Auth viga = 401/403."})]})]})}function m$(){const e=pe(aw),t=pe(iw),r=pe(sw),n=pe(ow),[a,i]=_.useState(null),[s,l]=_.useState(null),[c,u]=_.useState(null),f=async(d,p)=>{u(d),i(null),l(null),console.log("[admin] ping click",d);try{const m=await p();console.log("[admin] ping response",d,m),i({label:d,value:m})}catch(m){console.error("[admin] ping threw",d,m),l(JSON.stringify({label:d,name:m?.name,message:m?.message??String(m),status:m?.status,response:m?.response,stack:m?.stack?.split(`
65`).slice(0,5)},null,2))}finally{u(null)}};return o.jsxs(_e,{title:"Server ping",description:"Tõestab, et admin server-fn kutsumismuster töötab.",headerAction:o.jsxs("div",{className:"flex gap-1.5 flex-wrap",children:[o.jsx("button",{type:"button",onClick:()=>f("public",()=>e({data:void 0})),disabled:c!==null,className:"bg-ink/70 text-white text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50",children:c==="public"?"…":"Ping (public)"}),o.jsx("button",{type:"button",onClick:()=>f("noauth",()=>t({data:void 0})),disabled:c!==null,className:"bg-ink/70 text-white text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50",children:c==="noauth"?"…":"Ping (no auth)"}),o.jsx("button",{type:"button",onClick:()=>f("admin",()=>r({data:void 0})),disabled:c!==null,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50",children:c==="admin"?"…":"Ping (require admin)"}),o.jsx("button",{type:"button",onClick:()=>f("env",()=>n({data:void 0})),disabled:c!==null,className:"bg-ink text-white text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50",children:c==="env"?"…":"Inspect backend env"})]}),children:[o.jsxs("div",{className:"text-[11px] font-mono space-y-1",children:[o.jsxs("div",{children:["Loading: ",o.jsx("strong",{children:c??"—"})]}),o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:a?.value?.reachedServer===!0?"yes":"no"})]}),o.jsxs("div",{children:["Stage: ",o.jsx("strong",{children:a?.value?.stage??"—"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:a?.value?.adminCheckPassed===!0?"yes":a?.value?.adminCheckPassed===!1?"no":"—"})]}),o.jsxs("div",{children:["RequireAdmin env source: ",o.jsx("strong",{children:a?.value?.envSourceUsed??a?.value?.requireAdminEnvSource??a?.value?.resolved?.requireAdminEnvSource??"—"})]}),o.jsxs("div",{children:["Error: ",o.jsx("strong",{children:a?.value?.error??s??"—"})]}),o.jsxs("div",{children:["Timestamp: ",o.jsx("strong",{children:a?.value?.now??"—"})]})]}),o.jsxs("div",{className:"mt-3 text-[11px] bg-amber-50 border border-amber-300 text-amber-900 p-2",children:["Backend admin diagnostics use ",o.jsx("strong",{children:"SUPABASE_URL"})," plus ",o.jsx("strong",{children:"SUPABASE_SERVICE_ROLE_KEY"})," when available. ",o.jsx("strong",{children:"SUPABASE_PUBLISHABLE_KEY"})," is only a fallback."]}),Array.isArray(a?.value?.vars)&&o.jsxs("div",{className:"mt-2",children:[o.jsx("div",{className:"text-[11px] uppercase tracking-wider mb-1",children:"Backend env vars"}),o.jsxs("table",{className:"text-[11px] font-mono w-full border border-ink/15",children:[o.jsx("thead",{className:"bg-paper-deep",children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left p-1.5 border-b border-ink/15",children:"Name"}),o.jsx("th",{className:"text-left p-1.5 border-b border-ink/15",children:"Present"}),o.jsx("th",{className:"text-left p-1.5 border-b border-ink/15",children:"Length"}),o.jsx("th",{className:"text-left p-1.5 border-b border-ink/15",children:"Source"})]})}),o.jsx("tbody",{children:a.value.vars.map(d=>o.jsxs("tr",{children:[o.jsx("td",{className:"p-1.5 border-b border-ink/10",children:d.name}),o.jsx("td",{className:"p-1.5 border-b border-ink/10",children:o.jsx("strong",{className:d.present?"text-green-700":"text-red-700",children:d.present?"yes":"no"})}),o.jsx("td",{className:"p-1.5 border-b border-ink/10",children:d.length}),o.jsx("td",{className:"p-1.5 border-b border-ink/10",children:d.source??"—"})]},d.name))})]}),a.value.resolved&&o.jsxs("div",{className:"text-[11px] font-mono mt-2 space-y-0.5",children:[o.jsxs("div",{children:["Resolved SUPABASE_URL: ",o.jsx("strong",{children:a.value.resolved.supabaseUrl?.present?"yes":"no"})," (",a.value.resolved.supabaseUrl?.source??"—",")"]}),o.jsxs("div",{children:["Resolved publishable key: ",o.jsx("strong",{children:a.value.resolved.supabasePublishableKey?.present?"yes":"no"})," (",a.value.resolved.supabasePublishableKey?.source??"—",")"]}),o.jsxs("div",{children:["Service role key: ",o.jsx("strong",{children:a.value.resolved.serviceRoleKey?.present?"yes":"no"})," (",a.value.resolved.serviceRoleKey?.source??"—",")"]}),o.jsxs("div",{children:["RequireAdmin actually uses: ",o.jsx("strong",{children:a.value.resolved.requireAdminEnvSource??"—"}),a.value.resolved.requireAdminEnvSourceDetail?` (${a.value.resolved.requireAdminEnvSourceDetail})`:""]}),a.value.resolved.requireAdminEnvReason&&o.jsxs("div",{children:["Reason: ",a.value.resolved.requireAdminEnvReason]}),Array.isArray(a.value.resolved.requireAdminEnvSkipped)&&a.value.resolved.requireAdminEnvSkipped.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("div",{children:"Skipped env vars:"}),o.jsx("ul",{className:"ml-4 list-disc",children:a.value.resolved.requireAdminEnvSkipped.map(d=>o.jsxs("li",{children:[o.jsx("strong",{children:d.name})," (length ",d.length,"): ",d.reason]},d.name))})]})]})]}),a&&o.jsx("pre",{className:"mt-2 text-[10px] bg-paper-deep border border-ink/15 p-2 overflow-auto max-h-60",children:JSON.stringify(a,null,2)}),s&&o.jsx("pre",{className:"mt-2 text-[10px] bg-red-50 border border-red-300 text-red-800 p-2 overflow-auto max-h-60",children:s})]})}function g$(){const e=pe(pw),[t,r]=_.useState(!1),[n,a]=_.useState(null),[i,s]=_.useState(null),[l,c]=_.useState(null),[u,f]=_.useState(!1),d=async()=>{f(!0),r(!0),s(null),a(null),console.log("[admin] ErikLateAudit click fired");try{const p=await e({data:{}});console.log("[admin] ErikLateAudit server response",p),p==null?s("Server function returned no value (undefined). Likely admin auth rejected the call."):a(p)}catch(p){console.error("[admin] ErikLateAudit threw",p),s(p?.message??String(p)),c(JSON.stringify({name:p?.name,message:p?.message??String(p),status:p?.status,response:p?.response,stack:p?.stack?.split(`
66`).slice(0,6)},null,2))}finally{r(!1)}};return o.jsxs(_e,{title:"Erik hiline kalisteenika — kuupäevade audit",description:"Per-date Cal.com check kalisteenika-hiline slugile. Oodatav aeg loetakse serverist (site_settings.season_mode): 18:45 suvel, 19:00 sügisel.",headerAction:o.jsx("button",{type:"button",onClick:d,disabled:t,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:t?"Kontrollin…":"Run Erik late audit"}),children:[u&&o.jsxs("div",{className:"border border-ink/20 bg-paper-deep px-3 py-2 mb-2 text-[11px] font-mono space-y-0.5",children:[o.jsxs("div",{children:["Client click fired: ",o.jsx("strong",{children:u?"yes":"no"})]}),o.jsxs("div",{children:["Function called: ",o.jsx("strong",{children:"runErikLateAudit"})]}),o.jsxs("div",{children:["Loading: ",o.jsx("strong",{children:t?"yes":"no"})]}),o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:n?.reachedServer===!0?"yes":"no"})]}),o.jsxs("div",{children:["Server stage: ",o.jsx("strong",{children:n?.stage??"—"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:n?.adminCheckPassed===!0?"yes":n?.adminCheckPassed===!1?"no":"—"})]}),o.jsxs("div",{children:["Error: ",o.jsx("strong",{children:i??n?.error??"—"})]})]}),u&&(n||l)&&o.jsx("pre",{className:"text-[10px] bg-paper-deep border border-ink/15 p-2 overflow-auto max-h-72 mb-2",children:l?`[CAUGHT ERROR]
67${l}
67`:`[RAW SERVER VALUE]
68${JSON.stringify(n,null,2)}`}),i&&o.jsxs("div",{className:"border border-red-300 bg-red-50 px-3 py-2",children:[o.jsx("p",{className:"text-[12px] font-medium text-red-800",children:U1(i)}),o.jsx("p",{className:"text-[11px] text-red-700/80 mt-1 font-mono break-all",children:i})]}),n&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"border border-ink/15 p-3 text-[12px] bg-paper-deep grid grid-cols-2 md:grid-cols-4 gap-x-4 gap-y-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"text-ink/60",children:"Season (server)"}),o.jsx("br",{}),o.jsx("strong",{className:"uppercase tracking-wider",children:n.season})]}),o.jsxs("p",{children:[o.jsx("span",{className:"text-ink/60",children:"Expected time"}),o.jsx("br",{}),o.jsx("strong",{className:"font-mono",children:n.expectedHHMM})]}),o.jsxs("p",{children:[o.jsx("span",{className:"text-ink/60",children:"Cal.com slug"}),o.jsx("br",{}),o.jsx("strong",{className:"font-mono",children:n.eventTypeSlug})]}),o.jsxs("p",{children:[o.jsx("span",{className:"text-ink/60",children:"Timezone"}),o.jsx("br",{}),o.jsx("strong",{children:n.timeZone})]})]}),n.error&&o.jsx("p",{className:"text-[12px] text-red-700 border border-red-300 bg-red-50 px-2 py-1",children:n.error}),o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Date"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Day"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Expected"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Cal.com slots (Tallinn)"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"HTTP"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Status"})]})}),o.jsx("tbody",{children:(n.rows??[]).map((p,m)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:m%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 font-mono whitespace-nowrap",children:p.date}),o.jsx("td",{className:"px-2.5 py-1.5",children:p.weekday}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:p.expected}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:p.slotsTallinn?.length?p.slotsTallinn.join(", "):"—"}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:p.httpStatus}),o.jsxs("td",{className:"px-2.5 py-1.5",children:[o.jsx("span",{className:p.status==="ok"?"inline-block px-2 py-0.5 text-[10px] uppercase tracking-wider bg-emerald-700/10 text-emerald-800":p.status==="missing"?"inline-block px-2 py-0.5 text-[10px] uppercase tracking-wider bg-sienna/15 text-sienna":"inline-block px-2 py-0.5 text-[10px] uppercase tracking-wider bg-red-700/10 text-red-800",title:p.reason??void 0,children:p.status==="ok"?"OK":p.status==="missing"?"VIGA":"ERROR"}),p.reason&&o.jsx("p",{className:"text-[11px] text-ink/60 mt-0.5 leading-snug",children:p.reason})]})]},m))})]})})]})]})}function v$(){const e=pe(kw),[t,r]=_.useState(!1),[n,a]=_.useState(null),[i,s]=_.useState(null),l=async()=>{r(!0),s(null),a(null);try{const u=await e({data:void 0});a(u)}catch(u){s(u instanceof Error?u.message:String(u))}finally{r(!1)}}
68,c={display:"flex",justifyContent:"space-between",gap:12,padding:"6px 0",borderBottom:"1px solid var(--paper-deep, #eee)",fontSize:13};return o.jsxs(_e,{title:"Kontakt / Personaaltreening email diagnostika",description:"Testib kontaktivormi ja personaaltreeningu broneeringu env-muutujaid. Salasõnu ei kuvata.",headerAction:o.jsx("button",{type:"button",onClick:l,disabled:t,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:t?"Testin…":"Test email"}),children:[i&&o.jsxs("p",{className:"text-[13px]",style:{color:"#b91c1c"},children:["Server function call failed: ",i]}),n&&o.jsxs("div",{className:"border border-ink/15 p-3",style:{background:"var(--paper)"},children:[o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mb-1.5 text-ink/60",children:"Required env vars"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"RESEND_API_KEY detected?"}),o.jsx("strong",{children:dt(n.env?.RESEND_API_KEY?.exists)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"RESEND_API_KEY length"}),o.jsx("strong",{children:n.env?.RESEND_API_KEY?.length??0})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"SUPABASE_URL detected?"}),o.jsx("strong",{children:dt(n.env?.SUPABASE_URL?.exists)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"SUPABASE_SERVICE_ROLE_KEY detected?"}),o.jsx("strong",{children:dt(n.env?.SUPABASE_SERVICE_ROLE_KEY?.exists)})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Sender / recipient (hardcoded)"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"From"}),o.jsx("strong",{children:o.jsx("code",{children:n.from})})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"To"}),o.jsx("strong",{children:o.jsx("code",{children:n.to})})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Supabase insert"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"contact_submissions insert works?"}),o.jsx("strong",{children:dt(n.supabaseInsert?.ok)})]}),n.supabaseInsert?.error&&o.jsxs("div",{style:{...c,color:"#b91c1c"},children:[o.jsx("span",{children:"Error"}),o.jsx("strong",{style:{textAlign:"right",maxWidth:380},children:n.supabaseInsert.error})]}),o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mt-4 mb-1.5 text-ink/60",children:"Email send (Resend)"}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"Resend API key accepted?"}),o.jsx("strong",{children:dt(n.emailSend?.ok)})]}),o.jsxs("div",{style:c,children:[o.jsx("span",{children:"HTTP status"}),o.jsx("strong",{children:n.emailSend?.status??0})]}),n.emailSend?.error&&o.jsxs("div",{style:{...c,color:"#b91c1c"},children:[o.jsx("span",{children:"Error"}),o.jsx("strong",{style:{textAlign:"right",maxWidth:380},children:n.emailSend.error})]}),o.jsxs("p",{className:"text-[11px] text-ink/60 mt-3 leading-snug",children:["Test ei saada päris emaili — kontrollib ainult Resend API võtit (",o.jsx("code",{children:"GET /domains"}),"). Supabase insert lisab ja kustutab kohe diagnostika rea."]})]})]})}function vn(e){const t=e==null?"":String(e);return/[",\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function y$(){const[e,t]=_.useState([]),[r,n]=_.useState(null),[a,i]=_.useState(!1),[s,l]=_.useState(!1),[c,u]=_.useState(!1),[f,d]=_.useState(null),[p,m]=_.useState(null),[v,y]=_.useState(null),[h,w]=_.useState(Ye),[j,x]=_.useState(""),[k,g]=_.useState(""),[b,S]=_.useState(""),O=async()=>{i(!0),d(null);const{data:P,error:L,count:D}=await ie.from("newsletter_subscribers").select("id, email, created_at, source, locale",{count:"exact"}).order("created_at",{ascending:!1}).limit(500);L?d(L.message):(t(P??[]),n(D??null)),i(!1)},E=async()=>{const{data:P,error:L}=await ie.from("admin_export_log").select("exported_until, created_at").eq("export_type","newsletter_subscribers_new").order("created_at",{ascending:!1}).limit(1).maybeSingle();if(!L){m(P??null);let D=ie.from("newsletter_subscribers").select("id",{count:"exact",head:!0});P?.exported_until&&(D=D.gt("created_at",P.exported_until));const{count:R}=await D;y(R??0)}};_.useEffect(()=>{O(),E()},[]);async function T(P){let D=0;const R=[];for(;;){let F=ie.from("newsletter_subscribers").select("id, email, created_at, source, locale").order("created_at",{ascending:!1}).range(D,D+1e3-1);P&&(F=F.gt("created_at",P));const{data:V,error:Z}=await F;
68if(Z)return d(Z.message),null;const W=V??[];if(R.push(...W),W.length<1e3)break;D+=1e3}return R}function N(P){const D=[["Email","Loodud","Allikas","Keel"].map(vn).join(",")];for(const R of P)D.push([vn(R.email),vn(Ce(R.created_at)),vn(R.source),vn(R.locale)].join(","));return"\uFEFF"+D.join(`\r
69`)+`\r
70`}function A(P,L){const D=new Blob([P],{type:"text/csv;charset=utf-8;"}),R=URL.createObjectURL(D),F=document.createElement("a");F.href=R,F.download=L,document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(R)}const C=async()=>{l(!0),d(null);const P=await T();if(!P){l(!1);return}A(N(P),`newsletter-subscribers-all-${new Date().toISOString().slice(0,10)}.csv`),l(!1)},I=async()=>{u(!0),d(null);const P=p?.exported_until??null,L=await T(P);if(!L){u(!1);return}if(A(N(L),`newsletter-subscribers-new-${new Date().toISOString().slice(0,10)}.csv`),L.length>0){const{error:D}=await ie.from("admin_export_log").insert({export_type:"newsletter_subscribers_new",exported_until:L[0].created_at,row_count:L.length});D?d(D.message):await E()}u(!1)};return o.jsx(_e,{title:"Newsletter subscribers",description:"Jaluse kaudu kogutud emailid. Näidatud on viimased 50; CSV sisaldab kõik.",headerAction:o.jsxs("div",{className:"flex flex-col gap-2 items-stretch md:items-end",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:flex-wrap items-stretch md:items-center gap-2 md:justify-end",children:[o.jsx("button",{onClick:C,disabled:s||(r??0)===0,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:s?"Ekspordin…":"Lae alla kõik liitujad"}),o.jsx("button",{onClick:I,disabled:c,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50 w-full md:w-auto",children:c?"Ekspordin…":"Lae alla uued pärast viimast eksporti"}),o.jsx("button",{onClick:O,disabled:a,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:a?"Laen…":"Värskenda"})]}),o.jsxs("div",{className:"text-[10px] text-ink/55 text-left md:text-right leading-snug",children:[p?.created_at?o.jsxs(o.Fragment,{children:["Viimane uute liitujate eksport: ",Ce(p.created_at)]}):o.jsx(o.Fragment,{children:"Uute liitujate eksporti pole veel tehtud."}),v!=null&&o.jsxs(o.Fragment,{children:[" · Uusi pärast viimast eksporti: ",v]})]})]}),children:o.jsx(x$,{rows:e,total:r,loading:a,error:f,visibleCount:h,setVisibleCount:w,query:j,setQuery:x,dateFrom:k,setDateFrom:g,dateTo:b,setDateTo:S})})}function x$({rows:e,total:t,loading:r,error:n,visibleCount:a,setVisibleCount:i,query:s,setQuery:l,dateFrom:c,setDateFrom:u,dateTo:f,setDateTo:d}){const p=_.useMemo(()=>{const v=s.trim().toLowerCase();return e.filter(y=>{if(v&&!y.email.toLowerCase().includes(v))return!1;const h=y.created_at.slice(0,10);return!(c&&h<c||f&&h>f)})},[e,s,c,f]),m=p.slice(0,a);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:t??0}),o.jsx(ke,{label:"Filtreeritud",value:p.length})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60 min-w-[180px]",children:["Email",o.jsx("input",{type:"text",value:s,onChange:v=>l(v.target.value),placeholder:"otsi…",className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Alates",o.jsx("input",{type:"date",value:c,onChange:v=>u(v.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Kuni",o.jsx("input",{type:"date",value:f,onChange:v=>d(v.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),(s||c||f)&&o.jsx("button",{type:"button",onClick:()=>{l(""),u(""),d("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"})]}),n&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:n}),m.length===0&&!r?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Tellijaid pole."}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"hidden md:block border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[13px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Email"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Loodud"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Allikas"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Keel"})]})}),o.jsx("tbody",{children:m.map((v,y)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:y%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 font-mono break-all",children:v.email}),o.jsx("td",{className:"px-2.5 py-1.5 whitespace-nowrap",children:Ce(v.created_at)}),o.jsx("td",{className:"px-2.5 py-1.5",children:v.source??"—"}),o.jsx("td",{className:"px-2.5 py-1.5 uppercase",children:v.locale??"—"})]},v.id))})]})}),o.jsx("ul",{className:"md:hidden border border-ink/15 divide-y divide-ink/10",children:m.map((v,y)=>o.jsxs("li",{style:{backgroundColor:y%2===0?"var(--paper)":"var(--paper-deep)"},className:"px-2.5 py-2 text-[12px] space-y-0.5",children:[o.jsx(Le,{label:"Email",value:o.jsx("span",{className:"font-mono break-all",children:v.email})}),o.jsx(Le,{label:"Loodud",value:Ce(v.created_at)}),o.jsx(Le,{label:"Allikas",value:v.source??"—"}),o.jsx(Le,{label:"Keel",value:o.jsx("span",{className:"uppercase",children:v.locale??"—"})})]},v.id))})]}),o.jsx("div",{className:"flex items-center justify-center pt-1",children:p.length>a?o.jsxs("button",{type:"button",onClick:()=>i(v=>v+Ye),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-3 py-1.5 hover:bg-ink hover:text-paper transition-colors",children:["Näita veel ",Ye]}):p.length>Ye&&o.jsx("p",{className:"text-[11px] text-ink/55 italic",children:"Kõik kirjed on kuvatud."})})]})}function fe(e){const t=e==null?"":String(e);return/[";\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}
70const b$=["P","E","T","K","N","R","L"],w$=["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dets"];function $a(e){if(!e)return"—";const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const r=Number(t[1]),n=Number(t[2]),a=Number(t[3]),i=new Date(Date.UTC(r,n-1,a,12,0,0)),s=b$[i.getUTCDay()],l=w$[n-1],c=String(a).padStart(2,"0"),u=String(r).slice(-2);return`${s} ${c}. ${l}.${u}`}function Ce(e){const t=new Date(e),r=new Intl.DateTimeFormat("et-EE",{timeZone:"Europe/Tallinn",day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),n=a=>r.find(i=>i.type===a)?.value??"";return`${n("day")}.${n("month")}.${n("year")} ${n("hour")}:${n("minute")}`}const Fd=[{id:"kadi-kalisteenika",label:"Kadi kalisteenika",match:e=>e.class_name==="Kalisteenika"&&e.trainer_name==="Kadi",days:[2,4],trainerNames:["Kadi"]},{id:"eriku-kalisteenika",label:"Eriku kalisteenika",match:e=>e.class_name==="Kalisteenika"&&e.trainer_name==="Erik",days:[1,3],trainerNames:["Erik"]},{id:"algajate-kalisteenika",label:"Algajate kalisteenika",match:e=>e.class_name==="Algajate kalisteenika",days:[1,3],trainerNames:["Erik"]},{id:"laste-kalisteenika",label:"Laste kalisteenika",match:e=>e.class_name==="Laste kalisteenika",days:[2,4],trainerNames:["Erik"]},{id:"katelseis",label:"Kätelseis",match:e=>e.class_name==="Kätelseis",days:[0],trainerNames:["Villem"]},{id:"total-body-performance",label:"Total Body Performance",match:e=>e.class_name==="Total Body Performance",days:[6],trainerNames:["Alex"]},{id:"eriku-ruhmad",label:"Eriku rühmad",match:e=>e.class_name==="Algajate kalisteenika"||e.class_name==="Kalisteenika"&&e.trainer_name==="Erik",days:[1,3],trainerNames:["Erik"]}];function j$(e,t){if(!t)return!0;if(t.startsWith("raw:"))return e.class_name===t.slice(4);const r=Fd.find(n=>n.id===t);return r?r.match(e):!0}function Ai(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function k$(e){if(!e||e.length===0)return[];const t=new Date;t.setHours(0,0,0,0);const r=Ai(t),n=c=>e.includes(c.getDay()),a=[],i=new Date(t);for(i.setDate(i.getDate()-1);a.length<4;)n(i)&&a.push(new Date(i)),i.setDate(i.getDate()-1);a.reverse();const s=[],l=new Date(t);for(;s.length<4;)n(l)&&s.push(new Date(l)),l.setDate(l.getDate()+1);return[...a,...s].map(c=>{const u=Ai(c),f=$a(u)+(u===r?" (täna)":"");return{value:u,label:f}})}const Ye=20,_$=["new","contacted","confirmed","cancelled"];function Bx(e){return e==="free_trial"?"Proovimine":e==="monthly_pass"?"Kuupääse":e}function Fx(e){return Array.isArray(e)?e.map(t=>String(t)).join(", "):typeof e=="string"?e:""}function S$(){const[e,t]=_.useState([]),[r,n]=_.useState(null),[a,i]=_.useState(!1),[s,l]=_.useState(null),[c,u]=_.useState(""),[f,d]=_.useState(""),[p,m]=_.useState(""),[v,y]=_.useState(!1),[h,w]=_.useState(!1),[j,x]=_.useState(!1),[k,g]=_.useState(null),b=async()=>{i(!0),l(null);const{data:P,error:L,count:D}=await ie.from("studio_bookings").select("*",{count:"exact"}).order("created_at",{ascending:!1}).limit(500);L?l(L.message):(t(P??[]),n(D??null)),i(!1)},S=async()=>{const{data:P}=await ie.from("admin_export_log").select("exported_until, created_at").eq("export_type","studio_bookings_new").order("created_at",{ascending:!1}).limit(1).maybeSingle();g(P??null)};_.useEffect(()=>{b(),S()},[]);const O=_.useMemo(()=>{const P=c.trim().toLowerCase();return e.filter(L=>{if(!v&&L.removed||P&&!`${L.email} ${L.name} ${L.phone}`.toLowerCase().includes(P))return!1;const D=L.created_at.slice(0,10);return!(f&&D<f||p&&D>p)})},[e,c,f,p,v]);function E(P){const D=[["Email","Nimi","Telefon","Päev","Kuupäev","Kellaaeg","Valik","Kommentaar","Loodud","Staatus"].map(fe).join(";")];for(const R of P)D.push([fe(R.email),fe(R.name),fe(R.phone),fe(R.weekday),fe(Fx(R.selected_dates)),fe(`${R.start_time} - ${R.end_time}`),fe(Bx(R.membership_choice)),fe(R.comment),fe(Ce(R.created_at)),fe(R.status)].join(";"));return"\uFEFF"+D.join(`\r
71`)+`\r
72`}function T(P,L){const D=new Blob([P],{type:"text/csv;charset=utf-8;"}),R=URL.createObjectURL(D),F=document.createElement("a");F.href=R,F.download=L,document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(R)}async function N(P){let L=ie.from("studio_bookings").select("*").order("created_at",{ascending:!1}).limit(2e3);P&&(L=L.gt("created_at",P));const{data:D,error:R}=await L;return R?(l(R.message),null):D??[]}const A=async()=>{w(!0);const P=await N();P&&T(E(P),`studio-bookings-all-${new Date().toISOString().slice(0,10)}.csv`),w(!1)},C=async()=>{x(!0);const P=await N(k?.exported_until??void 0);P&&(T(E(P),`studio-bookings-new-${new Date().toISOString().slice(0,10)}.csv`),P.length>0&&(await ie.from("admin_export_log").insert({export_type:"studio_bookings_new",exported_until:P[0].created_at,row_count:P.length}),await S())),x(!1)},I=async(P,L)=>{t(R=>R.map(F=>F.id===P?{...F,...L}:F));const{error:D}=await ie.from("studio_bookings").update(L).eq("id",P);D&&(l(D.message),b())};
72return o.jsxs(_e,{title:"Vaba saali broneeringu taotlused",description:"Stuudio iseseisva kasutuse päringud broneerimismodaali kaudu.",headerAction:o.jsxs("div",{className:"flex flex-col gap-2 items-stretch md:items-end",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:flex-wrap items-stretch md:items-center gap-2 md:justify-end",children:[o.jsx("button",{onClick:A,disabled:h,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:h?"Ekspordin…":"Lae alla kõik"}),o.jsx("button",{onClick:C,disabled:j,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50 w-full md:w-auto",children:j?"Ekspordin…":"Lae alla uued pärast viimast eksporti"}),o.jsx("button",{onClick:b,disabled:a,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:a?"Laen…":"Värskenda"})]}),o.jsx("div",{className:"text-[10px] text-ink/55 text-left md:text-right leading-snug",children:k?.created_at?o.jsxs(o.Fragment,{children:["Viimane eksport: ",Ce(k.created_at)]}):o.jsx(o.Fragment,{children:"Eksporti pole veel tehtud."})})]}),children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:r??0}),o.jsx(ke,{label:"Filtreeritud",value:O.length})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Email / nimi / telefon",o.jsx("input",{type:"text",value:c,onChange:P=>u(P.target.value),placeholder:"otsi…",className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Alates",o.jsx("input",{type:"date",value:f,onChange:P=>d(P.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Kuni",o.jsx("input",{type:"date",value:p,onChange:P=>m(P.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),(c||f||p)&&o.jsx("button",{type:"button",onClick:()=>{u(""),d(""),m("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"}),o.jsx("button",{type:"button",onClick:()=>y(P=>!P),className:`md:ml-auto border text-[11px] uppercase tracking-wider px-2.5 py-1 transition-colors ${v?"border-red-700/40 text-red-800 hover:bg-red-700/10":"border-ink/30 hover:bg-ink hover:text-paper"}`,children:v?"Peida eemaldatud":"Näita eemaldatuid"})]}),s&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:s}),O.length===0&&!a?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Taotlusi pole."}):o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px] min-w-[1100px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsx("tr",{children:["Email","Nimi","Telefon","Päev","Kuupäev","Kellaaeg","Valik","Kommentaar","Loodud","Staatus","Tegevused"].map(P=>o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:P},P))})}),o.jsx("tbody",{children:O.map((P,L)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:L%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2 py-1.5 font-mono",children:P.email}),o.jsx("td",{className:"px-2 py-1.5",children:P.name}),o.jsx("td",{className:"px-2 py-1.5 font-mono",children:P.phone}),o.jsx("td",{className:"px-2 py-1.5 whitespace-nowrap",children:P.weekday}),o.jsx("td",{className:"px-2 py-1.5",children:Fx(P.selected_dates)||o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsxs("td",{className:"px-2 py-1.5 font-mono whitespace-nowrap",children:[P.start_time,"–",P.end_time]}),o.jsx("td",{className:"px-2 py-1.5 whitespace-nowrap",children:Bx(P.membership_choice)}),o.jsx("td",{className:"px-2 py-1.5",children:P.comment?.trim()?P.comment:o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 whitespace-nowrap",children:Ce(P.created_at)}),o.jsx("td",{className:"px-2 py-1.5",children:o.jsx("select",{value:P.status,onChange:D=>I(P.id,{status:D.target.value}),className:"border border-ink/30 bg-paper px-1.5 py-0.5 text-[12px] text-ink",children:_$.map(D=>o.jsx("option",{value:D,children:D},D))})}),o.jsx("td",{className:"px-2 py-1.5",children:P.removed?o.jsx("button",{type:"button",onClick:()=>I(P.id,{removed:!1}),className:"text-[11px] uppercase tracking-wider text-ink/60 hover:text-ink",children:"Taasta"}):o.jsx("button",{type:"button",onClick:()=>I(P.id,{removed:!0}),className:"text-[11px] uppercase tracking-wider text-red-800 hover:underline",children:"Eemalda"})})]},P.id))})]})})]})}function O$(){const e=pe(ZR),t=pe(JR),r=pe(QR),n=pe(e$),[a,i]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState(null),[f,d]=_.useState(null),[p,m]=_.useState(""),[v,y]=_.useState(""),[h,w]=_.useState(""),[j,x]=_.useState(!1),[k,g]=_.useState(null),b=async()=>
72{l(!0),u(null);try{const T=await e();T?.ok?i(T.accounts??[]):u(T?.error??"Laadimine ebaõnnestus")}catch(T){u(T instanceof Error?T.message:String(T))}l(!1)};_.useEffect(()=>{b()},[]);const S=async T=>{T.preventDefault(),g(null),x(!0);try{const N=await t({data:{email:p.trim(),password:v,trainerName:h.trim()}});N?.ok?(m(""),y(""),w(""),g(`Konto loodud: ${p}`),await b()):g(`Ebaõnnestus: ${N?.error??"tundmatu viga"}`)}catch(N){g(`Ebaõnnestus: ${N instanceof Error?N.message:String(N)}`)}finally{x(!1)}},O=async T=>{const N=T.blocked?"taasta ligipääs":"blokeeri sisselogimine";if(!(typeof window<"u"&&!window.confirm(`Kas ${N} kasutajale ${T.email}?`))){d(T.userId);try{const A=await r({data:{userId:T.userId,blocked:!T.blocked}});A?.ok?await b():u(A?.error??"Ebaõnnestus")}catch(A){u(A instanceof Error?A.message:String(A))}finally{d(null)}}},E=async T=>{if(!(typeof window<"u"&&!window.confirm(`Kustuta konto ${T.email} jäädavalt? Seda ei saa tagasi võtta.`))){d(T.userId);try{const N=await n({data:{userId:T.userId}});N?.ok?await b():u(N?.error??"Ebaõnnestus")}catch(N){u(N instanceof Error?N.message:String(N))}finally{d(null)}}};return o.jsxs(_e,{title:"Admin users",description:"Admini ja treenerite kontod. Treeneri konto näeb ainult enda trenne broneerijate menüüs.",headerAction:o.jsx("button",{type:"button",onClick:b,disabled:s,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50",children:s?"Laen…":"Värskenda"}),children:[c&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:c}),o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Email"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Roll"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Treener"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Viimati sees"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Staatus"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tegevused"})]})}),o.jsxs("tbody",{children:[a.length===0&&!s&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"px-2 py-3 text-ink/60 italic",children:"Kontosid pole."})}),a.map(T=>o.jsxs("tr",{className:"border-t border-ink/10",children:[o.jsx("td",{className:"px-2 py-1.5",children:T.email}),o.jsx("td",{className:"px-2 py-1.5 uppercase text-[10px] tracking-wider",children:T.role}),o.jsx("td",{className:"px-2 py-1.5",children:T.trainerName??"—"}),o.jsx("td",{className:"px-2 py-1.5",children:T.lastSignInAt?Ce(T.lastSignInAt):"—"}),o.jsx("td",{className:"px-2 py-1.5",children:T.blocked?o.jsx("span",{className:"text-red-800",children:"Blokeeritud"}):o.jsx("span",{className:"text-emerald-800",children:"Aktiivne"})}),o.jsx("td",{className:"px-2 py-1.5",children:o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx("button",{type:"button",onClick:()=>O(T),disabled:f===T.userId,className:"border border-ink/30 text-[10px] uppercase tracking-wider px-1.5 py-0.5 disabled:opacity-50",children:T.blocked?"Taasta":"Blokeeri"}),o.jsx("button",{type:"button",onClick:()=>E(T),disabled:f===T.userId,className:"border border-red-800/30 text-red-800 text-[10px] uppercase tracking-wider px-1.5 py-0.5 disabled:opacity-50",children:"Kustuta"})]})})]},T.userId))]})]})}),o.jsxs("div",{className:"border-t border-ink/10 pt-3",children:[o.jsx("p",{className:"text-[11px] uppercase tracking-wider text-ink/60 mb-2",children:"Lisa uus treeneri konto"}),o.jsxs("form",{onSubmit:S,className:"grid grid-cols-1 md:grid-cols-4 gap-2 items-end max-w-3xl",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Email",o.jsx("input",{type:"email",value:p,onChange:T=>m(T.target.value),required:!0,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Algne parool",o.jsx("input",{type:"text",value:v,onCh
72ange:T=>y(T.target.value),required:!0,minLength:8,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Treeneri nimi (nt Kadi)",o.jsx("input",{type:"text",value:h,onChange:T=>w(T.target.value),required:!0,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsx("button",{type:"submit",disabled:j,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:j?"Loon…":"Loo konto"})]}),o.jsx("p",{className:"text-[11px] text-ink/50 mt-1",children:"Treeneri nimi peab täpselt kattuma broneeringute treeneri väljaga (nt „Kadi“ või „Villem“), muidu ei leia tema konto ühtegi broneeringut."}),k&&o.jsx("p",{className:"text-[12px] mt-2",children:k})]})]})}const A$={Esmaspäev:"E",Teisipäev:"T",Kolmapäev:"K",Neljapäev:"N",Reede:"R",Laupäev:"L",Pühapäev:"P"},xu=yw.filter(e=>e.bookingTypeKey).map(e=>{const t=or[e.bookingTypeKey];return{id:`${e.bookingTypeKey}|${e.day}|${e.time}`,label:`${e.category} (${e.trainer}) · ${A$[e.day]??e.day} ${e.time}`,eventTypeSlug:t.eventTypeSlug,className:e.category,trainerName:e.trainer,dayIdx:B1[e.day],time:e.time,ownClass:e.trainer==="Erik"}});function N$(e){const t=new Date;if(t.setHours(0,0,0,0),e==null)return Ai(t);for(;t.getDay()!==e;)t.setDate(t.getDate()+1);return Ai(t)}function E$({onAdded:e}){const t=pe(Aw),[r,n]=_.useState(!1),[a,i]=_.useState(""),[s,l]=_.useState(""),[c,u]=_.useState(""),[f,d]=_.useState(""),[p,m]=_.useState(""),[v,y]=_.useState(""),[h,w]=_.useState(!1),[j,x]=_.useState(!1),[k,g]=_.useState(null),b=xu.find(A=>A.id===a),S=A=>{i(A);const C=xu.find(I=>I.id===A);C&&(l(N$(C.dayIdx)),u(C.time))},O=()=>{d(""),m(""),y(""),w(!1)},E=async A=>{if(A.preventDefault(),!(!b||j)){x(!0),g(null);try{const C=await t({data:{name:f,email:p,phone:v||void 0,eventTypeSlug:b.eventTypeSlug,className:b.className,trainerName:b.trainerName,date:s,time:c,newsletterOptIn:h}});if(!C?.ok){g({ok:!1,text:C?.error??"Lisamine ebaõnnestus"});return}e(C.row);const I="broneeritud Cal.com-is, klient saab Cal.com kinnituskirja",P=C.newsletter==="subscribed"?", lisatud uudiskirja":C.newsletter==="failed"?", uudiskirja lisamine ebaõnnestus":"";g({ok:!0,text:`${p} lisatud — ${I}${P}.`}),O()}catch(C){g({ok:!1,text:C instanceof Error?C.message:String(C)})}finally{x(!1)}}},T="mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",N="flex flex-col text-[10px] uppercase tracking-wider text-ink/60";return o.jsxs("div",{className:"border border-ink/15 bg-paper-deep",children:[o.jsxs("button",{type:"button",onClick:()=>n(A=>!A),className:"w-full text-left px-2.5 py-1.5 text-[11px] uppercase tracking-wider hover:bg-ink/5","aria-expanded":r,children:[r?"▾":"▸"," Lisa osaleja käsitsi"]}),r&&o.jsxs("form",{onSubmit:E,className:"px-2.5 pb-2.5 pt-1 space-y-2",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[o.jsxs("label",{className:`${N} md:col-span-3`,children:["Trenn",o.jsxs("select",{required:!0,value:a,onChange:A=>S(A.target.value),className:T,children:[o.jsx("option",{value:"",children:"Vali trenn…"}),xu.map(A=>o.jsx("option",{value:A.id,children:A.label},A.id))]})]}),o.jsxs("label",{className:N,children:["Kuupäev",o.jsx("input",{required:!0,type:"date",value:s,onChange:A=>l(A.target.value),className:T})]}),o.jsxs("label",{className:N,children:["Kellaaeg",o.jsx("input",{required:!0,type:"time",value:c,onChange:A=>u(A.target.value),className:T})]}),o.jsxs("label",{className:N,children:["Nimi",o.jsx("input",{required:!0,type:"text",value:f,onChange:A=>d(A.target.value),className:T})]}),o.jsxs("label",{className:N,children:["Email",o.jsx("input",{required:!0,type:"email",value:p,onChange:A=>m(A.target.value),className:T})]}),o.jsxs("label",{className:N,children:["Telefon",o.jsx("input",{type:"tel",value:v,onChange:A=>y(A.target.value),className:T})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-ink",children:[o.jsx("input",{type:"checkbox",checked:h,onChange:A=>w(A.target.checked)}),"Lisa uudiskirja"]}),b&&o.jsx("p",{className:"text-[11px] text-ink/60",children:b.ownClass?"Broneeritakse Cal.com-is, klient saab tavalise kinnituskirja. Sulle teavitust ei saadeta.":`Broneeritakse Cal.com-is, klient saab tavalise kinnituskirja ja treener (${b.trainerName}) saab teavituse.`}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"submit",disabled:j||!b,className:"bg-ink text-paper text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:j?"Lisan…":"Lisa osaleja"}),k&&o.jsx("span",{className:`text-[12px] ${k.ok?"text-ink":"text-red-800"}`,children:k.text})]})]})]})}function bu(e){return!!(e.referral_sources&&e.referral_sources.length>0||e.gender||e.age_group)}function Ud({row:e,onSaved:t}){const r=pe(Wx),[n,a]=_.useState(!1),[i,s]=_.useState(null),l=async c=>{a(!0),s(null);try{const u=await r({data:{registrationId:e.id,attended:c}});u?.ok?t(u.row):s(u?.error??"Salvestamine ebaõnnestus")}catch(u){s(u instanceof Error?u.message:String(u))}finally{a(!1)}};return o.jsxs("label",{className:"inline-flex flex-wrap items-center gap-1 text-[11px] cursor-pointer",title:i??"Inimene tuli kohale",children:[o.jsx("input",{type:"checkbox",checked:!!e.attended,disabled:n,onChange:c=>l(c.target.checked),className:"accent-[var(--sienna)]"}),o.jsx("span",{className:i?"text-red-800":"",children:n?"…":"Käis"}),e.attended&&e.attended_at&&!n&&o.jsx("span",{className:"text-ink/50 text-[10px]",title:"Millal märgiti",children:Ce(e.attended_at)}),i&&o.jsx("span",{className:"block text-red-800 text-[10px] leading-tight max-w-[220px] whitespace-normal",children:i})]})}function Ux({row:e,onSaved:t,onClose:r}){const n=pe(Wx),[a,i]=_.useState(Hd(e.referral_sources)),[s,l]=_.useState(e.referral_other??""),[c,u]=_.useState(e.gender??null),[f,d]=_.useState(e.age_group??null),[p,m]=_.useState(""),[v,y]=_.useState(!1),[h,w]=_.useState(null);_.useEffect(()=>{let g=!1;return(async()=>{const b=await ie.from("new_customers").select("lisainfo").eq("registration_id",e.id).limit(1).maybeSingle();let S=b.data;!S&&!b.error&&(S=(await ie.from("new_customers").select("lisainfo").eq("email",e.email.trim().toLowerCase()).order("first_visit_date",{ascending:!0}).limit(1).maybeSingle()).data),!g&&S?.lisainfo&&m(S.lisainfo)})(),()=>{g=!0}},[e.id,e.email]);const j=g=>i(b=>b.includes(g)?b.filter(S=>S!==g):[...b,g]),x=async()=>{y(!0),w(null);try{const g=await n({data:{registrationId:e.id,referralSources:a,referralOther:s,gender:c,ageGroup:f,lisainfo:p}});g?.ok&&g.listError?(t(g.row),w({ok:!1,text:`Salvestatud, aga klientide nimekirja ei läinud: ${g.listError}`})):g?.ok?(t(g.row),r()):w({ok:!1,text:g?.error??"Salvestamine ebaõnnestus"})}catch(g){w({ok:!1,text:g instanceof Error?g.message:String(g)})}finally{y(!1)}},k=g=>`border px-2 py-1 text-[11px] transition-colors ${g?"bg-ink text-paper border-ink":"border-ink/30 hover:bg-ink/5"}`;return o.jsxs("div",{className:"bg-paper border border-ink/15 p-2.5 space-y-3 text-[12px]",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx(Ud,{row:e,onSaved:t}),o.jsx("span",{className:"text-ink/55 text-[11px] truncate",children:e.name??e.email})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:"Referral (võib valida mitu)"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ni.map(g=>o.jsx("button",{type:"button",onClick:()=>j(g),className:k(a.includes(g)),children:g},g))}),a.includes(Kd)&&o.jsx("input",{type:"text",value:s,onChange:g=>l(g.target.value),placeholder:"Kirjuta, kust kuulis",maxLength:500,className:"mt-1.5 w-full md:w-96 border border-ink/30 bg-paper px-2 py-1 text-[12px]"})]}),o.jsxs("div",{className:"flex flex-wrap gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:"Sugu"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Wd.map(g=>o.jsx("button",{type:"button",onClick:()=>u(c===g?null:g),className:k(c===g),children:g},g))})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:"Vanus"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Gd.map(g=>o.jsx("button",{type:"button",onClick:()=>d(f===g?null:g),className:k(f===g),children:g},g))})]})]}),o.jsxs("label",{className:"block",children:[o.jsx("span",{className:"block text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:"Lisainfo"}),o.jsx("textarea",{value:p,onChange:g=>m(g.target.value),rows:2,maxLength:2e3,placeholder:"Nt kes kutsus, kus enne trenni tegi",className:"w-full md:w-[32rem] border border-ink/30 bg-paper px-2 py-1 text-[12px]"})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h&&o.jsx("span",{className:`text-[11px] ${h.ok?"text-ink/70":"text-red-800"}`,children:h.text}),o.jsx("button",{type:"button",onClick:r,className:"border border-ink/30 text-[10px] uppercase tracking-wider px-2 py-1",children:"Sulge"}),o.jsx("button",{type:"button",onClick:x,disabled:v,className:"bg-sienna text-white text-[10px] uppercase tracking-wider px-3 py-1 disabled:opacity-50",children:v?"Salvestan…":"Salvesta"})]})]})}const Ma=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],Ia=8;function wu({title:e,data:t,base:r,unmarked:n}){const a=t.filter(l=>l.value>0).sort((l,c)=>c.value-l.value),i=a.length>Ia?[...a.slice(0,Ia-1),{name:"Muud",value:a.slice(Ia-1).reduce((l,c)=>l+c.value,0)}]:a,s=l=>r>0?`${Math.round(l/r*100)}%`:"—";return o.jsxs("div",{className:"border border-ink/15 p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[o.jsx("p",{className:"text-[12px] font-medium",children:e}),o.jsxs("p",{className:"text-[10px] text-ink/55",children:[r," inimest",n>0?` · ${n} märkimata`:""]})]}),i.length===0?o.jsx("p",{className:"text-[12px] text-ink/55 italic py-6 text-center",children:"Andmeid pole veel märgitud."}):o.jsx("div",{className:"h-[180px]",children:o.jsx(mO,{width:"100%",height:"100%",children:o.jsxs(KR,{children:[o.jsx(Wt,{data:i,dataKey:"value",nameKey:"name",innerRadius:"55%",outerRadius:"90%",stroke:"var(--paper)",strokeWidth:2,isAnimationActive:!1,children:i.map((l,c)=>o.jsx(gf,{fill:Ma[c%Ma.length]},l.name))}),o.jsx(kt,{formatter:(l,c)=>[`${l} (${s(l)})`,c],contentStyle:{fontSize:12,border:"1px solid rgba(0,0,0,0.15)",borderRadius:0}})]})})}),a.length>0&&o.jsx("ul",{className:"text-[11px] space-y-0.5",children:a.map(l
72=>{const c=i.findIndex(f=>f.name===l.name),u=c>=0?Ma[c]:Ma[Ia-1];return o.jsxs("li",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block w-2.5 h-2.5 shrink-0",style:{backgroundColor:u}}),o.jsx("span",{className:"flex-1 min-w-0 truncate",children:l.name}),o.jsx("span",{className:"font-mono",children:l.value}),o.jsx("span",{className:"text-ink/55 w-9 text-right",children:s(l.value)})]},l.name)})})]})}function T$(){const[e,t]=_.useState([]),[r,n]=_.useState([]),[a,i]=_.useState(!1),[s,l]=_.useState(null),[c,u]=_.useState(""),[f,d]=_.useState(""),p=async()=>{i(!0),l(null);const v=1e3,y=[];for(let w=0;;w+=v){const{data:j,error:x}=await ie.from("booking_registrations").select("*").order("created_at",{ascending:!1}).range(w,w+v-1);if(x){l(x.message),i(!1);return}const k=j??[];if(y.push(...k),k.length<v)break}t(y.filter(w=>Su(w)&&w.status!=="cancelled"));const h=await P$();h.error&&l(h.error),n(h.rows),i(!1)};_.useEffect(()=>{p()},[]);const m=_.useMemo(()=>{const v=e.filter(x=>!(c&&(x.booking_date??"")<c||f&&(x.booking_date??"")>f)),y=v.filter(x=>x.attended),h=new Map;for(const x of r)c&&x.first_visit_date<c||f&&x.first_visit_date>f||h.set(x.id,{referrals:x.referral_sources?.length?x.referral_sources:null,gender:x.gender,age:x.age_group});const w=(x,k)=>{const g=new Map(x.map(S=>[S,0]));let b=0;for(const S of h.values()){const O=k(S);if(!(!O||O.length===0)){b++;for(const E of O)g.set(E,(g.get(E)??0)+1)}}return{data:Array.from(g,([S,O])=>({name:S,value:O})),marked:b}};let j=c;if(!j)for(const x of r)(!j||x.first_visit_date<j)&&(j=x.first_visit_date);return{since:j,visits:y.length,visitors:h.size,bookings:v.length,referral:w(Ni,x=>x.referrals),gender:w(Wd,x=>x.gender?[x.gender]:null),age:w(Gd,x=>x.age?[x.age]:null)}},[e,r,c,f]);return o.jsxs(_e,{title:"Uute klientide statistika",description:"Eriku trennide uued kliendid: statistika ja nimekiri. Kui sisestad broneeringu juures kliendi andmed, lisandub ta siia. „6 kuud“ ja „1a“ avanevad, kui esimesest korrast on nii palju aega möödas.",headerAction:o.jsx("button",{onClick:p,disabled:a,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:a?"Laen…":"Värskenda"}),children:[o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Alates",o.jsx("input",{type:"date",value:c,onChange:v=>u(v.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Kuni",o.jsx("input",{type:"date",value:f,onChange:v=>d(v.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),(c||f)&&o.jsx("button",{type:"button",onClick:()=>{u(""),d("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühjenda"})]}),s&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:s}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:m.since?`Uusi kliente alates ${m.since.split("-").reverse().join(".")}`:"Uusi kliente",value:m.visitors,accent:!0}),o.jsx(ke,{label:"Külastusi kokku",value:m.visits}),o.jsx(ke,{label:"Broneeringuid",value:m.bookings})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[o.jsx(wu,{title:"Referral",data:m.referral.data,base:m.referral.marked,unmarked:m.visitors-m.referral.marked}),o.jsx(wu,{title:"Sugu",data:m.gender.data,base:m.gender.marked,unmarked:m.visitors-m.gender.marked}),o.jsx(wu,{title:"Vanus",data:m.age.data,base:m.age.marked,unmarked:m.visitors-m.age.marked})]}),o.jsx("p",{className:"text-[10px] text-ink/55",children:"Referral'is võib inimesel olla mitu vastust, seega protsendid võivad kokku anda üle 100%."}),o.jsx(C$,{rows:r,setRows:n,loading:a})]})}async function P$(){const t=[];for(let r=0;;r+=1e3){const{data:n,error:a}=await ie.from("new_customers").select("*").order("first_visit_date",{ascending:!0}).order("first_visit_time",{ascending:!0,nullsFirst:!0}).order("legacy_nr",{ascending:!0,nullsFirst:!1}).range(r,r+1e3-1);if(a){const s=/new_customers|schema cache|does not exist/i.test(a.message);return{rows:t,error:s?"Klientide nimekirja tabel puudub andmebaasis: käivita migratsioon 20261009010000 Supabase'i SQL editoris.":a.message}}const i=n??[];for(const s of i)s.referral_sources?.length&&(s.referral_sources=Hd(s.referral_sources));if(t.push(...i),i.length<1e3)break}return{rows:t,error:null}}function ju(e){if(!e)return"";const[t,r,n]=e.slice(0,10).split("-");return`${n}.${r}.${t}`}function C$({rows:e,setRows:t,loading:r}){const n=pe(Nw),[a,i]=_.useState(""),[s,l]=_.useState(null),[c,u]=_.useState(null),[f,d]=_.useState(null),p=_.useMemo(()=>e.map((x,k)=>({nr:k+1,row:x})),[e]),m=_.useMemo(()=>{const x=a.trim().toLowerCase();return x?p.filter(({row:k})=>[k.name,k.email,k.phone,k.lisainfo,k.comment].some(g=>g?.toLowerCase().includes(x))):p}
72,[p,a]),v=async(x,k)=>{const g={...x,...k};u(x.id),d(null);try{const b=await n({data:{id:x.id,name:g.name,email:g.email||null,phone:g.phone||null,comment:g.comment||null,firstVisitDate:g.first_visit_date,firstVisitTime:g.first_visit_time||null,gender:g.gender||null,ageGroup:g.age_group||null,referralSources:g.referral_sources??[],referralOther:g.referral_other||null,lisainfo:g.lisainfo||null,passType:g.pass_type||null,after6m:g.after_6m||null,after12m:g.after_12m||null}});return b?.ok?(t(S=>S.map(O=>O.id===x.id?b.row:O)),!0):(d({id:x.id,text:b?.error??"Salvestamine ebaõnnestus"}),!1)}catch(b){return d({id:x.id,text:b instanceof Error?b.message:String(b)}),!1}finally{u(null)}},y=()=>{const k=[["Nr","Kuupäev","Kellaaeg","Nimi","Email","Telefon","Sugu","Vanus","Referral","Referral (Muu)","Lisainfo","Kommentaar","Pääse","6 kuud hiljem","12 kuud hiljem"].join(";")];for(const{nr:E,row:T}of p)k.push([String(E),ju(T.first_visit_date),T.first_visit_time,T.name,T.email,T.phone,T.gender,T.age_group,(T.referral_sources??[]).join(", "),T.referral_other,T.lisainfo,T.comment,T.pass_type,T.after_6m,T.after_12m].map(fe).join(";"));const g="\uFEFF"+k.join(`\r
73`)+`\r
74`,b=new Blob([g],{type:"text/csv;charset=utf-8;"}),S=URL.createObjectURL(b),O=document.createElement("a");O.href=S,O.download=`uued-kliendid-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(S)},h=(x,k)=>{const g=k===6?"after_6m":"after_12m",b=Cw(x.first_visit_date,k),S=ju(Gx(x.first_visit_date,k));return o.jsxs("select",{value:x[g]??"",disabled:!b||c===x.id,title:b?void 0:`Saab märkida alates ${S}`,onChange:O=>v(x,{[g]:O.target.value||null}),className:"border border-ink/30 bg-paper px-1 py-0.5 text-[11px] disabled:opacity-40 disabled:cursor-not-allowed",children:[o.jsx("option",{value:"",children:"—"}),Tw.map(O=>o.jsx("option",{value:O,children:O},O))]})},w="text-left font-normal text-ink/55 uppercase text-[10px] tracking-wider px-1.5 py-1 whitespace-nowrap",j="px-1.5 py-1 align-top";return o.jsxs("div",{className:"space-y-2 border-t border-ink/15 pt-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("p",{className:"text-[12px] font-medium mr-auto",children:"Klientide nimekiri"}),o.jsx("input",{type:"search",value:a,onChange:x=>i(x.target.value),placeholder:"Otsi nime, emaili, telefoni…",className:"border border-ink/30 bg-paper px-2 py-1 text-[12px] w-full md:w-72"}),o.jsxs("span",{className:"text-[11px] text-ink/55",children:[a?`${m.length} / ${e.length}`:e.length," klienti"]}),o.jsx("button",{onClick:y,disabled:e.length===0,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:"Lae alla CSV"})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-[12px] border-collapse",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-ink/15",children:[o.jsx("th",{className:w,children:"Nr"}),o.jsx("th",{className:w,children:"Kuupäev"}),o.jsx("th",{className:w,children:"Nimi"}),o.jsx("th",{className:w,children:"Kontakt"}),o.jsx("th",{className:w,children:"Sugu"}),o.jsx("th",{className:w,children:"Vanus"}),o.jsx("th",{className:w,children:"Referral"}),o.jsx("th",{className:w,children:"Lisainfo"}),o.jsx("th",{className:w,children:"Pääse"}),o.jsx("th",{className:w,children:"6 kuud hiljem"}),o.jsx("th",{className:w,children:"1a hiljem"}),o.jsx("th",{className:w})]})}),o.jsxs("tbody",{children:[m.map(({nr:x,row:k})=>o.jsxs(_.Fragment,{children:[o.jsxs("tr",{className:"border-b border-ink/10",children:[o.jsx("td",{className:`${j} font-mono text-ink/55`,children:x}),o.jsxs("td",{className:`${j} whitespace-nowrap`,children:[ju(k.first_visit_date),k.first_visit_time&&o.jsxs("span",{className:"text-ink/55",children:[" ",k.first_visit_time]})]}),o.jsx("td",{className:`${j} min-w-[140px]`,children:k.name}),o.jsxs("td",{className:`${j} min-w-[160px]`,children:[k.email&&o.jsx("div",{className:"break-all",children:k.email}),k.phone&&o.jsx("div",{className:"text-ink/70",children:k.phone}),k.comment&&o.jsxs("div",{className:"text-ink/55 italic",title:"Kommentaar broneeringul",children:["„",k.comment,"“"]})]}),o.jsx("td",{className:j,children:k.gender??""}),o.jsx("td",{className:j,children:k.age_group??""}),o.jsxs("td",{className:`${j} min-w-[140px]`,children:[(k.referral_sources??[]).join(", "),k.referral_other&&o.jsxs("span",{className:"text-ink/55",children:[" (",k.referral_other,")"]})]}),o.jsx("td",{className:`${j} min-w-[160px] text-ink/80`,children:k.lisainfo??""}),o.jsx("td",{className:j,children:o.jsxs("select",{value:k.pass_type??"",disabled:c===k.id,onChange:g=>v(k,{pass_type:g.target.value||null}),className:"border border-ink/30 bg-paper px-1 py-0.5 text-[11px]",children:[o.jsx("option",{value:"",children:"—"}),Ew.map(g=>o.jsx("option",{value:g,children:g},g))]})}),o.jsx("td",{className:j,children:h(k,6)}),o.jsx("td",{className:j,children:h(k,12)}),o.jsx("td",{className:`${j} whitespace-nowrap`,children:o.jsx("button",{type:"button",onClick:()=>
74l(s===k.id?null:k.id),className:"text-sienna underline underline-offset-2 hover:no-underline text-[11px]",children:s===k.id?"Sulge":"Muuda"})})]}),f?.id===k.id&&s!==k.id&&o.jsx("tr",{children:o.jsx("td",{colSpan:12,className:"px-1.5 pb-1 text-[11px] text-red-800",children:f.text})}),s===k.id&&o.jsx("tr",{className:"border-b border-ink/10",children:o.jsx("td",{colSpan:12,className:"p-1.5",children:o.jsx(M$,{row:k,saving:c===k.id,error:f?.id===k.id?f.text:null,onSave:async g=>{await v(k,g)&&l(null)},onClose:()=>l(null)})})})]},k.id)),!r&&m.length===0&&o.jsx("tr",{children:o.jsx("td",{colSpan:12,className:"text-center text-ink/55 italic py-6",children:"Kliente pole."})})]})]})})]})}function M$({row:e,saving:t,error:r,onSave:n,onClose:a}){const[i,s]=_.useState(e.name),[l,c]=_.useState(e.email??""),[u,f]=_.useState(e.phone??""),[d,p]=_.useState(e.first_visit_date),[m,v]=_.useState(e.first_visit_time??""),[y,h]=_.useState(e.gender),[w,j]=_.useState(e.age_group),[x,k]=_.useState(Hd(e.referral_sources)),[g,b]=_.useState(e.referral_other??""),[S,O]=_.useState(e.lisainfo??""),[E,T]=_.useState(e.comment??""),N=I=>`border px-2 py-1 text-[11px] transition-colors ${I?"bg-ink text-paper border-ink":"border-ink/30 hover:bg-ink/5"}`,A="block text-ink/55 uppercase text-[10px] tracking-wider mb-1",C="w-full border border-ink/30 bg-paper px-2 py-1 text-[12px]";return o.jsxs("div",{className:"bg-paper border border-ink/15 p-2.5 space-y-3 text-[12px]",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-2",children:[o.jsxs("label",{className:"md:col-span-2",children:[o.jsx("span",{className:A,children:"Nimi"}),o.jsx("input",{value:i,onChange:I=>s(I.target.value),className:C})]}),o.jsxs("label",{children:[o.jsx("span",{className:A,children:"Kuupäev"}),o.jsx("input",{type:"date",value:d,onChange:I=>p(I.target.value),className:C})]}),o.jsxs("label",{children:[o.jsx("span",{className:A,children:"Kellaaeg"}),o.jsx("input",{value:m,onChange:I=>v(I.target.value),placeholder:"17:30",className:C})]}),o.jsx("span",{}),o.jsxs("label",{className:"md:col-span-2",children:[o.jsx("span",{className:A,children:"Email"}),o.jsx("input",{type:"email",value:l,onChange:I=>c(I.target.value),className:C})]}),o.jsxs("label",{children:[o.jsx("span",{className:A,children:"Telefon"}),o.jsx("input",{type:"tel",value:u,onChange:I=>f(I.target.value),className:C})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:A,children:"Referral (võib valida mitu)"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ni.map(I=>o.jsx("button",{type:"button",className:N(x.includes(I)),onClick:()=>k(P=>P.includes(I)?P.filter(L=>L!==I):[...P,I]),children:I},I))}),x.includes(Kd)&&o.jsx("input",{value:g,onChange:I=>b(I.target.value),placeholder:"Kirjuta, kust kuulis",maxLength:500,className:`${C} mt-1.5 md:w-96`})]}),o.jsxs("div",{className:"flex flex-wrap gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:A,children:"Sugu"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Wd.map(I=>o.jsx("button",{type:"button",onClick:()=>h(y===I?null:I),className:N(y===I),children:I},I))})]}),o.jsxs("div",{children:[o.jsx("div",{className:A,children:"Vanus"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Gd.map(I=>o.jsx("button",{type:"button",onClick:()=>j(w===I?null:I),className:N(w===I),children:I},I))})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[o.jsxs("label",{children:[o.jsx("span",{className:A,children:"Lisainfo"}),o.jsx("textarea",{value:S,onChange:I=>O(I.target.value),rows:2,maxLength:2e3,className:C})]}),o.jsxs("label",{children:[o.jsx("span",{className:A,children:"Kommentaar (broneeringult)"}),o.jsx("textarea",{value:E,onChange:I=>T(I.target.value),rows:2,maxLength:2e3,className:C})]})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r&&o.jsx("span",{className:"text-[11px] text-red-800",children:r}),o.jsx("button",{type:"button",onClick:a,className:"border border-ink/30 text-[10px] uppercase tracking-wider px-2 py-1",children:"Sulge"}),o.jsx("button",{type:"button",disabled:t||!i.trim()||!d,onClick:()=>n({name:i.trim(),email:l.trim()||null,phone:u.trim()||null,first_visit_date:d,first_visit_time:m.trim()||null,gender:y,age_group:w,referral_sources:x,referral_other:g.trim()||null,lisainfo:S.trim()||null,comment:E.trim()||null}),className:"bg-sienna text-white text-[10px] uppercase tracking-wider px-3 py-1 disabled:opacity-50",children:t?"Salvestan…":"Salvesta"})]})]})}function K1({trainerScope:e}={}){const t=jw[e?.locale??"et"],r=pe(J1),n=pe(zR),a=pe(VR),i=pe(XR),s=pe(YR),[l,c]=_.useState([]),[u,f]=_.useState(null),[d,p]=_.useState(!1),[m,v]=_.useState(!1),[y,h]=_.useState(!1),[w,j]=_.useState(null),[x,k]=_.useState(""),[g,b]=_.useState(""),[S,O]=_.useState(""),[E,T]=_.useState(""),[N,A]=_.useState(""),[C,I]=_.useState(null),[P,L]=_.useState(Ye),[D,R]=_.useState(null),[F,V]=_.useState(null),[Z,W]=_.useState(null),[re,ce]=_.useState(null),[H,ae]=_.useState(!1),[K,z]=_.useState(null),[B,X]=_.useState(()=>Date.now());_.useEffect(()=>{const M=setInterval(()=>X(Date.now()),3e4);return()=>clearInterval(M)},[]);const J=M=>
74!e&&M.status!=="cancelled"&&Su(M),U=M=>{const G=Qf(M);return G==null||B>=G},ye=M=>J(M)&&U(M),ue=M=>{const G=Qf(M);if(G==null)return null;const ee=new Intl.DateTimeFormat("et-EE",{timeZone:"Europe/Tallinn",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(G));return o.jsxs("span",{className:"text-ink/45 text-[10px]",title:"Avaneb 15 min enne trenni algust",children:["Avaneb ",ee]})},[$e,Me]=_.useState(new Map);_.useEffect(()=>{e||(async()=>{const M=new Map,G=1e3;for(let ee=0;;ee+=G){const{data:te,error:se}=await ie.from("booking_registrations").select("id, email").or("gender.not.is.null,age_group.not.is.null,referral_sources.neq.{}").order("created_at",{ascending:!0}).range(ee,ee+G-1);if(se||!te)break;for(const oe of te){const ze=oe.email.toLowerCase();M.has(ze)||M.set(ze,oe.id)}if(te.length<G)break}for(let ee=0;;ee+=G){const{data:te,error:se}=await ie.from("new_customers").select("id, email, registration_id").not("email","is",null).order("first_visit_date",{ascending:!0}).range(ee,ee+G-1);if(se||!te)break;for(const oe of te){const ze=(oe.email??"").toLowerCase();ze&&!M.has(ze)&&M.set(ze,oe.registration_id??`list:${oe.id}`)}if(te.length<G)break}Me(M)})()},[e]);const De=M=>{const G=$e.get(M.email.toLowerCase());return!!G&&G!==M.id},tt=M=>{c(G=>G.map(ee=>ee.id===M.id?{...ee,...M}:ee)),bu(M)&&Me(G=>{const ee=M.email.toLowerCase();if(G.has(ee))return G;const te=new Map(G);return te.set(ee,M.id),te})},vt=M=>{const G=K===M.id;return De(M)?o.jsx("span",{className:"inline-block border border-ink/25 bg-ink/5 text-ink/70 text-[10px] uppercase tracking-wider px-1.5 py-0.5",title:"Selle kliendi andmed on juba olemas (teise broneeringu juures või uute klientide nimekirjas)",children:"Andmed olemas"}):o.jsx("button",{type:"button",onClick:()=>z(G?null:M.id),"aria-expanded":G,className:"text-sienna underline underline-offset-2 hover:no-underline text-[11px]",children:G?"Sulge":bu(M)?"Andmed ✓":"Andmed"})},[rt,yt]=_.useState(null),st=M=>{yt(G=>!G||G.key!==M?{key:M,dir:"asc"}:G.dir==="asc"?{key:M,dir:"desc"}:null)},Gt=M=>rt?.key===M?rt.dir==="asc"?" ↑":" ↓":"",sn=async M=>{if(!(Z||!(typeof window>"u"||window.confirm(t.confirmCancel(M.email,M.name))))){W(M.id),ce(null);try{const ee=await r({data:{registrationId:M.id}});ee?.ok?(c(te=>te.map(se=>se.id===M.id?{...se,status:"cancelled",last_activity_at:new Date().toISOString()}:se)),ce(t.removed(M.email))):ce(t.removeFailed(ee?.stage??"?",ee?.error??t.unknownError))}catch(ee){ce(t.removeFailedGeneric(ee instanceof Error?ee.message:String(ee)))}finally{W(null)}}},on=async()=>{if(p(!0),j(null),e){try{const te=await n();te?.ok?(c(te.rows??[]),f(te.total??null)):j(te?.error??t.loadFailed)}catch(te){j(te instanceof Error?te.message:String(te))}p(!1);return}const{data:M,error:G,count:ee}=await ie.from("booking_registrations").select("*",{count:"exact"}).order("last_activity_at",{ascending:!1}).limit(500);G?j(G.message):(c(M??[]),f(ee??null)),p(!1)},fs=async()=>{if(e){try{const ee=await i();R(ee?.lastExport??null),V(ee?.newCount??0)}catch{}return}const{data:M,error:G}=await ie.from("admin_export_log").select("exported_until, created_at").eq("export_type","class_registrations_new").order("created_at",{ascending:!1}).limit(1).maybeSingle();if(!G){R(M??null);let ee=ie.from("booking_registrations").select("id",{count:"exact",head:!0});M?.exported_until&&(ee=ee.gt("created_at",M.exported_until));const{count:te}=await ee;V(te??0)}};_.useEffect(()=>{on(),fs()},[]);const er=_.useMemo(()=>{const M=e?Fd.filter(te=>te.trainerNames.includes(e.trainerName)):Fd,G=[],ee=new Set;for(const te of l)!te.class_name||ee.has(te.class_name)||(ee.add(te.class_name),M.some(se=>se.match(te))||G.push(te.class_name));return G.sort(),[...M.map(te=>({id:te.id,label:te.label,days:te.days})),...G.map(te=>({id:`raw:${te}`,label:te,days:void 0}))]},[l,e]);_.useEffect(()=>{e&&!x&&er.length>0&&k(er[0].id)},[e,x,er]);const ps=_.useMemo(()=>k$(er.find(M=>M.id===x)?.days),[er,x]);_.useEffect(()=>{A("")},[x]);const hs=N||S,ms=N||E,ga=_.useMemo(()=>{const M=g.trim().toLowerCase(),G=l.filter(ve=>!(!H&&ve.status==="cancelled"||x&&!j$(ve,x)||M&&!`${ve.email} ${ve.name??""} ${ve.client_phone??""}`.toLowerCase().includes(M)||hs&&(ve.booking_date??"")<hs||ms&&(ve.booking_date??"")>
74ms));if(!rt)return G;const{key:ee,dir:te}=rt,se=te==="asc"?1:-1,oe=new Intl.Collator("et",{sensitivity:"base",numeric:!0}),ze=ve=>{switch(ee){case"email":return ve.email??"";case"name":return ve.name??"";case"phone":return ve.client_phone??"";case"class":return ve.class_name??"";case"trainer":return ve.trainer_name??"";case"date":{if(ve.booking_start)return Date.parse(ve.booking_start)||0;const va=ve.booking_date??"",ln=ve.booking_time??"00:00",xr=Date.parse(`${va}T${ln}:00`);return Number.isFinite(xr)?xr:0}case"time":return ve.booking_time??"";case"created":return Date.parse(ve.created_at)||0;case"activity":return Date.parse(ve.last_activity_at??ve.created_at)||0;case"status":return ve.status??"";case"message":return ve.client_message&&ve.client_message.trim()?1:0}return""};return[...G].sort((ve,va)=>{const ln=ze(ve),xr=ze(va);return typeof ln=="number"&&typeof xr=="number"?(ln-xr)*se:oe.compare(String(ln),String(xr))*se})},[l,x,g,hs,ms,rt,H]),gs=ga.slice(0,P),H1=ga.length>P;function Yf(M){const G=!e,ee=new Map;if(G)for(const oe of M)bu(oe)&&!ee.has(oe.email.toLowerCase())&&ee.set(oe.email.toLowerCase(),oe);const se=[(G?[...t.csvHeaders,"Käis","Käis märgitud","Referral","Referral (Muu)","Sugu","Vanus"]:t.csvHeaders).map(fe).join(";")];for(const oe of M){const ze=ee.get(oe.email.toLowerCase()),ve=G?[fe(Su(oe)?oe.attended?"Jah":"Ei":""),fe(oe.attended&&oe.attended_at?Ce(oe.attended_at):""),fe(ze?.referral_sources?.join(", ")??""),fe(ze?.referral_other??""),fe(ze?.gender??""),fe(ze?.age_group??"")]:[];se.push([fe(oe.email),fe(oe.name),fe(oe.client_phone),fe(oe.class_name),fe(oe.trainer_name),fe($a(oe.booking_date)),fe(oe.booking_time),fe(Ce(oe.created_at)),fe(oe.status),fe(oe.client_message),...ve].join(";"))}return"\uFEFF"+se.join(`\r
75`)+`\r
76`}function Zf(M,G){const ee=new Blob([M],{type:"text/csv;charset=utf-8;"}),te=URL.createObjectURL(ee),se=document.createElement("a");se.href=te,se.download=G,document.body.appendChild(se),se.click(),document.body.removeChild(se),URL.revokeObjectURL(te)}async function Jf(M){if(e)try{const se=await a({data:{gtCreated:M?.gtCreated}});return se?.ok?se.rows??[]:(j(se?.error??t.exportFailed),null)}catch(se){return j(se instanceof Error?se.message:String(se)),null}const G=1e3;let ee=0;const te=[];for(;;){let se=ie.from("booking_registrations").select("*").order("created_at",{ascending:!1}).range(ee,ee+G-1);M?.gtCreated&&(se=se.gt("created_at",M.gtCreated));const{data:oe,error:ze}=await se;if(ze)return j(ze.message),null;const ve=oe??[];if(te.push(...ve),ve.length<G)break;ee+=G}return te}const W1=async()=>{v(!0),j(null);const M=await Jf();
76if(!M){v(!1);return}const G=Yf(M),ee=new Date().toISOString().slice(0,10);Zf(G,`class-registrations-all-${ee}.csv`),v(!1)},G1=async()=>{h(!0),j(null);const M=D?.exported_until??null,G=await Jf(M?{gtCreated:M}:void 0);if(!G){h(!1);return}const ee=Yf(G),te=new Date().toISOString().slice(0,10);if(Zf(ee,`class-registrations-new-${te}.csv`),G.length>0){const se=G[0].created_at;if(e)try{const oe=await s({data:{exportedUntil:se,rowCount:G.length}});oe?.ok?await fs():j(oe?.error??t.exportLogFailed)}catch(oe){j(oe instanceof Error?oe.message:String(oe))}else{const{error:oe}=await ie.from("admin_export_log").insert({export_type:"class_registrations_new",exported_until:se,row_count:G.length});oe?j(oe.message):await fs()}}h(!1)};return o.jsxs(_e,{title:"Class registrations",description:t.description,defaultOpen:!!e,headerAction:o.jsxs("div",{className:"flex flex-col gap-2 items-stretch md:items-end",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:flex-wrap items-stretch md:items-center gap-2 md:justify-end",children:[o.jsx("button",{onClick:W1,disabled:m,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:m?t.exporting:t.downloadAll}),o.jsx("button",{onClick:G1,disabled:y,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50 w-full md:w-auto",children:y?t.exporting:t.downloadNew}),o.jsx("button",{onClick:on,disabled:d,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:d?t.refreshing:t.refresh})]}),o.jsxs("div",{className:"text-[10px] text-ink/55 text-left md:text-right leading-snug",children:[D?.created_at?o.jsxs(o.Fragment,{children:[t.lastExportPrefix,Ce(D.created_at)]}):o.jsx(o.Fragment,{children:t.noExportYet}),F!=null&&o.jsxs(o.Fragment,{children:[" · ",t.newSinceExport,F]})]})]}),children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:t.statTotal,value:u??0}),o.jsx(ke,{label:t.statFiltered,value:ga.length})]}),!e&&o.jsx(E$,{onAdded:M=>{c(G=>[M,...G]),f(G=>G==null?G:G+1)}}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:[t.classLabel,o.jsxs("select",{value:x,onChange:M=>k(M.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[!e&&o.jsx("option",{value:"",children:"Kõik"}),er.map(M=>o.jsx("option",{value:M.id,children:M.label},M.id))]})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:[t.quickDateLabel,o.jsxs("select",{value:N,onChange:M=>A(M.target.value),disabled:ps.length===0||!!(S||E),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink disabled:opacity-50 disabled:cursor-not-allowed",children:[o.jsx("option",{value:"",children:ps.length===0?t.pickClassFirst:"—"}),ps.map(M=>o.jsx("option",{value:M.value,children:M.label},M.value))]})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:[t.searchLabel,o.jsx("input",{type:"text",value:g,onChange:M=>b(M.target.value),placeholder:t.searchPlaceholder,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:[t.fromLabel,o.jsx("input",{type:"date",value:S,onChange:M=>O(M.target.value),disabled:!!N,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink disabled:opacity-50 disabled:cursor-not-allowed"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:[t.toLabel,o.jsx("input",{type:"date",value:E,onChange:M=>T(M.target.value),disabled:!!N,className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink disabled:opacity-50 disabled:cursor-not-allowed"})]}),(x||g||S||E||N)&&o.jsx("button",{type:"button",onClick:()=>{k(e?er[0]?.id??"":""),b(""),O(""),T(""),A("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:t.clear}),o.jsx("button",{type:"button",onClick:()=>ae(M=>!M),className:`md:ml-auto border text-[11px] uppercase tracking-wider px-2.5 py-1 transition-colors ${H?"border-red-700/40 text-red-800 hover:bg-red-700/10":"border-ink/30 hover:bg-ink hover:text-paper"}`,children:H?t.hideRemoved:t.showRemoved})]}),w&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:w}),re&&o.jsxs("p",{className:"text-[12px] text-ink bg-ink/5 border border-ink/15 px-2.5 py-1.5 flex items-center justify-between gap-2",children:[o.jsx("span",{children:re}),o.jsx("button",{type:"button",onClick:()=>ce(null),className:"text-[10px] uppercase tracking-wider text-ink/60 hover:text-ink",children:t.close})]}),gs.length===0&&!d?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:t.noBookings}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"hidden md:block border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px] table-fixed min-w-[1440px]",children:[o.jsxs("colgroup",{children:[o.jsx("col",{style:{width:"15%"}}),o.jsx("col",{style:{width:"9%"}}),o.jsx("col",{style:{width:"8%"}}),o.jsx("col",{style:{width:"10%"}}),o.jsx("col",{style:{width:"6%"}}
76),o.jsx("col",{style:{width:"9%"}}),o.jsx("col",{style:{width:"5%"}}),o.jsx("col",{style:{width:"12%"}}),o.jsx("col",{style:{width:"9%"}}),o.jsx("col",{style:{width:"7%"}}),o.jsx("col",{style:{width:"8%"}}),o.jsx("col",{style:{width:"10%"}})]}),o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[[["email","Email","px-2"],["name",t.colName,"px-2"],["phone",t.colPhone,"px-2"],["class",t.classLabel,"px-2"],["trainer",t.colTrainer,"px-2"],["date",t.colDate,"px-2"],["time",t.colTime,"px-2"]].map(([M,G,ee])=>o.jsx("th",{className:`${ee} py-1.5 text-[10px] uppercase tracking-wider font-medium`,children:o.jsxs("button",{type:"button",onClick:()=>st(M),className:"uppercase tracking-wider font-medium hover:text-sienna inline-flex items-center gap-0.5",children:[G,Gt(M)]})},M)),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium whitespace-nowrap",children:o.jsxs("div",{className:"flex flex-col items-start leading-tight",children:[o.jsxs("button",{type:"button",onClick:()=>st("created"),className:"uppercase tracking-wider font-medium hover:text-sienna inline-flex items-center gap-0.5",children:[t.colCreated,Gt("created")]}),o.jsxs("button",{type:"button",onClick:()=>st("activity"),className:"uppercase tracking-wider font-medium text-paper/70 hover:text-sienna inline-flex items-center gap-0.5 text-[9px]",children:[t.colUpdated,Gt("activity")]})]})}),[["status",t.colStatus,"px-2"],["message",t.colMessage,"px-2"]].map(([M,G,ee])=>o.jsx("th",{className:`${ee} py-1.5 text-[10px] uppercase tracking-wider font-medium`,children:o.jsxs("button",{type:"button",onClick:()=>st(M),className:"uppercase tracking-wider font-medium hover:text-sienna inline-flex items-center gap-0.5",children:[G,Gt(M)]})},M)),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:e?"":"Külastus"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:t.colActions})]})}),o.jsx("tbody",{children:gs.map((M,G)=>{const ee=!!(M.client_message&&M.client_message.trim()),te=C===M.id,se=G%2===0?"var(--paper)":"var(--paper-deep)";return o.jsxs(_.Fragment,{children:[o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:se},children:[o.jsx("td",{className:"px-2 py-1.5 font-mono truncate",title:M.email,children:M.email}),o.jsx("td",{className:"px-2 py-1.5 truncate",title:M.name??"",children:M.name??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 font-mono truncate",children:M.client_phone?M.client_phone:o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 truncate",title:M.class_name??"",children:M.class_name??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 truncate",children:M.trainer_name??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 whitespace-nowrap",children:$a(M.booking_date)}),o.jsx("td",{className:"px-2 py-1.5 font-mono",children:M.booking_time??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsxs("td",{className:"px-2 py-1.5 whitespace-nowrap leading-tight",children:[o.jsx("div",{children:Ce(M.created_at)}),M.last_activity_at&&M.last_activity_at!==M.created_at&&o.jsxs("div",{className:"text-ink/55 text-[10px]",children:[t.updatedPrefix,Ce(M.last_activity_at)]})]}),o.jsx("td",{className:"px-2 py-1.5 truncate",title:M.status??"",children:M.status??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5",children:ee?o.jsx("button",{type:"button",onClick:()=>I(te?null:M.id),className:"text-sienna underline underline-offset-2 hover:no-underline text-[12px]","aria-expanded":te,children:te?t.closeMsg:t.yes}):o.jsx("span",{className:"text-ink/40",children:t.no})}),o.jsx("td",{className:"px-2 py-1.5",children:ye(M)?o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(Ud,{row:M,onSaved:tt}),vt(M)]}):J(M)&&o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[ue(M),De(M)&&vt(M)]})}),o.jsx("td",{className:"px-2 py-1.5",children:M.status==="cancelled"?o.jsx("span",{className:"text-ink/40 text-[11px] italic",children:t.cancelled}):o.jsx("button",{type:"button",onClick:()=>sn(M),disabled:Z===M.id,className:"border border-red-700/40 text-red-800 text-[10px] uppercase tracking-wider px-2 py-1 hover:bg-red-700/10 disabled:opacity-50",title:t.removeTooltip,children:Z===M.id?t.removing:t.remove})})]}),te&&ee&&o.jsx("tr",{style:{backgroundColor:se},children:o.jsxs("td",{colSpan:12,className:"px-3 py-2 border-b border-ink/10",children:[o.jsx("div",{className:"text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:t.colMessage}),o.jsx("div",{className:"whitespace-pre-wrap break-words text-[12px] text-ink bg-paper border border-ink/15 p-2.5",children:M.client_message}),o.jsx("div",{className:"mt-2 flex justify-end",children:o.jsx("button",{type:"button",onClick:()=>I(null),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-2 py-0.5",children:t.closeMsg})})]})}),K===M.id&&ye(M)&&!De(M)&&o.jsx("tr",{style:{backgroundColor:se},children:o.jsx("td",{colSpan:12,className:"px-3 py-2 border-b border-ink/10",children:o.jsx("div",{className:"sticky left-3 max-w-[calc(100vw-6rem)] lg:max-w-[1000px]",children:o.jsx(Ux,{row:M,onSaved:tt,onClose:()=>z(null)})})})})]},M.id)})})]})}),o.jsxs("div",{className:"md:hidden flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-wider text-ink/60",children:[o.jsx("span",{children:t.sortLabel}),o.jsxs("select",{value:rt?`${rt.key}:${rt.dir}`:"",onChange:M=>{const G=M.target.value;if(!G){yt(null);return}const[ee,te]=G.split(":");yt({key:ee,dir:te})},className:"border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:t.sortDefault}),[["email","Email"],["name",t.colName],["phone",t.colPhone],["class",t.classLabel],["trainer",t.colTrainer],["date",t.colDate],["time",t.colTime],["created",t.colCreated],["activity",t.colUpdated],["status",t.colStatus],["message",t.colMessage]].flatMap(([M,G])=>[o.jsxs("option",{value:`${M}
76:asc`,children:[G," ↑"]},`${M}-asc`),o.jsxs("option",{value:`${M}:desc`,children:[G," ↓"]},`${M}-desc`)])]})]}),o.jsx("ul",{className:"md:hidden border border-ink/15 divide-y divide-ink/10",children:gs.map((M,G)=>{const ee=!!(M.client_message&&M.client_message.trim()),te=C===M.id,se=G%2===0?"var(--paper)":"var(--paper-deep)";return o.jsxs("li",{style:{backgroundColor:se},className:"px-2.5 py-2 text-[12px] space-y-0.5",children:[o.jsx(Le,{label:"Email",value:o.jsx("span",{className:"font-mono break-all",children:M.email})}),o.jsx(Le,{label:t.colName,value:M.name??"—"}),o.jsx(Le,{label:t.colPhone,value:M.client_phone??"—"}),o.jsx(Le,{label:t.classLabel,value:M.class_name??"—"}),o.jsx(Le,{label:t.colTrainer,value:M.trainer_name??"—"}),o.jsx(Le,{label:t.colDate,value:$a(M.booking_date)}),o.jsx(Le,{label:t.colTime,value:M.booking_time??"—"}),o.jsx(Le,{label:t.colCreated,value:Ce(M.created_at)}),M.last_activity_at&&M.last_activity_at!==M.created_at&&o.jsx(Le,{label:t.colUpdated,value:Ce(M.last_activity_at)}),o.jsx(Le,{label:t.colStatus,value:M.status??"—"}),o.jsxs("div",{className:"flex items-baseline gap-1.5",children:[o.jsx("span",{className:"text-ink/55 uppercase text-[10px] tracking-wider w-[68px] shrink-0",children:t.colMessage}),ee?o.jsx("button",{type:"button",onClick:()=>I(te?null:M.id),className:"text-sienna underline underline-offset-2 text-[12px]",children:te?t.closeMsg:t.yes}):o.jsx("span",{className:"text-ink/40",children:t.no})]}),te&&ee&&o.jsx("div",{className:"mt-1.5 whitespace-pre-wrap break-words text-[12px] text-ink bg-paper border border-ink/15 p-2",children:M.client_message}),J(M)&&o.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[o.jsx("span",{className:"text-ink/55 uppercase text-[10px] tracking-wider w-[68px] shrink-0",children:"Külastus"}),ye(M)?o.jsxs(o.Fragment,{children:[o.jsx(Ud,{row:M,onSaved:tt}),vt(M)]}):o.jsxs(o.Fragment,{children:[ue(M),De(M)&&vt(M)]})]}),K===M.id&&ye(M)&&!De(M)&&o.jsx("div",{className:"mt-1.5",children:o.jsx(Ux,{row:M,onSaved:tt,onClose:()=>z(null)})}),o.jsx("div",{className:"pt-1.5",children:M.status==="cancelled"?o.jsx("span",{className:"text-ink/40 text-[11px] italic",children:t.cancelled}):o.jsx("button",{type:"button",onClick:()=>sn(M),disabled:Z===M.id,className:"border border-red-700/40 text-red-800 text-[10px] uppercase tracking-wider px-2 py-1 hover:bg-red-700/10 disabled:opacity-50",children:Z===M.id?t.removing:t.removeParticipant})})]},M.id)})}),o.jsx("div",{className:"flex items-center justify-center pt-1",children:H1?o.jsx("button",{type:"button",onClick:()=>L(M=>M+Ye),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-3 py-1.5 hover:bg-ink hover:text-paper transition-colors",children:t.showMore(Ye)}):ga.length>Ye&&o.jsx("p",{className:"text-[11px] text-ink/55 italic",children:t.allShown})})]})]})}function Te(e){const t=e==null?"":String(e);return/[";\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function I$(){const[e,t]=_.useState([]),[r,n]=_.useState(null),[a,i]=_.useState(!1),[s,l]=_.useState(!1),[c,u]=_.useState(!1),[f,d]=_.useState(null),[p,m]=_.useState(""),[v,y]=_.useState(""),[h,w]=_.useState(""),[j,x]=_.useState(""),[k,g]=_.useState(null),[b,S]=_.useState(""),[O,E]=_.useState(null),[T,N]=_.useState(null),[A,C]=_.useState(null),[I,P]=_.useState(Ye),L=async()=>{i(!0),d(null);const{data:K,error:z,count:B}=await ie.from("contact_submissions").select("*",{count:"exact"}).not("question","ilike",Tr).order("created_at",{ascending:!1}).limit(200);z?d(z.message):(t(K??[]),n(B??null)),i(!1)},D=async()=>{const{data:K,error:z}=await ie.from("admin_export_log").select("exported_until, created_at").eq("export_type","contact_submissions_new").order("created_at",{ascending:!1}).limit(1).maybeSingle();if(!z){N(K??null);let B=ie.from("contact_submissions").select("id",{count:"exact",head:!0}).not("question","ilike",Tr);K?.exported_until&&(B=B.gt("created_at",K.exported_until));const{count:X}=await B;C(X??0)}};_.useEffect(()=>{L(),D()},[]);const R=_.useMemo(()=>{const K=v.trim().toLowerCase();return e.filter(z=>{if(p&&(z.status??"new")!==p||K&&!`${z.email} ${z.name} ${z.phone??""}`.toLowerCase().includes(K))return!1;const B=z.created_at.slice(0,10);return!(h&&B<h||j&&B>j)})},[e,p,v,h,j]),F=_.useMemo(()=>R.slice(0,I),[R,I]),V=async(K,z)=>{const{error:B}=await ie.from("contact_submissions").update({status:z}).eq("id",K);B?d(B.message):t(X=>X.map(J=>J.id===K?{...J,status:z}:J))},Z=async K=>{const{error:z}=await ie.from("contact_submissions").update({admin_notes:b}).eq("id",K);z?d(z.message):(t(B=>B.map(X=>X.id===K?{...X,admin_notes:b}:X)),g(null))};async function W(K){let B=0;const X=[];for(;;){let J=ie.from("contact_submissions").select("*").not("question","ilike",Tr).order("created_at",{ascending:!1}).range(B,B+1e3-1);K&&(J=J.gt("created_at",K));const{data:U,error:ye}=await J;if(ye)return d(ye.message),null;const ue=U??[];if(X.push(...ue),ue.length<1e3)break;B+=1e3}return X}function re(K){const B=[["Nimi","Email","Telefon","Teema","Sõnum","Leht","Keel","Loodud","Staatus","Märkmed"].map(Te).join(";")];for(const X of K){const J=X.form_type&&X.form_type.trim()||(X.question?.split(`
77`)[0]??"").slice(0,200);B.push([Te(X.name),Te(X.email),Te(X.phone),Te(J),Te(X.question),Te(X.source_page),Te(X.locale),Te(Ce(X.
77created_at)),Te(X.status??"new"),Te(X.admin_notes)].join(";"))}return"\uFEFF"+B.join(`\r
78`)+`\r
79`}function ce(K,z){const B=new Blob([K],{type:"text/csv;charset=utf-8;"}),X=URL.createObjectURL(B),J=document.createElement("a");J.href=X,J.download=z,document.body.appendChild(J),J.click(),document.body.removeChild(J),URL.revokeObjectURL(X)}const H=async()=>{l(!0),d(null);const K=await W();if(!K){l(!1);return}ce(re(K),`contact-submissions-all-${new Date().toISOString().slice(0,10)}.csv`),l(!1)},ae=async()=>{u(!0),d(null);const K=T?.exported_until??null,z=await W(K);if(!z){u(!1);return}if(ce(re(z),`contact-submissions-new-${new Date().toISOString().slice(0,10)}.csv`),z.length>0){const{error:B}=await ie.from("admin_export_log").insert({export_type:"contact_submissions_new",exported_until:z[0].created_at,row_count:z.length});B?d(B.message):await D()}u(!1)};return o.jsxs(_e,{title:"Kontaktivormi kirjad",description:"Üldised kontaktivormi sissetulnud kirjad (välja arvatud personaaltreeningu päringud). Näidatud viimased 20.",headerAction:o.jsxs("div",{className:"flex flex-col gap-2 items-stretch md:items-end",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:flex-wrap items-stretch md:items-center gap-2 md:justify-end",children:[o.jsx("button",{onClick:H,disabled:s||(r??0)===0,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:s?"Ekspordin…":"Lae alla kõik kontaktipäringud"}),o.jsx("button",{onClick:ae,disabled:c,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50 w-full md:w-auto",children:c?"Ekspordin…":"Lae alla uued pärast viimast eksporti"}),o.jsx("button",{onClick:L,disabled:a,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:a?"Laen…":"Värskenda"})]}),o.jsxs("div",{className:"text-[10px] text-ink/55 text-left md:text-right leading-snug",children:[T?.created_at?o.jsxs(o.Fragment,{children:["Viimane uute kontaktipäringute eksport: ",Ce(T.created_at)]}):o.jsx(o.Fragment,{children:"Uute kontaktipäringute eksporti pole veel tehtud."}),A!=null&&o.jsxs(o.Fragment,{children:[" · Uusi pärast viimast eksporti: ",A]})]})]}),children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:r??0}),o.jsx(ke,{label:"Uued",value:e.filter(K=>(K.status??"new")==="new").length,accent:!0}),o.jsx(ke,{label:"Filtreeritud",value:R.length})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Staatus",o.jsxs("select",{value:p,onChange:K=>m(K.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:"Kõik"}),o.jsx("option",{value:"new",children:"new"}),o.jsx("option",{value:"contacted",children:"contacted"}),o.jsx("option",{value:"done",children:"done"})]})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60 min-w-[180px]",children:["Email / nimi / telefon",o.jsx("input",{type:"text",value:v,onChange:K=>y(K.target.value),placeholder:"otsi…",className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Alates",o.jsx("input",{type:"date",value:h,onChange:K=>w(K.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Kuni",o.jsx("input",{type:"date",value:j,onChange:K=>x(K.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),(p||v||h||j)&&o.jsx("button",{type:"button",onClick:()=>{m(""),y(""),w(""),x("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"})]}),f&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:f}),F.length===0&&!a?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Kirju pole."}):o.jsx("ul",{className:"border border-ink/15 divide-y divide-ink/10",children:F.map((K,z)=>{const B=O===K.id,X=K.form_type&&K.form_type.trim()||(K.question?.split(`
80`)[0]??"").slice(0,120)||"—";return o.jsxs("li",{style:{backgroundColor:z%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsxs("button",{type:"button",onClick:()=>E(B?null:K.id),className:"w-full text-left px-2.5 py-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] hover:bg-ink/5","aria-expanded":B,children:[o.jsx("span",{className:"text-ink/50 w-4 text-center",children:B?"▾":"▸"}),o.jsx("span",{className:"font-mono whitespace-nowrap",children:Ce(K.created_at)}),o.jsx("span",{className:"font-medium",children:K.name}),o.jsx("span",{className:"font-mono text-ink/70",children:K.email}),o.jsx("span",{className:"text-ink/40",children:"—"}),o.jsx("span",{className:"text-ink/90 truncate",children:X}),(K.status??"new")==="new"&&o.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-wider bg-sienna text-white px-1.5 py-0.5",children:"new"})]}),B&&o.jsxs("div",{className:"px-2.5 pb-3 pt-1 text-[12px] grid gap-2 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-ink/50 uppercase text-[10px] tracking-wider",children:"Telefon: "}),K.phone??"—"]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-ink/50 uppercase text-[10px] tracking-wider",children:"Keel: "}),K.locale??"—"]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-ink/50 uppercase text-[10px] tracking-wider",children:"Vorm: "}),K.form_type??"—"]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-ink/50 uppercase text-[10px] tracking-wider",children:"Leht: "}),K.source_page??"—"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-ink/50 uppercase text-[10px] tracking-wider",children:"Staatus:"}),o.jsxs("select",{value:K.status??"new",onChange:J=>V(K.id,J.target.value),className:"border border-ink/30 bg-paper px-1.5 py-0.5 text-[11px]",children:[o.jsx("option",{value:"new",children:"new"}),o.jsx("option",{value:"contacted",children:"contacted"}),o.jsx("option",{value:"done",children:"done"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-ink/50 uppercase text-[10px] tracking-wider mb-1",children:"Sõnum"}),o.jsx("div",{className:"whitespace-pre-wrap border border-ink/15 bg-paper px-2 py-1.5",children:K.question})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-ink/50 uppercase text-[10px] tracking-wider mb-1",children:"Märkmed"}),k===K.id?o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("textarea",{value:b,onChange:J=>S(J.target.value),rows:3,className:"border border-ink/30 bg-paper px-1.5 py-1 text-[12px] w-full"}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx("button",{onClick:()=>Z(K.id),className:"bg-sienna text-white text-[10px] uppercase tracking-wider px-2 py-0.5",children:"Salvesta"}),o.jsx("button",{onClick:()=>g(null),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-2 py-0.5",children:"Tühista"})]})]}):o.jsx("button",{onClick:()=>{g(K.id),S(K.admin_notes??"")},className:"text-left text-ink/80 hover:text-ink block w-full border border-ink/15 bg-paper px-2 py-1.5",children:K.admin_notes?K.admin_notes:o.jsx("span",{className:"italic text-ink/40",children:"+ lisa märkus"})})]})]})]})]},K.id)})}),o.jsx("div",{className:"flex items-center justify-center pt-1",children:R.length>I?o.jsxs("button",{type:"button",onClick:()=>P(K=>K+Ye),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-3 py-1.5 hover:bg-ink hover:text-paper transition-colors",children:["Näita veel ",Ye]}):R.length>Ye&&o.jsx("p",{className:"text-[11px] text-ink/55 italic",children:"Kõik kirjed on kuvatud."})})]})}function R$(){const[e,t]=_.useState([]),[r,n]=_.useState(!1),[a,i]=_.useState(null),[s,l]=_.useState(""),[c,u]=_.useState(!1),[f,d]=_.useState(null),p=async()=>{n(!0),i(null);const{data:x,error:k}=await ie.from("admin_error_logs").select("*").order("created_at",{ascending:!1}).limit(200);k?i(k.message):t(x??[]),n(!1)};_.useEffect(()=>{p()},[]);const m=_.useMemo(()=>Array.from(new Set(e.map(x=>x.source))).sort(),[e]),v=_.useMemo(()=>e.filter(x=>!(s&&x.source!==s||!c&&x.resolved)),[e,s,c]),y=e.filter(x=>
80!x.resolved).length,h=async(x,k)=>{const{error:g}=await ie.from("admin_error_logs").update({resolved:k}).eq("id",x);g?i(g.message):t(b=>b.map(S=>S.id===x?{...S,resolved:k}:S))},w=x=>{const k=JSON.stringify({created_at:x.created_at,source:x.source,page:x.page,endpoint:x.endpoint,status_code:x.status_code,error_message:x.error_message,error_details:x.error_details,customer_email:x.customer_email},null,2);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(k).catch(()=>{})},j=()=>{const k=[["created_at","source","page","endpoint","status_code","error_message","customer_email","class_name","trainer_name","booking_date","booking_time","resolved"].map(Te).join(";")];for(const E of e)k.push([Te(new Date(E.created_at).toLocaleString("sv-SE",{timeZone:"Europe/Tallinn"})),Te(E.source),Te(E.page),Te(E.endpoint),Te(E.status_code!=null?String(E.status_code):""),Te(E.error_message),Te(E.customer_email),Te(E.class_name),Te(E.trainer_name),Te(E.booking_date),Te(E.booking_time),Te(E.resolved?"yes":"no")].join(";"));const g="\uFEFF"+k.join(`\r
81`)+`\r
82`,b=new Blob([g],{type:"text/csv;charset=utf-8;"}),S=URL.createObjectURL(b),O=document.createElement("a");O.href=S,O.download=`admin-error-logs-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(S)};return o.jsxs(_e,{title:"Failed booking / API errors",description:"Avalike vormide ja booking API vead, mis on logitud (lisaks ülal asuvale booking_errors loendile).",headerAction:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:p,disabled:r,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 disabled:opacity-50",children:r?"Laen…":"Värskenda"}),o.jsx("button",{onClick:j,disabled:e.length===0,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:"Lae alla CSV"})]}),children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:e.length}),o.jsx(ke,{label:"Lahendamata",value:y,accent:y>0})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Allikas",o.jsxs("select",{value:s,onChange:x=>l(x.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:"Kõik"}),m.map(x=>o.jsx("option",{value:x,children:x},x))]})]}),o.jsxs("label",{className:"inline-flex items-center gap-1.5 text-[12px] mt-4",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:x=>u(x.target.checked)}),"Näita lahendatud"]})]}),a&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:a}),v.length===0&&!r?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Vigu pole logitud."}):o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Aeg"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Allikas"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Endpoint"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Email"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Sõnum"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Lahendatud"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tegevus"})]})}),o.jsx("tbody",{children:v.map((x,k)=>o.jsxs(_.Fragment,{children:[o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:k%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 whitespace-nowrap font-mono",children:new Date(x.created_at).toLocaleStr
82ing("et-EE",{timeZone:"Europe/Tallinn"})}),o.jsx("td",{className:"px-2.5 py-1.5",children:x.source}),o.jsxs("td",{className:"px-2.5 py-1.5 font-mono",children:[x.endpoint??"—",x.status_code!=null&&o.jsx("span",{className:"ml-1 bg-red-700/10 text-red-800 px-1",children:x.status_code})]}),o.jsx("td",{className:"px-2.5 py-1.5",children:x.customer_email??"—"}),o.jsx("td",{className:"px-2.5 py-1.5 max-w-[28ch] truncate",title:x.error_message??"",children:x.error_message??"—"}),o.jsx("td",{className:"px-2.5 py-1.5",children:o.jsx("input",{type:"checkbox",checked:x.resolved,onChange:g=>h(x.id,g.target.checked)})}),o.jsxs("td",{className:"px-2.5 py-1.5 whitespace-nowrap",children:[o.jsx("button",{onClick:()=>d(f===x.id?null:x.id),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-1.5 py-0.5 mr-1",children:f===x.id?"Peida":"Detailid"}),o.jsx("button",{onClick:()=>w(x),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-1.5 py-0.5",children:"Kopeeri"})]})]}),f===x.id&&o.jsx("tr",{style:{backgroundColor:"var(--paper-deep)"},children:o.jsx("td",{colSpan:7,className:"px-2.5 py-2",children:o.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all font-mono",children:JSON.stringify({page:x.page,class_name:x.class_name,trainer_name:x.trainer_name,booking_date:x.booking_date,booking_time:x.booking_time,customer_name:x.customer_name,error_details:x.error_details},null,2)})})})]},x.id))})]})})]})}function $$(){const e=pe(hw),[t,r]=_.useState(null),[n,a]=_.useState(!1),[i,s]=_.useState(null),[l,c]=_.useState(""),u=async()=>{a(!0),s(null);try{const d=await e();r(d)}catch(d){s(d instanceof Error?d.message:"Check failed")}finally{a(!1)}},f=_.useMemo(()=>t?t.issues.filter(d=>!l||d.severity===l):[],[t,l]);return o.jsxs(_e,{title:"Translation missing checker",description:"Võrdleb ET ja EN sõnastikke. Käivitub ainult nupule vajutamisel.",headerAction:o.jsx("button",{onClick:u,disabled:n,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:n?"Kontrollin…":"Run translation check"}),children:[i&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:i}),t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"ET võtmeid",value:t.totalEtKeys}),o.jsx(ke,{label:"EN võtmeid",value:t.totalEnKeys}),o.jsx(ke,{label:"Probleeme",value:t.issues.length,accent:t.issues.length>0}),o.jsx(ke,{label:"Olulisi",value:t.issues.filter(d=>d.severity==="important").length,accent:t.issues.some(d=>d.severity==="important")})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Tähtsus",o.jsxs("select",{value:l,onChange:d=>c(d.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:"Kõik"}),o.jsx("option",{value:"important",children:"important"}),o.jsx("option",{value:"warning",children:"warning"})]})]}),o.jsxs("span",{className:"text-[10px] text-ink/50 mt-4",children:["Kontrollitud: ",new Date(t.checkedAt).toLocaleString("et-EE",{timeZone:"Europe/Tallinn"})]})]}),f.length===0?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Probleeme ei leitud. 🎉"}):o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Leht"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Probleem"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Võti"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Praegune"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Keel"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tähtsus"})]})}),o.jsx("tbody",{children:f.map((d,p)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:p%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:d.page}),o.jsx("td",{className:"px-2.5 py-1.5",children:d.issueType}),o.jsx("td",{className:"px-2.5 py-1.5 font-mono text-[11px]",children:d.keyPath}),o.jsx("td",{className:"px-2.5 py-1.5 max-w-[32ch] truncate",title:d.currentValue,children:d.currentValue}),o.jsx("td",{className:"px-2.5 py-1.5 uppercase",children:d.expectedLanguage}),o.jsx("td",{className:"px-2.5 py-1.5",children:o.jsx("span",{className:d.severity==="important"?"bg-red-700/10 text-red-800 px-1.5 py-0.5":"bg-amber-700/10 text-amber-800 px-1.5 py-0.5",children:d.severity})})]},p))})]})})]}):o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:'Vajuta "Run translation check" et alustada.'})]})}function D$(){const e=pe(mw),[t,r]=_.useState("https://ykus-studio-landing.lovable.app"),[n,a]=_.useState(null),[i,s]=_.useState(!1),[l,c]=_.useState(null),[u,f]=_.useState(null),d=async()=>{s(!0),c(null);try{const p=await e({data:{baseUrl:t}});a(p)}catch(p){c(p instanceof Error?p.message:"Check failed")}finally{s(!1)}};return o.jsxs(_e,{title:"SEO / social preview checker",description:"Käivitub ainult nupule vajutamisel. Kontrollib fikseeritud avalike marsruutide meta-andmeid.",headerAction:o.jsx("button",{onClick:d,disabled:i,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:i?"Kontrollin…":"Run SEO check"}),children:[o.jsx("div",{className:"flex flex-wrap gap-2 items-end",children:o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60 flex-1 min-w-[16rem]",children:["Base URL",o.jsx("input",{type:"url",value:t,onChange:p=>r(p.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink font-mono"})]})}),o.jsx("p",{className:"text-[10px] text-ink/50",children:"This checks page metadata and social preview basics. WhatsApp/Facebook may cache old previews."}),l&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:l}),n?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Lehti",value:n.results.length}),o.jsx(ke,{label:"Hoiatusi",value:n.results.reduce((p,m)=>p+m.warnings.length,0),accent:!0}),o.jsx(ke,{label:"HTTP 4xx/5xx",value:n.results.filter(p=>p.status>=400).length})]}),o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Marsruut"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Status"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tiitel"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"OG image"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Hoiatused"}),o.jsx("th",{className:"px-2.5 py-1.5 text-[10px] uppercase tracking-wider font-medium"})]})}),o.jsx("tbody",{children:n.results.map((p,m)=>{const v=p.warnings.length===0?"OK":p.status>=400?"Error":p.warnings.some(h=>h.startsWith("Missing"))?"Missing":"Warning",y=v==="OK"?"bg-emerald-700/10 text-emerald-800":v==="Error"?"bg-red-700/10 text-red-800":"bg-amber-700/10 text-amber-800";return o.jsxs(_.Fragment,{children:[o.jsxs("tr",{className:"border-b border-ink/10 align-top",style:{backgroundColor:m%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2.5 py-1.5 font-mono",children:p.route}),o.jsxs("td",{className:"px-2.5 py-1.5",children:[o.jsx("span",{className:`${y} px-1.5 py-0.5`,children:v}),o.jsx("span",{className:"ml-1 font-mono text-ink/60",children:p.status||"—"})]}),o.jsx("td",{className:"px-2.5 py-1.5 max-w-[24ch] truncate",title:p.title??"not available",children:p.title??o.jsx("span",{className:"italic text-ink/40",children:"not available"})}),o.jsx("td",{className:"px-2.5 py-1.5 max-w-[18ch] truncate",title:p.ogImage??"n
82ot available",children:p.ogImage?"✓":o.jsx("span",{className:"italic text-ink/40",children:"not available"})}),o.jsx("td",{className:"px-2.5 py-1.5 text-[11px]",children:p.warnings.length===0?"—":p.warnings.join(", ")}),o.jsx("td",{className:"px-2.5 py-1.5",children:o.jsx("button",{onClick:()=>f(u===p.route?null:p.route),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-1.5 py-0.5",children:u===p.route?"Peida":"Detailid"})})]}),u===p.route&&o.jsx("tr",{style:{backgroundColor:"var(--paper-deep)"},children:o.jsx("td",{colSpan:6,className:"px-2.5 py-2",children:o.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all font-mono",children:JSON.stringify({description:p.description,canonical:p.canonical,ogTitle:p.ogTitle,ogDescription:p.ogDescription,ogImage:p.ogImage,ogType:p.ogType,twitterCard:p.twitterCard,twitterTitle:p.twitterTitle,twitterDescription:p.twitterDescription,twitterImage:p.twitterImage,hreflang:p.hreflang,fetchedUrl:p.fetchedUrl,redirected:p.redirected},null,2)})})})]},p.route)})})]})}),o.jsxs("p",{className:"text-[10px] text-ink/50",children:["Kontrollitud: ",new Date(n.checkedAt).toLocaleString("et-EE",{timeZone:"Europe/Tallinn"})," · ",n.baseUrl]})]}):o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:'Vajuta "Run SEO check" et alustada.'})]})}const Kx=["Website","Booking","SEO","Translation","Season Mode","Admin","Other"];function L$(){const[e,t]=_.useState([]),[r,n]=_.useState(!1),[a,i]=_.useState(null),[s,l]=_.useState(!1),[c,u]=_.useState(""),[f,d]=_.useState(""),[p,m]=_.useState("Website"),[v,y]=_.useState(null),[h,w]=_.useState(""),[j,x]=_.useState(""),[k,g]=_.useState("Website"),b=async()=>{n(!0),i(null);const{data:N,error:A}=await ie.from("admin_changelog").select("*").order("created_at",{ascending:!1}).limit(200);A?i(A.message):t(N??[]),n(!1)};_.useEffect(()=>{b()},[]);const S=async()=>{if(!c.trim())return;const{data:{user:N}}=await ie.auth.getUser();if(!N){i("Pole sisse logitud.");return}const{error:A}=await ie.from("admin_changelog").insert({title:c.trim(),body:f.trim()||null,category:p,created_by:N.id,created_by_email:N.email??null});if(A){i(A.message);return}u(""),d(""),m("Website"),l(!1),b()},O=N=>{y(N.id),w(N.title),x(N.body??""),g(N.category??"Website")},E=async()=>{if(!v)return;const{error:N}=await ie.from("admin_changelog").update({title:h.trim(),body:j.trim()||null,category:k}).eq("id",v);if(N){i(N.message);return}y(null),b()},T=async N=>{if(!confirm("Kustutada see kirje?"))return;const{error:A}=await ie.from("admin_changelog").delete().eq("id",N);if(A){i(A.message);return}t(C=>C.filter(I=>I.id!==N))};return o.jsxs(_e,{title:"Admin notes / changelog",description:"Sisemine logi admin tegevuste ja muudatuste jaoks. Pole avalik.",headerAction:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:b,disabled:r,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 disabled:opacity-50",children:r?"Laen…":"Värskenda"}),o.jsx("button",{onClick:()=>l(N=>!N),className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5",children:s?"Sulge":"+ Uus kirje"})]}),children:[a&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:a}),s&&o.jsxs("div",{className:"border border-ink/20 p-2.5 space-y-1.5",style:{backgroundColor:"var(--paper-deep)"},children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{value:c,onChange:N=>u(N.target.value),placeholder:"Pealkiri",className:"flex-1 border border-ink/30 bg-paper px-2 py-1 text-[13px]"}),o.jsx("select",{value:p,onChange:N=>m(N.target.value),className:"border border-ink/30 bg-paper px-2 py-1 text-[12px]",children:Kx.map(N=>o.jsx("option",{value:N,children:N},N))})]}),o.jsx("textarea",{value:f,onChange:N=>d(N.target.value),placeholder:"Sisu (valikuline)",rows:3,className:"w-full border border-ink/30 bg-paper px-2 py-1 text-[13px]"}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{onClick:()=>l(!1),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"}),o.jsx("button",{onClick:S,disabled:!c.trim(),className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:"Salvesta"})]})]}),e.length===0&&!r?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Kirjeid pole."}):o.jsx("ul",{className:"space-y-1.5",children:e.map(N=>o.jsx("li",{className:"border border-ink/15 p-2.5",style:{backgroundColor:"var(--paper)"},children:v===N.id?o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{value:h,onChange:A=>w(A.target.value),className:"flex-1 border border-ink/30 bg-paper px-2 py-1 text-[13px]"}),o.jsx("select",{value:k,onChange:A=>g(A.target.value),className:"border border-ink/30 bg-paper px-2 py-1 text-[12px]",children:Kx.map(A=>o.jsx("option",{value:A,children:A},A))})]}),o.jsx("textarea",{value:j,onChange:A=>x(A.target.value),rows:3,className:"w-full border border-ink/30 bg-paper px-2 py-1 text-[13px]"}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{onClick:()=>y(null),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"}),o.jsx("button",{onClick:E,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5",children:"Salvesta"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[o.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[o.jsx("span",{className:"text-[13px] font-medium",children:N.title}),N.category&&o.jsx("span",{className:"text-[10px] uppercase tracking-wider bg-ink/10 px-1.5 py-0.5",children:N.category})]}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx("button",{onClick:()=>O(N),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-1.5 py-0.5",children:"Muuda"}),o.jsx("button",{onClick:()=>T(N.id),className:"border border-red-800/30 text-red-800 text-[10px] uppercase tracking-wider px-1.5 py-0.5",children:"Kustuta"})]})]}),N.body&&o.jsx("p",{className:"text-[12px] text-ink/80 whitespace-pre-wrap mt-1",children:N.body}),o.jsxs("p",{className:"text-[10px] text-ink/50 mt-1 font-mono",children:[new Date(N.created_at).toLocaleStr
82ing("et-EE",{timeZone:"Europe/Tallinn"}),N.created_by_email&&o.jsxs(o.Fragment,{children:[" · ",N.created_by_email]})]})]})},N.id))})]})}function q$(){const e=pe(lw),t=Object.keys(or),[r,n]=_.useState(t[0]),[a,i]=_.useState(!1),[s,l]=_.useState(null),[c,u]=_.useState(null),[f,d]=_.useState(null),[p,m]=_.useState(!1),v=or[r],y=async()=>{m(!0),i(!0),u(null),d(null),l(null),console.log("[admin] BookingFieldsInspector click fired",{username:v.username,eventTypeSlug:v.eventTypeSlug});try{const h=await e({data:{username:v.username,eventTypeSlug:v.eventTypeSlug}});console.log("[admin] BookingFieldsInspector server response",h),h==null?u("Server function returned no value (undefined). Likely admin auth rejected the call."):l(h)}catch(h){console.error("[admin] BookingFieldsInspector threw",h),u(h?.message??String(h)),d(JSON.stringify({name:h?.name,message:h?.message??String(h),status:h?.status,response:h?.response,stack:h?.stack?.split(`
83`).slice(0,6)},null,2))}finally{i(!1)}};return o.jsxs(_e,{title:"Cal.com booking fields inspector",description:"Loeb Cal.com event type'i booking-välju. Diagnostiline, ei loo broneeringut.",headerAction:o.jsx("button",{type:"button",onClick:y,disabled:a,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:a?"Loen…":"Loe booking fields"}),children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[o.jsx("label",{className:"text-[11px] uppercase tracking-wider text-ink/60",children:"Event type"}),o.jsx("select",{value:r,onChange:h=>n(h.target.value),className:"border border-ink/20 bg-paper text-[12px] px-2 py-1",children:t.map(h=>o.jsxs("option",{value:h,children:[or[h].label," — ",or[h].eventTypeSlug]},h))})]}),p&&o.jsxs("div",{className:"border border-ink/20 bg-paper-deep px-3 py-2 mb-2 text-[11px] font-mono space-y-0.5",children:[o.jsxs("div",{children:["Client click fired: ",o.jsx("strong",{children:p?"yes":"no"})]}),o.jsxs("div",{children:["Function called: ",o.jsx("strong",{children:"inspectEventTypeBookingFields"})]}),o.jsxs("div",{children:["Selected slug sent: ",o.jsx("strong",{children:v.eventTypeSlug})]}),o.jsxs("div",{children:["Username sent: ",o.jsx("strong",{children:v.username})]}),o.jsxs("div",{children:["Loading: ",o.jsx("strong",{children:a?"yes":"no"})]}),o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:s?.reachedServer===!0?"yes":"no"})]}),o.jsxs("div",{children:["Server stage: ",o.jsx("strong",{children:s?.stage??"—"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:s?.adminCheckPassed===!0?"yes":s?.adminCheckPassed===!1?"no":"—"})]}),o.jsxs("div",{children:["Slug received by server: ",o.jsx("strong",{children:s?.receivedSlug??"—"})]}),o.jsxs("div",{children:["HTTP status: ",o.jsx("strong",{children:s?.httpStatus??"—"})]}),o.jsxs("div",{children:["Error: ",o.jsx("strong",{children:c??s?.error??"—"})]})]}),p&&(s||f)&&o.jsx("pre",{className:"text-[10px] bg-paper-deep border border-ink/15 p-2 overflow-auto max-h-72 mb-2",children:f?`[CAUGHT ERROR]
84${f}`:`[RAW SERVER VALUE]
85${JSON.stringify(s,null,2)}`}),c&&o.jsxs("div",{className:"border border-red-300 bg-red-50 px-3 py-2 mb-2",children:[o.jsx("p",{className:"text-[12px] font-medium text-red-800",children:"Päring ebaõnnestus"}),o.jsx("p",{className:"text-[11px] text-red-700/80 mt-1 font-mono break-all",children:c})]}),s&&o.jsxs("div",{className:"border border-ink/15 p-3 space-y-3",style:{background:"var(--paper)"},children:[o.jsxs("div",{className:"text-[12px] space-y-1",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Reached server?"})," ",o.jsx("code",{children:s.reachedServer?"yes":"no"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Stage:"})," ",o.jsx("code",{children:s.stage??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Summary:"})," ",s.summary??"—"]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Selected slug (received by server):"})," ",o.jsx("code",{children:s.receivedSlug??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Cal.com username:"})," ",o.jsx("code",{children:s.username??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Request URL:"})," ",o.jsx("code",{className:"break-all",children:s.requestUrl??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"HTTP status:"})," ",o.jsx("code",{children:s.httpStatus??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Slug matched in Cal.com list?"})," ",o.jsx("code",{children:s.matchedSlug?"yes":"no"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Event type ID:"})," ",o.jsx("code",{children:s.eventTypeId??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Event title:"})," ",o.jsx("code",{children:s.eventTitle??"—"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Field count:"})," ",o.jsx("code",{children:s.fieldCount??0})]}),o.jsxs("div",{children:[o.jsx("strong",{children:'"Additional notes" leitud?'})," ",o.jsx("code",{children:s.hasAdditionalNotes?"yes":"no"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Soovitatud võti bookingFieldsResponses jaoks:"})," ",o.jsx("code",{style:{background:"#fff3bf",padding:"1px 4px"},children:s.suggestedBookingFieldsResponsesKey??"—"})]}),s.error&&o.jsxs("div",{style:{color:"#b91c1c"},children:[o.jsx("strong",{children:"Error:"})," ",s.error]})]}),Array.isArray(s.availableEventTypes)&&s.availableEventTypes.length>0&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-[10px] uppercase tracking-wider font-medium mb-1.5 text-ink/60",children:["Cal.com event types tagastatud (",s.availableEventTypes.length,")"]}),o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"id"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"slug"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"title"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"bookingFields"})]})}),o.jsx("tbody",{children:s.availableEventTypes.map((h,w)=>{const j=h.slug===s.receivedSlug;return o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:j?"#fff3bf":w%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2 py-1 font-mono",children:h.id??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.slug??"—"}),o.jsx("td",{className:"px-2 py-1",children:h.title??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.bookingFieldsCount??"—"})]},w)})})]})})]}),Array.isArray(s.fields)&&s.fields.length>0&&o.jsxs("div",{children:[o.jsx("h3",{className:"text-[10px] uppercase tracking-wider font-medium mb-1.5 text-ink/60",children:"Booking fields valitud event type'i jaoks"}),o.jsx("div",{className:"border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px]",children:[o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"name"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"slug"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"identifier"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"id"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"type"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"label"}),o.jsx("th",{className:"px-2 py-1 text-[10px] uppercase tracking-wider font-medium",children:"required"})]})}),o.jsx("tbody",{children:s.fields.map((h,w)=>o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:w%2===0?"var(--paper)":"var(--paper-deep)"},children:[o.jsx("td",{className:"px-2 py-1 font-mono",children:h.name??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.slug??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.identifier??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.id??"—"}),o.jsx("td",{className:"px-2 py-1 font-mono",children:h.type??"—"}),o.jsx("td",{className:"px-2 py-1",children:typeof h.label=="string"?h.label:"—"}),o.jsx("td",{className:"px-2 py-1",children:h.required===!0?"yes":h.required===!1?"no":"—"})]},w))})]})})]}),o.jsxs("details",{className:"text-[11px]",children:[o.jsx("summary",{className:"cursor-pointer text-ink/60 uppercase tracking-wider",children:"Raw Cal.com response"}),o.jsx("pre",{className:"mt-2 p-2 bg-ink text-paper overflow-auto max-h-80 text-[10px]",children:JSON.stringify(s.rawSample,null,2)})]})]})]})}function B$(){const e=pe(cw),[t,r]=_.useState(!1),[n,a]=_.useState(null),[i,s]=_.useState(null),l=async()=>{r(!0),s(null),a(null);try{const c=await e();a(c)}catch(c){s(c?.message??String(c))}finally{r(!1)}};return o.jsxs(_e,{title:"Booking debug DB test",description:"Backend-only kontroll: kas booking_debug_logs tabelisse saab kirjutada j
85a viimast rida lugeda.",headerAction:o.jsx("button",{type:"button",onClick:l,disabled:t,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:t?"Testin…":"Booking debug DB test"}),children:[i&&o.jsx("div",{className:"border border-red-300 bg-red-50 px-3 py-2 mb-2",children:o.jsx("p",{className:"text-[11px] text-red-700/80 font-mono break-all",children:i})}),n&&o.jsxs("div",{className:"border border-ink/15 p-3 space-y-1 text-[12px]",style:{background:"var(--paper)"},children:[o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:n.reachedServer?"yes":"no"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:n.adminCheckPassed?"yes":"no"})]}),o.jsxs("div",{children:["table booking_debug_logs exists: ",o.jsx("strong",{children:n.tableExists?"yes":"no"})]}),o.jsxs("div",{children:["insert client source used: ",o.jsx("strong",{className:"font-mono break-all",children:n.insertClientSourceUsed??"null"})]}),o.jsxs("div",{children:["can insert test row: ",o.jsx("strong",{children:n.canInsertTestRow?"yes":"no"})]}),o.jsxs("div",{children:["insert error if any: ",o.jsx("strong",{className:"font-mono break-all",children:n.insertError??"null"})]}),o.jsxs("div",{children:["inserted row id: ",o.jsx("code",{children:n.insertedRowId??"null"})]}),o.jsxs("div",{children:["read client source used: ",o.jsx("strong",{className:"font-mono break-all",children:n.readClientSourceUsed??"null"})]}),o.jsxs("div",{children:["can read latest row: ",o.jsx("strong",{children:n.canReadLatestRow?"yes":"no"})]}),o.jsxs("div",{children:["read error if any: ",o.jsx("strong",{className:"font-mono break-all",children:n.readError??"null"})]}),o.jsxs("div",{children:["latest row id: ",o.jsx("code",{children:n.latestRowId??"null"})]}),o.jsxs("div",{children:["latest row created_at: ",o.jsx("code",{children:n.latestRowCreatedAt??"null"})]}),o.jsxs("details",{className:"text-[11px] pt-2",children:[o.jsx("summary",{className:"cursor-pointer text-ink/60 uppercase tracking-wider",children:"Raw DB test result"}),o.jsx("pre",{className:"mt-2 p-2 bg-ink text-paper overflow-auto max-h-80 text-[10px]",children:JSON.stringify(n,null,2)})]})]})]})}function F$(){const e=pe(uw),[t,r]=_.useState(!1),[n,a]=_.useState(null),[i,s]=_.useState(null),l=async()=>{r(!0),s(null),a(null);try{const u=await e();a(u)}catch(u){s(u?.message??String(u))}finally{r(!1)}},c=n?.latestRow??n?.snapshot??null;return o.jsxs(_e,{title:"Last booking debug (Sõnum → Cal.com notes)",description:"Näitab viimase broneeringu päringu sisu ja Cal.com vastust. Admin-only diagnostika.",headerAction:o.jsx("button",{type:"button",onClick:l,disabled:t,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:t?"Laen…":"Load last booking debug"}),children:[i&&o.jsx("div",{className:"border border-red-300 bg-red-50 px-3 py-2 mb-2",children:o.jsx("p",{className:"text-[11px] text-red-700/80 font-mono break-all",children:i})}),n&&!c&&o.jsxs("div",{className:"text-[12px] border border-ink/15 p-3",style:{background:"var(--paper)"},children:[o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:n.reachedServer?"yes":"no"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:n.adminCheckPassed?"yes":"no"})]}),o.jsxs("div",{children:["Has snapshot: ",o.jsx("strong",{children:n.hasSnapshot?"yes":"no"})]}),o.jsxs("div",{children:["row count found: ",o.jsx("strong",{children:n.rowCount??0})]}),n.dbError&&o.jsxs("div",{style:{color:"#b91c1c"},children:["DB error: ",n.dbError]}),n.error&&o.jsxs("div",{style:{color:"#b91c1c"},children:["Error: ",n.error]}),!n.hasSnapshot&&o.jsx("div",{className:"mt-2 text-ink/60",children:"booking_debug_logs contains 0 rows"})]}),c&&o.jsxs("div",{className:"border border-ink/15 p-3 space-y-3 text-[12px]",style:{background:"var(--paper)"},children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4 gap-y-1 border border-ink/15 p-2 bg-paper-deep",children:[o.jsxs("div",{children:["Has snapshot: ",o.jsx("strong",{children:n.hasSnapshot?"yes":"no"})]}),o.jsxs("div",{children:["row count found: ",o.jsx("strong",{children:n.rowCount??0})]}),o.jsxs("div",{children:["read client source used: ",o.jsx("strong",{className:"font-mono break-all",children:n.readClientSourceUsed??"null"})]}),o.jsxs("div",{children:["latest row created_at: ",o.jsx("code",{children:c.created_at??"null"})]}),o.jsxs("div",{children:["latest row event_slug: ",o.jsx("code",{children:c.event_slug??"null"})]}),o.jsxs("div",{children:["latest row booking_uid: ",o.jsx("code",{children:c.booking_uid??c.cal_booking_uid??"null"})]}),o.jsxs("div",{children:["debug_source: ",o.jsx("strong",{className:"font-mono",children:c.debug_source??"null"})]}),n.dbError&&o.jsxs("div",{className:"md:col-span-2",style:{color:"#b91c1c"},children:["DB error: ",n.dbError]})]}),o.jsxs("div",{className:"border border-ink/15 p-2 bg-paper-deep",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/60 mb-1",children:"Direct booking_debug_logs latest row"}),o.jsxs("div",{children:["booking_message_received: ",o.jsx("strong",{children:c.booking_message_received===!0?"yes":c.booking_message_received===!1?"no":"null"})]}),o.jsxs("div",{children:["booking_message_preview: ",o.jsx("strong",{children:c.booking_message_preview??"null"})]}),o.jsxs("div",{children:["booking_fields_responses_included: ",o.jsx("strong",{children:c.booking_fields_responses_included===!0?"yes":c.booking_fields_responses_included===!1?"no":"null"})]}),o.jsxs("div",{children:["booking_fields_responses_key: ",o.jsx("strong",{children:c.booking_fields_responses_key??"null"})]}),o.jsxs("div",{children:["cal_create_status: ",o.jsx("strong",{children:c.cal_create_status??"null"})]}),o.jsxs("div",{children:["final_success: ",o.jsx("strong",{children:c.final_success===!0?"yes":c.final_success===!1?"no":"null"})]})]}),o.jsxs("div",{className:"border border-ink/15 p-2 bg-paper-deep",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/60 mb-1",children:"Debug insert proof"}),o.jsxs("div",{children:["debugInsertAttempted: ",o.jsx("strong",{children:c.debug_insert_attempted===!0?"yes":c.debug_insert_attempted===!1?"no":"null"})]}),o.jsxs("div",{children:["debugInsertSuccess: ",o.jsx("strong",{children:c.debug_insert_success===!0?"yes":c.debug_insert_success===!1?"no":"null"})]}),o.jsxs("div",{children:["debugInsertError: ",o.jsx("strong",{className:"font-mono break-all",children:c.debug_insert_error??"null"})]}),o.jsxs("div",{children:["retry_attempted: ",o.jsx("strong",{children:c.retry_attempted===!0?"yes":c.retry_attempted===!1?"no":"null"})]}),o.jsxs("div",{children:["retry_status: ",o.jsx("strong",{children:c.retry_status??"null"})]})]}),o.jsxs("div",{className:"border border-ink/15 p-2 bg-paper-deep",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/60 mb-1",children:"Stored Cal.com proof"}),o.jsxs("div",{children:["cal_payload_keys: ",o.jsx("code",{children:Array.isArray(c.cal_payload_keys)?c.cal_payload_keys.join(", "):JSON.stringify(c.cal_payload_keys??[])})]}),o.jsxs("div",{children:["cal_create_response_keys: ",o.jsx("code",{children:Array.isArray(c.cal_create_response_keys)?c.cal_create_response_keys.join(", "):JSON.stringify(c.cal_create_response_keys??[])})]}),o.jsxs("div",{children:["fetched_booking_status: ",o.jsx("strong",{children:c.fetched_booking_status??"null"})]}),o.jsxs("div",{children:["note_found_in_fetched_booking: ",o.jsx("strong",{children:c.note_found_in_fetched_booking??"null"})]}),o.jsxs("div",{children:["note_found_path: ",o.jsx("code",{children:c.note_found_path??"null"})]})]}),o.jsxs("details",{className:"text-[11px]",children:[o.jsx("summary",{className:"cursor-pointer text-ink/60 uppercase tracking-wider",children:"debug row raw JSON"}),o.jsx("pre",{className:"mt-2 p-2 bg-ink text-paper overflow-auto max-h-80 text-[10px]",children:JSON.stringify(c,null,2)})]})]})]})}function U$(){const e=pe(dw),t=pe(fw),[r,n]=_.useState([]),[a,i]=_.useState("kalisteenika"),[s,l]=_.useState("TEST NOTE 12345"),[c,u]=_.useState(""),[f,d]=_.useState(!1),[p,m]=_.useState(!1),[v,y]=_.useState(null),[h,w]=_.useState(null);_.useEffect(()=>{let g=!1;return(async()=>{d(!0);try{const b=await e();!g&&b?.slugs&&(n(b.slugs),b.slugs.length>0&&!b.slugs.find(S=>S.slug===a)&&i(b.slugs[0].slug))}catch(b){g||w(b?.message??String(b))}finally{g||d(!1)}})(),()=>{g=!0}},[]);const j=r.find(g=>g.slug===a),x=c.trim()||j?.trainerEmail||"",k=async()=>{m(!0),w(null),y(null);try{const g=await t({data:{eventSlug:a,testMessage:s,overrideRecipient:c.trim()||void 0}});y(g)}catch(g){w(g?.message??String(g))}finally{m(!1)}};return o.jsxs(_e,{title:"Trainer notification email test (Resend)",description:"Saadab valitud event slugile testi Resend-i kaudu. Kasutab sama mappimist, mis päris broneeringu järel.",headerAction:o.jsx("button",{type:"button",onClick:k,disabled:p||!a,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:p?"Saadan…":"Send test trainer email"}),children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-[12px]",children:[o.jsxs("label",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60",children:"Event slug"}),o.jsxs("select",{value:a,onChange:g=>i(g.target.value),disabled:f,className:"border border-ink/30 px-2 py-1 bg-paper",children:[r.length===0&&o.jsx("option",{value:"",children:f?"Laen…":"—"}),r.map(g=>o.jsxs("option",{value:g.slug,children:[g.slug," → ",g.trainerEmail]},g.slug))]})]}),o.jsxs("label",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60",children:"Resolved trainer email"}),o.jsx("input",{value:x,readOnly:!0,className:"border border-ink/30 px-2 py-1 bg-paper-deep font-mono"})]}),o.jsxs("label",{className:"flex flex-col gap-1 md:col-span-2",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60",children:"Test message (Sõnum)"}),o.jsx("input",{value:s,onChange:g=>l(g.target.value),className:"border border-ink/30 px-2 py-1 bg-paper",placeholder:"TEST NOTE 12345"})]}),o.jsxs("label",{className:"flex flex-col gap-1 md:col-span-2",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-ink/60",children:"Override recipient (optional)"}),o.jsx("input",{value:c,onChange:g=>u(g.target.value),className:"border border-ink/30 px-2 py-1 bg-paper",placeholder:"(leave empty to use mapped trainer email)"})]})]}),h&&o.jsx("div",{className:"border border-red-300 bg-red-50 px-3 py-2 mt-3",children:o.jsx("p",{className:"text-[11px] text-red-700/80 font-mono break-all",children:h})}),v&&o.jsxs("div",{className:"border border-ink/15 p-3 mt-3 space-y-1 text-[12px]",style:{background:"var(--paper)"},children:[o.jsxs("div",{children:["Reached server: ",o.jsx("strong",{children:v.reachedServer?"yes":"no"})]}),o.jsxs("div",{children:["Admin check passed: ",o.jsx("strong",{children:v.adminCheckPassed?"yes":"no"})]}),o.jsxs("div",{children:["Selected slug: ",o.jsx("code",{children:v.slug})]}),o.jsxs("div",{children:["Resolved trainer email: ",o.jsx("strong",{className:"font-mono",children:v.resolvedTrainerEmail??"null"})]}),o.jsxs("div",{children:["Message used: ",o.jsx("strong",{children:v.messageUsed??"-"})]}),o.jsxs("div",{children:["Recipient used: ",o.jsx("strong",{className:"font-mono",children:v.result?.recipient??"null"})]}),o.jsxs("div",{children:["BCC: ",o.jsx("strong",{className:"font-mono",children:v.result?.bcc??"(none)"})]}),o.jsxs("div",{children:["Resend accepted: ",o.jsx("strong",{children:v.result?.resendAccepted?"yes":"no"})]}),o.jsxs("div",{children:["Resend status: ",o.jsx("strong",{children:v.result?.resendStatus??"null"})]}),o.jsxs("div",{children:["Resend message id: ",o.jsx("code",{children:v.result?.resendMessageId??"null"})]}),o.jsxs("div",{children:["Skipped: ",o.jsx("strong",{children:v.result?.skipped?"yes":"no"})]}),v.result?.skippedReason&&o.jsxs("div",{children:["Skip reason: ",o.jsx("strong",{children:v.result.skippedReason})]}),v.result?.error&&o.jsxs("div",{style:{color:"#b91c1c"},children:["Error: ",o.jsx("span",{className:"font-mono break-all",children:v.result.error})]}),o.jsxs("details",{className:"text-[11px] pt-2",children:[o.jsx("summary",{className:"cursor-pointer text-ink/60 uppercase tracking-wider",children:"Raw result"}),o.jsx("pre",{className:"mt-2 p-2 bg-ink text-paper overflow-auto max-h-80 text-[10px]",children:JSON.stringify(v,null,2)})]})]})]})}function K$({children:e}){const[t,r]=_.useState(!1);return o.jsxs("section",{className:"border border-ink/30 bg-paper",children:[o.jsxs("button",{type:"button",onClick:()=>r(n=>!n),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left hover:bg-ink/5","aria-expanded":t,children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-ink/50 text-[10px] w-3 inline-block",children:t?"▾":"▸"}),o.jsx("span",{className:"text-[12px] uppercase tracking-[0.18em] font-medium",children:"Testid / diagnostika"})]}),o.jsx("span",{className:"text-[10px] text-ink/55 uppercase tracking-wider",children:"Tehnilised tööriistad"})]}),t&&o.jsx("div",{className:"px-2 sm:px-3 pb-3 pt-2 border-t border-ink/15 space-y-3",children:e})]})}const Tr="Personaaltreening%";function yn(e){const r=((e??"").split(`
86`)[0]??"").match(/^Personaaltreening\s+([A-Za-zÕÄÖÜõäöü]+)ga\b/i);return r?r[1]:"Üldine"}function H$(){const[e,t]=_.useState([]),[r,n]=_.useState(null),[a,i]=_.useState(!1),[s,l]=_.useState(!1),[c,u]=_.useState(!1),[f,d]=_.useState(null),[p,m]=_.useState(null),[v,y]=_.useState(Ye),[h,w]=_.useState(null),[j,x]=_.useState(null),[k,g]=_.useState(""),[b,S]=_.useState(""),[O,E]=_.useState(""),[T,N]=_.useState(""),[A,C]=_.useState(""),I=async()=>{i(!0),d(null);const{data:H,error:ae,count:K}=await ie.from("contact_submissions").select("id, created_at, name, email, phone, question, status, locale",{count:"exact"}).ilike("question",Tr).order("created_at",{ascending:!1}).limit(200);ae?d(ae.message):(t(H??[]),n(K??null)),i(!1)},P=async()=>{const{data:H,error:ae}=await ie.from("admin_export_log").select("exported_until, created_at").eq("export_type","personal_training_requests_new").order("created_at",{ascending:!1}).limit(1).maybeSingle();if(!ae){w(H??null);let K=ie.from("contact_submissions").select("id",{count:"exact",head:!0}).ilike("question",Tr);H?.exported_until&&(K=K.gt("created_at",H.exported_until));const{count:z}=await K;x(z??0)}};_.useEffect(()=>{I(),P()},[]);const L=_.useMemo(()=>{const H=new Set;for(const ae of e)H.add(yn(ae.question));return Array.from(H).sort()},[e]),D=_.useMemo(()=>{const H=b.trim().toLowerCase();return e.filter(ae=>{if(k&&yn(ae.question)!==k||H&&!`${ae.email} ${ae.name??""} ${ae.phone??""}`.toLowerCase().includes(H))return!1;const K=ae.created_at.slice(0,10);return!(O&&K<O||T&&K>T||A&&(ae.status??"new")!==A)})},[e,k,b,O,T,A]),R=D.slice(0,v),F=D.length>v;async function V(H){let K=0;const z=[];for(;;){let B=ie.from("contact_submissions").select("id, created_at, name, email, phone, question, status, locale").ilike("question",Tr).order("created_at",{ascending:!1}).range(K,K+1e3-1);H&&(B=B.gt("created_at",H));const{data:X,error:J}=await B;if(J)return d(J.message),null;const U=X??[];if(z.push(...U),U.length<1e3)break;K+=1e3}return z}function Z(H){const K=[["Nimi","Email","Telefon","Treener","Tüüp","Sõnum","Loodud","Staatus"].map(fe).join(";")];for(const z of H)K.push([fe(z.name),fe(z.email),fe(z.phone),fe(yn(z.question)),fe("Personaaltreening"),fe(z.question),fe(Ce(z.created_at)),fe(z.status??"new")].join(";"));return"\uFEFF"+K.join(`\r
87`)+`\r
88`}function W(H,ae){const K=new Blob([H],{type:"text/csv;charset=utf-8;"}),z=URL.createObjectURL(K),B=document.createElement("a");B.href=z,B.download=ae,document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(z)}const re=async()=>
88{l(!0),d(null);const H=await V();if(!H){l(!1);return}W(Z(H),`personal-training-requests-all-${new Date().toISOString().slice(0,10)}.csv`),l(!1)},ce=async()=>{u(!0),d(null);const H=h?.exported_until??null,ae=await V(H);if(!ae){u(!1);return}if(W(Z(ae),`personal-training-requests-new-${new Date().toISOString().slice(0,10)}.csv`),ae.length>0){const K=ae[0].created_at,{error:z}=await ie.from("admin_export_log").insert({export_type:"personal_training_requests_new",exported_until:K,row_count:ae.length});z?d(z.message):await P()}u(!1)};return o.jsxs(_e,{title:"Personaaltreeningu päringud",description:"Personaaltreeneri broneerimisvormi sissetulnud päringud.",headerAction:o.jsxs("div",{className:"flex flex-col gap-2 items-stretch md:items-end",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:flex-wrap items-stretch md:items-center gap-2 md:justify-end",children:[o.jsx("button",{onClick:re,disabled:s,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:s?"Ekspordin…":"Lae alla kõik personaaltreeningu päringud"}),o.jsx("button",{onClick:ce,disabled:c,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50 w-full md:w-auto",children:c?"Ekspordin…":"Lae alla uued pärast viimast eksporti"}),o.jsx("button",{onClick:I,disabled:a,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1.5 disabled:opacity-50 w-full md:w-auto",children:a?"Laen…":"Värskenda"})]}),o.jsxs("div",{className:"text-[10px] text-ink/55 text-left md:text-right leading-snug",children:[h?.created_at?o.jsxs(o.Fragment,{children:["Viimane uute personaaltreeningu päringute eksport: ",Ce(h.created_at)]}):o.jsx(o.Fragment,{children:"Uute personaaltreeningu päringute eksporti pole veel tehtud."}),j!=null&&o.jsxs(o.Fragment,{children:[" · Uusi pärast viimast eksporti: ",j]})]})]}),children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:[o.jsx(ke,{label:"Kokku",value:r??0}),o.jsx(ke,{label:"Filtreeritud",value:D.length})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Treener",o.jsxs("select",{value:k,onChange:H=>g(H.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:"Kõik"}),L.map(H=>o.jsx("option",{value:H,children:H},H))]})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60 min-w-[180px]",children:["Email / nimi / telefon",o.jsx("input",{type:"text",value:b,onChange:H=>S(H.target.value),placeholder:"otsi…",className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Alates",o.jsx("input",{type:"date",value:O,onChange:H=>E(H.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Kuni",o.jsx("input",{type:"date",value:T,onChange:H=>N(H.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink"})]}),o.jsxs("label",{className:"flex flex-col text-[10px] uppercase tracking-wider text-ink/60",children:["Staatus",o.jsxs("select",{value:A,onChange:H=>C(H.target.value),className:"mt-1 border border-ink/30 bg-paper px-2 py-1 text-[12px] normal-case tracking-normal text-ink",children:[o.jsx("option",{value:"",children:"Kõik"}),o.jsx("option",{value:"new",children:"new"}),o.jsx("option",{value:"contacted",children:"contacted"}),o.jsx("option",{value:"done",children:"done"})]})]}),(k||b||O||T||A)&&o.jsx("button",{type:"button",onClick:()=>{g(""),S(""),E(""),N(""),C("")},className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1",children:"Tühista"})]}),f&&o.jsx("p",{className:"text-[13px] text-red-800 bg-red-700/10 px-2.5 py-1.5",children:f}),R.length===0&&!a?o.jsx("p",{className:"text-[13px] text-ink/60 italic",children:"Päringuid pole."}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"hidden md:block border border-ink/15 overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left text-[12px] table-fixed min-w-[1100px]",children:[o.jsxs("colgroup",{children:[o.jsx("col",{style:{width:"18%"}}),o.jsx("col",{style:{width:"11%"}}),o.jsx("col",{style:{width:"11%"}}),o.jsx("col",{style:{width:"9%"}}),o.jsx("col",{style:{width:"13%"}}),o.jsx("col",{style:{width:"13%"}}),o.jsx("col",{style:{width:"10%"}}),o.jsx("col",{style:{width:"7%"}})]}),o.jsx("thead",{className:"bg-ink text-paper",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Email"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Nimi"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Telefon"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Treener"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Tüüp"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium whitespace-nowrap",children:"Loodud"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Staatus"}),o.jsx("th",{className:"px-2 py-1.5 text-[10px] uppercase tracking-wider font-medium",children:"Sõnum"})]})}),o.jsx("tbody",{children:R.map((H,ae)=>{const K=!!(H.question&&H.question.trim()),z=p===H.id,B=ae%2===0?"var(--paper)":"var(--paper-deep)";return o.jsxs(_.Fragment,{children:[o.jsxs("tr",{className:"border-b border-ink/10",style:{backgroundColor:B},children:[o.jsx("td",{className:"px-2 py-1.5 font-mono truncate",title:H.email,children:H.email}),o.jsx("td",{className:"px-2 py-1.5 truncate",title:H.name,children:H.name}),o.jsx("td",{className:"px-2 py-1.5 font-mono truncate",children:H.phone??o.jsx("span",{className:"text-ink/40",children:"—"})}),o.jsx("td",{className:"px-2 py-1.5 truncate",children:yn(H.question)}),o.jsx("td",{className:"px-2 py-1.5 truncate",children:"Personaaltreening"}),o.jsx("td",{className:"px-2 py-1.5 whitespace-nowrap",children:Ce(H.created_at)}),o.jsx("td",{className:"px-2 py-1.5 truncate",children:H.status??"new"}),o.jsx("td",{className:"px-2 py-1.5",children:K?o.jsx("button",{type:"button",onClick:()=>m(z?null:H.id),className:"text-sienna underline underline-offset-2 hover:no-underline text-[12px]","aria-expanded":z,children:z?"
88Sulge":"Jah"}):o.jsx("span",{className:"text-ink/40",children:"Ei"})})]}),z&&K&&o.jsx("tr",{style:{backgroundColor:B},children:o.jsxs("td",{colSpan:8,className:"px-3 py-2 border-b border-ink/10",children:[o.jsx("div",{className:"text-ink/55 uppercase text-[10px] tracking-wider mb-1",children:"Sõnum / vormi sisu"}),o.jsx("div",{className:"whitespace-pre-wrap break-words text-[12px] text-ink bg-paper border border-ink/15 p-2.5",children:H.question}),o.jsx("div",{className:"mt-2 flex justify-end",children:o.jsx("button",{type:"button",onClick:()=>m(null),className:"border border-ink/30 text-[10px] uppercase tracking-wider px-2 py-0.5",children:"Sulge"})})]})})]},H.id)})})]})}),o.jsx("ul",{className:"md:hidden border border-ink/15 divide-y divide-ink/10",children:R.map((H,ae)=>{const K=!!(H.question&&H.question.trim()),z=p===H.id,B=ae%2===0?"var(--paper)":"var(--paper-deep)";return o.jsxs("li",{style:{backgroundColor:B},className:"px-2.5 py-2 text-[12px] space-y-0.5",children:[o.jsx(Le,{label:"Email",value:o.jsx("span",{className:"font-mono break-all",children:H.email})}),o.jsx(Le,{label:"Nimi",value:H.name}),o.jsx(Le,{label:"Telefon",value:H.phone??"—"}),o.jsx(Le,{label:"Treener",value:yn(H.question)}),o.jsx(Le,{label:"Loodud",value:Ce(H.created_at)}),o.jsx(Le,{label:"Staatus",value:H.status??"new"}),o.jsxs("div",{className:"flex items-baseline gap-1.5",children:[o.jsx("span",{className:"text-ink/55 uppercase text-[10px] tracking-wider w-[68px] shrink-0",children:"Sõnum"}),K?o.jsx("button",{type:"button",onClick:()=>m(z?null:H.id),className:"text-sienna underline underline-offset-2 text-[12px]",children:z?"Sulge":"Jah"}):o.jsx("span",{className:"text-ink/40",children:"Ei"})]}),z&&K&&o.jsx("div",{className:"mt-1.5 whitespace-pre-wrap break-words text-[12px] text-ink bg-paper border border-ink/15 p-2",children:H.question})]},H.id)})}),o.jsx("div",{className:"flex items-center justify-center pt-1",children:F?o.jsxs("button",{type:"button",onClick:()=>y(H=>H+Ye),className:"border border-ink/30 text-[11px] uppercase tracking-wider px-3 py-1.5 hover:bg-ink hover:text-paper transition-colors",children:["Näita veel ",Ye]}):e.length>Ye&&o.jsx("p",{className:"text-[11px] text-ink/55 italic",children:"Kõik kirjed on kuvatud."})})]})]})}function ku(e){if(!e)return"unknown error";if(e instanceof Response)return`HTTP ${e.status} ${e.statusText||""}`.trim();if(e instanceof Error&&e.message)return e.message;try{if(typeof e=="object"){const t=e;return t.message?String(t.message):t.status?`HTTP ${t.status}`:JSON.stringify(t).slice(0,400)}}catch{}return String(e)}function _u(e){return!e||typeof e!="object"||e.diagnostics||e.debug||"ok"in e||"row_found"in e?e:e.result&&typeof e.result=="object"?e.result:e.data&&typeof e.data=="object"?e.data:e.value&&typeof e.value=="object"?e.value:e}function W$(){const e=pe(_w),t=pe(Sw),r=pe(Ow),[n,a]=_.useState(null),[i,s]=_.useState(!1),[l,c]=_.useState(!1),[u,f]=_.useState(!1),[d,p]=_.useState(null),[m,v]=_.useState(!1),[y,h]=_.useState(!1),[w,j]=_.useState(!1),[x,k]=_.useState(null),[g,b]=_.useState(null),S=async()=>{s(!0),p(null),v(!0),console.log("[SupabaseHealthSection] calling adminGetSupabaseHealth");try{const D=await e();console.log("[SupabaseHealthSection] adminGetSupabaseHealth result:",D);const R=_u(D);a(R),R&&R.ok===!1&&R.error&&p(R.error)}catch(D){const R=ku(D);console.error("[SupabaseHealthSection] getHealth threw:",R,D),p(R)}finally{s(!1)}};_.useEffect(()=>{S()},[]);const O=async()=>{c(!0),p(null),h(!0),console.log("[SupabaseHealthSection] calling adminRunSupabaseHeartbeat");try{const D=await t();console.log("[SupabaseHealthSection] heartbeat result:",D);const R=_u(D);k(R),R&&R.ok===!1&&R.error&&p(R.error),await S()}catch(D){const R=ku(D);console.error("[SupabaseHealthSection] runHeartbeat threw:",R,D),p(R)}finally{c(!1)}},E=async()=>{f(!0),p(null),j(!0),console.log("[SupabaseHealthSection] calling adminCreateOrFixSupabaseHealthRow");try{const D=await r();console.log("[SupabaseHealthSection] create/fix result:",D);const R=_u(D);b(R),R&&R.ok===!1&&R.error&&p(R.error),await S()}catch(D){const R=ku(D);console.error("[SupabaseHealthSection] create/fix threw:",R,D),p(R)}finally{f(!1)}},T=n?.ok?n.warning_level??"unknown":"unknown",N=T==="ok"?{label:"OK",cls:"bg-emerald-700/15 text-emerald-800 border-emerald-700/30"}:T==="attention"?{label:"Attention",cls:"bg-amber-500/15 text-amber-800 border-amber-600/40"}:T==="danger"?{label:"Danger",cls:"bg-red-700/15 text-red-800 border-red-700/40"}:{label:"Unknown",cls:"bg-ink/10 text-ink/70 border-ink/20"},A=D=>
88D?new Date(D).toLocaleString("et-EE",{timeZone:"Europe/Tallinn"}):"—",C=n?.diagnostics??n?.debug,I=n&&(n.row_found===!1||n.ok===!1||C?.app_health_query_error||C?.app_health_table_exists===!1||C?.app_health_table_exists==null),P=d||(n?.status_message?n.status_message:n?.ok&&n?.row_found===!1?"app_health table exists, heartbeat row missing":n?.ok?n.message:n&&n.error?n.error:i?"Laen…":"Andmeid pole."),L=d||(n?.error?n.error:C?.app_health_query_error?C.app_health_query_error:C?.app_health_table_exists===!1?"app_health table missing in connected Supabase project":C?.app_health_table_exists===!0&&n?.row_found===!1?"app_health table exists, heartbeat row missing":n&&n.row_found===!1?"Supabase health could not be checked or heartbeat row was not found":null);return o.jsxs(_e,{title:"Supabase status",description:"Heartbeat ja viimase eduka Supabase aktiivsuse jälgimine.",defaultOpen:!0,headerAction:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:S,disabled:i,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 disabled:opacity-50",children:i?"Laen…":"Refresh status"}),o.jsx("button",{onClick:O,disabled:l,className:"bg-sienna text-white text-[11px] uppercase tracking-wider px-3 py-1.5 disabled:opacity-50",children:l?"Käivitan…":"Run heartbeat now"})]}),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:`border px-2 py-0.5 text-[11px] uppercase tracking-wider ${N.cls}`,children:N.label}),o.jsx("span",{className:"text-[13px] text-ink/80",children:P})]}),d&&o.jsxs("div",{className:"border border-red-700/40 bg-red-700/10 px-3 py-2 text-[12px] font-mono break-all text-red-900",children:["ERROR: ",d]}),I&&L&&o.jsxs("div",{className:"border border-red-700/40 bg-red-700/10 px-3 py-2 text-[12px] font-mono break-all text-red-900",children:["WARNING: ",L]}),n?.ok&&n?.row_found&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-[13px]",children:[o.jsxs("div",{className:"border border-ink/15 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/55",children:"Viimane edukas aktiivsus"}),o.jsx("div",{className:"font-mono",children:A(n.last_success_at)})]}),o.jsxs("div",{className:"border border-ink/15 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/55",children:"Viimane heartbeat kontroll"}),o.jsx("div",{className:"font-mono",children:A(n.last_checked_at)})]}),o.jsxs("div",{className:"border border-ink/15 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/55",children:"Aega möödunud edust"}),o.jsx("div",{className:"font-mono",children:n.days_since_success!=null?`${n.days_since_success} päeva (${n.hours_since_success} h)`:"—"})]}),o.jsxs("div",{className:"border border-ink/15 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/55",children:"Heartbeat töötab"}),o.jsx("div",{className:"font-mono",children:n.heartbeat_status==="ok"?"Jah":n.heartbeat_status==="error"?"Ei":"—"})]}),o.jsxs("div",{className:"border border-ink/15 px-3 py-2 md:col-span-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-ink/55",children:"Connected Supabase project"}),o.jsx("div",{className:"font-mono text-[12px] break-all",children:C?.connected_project_ref??"—"})]}),n.last_error&&o.jsxs("div",{className:"border border-red-700/30 bg-red-700/5 px-3 py-2 md:col-span-2",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-red-800",children:"Viimane viga"}),o.jsx("div",{className:"font-mono text-[12px] break-all",children:n.last_error}),o.jsxs("div",{className:"text-[11px] text-ink/55 mt-1",children:["Aeg: ",A(n.last_error_at)]})]}),T==="danger"&&o.jsx("div",{className:"md:col-span-2 border border-red-700/40 bg-red-700/10 px-3 py-2 text-[13px] text-red-900",children:"HOIATUS: Supabase aktiivsus on üle 7 päeva vana või heartbeat ei tööta. Free plaan võib projekti peatada."}),T==="attention"&&o.jsx("div",{className:"md:col-span-2 border border-amber-600/40 bg-amber-500/10 px-3 py-2 text-[13px] text-amber-900",children:"Tähelepanu: Supabase aktiivsus on vananemas. Kontrolli cron seadistust."})]}),o.jsxs("details",{className:"border border-ink/15 bg-ink/[0.02] text-[12px]",children:[o.jsx("summary",{className:"cursor-pointer px-3 py-2 text-[11px] uppercase tracking-wider text-ink/60 select-none",children:"Technical debug"}),o.jsxs("div",{className:"px-3 py-2 font-mono space-y-1",children:[o.jsxs("div",{children:["SUPABASE_URL host: ",C?.supabase_url_host??"unknown"]}),o.jsxs("div",{children:["connected project ref: ",C?.connected_project_ref??"unknown"]}),o.jsxs("div",{children:["expected project ref: ",C?.expected_project_ref??"ckjhmqtdmmbvuybvhxtj"]}),o.jsxs("div",{children:["project ref matches expected: ",C?C.project_ref_matches_expected?"yes":"no":"unknown"]}),o.jsxs("div",{children:["query client used: ",C?.query_client_used??"unknown"]}),o.jsxs("div",{children:["app_health table exists: ",C?C.app_health_table_exists===!0?"yes":C.app_health_table_exists===!1?"no":"unknown":"unknown"]}),o.jsxs("div",{children:["app_health query result count: ",C?.app_health_query_result_count??"unknown"]}),o.jsxs("div",{className:"break-all",children:["app_health query error: ",C?.app_health_query_error??"(none)"]}),o.jsxs("div",{children:["app_health row found: ",n?n.row_found?"yes":"no":"unknown"]}),o.jsxs("div",{children:["called — get: ",m?"yes":"no"," · run: ",y?"yes":"no"," · fix: ",w?"yes":"no"]}),n?.env&&o.jsxs("div",{children:["env — SUPABASE_URL: ",n.env.SUPABASE_URL?"yes":"no"," · ","SERVICE_ROLE_KEY: ",n.env.SUPABASE_SERVICE_ROLE_KEY?"yes":"no"," · ","APP_HEARTBEAT_SECRET: ",n.env.APP_HEARTBEAT_SECRET?"yes":"no"," · ","APP_HEALTH_ALERT_SECRET: ",n.env.APP_HEALTH_ALERT_SECRET?"yes":"no"," · ","RESEND_API_KEY: ",n.env.RESEND_API_KEY?"yes":"no"]}),o.jsxs("div",{className:"break-all",children:["last error: ",d??(n&&n.error)??C?.app_health_query_error??L??"(none)"]}),o.jsxs("div",{className:"pt-2 border-t border-ink/10 flex items-center gap-2",children:[o.jsx("button",{onClick:E,disabled:u,className:"border border-ink/30 text-[11px] uppercase tracking-wider px-2.5 py-1 disabled:opacity-50",children:u?"Parandan…":"Create/fix health row"}),g&&o.jsxs("span",{className:"text-[11px] text-ink/60",children:["last fix: ",g.ok?"ok":"failed"]})]})]})]})]})}export{X$ as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.