anarock-widgets 1.0.289 → 1.0.291

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -27,7 +27,7 @@ Check the top-level render call using <`+le+">.")}return Q}}function be(L,Q){{if
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Qh,ca,KR,ca),u1[ca+Qh]=!0}}return L===r?zR(Wt):hs(Wt),Wt}}function VR(L,Q,le){return d1(L,Q,le,!0)}function HR(L,Q,le){return d1(L,Q,le,!1)}var YR=HR,UR=VR;jl.Fragment=r,jl.jsx=YR,jl.jsxs=UR})()),jl}var h1;function QR(){return h1||(h1=1,process.env.NODE_ENV==="production"?Bu.exports=GR():Bu.exports=XR()),Bu.exports}var g=QR();const Ie=({title:e,icon:t,period:n,children:r,footer:i,className:o="",titleWeight:a,titleColor:s,iconClassName:l,titleClassName:c,childrenClassName:u})=>{const d=a==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] flex flex-col gap-[16px] ${o}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:`flex items-center gap-[8px] ${l}`,children:[t,g.jsx("div",{style:{fontWeight:d,fontSize:"16px",lineHeight:"20px",color:s||"#121212"},className:`!my-0 ${c||"!text-[16px] !leading-[20px]"}`,children:e})]}),n&&g.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:n})]}),g.jsx("div",{className:`flex-1 min-h-0 space-y-[16px] ${u}`,children:r}),i&&g.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 !text-[12px] text-[#64748B]",children:i})]})},m1=e=>e,ZR=()=>{let e=m1;return{configure(t){e=t},generate(t){return e(t)},reset(){e=m1}}},JR=ZR();function Si(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function dn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Si(7));return e.charAt(0).toUpperCase()+e.slice(1)}function g1(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}var Wu={exports:{}},zu={exports:{}},Be={};/** @license React v16.13.1
30
+ <%s key={someKey} {...props} />`,Qh,ca,KR,ca),u1[ca+Qh]=!0}}return L===r?zR(Wt):hs(Wt),Wt}}function VR(L,Q,le){return d1(L,Q,le,!0)}function HR(L,Q,le){return d1(L,Q,le,!1)}var YR=HR,UR=VR;jl.Fragment=r,jl.jsx=YR,jl.jsxs=UR})()),jl}var h1;function QR(){return h1||(h1=1,process.env.NODE_ENV==="production"?Bu.exports=GR():Bu.exports=XR()),Bu.exports}var g=QR();const Ne=({title:e,icon:t,period:n,children:r,footer:i,className:o="",titleWeight:a,titleColor:s,iconClassName:l,titleClassName:c,childrenClassName:u})=>{const d=a==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] flex flex-col gap-[16px] ${o}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:`flex items-center gap-[8px] ${l}`,children:[t,g.jsx("div",{style:{fontWeight:d,fontSize:"16px",lineHeight:"20px",color:s||"#121212"},className:`!my-0 ${c||"!text-[16px] !leading-[20px]"}`,children:e})]}),n&&g.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:n})]}),g.jsx("div",{className:`flex-1 min-h-0 space-y-[16px] ${u}`,children:r}),i&&g.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 !text-[12px] text-[#64748B]",children:i})]})},m1=e=>e,ZR=()=>{let e=m1;return{configure(t){e=t},generate(t){return e(t)},reset(){e=m1}}},JR=ZR();function Si(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function dn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Si(7));return e.charAt(0).toUpperCase()+e.slice(1)}function g1(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}var Wu={exports:{}},zu={exports:{}},Be={};/** @license React v16.13.1
31
31
  * react-is.production.min.js
32
32
  *
33
33
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -66,7 +66,7 @@ Valid keys: `+JSON.stringify(Object.keys(B),null," "));var I=J(oe,K,Z,ee,ie+"."
66
66
  For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Si(18,`(${t})`));return null}const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function pI(e){const t=(o,a)=>o.replace("@media",a?`@container ${a}`:"@container");function n(o,a){o.up=(...s)=>t(e.breakpoints.up(...s),a),o.down=(...s)=>t(e.breakpoints.down(...s),a),o.between=(...s)=>t(e.breakpoints.between(...s),a),o.only=(...s)=>t(e.breakpoints.only(...s),a),o.not=(...s)=>{const l=t(e.breakpoints.not(...s),a);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...e,containerQueries:i}}const Cp={xs:0,sm:600,md:900,lg:1200,xl:1536},T1={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Cp[e]}px)`},hI={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Cp[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function oo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||T1;return t.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(t[l]),a),{})}if(typeof t=="object"){const o=r.breakpoints||T1;return Object.keys(t).reduce((a,s)=>{if(dI(o.keys,s)){const l=fI(r.containerQueries?r:hI,s);l&&(a[l]=n(t[s],s))}else if(Object.keys(o.values||Cp).includes(s)){const l=o.up(s);a[l]=n(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return n(t)}function mI(e={}){return e.keys?.reduce((n,r)=>{const i=e.up(r);return n[i]={},n},{})||{}}function M1(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Pp(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function sf(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Pp(e,n)||r,t&&(i=t(i,r,e)),i}function $t(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,c=Pp(l,r)||{};return oo(a,s,d=>{let f=sf(c,i,d);return d===f&&typeof d=="string"&&(f=sf(c,i,`${t}${d==="default"?"":dn(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes=process.env.NODE_ENV!=="production"?{[t]:ta}:{},o.filterProps=[t],o}function gI(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const vI={m:"margin",p:"padding"},yI={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},N1={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},bI=gI(e=>{if(e.length>2)if(N1[e])e=N1[e];else return[e];const[t,n]=e.split(""),r=vI[t],i=yI[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),kp=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Dp=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],xI=[...kp,...Dp];function ou(e,t,n,r){const i=Pp(e,t,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:(process.env.NODE_ENV!=="production"&&typeof o!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${o}.`),typeof i=="string"?i.startsWith("var(")&&o===0?0:i.startsWith("var(")&&o===1?i:`calc(${o} * ${i})`:i*o):Array.isArray(i)?o=>{if(typeof o=="string")return o;const a=Math.abs(o);process.env.NODE_ENV!=="production"&&(Number.isInteger(a)?a>i.length-1&&console.error([`MUI: The value provided (${a}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${a} > ${i.length-1}, you need to add the missing values.`].join(`
67
67
  `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
68
68
  `)));const s=i[a];return o>=0?s:typeof s=="number"?-s:typeof s=="string"&&s.startsWith("var(")?`calc(-1 * ${s})`:`-${s}`}:typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
69
- `)),()=>{})}function Yy(e){return ou(e,"spacing",8,"spacing")}function au(e,t){return typeof t=="string"||t==null?t:e(t)}function wI(e,t){return n=>e.reduce((r,i)=>(r[i]=au(t,n),r),{})}function _I(e,t,n,r){if(!t.includes(n))return null;const i=bI(n),o=wI(i,r),a=e[n];return oo(e,a,o)}function EP(e,t){const n=Yy(e.theme);return Object.keys(e).map(r=>_I(e,t,r,n)).reduce(vc,{})}function kt(e){return EP(e,kp)}kt.propTypes=process.env.NODE_ENV!=="production"?kp.reduce((e,t)=>(e[t]=ta,e),{}):{};kt.filterProps=kp;function Dt(e){return EP(e,Dp)}Dt.propTypes=process.env.NODE_ENV!=="production"?Dp.reduce((e,t)=>(e[t]=ta,e),{}):{};Dt.filterProps=Dp;process.env.NODE_ENV!=="production"&&xI.reduce((e,t)=>(e[t]=ta,e),{});function Ap(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?vc(i,t[o](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Ar(e){return typeof e!="number"?e:`${e}px solid`}function zr(e,t){return $t({prop:e,themeKey:"borders",transform:t})}const SI=zr("border",Ar),EI=zr("borderTop",Ar),OI=zr("borderRight",Ar),CI=zr("borderBottom",Ar),PI=zr("borderLeft",Ar),kI=zr("borderColor"),DI=zr("borderTopColor"),AI=zr("borderRightColor"),TI=zr("borderBottomColor"),MI=zr("borderLeftColor"),NI=zr("outline",Ar),jI=zr("outlineColor"),Tp=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ou(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:au(t,r)});return oo(e,e.borderRadius,n)}return null};Tp.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:ta}:{};Tp.filterProps=["borderRadius"];Ap(SI,EI,OI,CI,PI,kI,DI,AI,TI,MI,Tp,NI,jI);const Mp=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ou(e.theme,"spacing",8,"gap"),n=r=>({gap:au(t,r)});return oo(e,e.gap,n)}return null};Mp.propTypes=process.env.NODE_ENV!=="production"?{gap:ta}:{};Mp.filterProps=["gap"];const Np=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ou(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:au(t,r)});return oo(e,e.columnGap,n)}return null};Np.propTypes=process.env.NODE_ENV!=="production"?{columnGap:ta}:{};Np.filterProps=["columnGap"];const jp=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ou(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:au(t,r)});return oo(e,e.rowGap,n)}return null};jp.propTypes=process.env.NODE_ENV!=="production"?{rowGap:ta}:{};jp.filterProps=["rowGap"];const RI=$t({prop:"gridColumn"}),II=$t({prop:"gridRow"}),FI=$t({prop:"gridAutoFlow"}),LI=$t({prop:"gridAutoColumns"}),$I=$t({prop:"gridAutoRows"}),BI=$t({prop:"gridTemplateColumns"}),WI=$t({prop:"gridTemplateRows"}),zI=$t({prop:"gridTemplateAreas"}),VI=$t({prop:"gridArea"});Ap(Mp,Np,jp,RI,II,FI,LI,$I,BI,WI,zI,VI);function Ns(e,t){return t==="grey"?t:e}const HI=$t({prop:"color",themeKey:"palette",transform:Ns}),YI=$t({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ns}),UI=$t({prop:"backgroundColor",themeKey:"palette",transform:Ns});Ap(HI,YI,UI);function fr(e){return e<=1&&e!==0?`${e*100}%`:e}const KI=$t({prop:"width",transform:fr}),Uy=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Cp[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:fr(n)}};return oo(e,e.maxWidth,t)}return null};Uy.filterProps=["maxWidth"];const qI=$t({prop:"minWidth",transform:fr}),GI=$t({prop:"height",transform:fr}),XI=$t({prop:"maxHeight",transform:fr}),QI=$t({prop:"minHeight",transform:fr});$t({prop:"size",cssProperty:"width",transform:fr});$t({prop:"size",cssProperty:"height",transform:fr});const ZI=$t({prop:"boxSizing"});Ap(KI,Uy,qI,GI,XI,QI,ZI);const Rp={border:{themeKey:"borders",transform:Ar},borderTop:{themeKey:"borders",transform:Ar},borderRight:{themeKey:"borders",transform:Ar},borderBottom:{themeKey:"borders",transform:Ar},borderLeft:{themeKey:"borders",transform:Ar},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ar},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Tp},color:{themeKey:"palette",transform:Ns},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ns},backgroundColor:{themeKey:"palette",transform:Ns},p:{style:Dt},pt:{style:Dt},pr:{style:Dt},pb:{style:Dt},pl:{style:Dt},px:{style:Dt},py:{style:Dt},padding:{style:Dt},paddingTop:{style:Dt},paddingRight:{style:Dt},paddingBottom:{style:Dt},paddingLeft:{style:Dt},paddingX:{style:Dt},paddingY:{style:Dt},paddingInline:{style:Dt},paddingInlineStart:{style:Dt},paddingInlineEnd:{style:Dt},paddingBlock:{style:Dt},paddingBlockStart:{style:Dt},paddingBlockEnd:{style:Dt},m:{style:kt},mt:{style:kt},mr:{style:kt},mb:{style:kt},ml:{style:kt},mx:{style:kt},my:{style:kt},margin:{style:kt},marginTop:{style:kt},marginRight:{style:kt},marginBottom:{style:kt},marginLeft:{style:kt},marginX:{style:kt},marginY:{style:kt},marginInline:{style:kt},marginInlineStart:{style:kt},marginInlineEnd:{style:kt},marginBlock:{style:kt},marginBlockStart:{style:kt},marginBlockEnd:{style:kt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Mp},rowGap:{style:jp},columnGap:{style:Np},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fr},maxWidth:{style:Uy},minWidth:{transform:fr},height:{transform:fr},maxHeight:{transform:fr},minHeight:{transform:fr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function JI(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function eF(e,t){return typeof e=="function"?e(t):e}function tF(){function e(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const f=Pp(i,c)||{};return d?d(a):oo(a,r,h=>{let m=sf(f,u,h);return h===m&&typeof h=="string"&&(m=sf(f,u,`${n}${h==="default"?"":dn(h)}`,h)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const a=i.unstable_sxConfig??Rp;function s(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=mI(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=eF(c[p],i);if(h!=null)if(typeof h=="object")if(a[p])f=vc(f,e(p,h,i,a));else{const m=oo({theme:i},h,v=>({[p]:v}));JI(m,h)?f[p]=t({sx:h,theme:i,nested:!0}):f=vc(f,m)}else f=vc(f,e(p,h,i,a))}),!o&&i.modularCssLayers?{"@layer sx":A1(i,M1(d,f))}:A1(i,M1(d,f))}return Array.isArray(r)?r.map(s):s(r)}return t}const zs=tF();zs.filterProps=["sx"];function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gv.apply(null,arguments)}function nF(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function rF(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var iF=(function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(rF(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=nF(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),xn="-ms-",lf="-moz-",Ne="-webkit-",OP="comm",Ky="rule",qy="decl",oF="@import",CP="@keyframes",aF="@layer",sF=Math.abs,Ip=String.fromCharCode,lF=Object.assign;function cF(e,t){return un(e,0)^45?(((t<<2^un(e,0))<<2^un(e,1))<<2^un(e,2))<<2^un(e,3):0}function PP(e){return e.trim()}function uF(e,t){return(e=t.exec(e))?e[0]:e}function je(e,t,n){return e.replace(t,n)}function vv(e,t){return e.indexOf(t)}function un(e,t){return e.charCodeAt(t)|0}function Pc(e,t,n){return e.slice(t,n)}function li(e){return e.length}function Gy(e){return e.length}function Hu(e,t){return t.push(e),e}function dF(e,t){return e.map(t).join("")}var Fp=1,Vs=1,kP=0,rr=0,zt=0,pl="";function Lp(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Fp,column:Vs,length:a,return:""}}function Rl(e,t){return lF(Lp("",null,null,"",null,null,0),e,{length:-e.length},t)}function fF(){return zt}function pF(){return zt=rr>0?un(pl,--rr):0,Vs--,zt===10&&(Vs=1,Fp--),zt}function mr(){return zt=rr<kP?un(pl,rr++):0,Vs++,zt===10&&(Vs=1,Fp++),zt}function vi(){return un(pl,rr)}function Ud(){return rr}function su(e,t){return Pc(pl,e,t)}function kc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function DP(e){return Fp=Vs=1,kP=li(pl=e),rr=0,[]}function AP(e){return pl="",e}function Kd(e){return PP(su(rr-1,yv(e===91?e+2:e===40?e+1:e)))}function hF(e){for(;(zt=vi())&&zt<33;)mr();return kc(e)>2||kc(zt)>3?"":" "}function mF(e,t){for(;--t&&mr()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return su(e,Ud()+(t<6&&vi()==32&&mr()==32))}function yv(e){for(;mr();)switch(zt){case e:return rr;case 34:case 39:e!==34&&e!==39&&yv(zt);break;case 40:e===41&&yv(e);break;case 92:mr();break}return rr}function gF(e,t){for(;mr()&&e+zt!==57;)if(e+zt===84&&vi()===47)break;return"/*"+su(t,rr-1)+"*"+Ip(e===47?e:mr())}function vF(e){for(;!kc(vi());)mr();return su(e,rr)}function yF(e){return AP(qd("",null,null,null,[""],e=DP(e),0,[0],e))}function qd(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,v=1,b=1,S=0,w="",x=i,_=o,O=r,k=w;v;)switch(h=S,S=mr()){case 40:if(h!=108&&un(k,d-1)==58){vv(k+=je(Kd(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:k+=Kd(S);break;case 9:case 10:case 13:case 32:k+=hF(h);break;case 92:k+=mF(Ud()-1,7);continue;case 47:switch(vi()){case 42:case 47:Hu(bF(gF(mr(),Ud()),t,n),l);break;default:k+="/"}break;case 123*m:s[c++]=li(k)*b;case 125*m:case 59:case 0:switch(S){case 0:case 125:v=0;case 59+u:b==-1&&(k=je(k,/\f/g,"")),p>0&&li(k)-d&&Hu(p>32?R1(k+";",r,n,d-1):R1(je(k," ","")+";",r,n,d-2),l);break;case 59:k+=";";default:if(Hu(O=j1(k,t,n,c,u,i,s,w,x=[],_=[],d),o),S===123)if(u===0)qd(k,t,O,O,x,o,d,s,_);else switch(f===99&&un(k,3)===110?100:f){case 100:case 108:case 109:case 115:qd(e,O,O,r&&Hu(j1(e,O,O,0,0,i,s,w,i,x=[],d),_),i,_,d,s,r?x:_);break;default:qd(k,O,O,O,[""],_,0,s,_)}}c=u=p=0,m=b=1,w=k="",d=a;break;case 58:d=1+li(k),p=h;default:if(m<1){if(S==123)--m;else if(S==125&&m++==0&&pF()==125)continue}switch(k+=Ip(S),S*m){case 38:b=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(li(k)-1)*b,b=1;break;case 64:vi()===45&&(k+=Kd(mr())),f=vi(),u=d=li(w=k+=vF(Ud())),S++;break;case 45:h===45&&li(k)==2&&(m=0)}}return o}function j1(e,t,n,r,i,o,a,s,l,c,u){for(var d=i-1,f=i===0?o:[""],p=Gy(f),h=0,m=0,v=0;h<r;++h)for(var b=0,S=Pc(e,d+1,d=sF(m=a[h])),w=e;b<p;++b)(w=PP(m>0?f[b]+" "+S:je(S,/&\f/g,f[b])))&&(l[v++]=w);return Lp(e,t,n,i===0?Ky:s,l,c,u)}function bF(e,t,n){return Lp(e,t,n,OP,Ip(fF()),Pc(e,2,-2),0)}function R1(e,t,n,r){return Lp(e,t,n,qy,Pc(e,0,r),Pc(e,r+1,-1),r)}function js(e,t){for(var n="",r=Gy(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function xF(e,t,n,r){switch(e.type){case aF:if(e.children.length)break;case oF:case qy:return e.return=e.return||e.value;case OP:return"";case CP:return e.return=e.value+"{"+js(e.children,r)+"}";case Ky:e.value=e.props.join(",")}return li(n=js(e.children,r))?e.return=e.value+"{"+n+"}":""}function wF(e){var t=Gy(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function _F(e){return function(t){t.root||(t=t.return)&&e(t)}}function TP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var SF=function(t,n,r){for(var i=0,o=0;i=o,o=vi(),i===38&&o===12&&(n[r]=1),!kc(o);)mr();return su(t,rr)},EF=function(t,n){var r=-1,i=44;do switch(kc(i)){case 0:i===38&&vi()===12&&(n[r]=1),t[r]+=SF(rr-1,n,r);break;case 2:t[r]+=Kd(i);break;case 4:if(i===44){t[++r]=vi()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Ip(i)}while(i=mr());return t},OF=function(t,n){return AP(EF(DP(t),n))},I1=new WeakMap,CF=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!I1.get(r))&&!i){I1.set(t,!0);for(var o=[],a=OF(n,o),s=r.props,l=0,c=0;l<a.length;l++)for(var u=0;u<s.length;u++,c++)t.props[c]=o[l]?a[l].replace(/&\f/g,s[u]):s[u]+" "+a[l]}}},PF=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function MP(e,t){switch(cF(e,t)){case 5103:return Ne+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ne+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ne+e+lf+e+xn+e+e;case 6828:case 4268:return Ne+e+xn+e+e;case 6165:return Ne+e+xn+"flex-"+e+e;case 5187:return Ne+e+je(e,/(\w+).+(:[^]+)/,Ne+"box-$1$2"+xn+"flex-$1$2")+e;case 5443:return Ne+e+xn+"flex-item-"+je(e,/flex-|-self/,"")+e;case 4675:return Ne+e+xn+"flex-line-pack"+je(e,/align-content|flex-|-self/,"")+e;case 5548:return Ne+e+xn+je(e,"shrink","negative")+e;case 5292:return Ne+e+xn+je(e,"basis","preferred-size")+e;case 6060:return Ne+"box-"+je(e,"-grow","")+Ne+e+xn+je(e,"grow","positive")+e;case 4554:return Ne+je(e,/([^-])(transform)/g,"$1"+Ne+"$2")+e;case 6187:return je(je(je(e,/(zoom-|grab)/,Ne+"$1"),/(image-set)/,Ne+"$1"),e,"")+e;case 5495:case 3959:return je(e,/(image-set\([^]*)/,Ne+"$1$`$1");case 4968:return je(je(e,/(.+:)(flex-)?(.*)/,Ne+"box-pack:$3"+xn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ne+e+e;case 4095:case 3583:case 4068:case 2532:return je(e,/(.+)-inline(.+)/,Ne+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(li(e)-1-t>6)switch(un(e,t+1)){case 109:if(un(e,t+4)!==45)break;case 102:return je(e,/(.+:)(.+)-([^]+)/,"$1"+Ne+"$2-$3$1"+lf+(un(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~vv(e,"stretch")?MP(je(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(un(e,t+1)!==115)break;case 6444:switch(un(e,li(e)-3-(~vv(e,"!important")&&10))){case 107:return je(e,":",":"+Ne)+e;case 101:return je(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ne+(un(e,14)===45?"inline-":"")+"box$3$1"+Ne+"$2$3$1"+xn+"$2box$3")+e}break;case 5936:switch(un(e,t+11)){case 114:return Ne+e+xn+je(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ne+e+xn+je(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ne+e+xn+je(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ne+e+xn+e+e}return e}var kF=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case qy:t.return=MP(t.value,t.length);break;case CP:return js([Rl(t,{value:je(t.value,"@","@"+Ne)})],i);case Ky:if(t.length)return dF(t.props,function(o){switch(uF(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return js([Rl(t,{props:[je(o,/:(read-\w+)/,":"+lf+"$1")]})],i);case"::placeholder":return js([Rl(t,{props:[je(o,/:(plac\w+)/,":"+Ne+"input-$1")]}),Rl(t,{props:[je(o,/:(plac\w+)/,":"+lf+"$1")]}),Rl(t,{props:[je(o,/:(plac\w+)/,xn+"input-$1")]})],i)}return""})}},DF=[kF],AF=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||DF,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),b=1;b<v.length;b++)o[v[b]]=!0;s.push(m)});var l,c=[CF,PF];{var u,d=[xF,_F(function(m){u.insert(m)})],f=wF(c.concat(i,d)),p=function(v){return js(yF(v),f)};l=function(v,b,S,w){u=S,p(v?v+"{"+b.styles+"}":b.styles),w&&(h.inserted[b.name]=!0)}}var h={key:n,sheet:new iF({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return h.sheet.hydrate(s),h},Yu={exports:{}},ze={};/** @license React v16.13.1
69
+ `)),()=>{})}function Yy(e){return ou(e,"spacing",8,"spacing")}function au(e,t){return typeof t=="string"||t==null?t:e(t)}function wI(e,t){return n=>e.reduce((r,i)=>(r[i]=au(t,n),r),{})}function _I(e,t,n,r){if(!t.includes(n))return null;const i=bI(n),o=wI(i,r),a=e[n];return oo(e,a,o)}function EP(e,t){const n=Yy(e.theme);return Object.keys(e).map(r=>_I(e,t,r,n)).reduce(vc,{})}function kt(e){return EP(e,kp)}kt.propTypes=process.env.NODE_ENV!=="production"?kp.reduce((e,t)=>(e[t]=ta,e),{}):{};kt.filterProps=kp;function Dt(e){return EP(e,Dp)}Dt.propTypes=process.env.NODE_ENV!=="production"?Dp.reduce((e,t)=>(e[t]=ta,e),{}):{};Dt.filterProps=Dp;process.env.NODE_ENV!=="production"&&xI.reduce((e,t)=>(e[t]=ta,e),{});function Ap(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?vc(i,t[o](r)):i,{});return n.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,i)=>Object.assign(r,i.propTypes),{}):{},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Ar(e){return typeof e!="number"?e:`${e}px solid`}function zr(e,t){return $t({prop:e,themeKey:"borders",transform:t})}const SI=zr("border",Ar),EI=zr("borderTop",Ar),OI=zr("borderRight",Ar),CI=zr("borderBottom",Ar),PI=zr("borderLeft",Ar),kI=zr("borderColor"),DI=zr("borderTopColor"),AI=zr("borderRightColor"),TI=zr("borderBottomColor"),MI=zr("borderLeftColor"),NI=zr("outline",Ar),jI=zr("outlineColor"),Tp=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ou(e.theme,"shape.borderRadius",4,"borderRadius"),n=r=>({borderRadius:au(t,r)});return oo(e,e.borderRadius,n)}return null};Tp.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:ta}:{};Tp.filterProps=["borderRadius"];Ap(SI,EI,OI,CI,PI,kI,DI,AI,TI,MI,Tp,NI,jI);const Mp=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ou(e.theme,"spacing",8,"gap"),n=r=>({gap:au(t,r)});return oo(e,e.gap,n)}return null};Mp.propTypes=process.env.NODE_ENV!=="production"?{gap:ta}:{};Mp.filterProps=["gap"];const Np=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ou(e.theme,"spacing",8,"columnGap"),n=r=>({columnGap:au(t,r)});return oo(e,e.columnGap,n)}return null};Np.propTypes=process.env.NODE_ENV!=="production"?{columnGap:ta}:{};Np.filterProps=["columnGap"];const jp=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ou(e.theme,"spacing",8,"rowGap"),n=r=>({rowGap:au(t,r)});return oo(e,e.rowGap,n)}return null};jp.propTypes=process.env.NODE_ENV!=="production"?{rowGap:ta}:{};jp.filterProps=["rowGap"];const RI=$t({prop:"gridColumn"}),II=$t({prop:"gridRow"}),FI=$t({prop:"gridAutoFlow"}),LI=$t({prop:"gridAutoColumns"}),$I=$t({prop:"gridAutoRows"}),BI=$t({prop:"gridTemplateColumns"}),WI=$t({prop:"gridTemplateRows"}),zI=$t({prop:"gridTemplateAreas"}),VI=$t({prop:"gridArea"});Ap(Mp,Np,jp,RI,II,FI,LI,$I,BI,WI,zI,VI);function Ns(e,t){return t==="grey"?t:e}const HI=$t({prop:"color",themeKey:"palette",transform:Ns}),YI=$t({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ns}),UI=$t({prop:"backgroundColor",themeKey:"palette",transform:Ns});Ap(HI,YI,UI);function fr(e){return e<=1&&e!==0?`${e*100}%`:e}const KI=$t({prop:"width",transform:fr}),Uy=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Cp[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:fr(n)}};return oo(e,e.maxWidth,t)}return null};Uy.filterProps=["maxWidth"];const qI=$t({prop:"minWidth",transform:fr}),GI=$t({prop:"height",transform:fr}),XI=$t({prop:"maxHeight",transform:fr}),QI=$t({prop:"minHeight",transform:fr});$t({prop:"size",cssProperty:"width",transform:fr});$t({prop:"size",cssProperty:"height",transform:fr});const ZI=$t({prop:"boxSizing"});Ap(KI,Uy,qI,GI,XI,QI,ZI);const Rp={border:{themeKey:"borders",transform:Ar},borderTop:{themeKey:"borders",transform:Ar},borderRight:{themeKey:"borders",transform:Ar},borderBottom:{themeKey:"borders",transform:Ar},borderLeft:{themeKey:"borders",transform:Ar},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ar},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Tp},color:{themeKey:"palette",transform:Ns},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ns},backgroundColor:{themeKey:"palette",transform:Ns},p:{style:Dt},pt:{style:Dt},pr:{style:Dt},pb:{style:Dt},pl:{style:Dt},px:{style:Dt},py:{style:Dt},padding:{style:Dt},paddingTop:{style:Dt},paddingRight:{style:Dt},paddingBottom:{style:Dt},paddingLeft:{style:Dt},paddingX:{style:Dt},paddingY:{style:Dt},paddingInline:{style:Dt},paddingInlineStart:{style:Dt},paddingInlineEnd:{style:Dt},paddingBlock:{style:Dt},paddingBlockStart:{style:Dt},paddingBlockEnd:{style:Dt},m:{style:kt},mt:{style:kt},mr:{style:kt},mb:{style:kt},ml:{style:kt},mx:{style:kt},my:{style:kt},margin:{style:kt},marginTop:{style:kt},marginRight:{style:kt},marginBottom:{style:kt},marginLeft:{style:kt},marginX:{style:kt},marginY:{style:kt},marginInline:{style:kt},marginInlineStart:{style:kt},marginInlineEnd:{style:kt},marginBlock:{style:kt},marginBlockStart:{style:kt},marginBlockEnd:{style:kt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Mp},rowGap:{style:jp},columnGap:{style:Np},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fr},maxWidth:{style:Uy},minWidth:{transform:fr},height:{transform:fr},maxHeight:{transform:fr},minHeight:{transform:fr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function JI(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function eF(e,t){return typeof e=="function"?e(t):e}function tF(){function e(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const f=Pp(i,c)||{};return d?d(a):oo(a,r,h=>{let m=sf(f,u,h);return h===m&&typeof h=="string"&&(m=sf(f,u,`${n}${h==="default"?"":dn(h)}`,h)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:i={},nested:o}=n||{};if(!r)return null;const a=i.unstable_sxConfig??Rp;function s(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=mI(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=eF(c[p],i);if(h!=null)if(typeof h=="object")if(a[p])f=vc(f,e(p,h,i,a));else{const m=oo({theme:i},h,v=>({[p]:v}));JI(m,h)?f[p]=t({sx:h,theme:i,nested:!0}):f=vc(f,m)}else f=vc(f,e(p,h,i,a))}),!o&&i.modularCssLayers?{"@layer sx":A1(i,M1(d,f))}:A1(i,M1(d,f))}return Array.isArray(r)?r.map(s):s(r)}return t}const zs=tF();zs.filterProps=["sx"];function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gv.apply(null,arguments)}function nF(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function rF(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var iF=(function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(rF(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=nF(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),xn="-ms-",lf="-moz-",je="-webkit-",OP="comm",Ky="rule",qy="decl",oF="@import",CP="@keyframes",aF="@layer",sF=Math.abs,Ip=String.fromCharCode,lF=Object.assign;function cF(e,t){return un(e,0)^45?(((t<<2^un(e,0))<<2^un(e,1))<<2^un(e,2))<<2^un(e,3):0}function PP(e){return e.trim()}function uF(e,t){return(e=t.exec(e))?e[0]:e}function Re(e,t,n){return e.replace(t,n)}function vv(e,t){return e.indexOf(t)}function un(e,t){return e.charCodeAt(t)|0}function Pc(e,t,n){return e.slice(t,n)}function li(e){return e.length}function Gy(e){return e.length}function Hu(e,t){return t.push(e),e}function dF(e,t){return e.map(t).join("")}var Fp=1,Vs=1,kP=0,rr=0,zt=0,pl="";function Lp(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Fp,column:Vs,length:a,return:""}}function Rl(e,t){return lF(Lp("",null,null,"",null,null,0),e,{length:-e.length},t)}function fF(){return zt}function pF(){return zt=rr>0?un(pl,--rr):0,Vs--,zt===10&&(Vs=1,Fp--),zt}function mr(){return zt=rr<kP?un(pl,rr++):0,Vs++,zt===10&&(Vs=1,Fp++),zt}function vi(){return un(pl,rr)}function Ud(){return rr}function su(e,t){return Pc(pl,e,t)}function kc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function DP(e){return Fp=Vs=1,kP=li(pl=e),rr=0,[]}function AP(e){return pl="",e}function Kd(e){return PP(su(rr-1,yv(e===91?e+2:e===40?e+1:e)))}function hF(e){for(;(zt=vi())&&zt<33;)mr();return kc(e)>2||kc(zt)>3?"":" "}function mF(e,t){for(;--t&&mr()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return su(e,Ud()+(t<6&&vi()==32&&mr()==32))}function yv(e){for(;mr();)switch(zt){case e:return rr;case 34:case 39:e!==34&&e!==39&&yv(zt);break;case 40:e===41&&yv(e);break;case 92:mr();break}return rr}function gF(e,t){for(;mr()&&e+zt!==57;)if(e+zt===84&&vi()===47)break;return"/*"+su(t,rr-1)+"*"+Ip(e===47?e:mr())}function vF(e){for(;!kc(vi());)mr();return su(e,rr)}function yF(e){return AP(qd("",null,null,null,[""],e=DP(e),0,[0],e))}function qd(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,v=1,b=1,S=0,w="",x=i,_=o,O=r,k=w;v;)switch(h=S,S=mr()){case 40:if(h!=108&&un(k,d-1)==58){vv(k+=Re(Kd(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:k+=Kd(S);break;case 9:case 10:case 13:case 32:k+=hF(h);break;case 92:k+=mF(Ud()-1,7);continue;case 47:switch(vi()){case 42:case 47:Hu(bF(gF(mr(),Ud()),t,n),l);break;default:k+="/"}break;case 123*m:s[c++]=li(k)*b;case 125*m:case 59:case 0:switch(S){case 0:case 125:v=0;case 59+u:b==-1&&(k=Re(k,/\f/g,"")),p>0&&li(k)-d&&Hu(p>32?R1(k+";",r,n,d-1):R1(Re(k," ","")+";",r,n,d-2),l);break;case 59:k+=";";default:if(Hu(O=j1(k,t,n,c,u,i,s,w,x=[],_=[],d),o),S===123)if(u===0)qd(k,t,O,O,x,o,d,s,_);else switch(f===99&&un(k,3)===110?100:f){case 100:case 108:case 109:case 115:qd(e,O,O,r&&Hu(j1(e,O,O,0,0,i,s,w,i,x=[],d),_),i,_,d,s,r?x:_);break;default:qd(k,O,O,O,[""],_,0,s,_)}}c=u=p=0,m=b=1,w=k="",d=a;break;case 58:d=1+li(k),p=h;default:if(m<1){if(S==123)--m;else if(S==125&&m++==0&&pF()==125)continue}switch(k+=Ip(S),S*m){case 38:b=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(li(k)-1)*b,b=1;break;case 64:vi()===45&&(k+=Kd(mr())),f=vi(),u=d=li(w=k+=vF(Ud())),S++;break;case 45:h===45&&li(k)==2&&(m=0)}}return o}function j1(e,t,n,r,i,o,a,s,l,c,u){for(var d=i-1,f=i===0?o:[""],p=Gy(f),h=0,m=0,v=0;h<r;++h)for(var b=0,S=Pc(e,d+1,d=sF(m=a[h])),w=e;b<p;++b)(w=PP(m>0?f[b]+" "+S:Re(S,/&\f/g,f[b])))&&(l[v++]=w);return Lp(e,t,n,i===0?Ky:s,l,c,u)}function bF(e,t,n){return Lp(e,t,n,OP,Ip(fF()),Pc(e,2,-2),0)}function R1(e,t,n,r){return Lp(e,t,n,qy,Pc(e,0,r),Pc(e,r+1,-1),r)}function js(e,t){for(var n="",r=Gy(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function xF(e,t,n,r){switch(e.type){case aF:if(e.children.length)break;case oF:case qy:return e.return=e.return||e.value;case OP:return"";case CP:return e.return=e.value+"{"+js(e.children,r)+"}";case Ky:e.value=e.props.join(",")}return li(n=js(e.children,r))?e.return=e.value+"{"+n+"}":""}function wF(e){var t=Gy(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function _F(e){return function(t){t.root||(t=t.return)&&e(t)}}function TP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var SF=function(t,n,r){for(var i=0,o=0;i=o,o=vi(),i===38&&o===12&&(n[r]=1),!kc(o);)mr();return su(t,rr)},EF=function(t,n){var r=-1,i=44;do switch(kc(i)){case 0:i===38&&vi()===12&&(n[r]=1),t[r]+=SF(rr-1,n,r);break;case 2:t[r]+=Kd(i);break;case 4:if(i===44){t[++r]=vi()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Ip(i)}while(i=mr());return t},OF=function(t,n){return AP(EF(DP(t),n))},I1=new WeakMap,CF=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!I1.get(r))&&!i){I1.set(t,!0);for(var o=[],a=OF(n,o),s=r.props,l=0,c=0;l<a.length;l++)for(var u=0;u<s.length;u++,c++)t.props[c]=o[l]?a[l].replace(/&\f/g,s[u]):s[u]+" "+a[l]}}},PF=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function MP(e,t){switch(cF(e,t)){case 5103:return je+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return je+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return je+e+lf+e+xn+e+e;case 6828:case 4268:return je+e+xn+e+e;case 6165:return je+e+xn+"flex-"+e+e;case 5187:return je+e+Re(e,/(\w+).+(:[^]+)/,je+"box-$1$2"+xn+"flex-$1$2")+e;case 5443:return je+e+xn+"flex-item-"+Re(e,/flex-|-self/,"")+e;case 4675:return je+e+xn+"flex-line-pack"+Re(e,/align-content|flex-|-self/,"")+e;case 5548:return je+e+xn+Re(e,"shrink","negative")+e;case 5292:return je+e+xn+Re(e,"basis","preferred-size")+e;case 6060:return je+"box-"+Re(e,"-grow","")+je+e+xn+Re(e,"grow","positive")+e;case 4554:return je+Re(e,/([^-])(transform)/g,"$1"+je+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,je+"$1"),/(image-set)/,je+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,je+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,je+"box-pack:$3"+xn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+je+e+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,je+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(li(e)-1-t>6)switch(un(e,t+1)){case 109:if(un(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+je+"$2-$3$1"+lf+(un(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~vv(e,"stretch")?MP(Re(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(un(e,t+1)!==115)break;case 6444:switch(un(e,li(e)-3-(~vv(e,"!important")&&10))){case 107:return Re(e,":",":"+je)+e;case 101:return Re(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+je+(un(e,14)===45?"inline-":"")+"box$3$1"+je+"$2$3$1"+xn+"$2box$3")+e}break;case 5936:switch(un(e,t+11)){case 114:return je+e+xn+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return je+e+xn+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return je+e+xn+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return je+e+xn+e+e}return e}var kF=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case qy:t.return=MP(t.value,t.length);break;case CP:return js([Rl(t,{value:Re(t.value,"@","@"+je)})],i);case Ky:if(t.length)return dF(t.props,function(o){switch(uF(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return js([Rl(t,{props:[Re(o,/:(read-\w+)/,":"+lf+"$1")]})],i);case"::placeholder":return js([Rl(t,{props:[Re(o,/:(plac\w+)/,":"+je+"input-$1")]}),Rl(t,{props:[Re(o,/:(plac\w+)/,":"+lf+"$1")]}),Rl(t,{props:[Re(o,/:(plac\w+)/,xn+"input-$1")]})],i)}return""})}},DF=[kF],AF=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||DF,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),b=1;b<v.length;b++)o[v[b]]=!0;s.push(m)});var l,c=[CF,PF];{var u,d=[xF,_F(function(m){u.insert(m)})],f=wF(c.concat(i,d)),p=function(v){return js(yF(v),f)};l=function(v,b,S,w){u=S,p(v?v+"{"+b.styles+"}":b.styles),w&&(h.inserted[b.name]=!0)}}var h={key:n,sheet:new iF({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return h.sheet.hydrate(s),h},Yu={exports:{}},ze={};/** @license React v16.13.1
70
70
  * react-is.production.min.js
71
71
  *
72
72
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -165,15 +165,15 @@ This could lead to inefficient memoization and unnecessary re-renders.
165
165
  Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},dW=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:o,inputSelectorResultsCopy:a}=e,s=r(()=>({}),...i);if(!(s.apply(null,o)===s.apply(null,a))){let c;try{throw new Error}catch(u){({stack:c}=u)}console.warn(`An input selector returned a different result when passed same arguments.
166
166
  This means your output selector will likely run more frequently than intended.
167
167
  Avoid returning a new reference inside your input selector, e.g.
168
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:a,stack:c})}},fW={inputStabilityCheck:"once",identityFunctionCheck:"once"};function pW(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hW(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function mW(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Z_=e=>Array.isArray(e)?e:[e];function gW(e){const t=Array.isArray(e[0])?e[0]:e;return mW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function J_(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var vW=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...fW,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:uW},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:dW}}},yW=class{constructor(e){this.value=e}deref(){return this.value}},bW=typeof WeakRef<"u"?WeakRef:yW,xW=0,eS=1;function id(){return{s:xW,v:void 0,o:null,p:null}}function TD(e,t={}){let n=id();const{resultEqualityCheck:r}=t;let i,o=0;function a(){let s=n;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let h=s.o;h===null&&(s.o=h=new WeakMap);const m=h.get(p);m===void 0?(s=id(),h.set(p,s)):s=m}else{let h=s.p;h===null&&(s.p=h=new Map);const m=h.get(p);m===void 0?(s=id(),h.set(p,s)):s=m}}const c=s;let u;if(s.s===eS)u=s.v;else if(u=e.apply(null,arguments),o++,r){const d=i?.deref?.()??i;d!=null&&r(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new bW(u):u}return c.s=eS,c.v=u,u}return a.clearCache=()=>{n=id(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function wW(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,s,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),pW(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:p=TD,argsMemoizeOptions:h=[],devModeChecks:m={}}=u,v=Z_(f),b=Z_(h),S=gW(i),w=d(function(){return o++,c.apply(null,arguments)},...v);let x=!0;const _=p(function(){a++;const k=J_(S,arguments);if(s=w.apply(null,k),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:D,inputStabilityCheck:T}=vW(x,m);if(D.shouldRun&&D.run(c,k,s),T.shouldRun){const j=J_(S,arguments);T.run({inputSelectorResults:k,inputSelectorResultsCopy:j},{memoize:d,memoizeOptions:v},arguments)}x&&(x=!1)}return s},...b);return Object.assign(_,{resultFunc:c,memoizedResultFunc:w,dependencies:S,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var z=wW(TD),_W=Object.assign((e,t=z)=>{hW(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,s,l)=>(a[n[l]]=s,a),{}))},{withTypes:()=>_W}),lg={},cg={},ug={},tS;function SW(){return tS||(tS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,o)=>{if(r!==i){const a=t(r),s=t(i);if(a===s&&a===0){if(r<i)return o==="desc"?1:-1;if(r>i)return o==="desc"?-1:1}return o==="desc"?s-a:a-s}return 0};e.compareValues=n})(ug)),ug}var dg={},fg={},nS;function MD(){return nS||(nS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(fg)),fg}var rS;function EW(){return rS||(rS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MD(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,a){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(r.test(o)||!n.test(o))||a!=null&&Object.hasOwn(a,o)}e.isKey=i})(dg)),dg}var iS;function OW(){return iS||(iS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SW(),n=EW(),r=_b();function i(o,a,s,l){if(o==null)return[];s=l?void 0:s,Array.isArray(o)||(o=Object.values(o)),Array.isArray(a)||(a=a==null?[null]:[a]),a.length===0&&(a=[null]),Array.isArray(s)||(s=s==null?[]:[s]),s=s.map(p=>String(p));const c=(p,h)=>{let m=p;for(let v=0;v<h.length&&m!=null;++v)m=m[h[v]];return m},u=(p,h)=>h==null||p==null?h:typeof p=="object"&&"key"in p?Object.hasOwn(h,p.key)?h[p.key]:c(h,p.path):typeof p=="function"?p(h):Array.isArray(p)?c(h,p):typeof h=="object"?h[p]:h,d=a.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||n.isKey(p)?p:{key:p,path:r.toPath(p)}));return o.map(p=>({original:p,criteria:d.map(h=>u(h,p))})).slice().sort((p,h)=>{for(let m=0;m<d.length;m++){const v=t.compareValues(p.criteria[m],h.criteria[m],s[m]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=i})(cg)),cg}var pg={},oS;function CW(){return oS||(oS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],o=Math.floor(r),a=(s,l)=>{for(let c=0;c<s.length;c++){const u=s[c];Array.isArray(u)&&l<o?a(u,l+1):i.push(u)}};return a(n,0),i}e.flatten=t})(pg)),pg}var hg={},aS;function ND(){return aS||(aS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kD(),n=jb(),r=_D(),i=ED();function o(a,s,l){return r.isObject(l)&&(typeof s=="number"&&n.isArrayLike(l)&&t.isIndex(s)&&s<l.length||typeof s=="string"&&s in l)?i.eq(l[s],a):!1}e.isIterateeCall=o})(hg)),hg}var sS;function PW(){return sS||(sS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OW(),n=CW(),r=ND();function i(o,...a){const s=a.length;return s>1&&r.isIterateeCall(o,a[0],a[1])?a=[]:s>2&&r.isIterateeCall(a[0],a[1],a[2])&&(a=[a[0]]),t.orderBy(o,n.flatten(a),["asc"])}e.sortBy=i})(lg)),lg}var mg,lS;function kW(){return lS||(lS=1,mg=PW().sortBy),mg}var DW=kW();const oh=go(DW);var jD=e=>e.legend.settings,AW=e=>e.legend.size,TW=e=>e.legend.payload,MW=z([TW,jD],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?oh(r,n):r});function NW(){return ue(MW)}var od=1;function RD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=P.useState({height:0,left:0,top:0,width:0}),r=P.useCallback(i=>{if(i!=null){var o=i.getBoundingClientRect(),a={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(a.height-t.height)>od||Math.abs(a.left-t.left)>od||Math.abs(a.top-t.top)>od||Math.abs(a.width-t.width)>od)&&n({height:a.height,left:a.left,top:a.top,width:a.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function ln(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var jW=typeof Symbol=="function"&&Symbol.observable||"@@observable",cS=jW,gg=()=>Math.random().toString(36).substring(7).split("").join("."),RW={INIT:`@@redux/INIT${gg()}`,REPLACE:`@@redux/REPLACE${gg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${gg()}`},$a=RW;function mu(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function IW(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($W(e))return"date";if(LW(e))return"error";const n=FW(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function FW(e){return typeof e.constructor=="function"?e.constructor.name:null}function LW(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $W(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function To(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=IW(e)),t}function ID(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ln(2):`Expected the root reducer to be a function. Instead, received: '${To(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ln(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ln(1):`Expected the enhancer to be a function. Instead, received: '${To(n)}'`);return n(ID)(e,t)}let r=e,i=t,o=new Map,a=o,s=0,l=!1;function c(){a===o&&(a=new Map,o.forEach((v,b)=>{a.set(b,v)}))}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?ln(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function d(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ln(4):`Expected the listener to be a function. Instead, received: '${To(v)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?ln(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;c();const S=s++;return a.set(S,v),function(){if(b){if(l)throw new Error(process.env.NODE_ENV==="production"?ln(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c(),a.delete(S),o=null}}}function f(v){if(!mu(v))throw new Error(process.env.NODE_ENV==="production"?ln(7):`Actions must be plain objects. Instead, the actual type was: '${To(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ln(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?ln(17):`Action "type" property must be a string. Instead, the actual type was: '${To(v.type)}'. Value was: '${v.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?ln(9):"Reducers may not dispatch actions.");try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(S=>{S()}),v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ln(10):`Expected the nextReducer to be a function. Instead, received: '${To(v)}`);r=v,f({type:$a.REPLACE})}function h(){const v=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?ln(11):`Expected the observer to be an object. Instead, received: '${To(b)}'`);function S(){const x=b;x.next&&x.next(u())}return S(),{unsubscribe:v(S)}},[cS](){return this}}}return f({type:$a.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[cS]:h}}function uS(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function BW(e,t,n,r){const i=Object.keys(t),o=n&&n.type===$a.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!mu(e))return`The ${o} has unexpected type of "${To(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const a=Object.keys(e).filter(s=>!t.hasOwnProperty(s)&&!r[s]);if(a.forEach(s=>{r[s]=!0}),!(n&&n.type===$a.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function WW(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:$a.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?ln(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:$a.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ln(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${$a.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function FD(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];process.env.NODE_ENV!=="production"&&typeof e[s]>"u"&&uS(`No reducer provided for key "${s}"`),typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let o;try{WW(n)}catch(a){o=a}return function(s={},l){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=BW(s,n,l,i);d&&uS(d)}let c=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],p=n[f],h=s[f],m=p(h,l);if(typeof m>"u"){const v=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?ln(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[f]=m,c=c||m!==h}return c=c||r.length!==Object.keys(s).length,c?u:s}}function Tf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function zW(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?ln(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},s=e.map(l=>l(a));return o=Tf(...s)(i.dispatch),{...i,dispatch:o}}}function Fb(e){return mu(e)&&"type"in e&&typeof e.type=="string"}var LD=Symbol.for("immer-nothing"),dS=Symbol.for("immer-draftable"),yr=Symbol.for("immer-state"),VW=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Xn(e,...t){if(process.env.NODE_ENV!=="production"){const n=VW[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zs=Object.getPrototypeOf;function Qa(e){return!!e&&!!e[yr]}function co(e){return e?$D(e)||Array.isArray(e)||!!e[dS]||!!e.constructor?.[dS]||gu(e)||sh(e):!1}var HW=Object.prototype.constructor.toString();function $D(e){if(!e||typeof e!="object")return!1;const t=Zs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===HW}function Mf(e,t){ah(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ah(e){const t=e[yr];return t?t.type_:Array.isArray(e)?1:gu(e)?2:sh(e)?3:0}function Wv(e,t){return ah(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function BD(e,t,n){const r=ah(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function YW(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function gu(e){return e instanceof Map}function sh(e){return e instanceof Set}function wa(e){return e.copy_||e.base_}function zv(e,t){if(gu(e))return new Map(e);if(sh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=$D(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[yr];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const a=i[o],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Zs(e),r)}else{const r=Zs(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Lb(e,t=!1){return lh(e)||Qa(e)||!co(e)||(ah(e)>1&&Object.defineProperties(e,{set:{value:ad},add:{value:ad},clear:{value:ad},delete:{value:ad}}),Object.freeze(e),t&&Object.values(e).forEach(n=>Lb(n,!0))),e}function ad(){Xn(2)}function lh(e){return Object.isFrozen(e)}var UW={};function Za(e){const t=UW[e];return t||Xn(0,e),t}var Fc;function WD(){return Fc}function KW(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fS(e,t){t&&(Za("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vv(e){Hv(e),e.drafts_.forEach(qW),e.drafts_=null}function Hv(e){e===Fc&&(Fc=e.parent_)}function pS(e){return Fc=KW(Fc,e)}function qW(e){const t=e[yr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[yr].modified_&&(Vv(t),Xn(4)),co(e)&&(e=Nf(t,e),t.parent_||jf(t,e)),t.patches_&&Za("Patches").generateReplacementPatches_(n[yr].base_,e,t.patches_,t.inversePatches_)):e=Nf(t,n,[]),Vv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==LD?e:void 0}function Nf(e,t,n){if(lh(t))return t;const r=t[yr];if(!r)return Mf(t,(i,o)=>mS(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return jf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),Mf(o,(s,l)=>mS(e,r,i,s,l,n,a)),jf(e,i,!1),n&&e.patches_&&Za("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function mS(e,t,n,r,i,o,a){if(process.env.NODE_ENV!=="production"&&i===n&&Xn(5),Qa(i)){const s=o&&t&&t.type_!==3&&!Wv(t.assigned_,r)?o.concat(r):void 0,l=Nf(e,i,s);if(BD(n,r,l),Qa(l))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(co(i)&&!lh(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Nf(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(gu(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&jf(e,i)}}function jf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lb(t,n)}function GW(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:WD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=$b;n&&(i=[r],o=Lc);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}var $b={get(e,t){if(t===yr)return e;const n=wa(e);if(!Wv(n,t))return XW(e,n,t);const r=n[t];return e.finalized_||!co(r)?r:r===vg(e.base_,t)?(yg(e),e.copy_[t]=Uv(r,e)):r},has(e,t){return t in wa(e)},ownKeys(e){return Reflect.ownKeys(wa(e))},set(e,t,n){const r=zD(wa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=vg(wa(e),t),o=i?.[yr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(YW(n,i)&&(n!==void 0||Wv(e.base_,t)))return!0;yg(e),Yv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return vg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,yg(e),Yv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=wa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Xn(11)},getPrototypeOf(e){return Zs(e.base_)},setPrototypeOf(){Xn(12)}},Lc={};Mf($b,(e,t)=>{Lc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Lc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Xn(13),Lc.set.call(this,e,t,void 0)};Lc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Xn(14),$b.set.call(this,e[0],t,n,e[0])};function vg(e,t){const n=e[yr];return(n?wa(n):e)[t]}function XW(e,t,n){const r=zD(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function zD(e,t){if(!(t in e))return;let n=Zs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Zs(n)}}function Yv(e){e.modified_||(e.modified_=!0,e.parent_&&Yv(e.parent_))}function yg(e){e.copy_||(e.copy_=zv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var QW=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(l=o,...c){return a.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Xn(6),r!==void 0&&typeof r!="function"&&Xn(7);let i;if(co(t)){const o=pS(this),a=Uv(t,void 0);let s=!0;try{i=n(a),s=!1}finally{s?Vv(o):Hv(o)}return fS(o,r),hS(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===LD&&(i=void 0),this.autoFreeze_&&Lb(i,!0),r){const o=[],a=[];Za("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else Xn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let r,i;return[this.produce(t,n,(a,s)=>{r=a,i=s}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){co(e)||Xn(8),Qa(e)&&(e=no(e));const t=pS(this),n=Uv(e,void 0);return n[yr].isManual_=!0,Hv(t),n}finishDraft(e,t){const n=e&&e[yr];(!n||!n.isManual_)&&Xn(9);const{scope_:r}=n;return fS(r,t),hS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Za("Patches").applyPatches_;return Qa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Uv(e,t){const n=gu(e)?Za("MapSet").proxyMap_(e,t):sh(e)?Za("MapSet").proxySet_(e,t):GW(e,t);return(t?t.scope_:WD()).drafts_.push(n),n}function no(e){return Qa(e)||Xn(10,e),VD(e)}function VD(e){if(!co(e)||lh(e))return e;const t=e[yr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=zv(e,t.scope_.immer_.useStrictShallowCopy_)}else n=zv(e,!0);return Mf(n,(r,i)=>{BD(n,r,VD(i))}),t&&(t.finalized_=!1),n}var ZW=new QW,HD=ZW.produce;function YD(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var JW=YD(),ez=YD,tz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tf:Tf.apply(null,arguments)},nz=e=>e&&typeof e.match=="function";function Fr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(process.env.NODE_ENV==="production"?Re(0):"prepareAction did not return an object");return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Fb(r)&&r.type===e,n}function rz(e){return typeof e=="function"&&"type"in e&&nz(e)}function iz(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
168
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:o,secondInputs:a,stack:c})}},fW={inputStabilityCheck:"once",identityFunctionCheck:"once"};function pW(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hW(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function mW(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Z_=e=>Array.isArray(e)?e:[e];function gW(e){const t=Array.isArray(e[0])?e[0]:e;return mW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function J_(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var vW=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...fW,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:uW},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:dW}}},yW=class{constructor(e){this.value=e}deref(){return this.value}},bW=typeof WeakRef<"u"?WeakRef:yW,xW=0,eS=1;function id(){return{s:xW,v:void 0,o:null,p:null}}function TD(e,t={}){let n=id();const{resultEqualityCheck:r}=t;let i,o=0;function a(){let s=n;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let h=s.o;h===null&&(s.o=h=new WeakMap);const m=h.get(p);m===void 0?(s=id(),h.set(p,s)):s=m}else{let h=s.p;h===null&&(s.p=h=new Map);const m=h.get(p);m===void 0?(s=id(),h.set(p,s)):s=m}}const c=s;let u;if(s.s===eS)u=s.v;else if(u=e.apply(null,arguments),o++,r){const d=i?.deref?.()??i;d!=null&&r(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new bW(u):u}return c.s=eS,c.v=u,u}return a.clearCache=()=>{n=id(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function wW(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,s,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),pW(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:p=TD,argsMemoizeOptions:h=[],devModeChecks:m={}}=u,v=Z_(f),b=Z_(h),S=gW(i),w=d(function(){return o++,c.apply(null,arguments)},...v);let x=!0;const _=p(function(){a++;const k=J_(S,arguments);if(s=w.apply(null,k),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:D,inputStabilityCheck:T}=vW(x,m);if(D.shouldRun&&D.run(c,k,s),T.shouldRun){const j=J_(S,arguments);T.run({inputSelectorResults:k,inputSelectorResultsCopy:j},{memoize:d,memoizeOptions:v},arguments)}x&&(x=!1)}return s},...b);return Object.assign(_,{resultFunc:c,memoizedResultFunc:w,dependencies:S,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var z=wW(TD),_W=Object.assign((e,t=z)=>{hW(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,s,l)=>(a[n[l]]=s,a),{}))},{withTypes:()=>_W}),lg={},cg={},ug={},tS;function SW(){return tS||(tS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,o)=>{if(r!==i){const a=t(r),s=t(i);if(a===s&&a===0){if(r<i)return o==="desc"?1:-1;if(r>i)return o==="desc"?-1:1}return o==="desc"?s-a:a-s}return 0};e.compareValues=n})(ug)),ug}var dg={},fg={},nS;function MD(){return nS||(nS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(fg)),fg}var rS;function EW(){return rS||(rS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MD(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,a){return Array.isArray(o)?!1:typeof o=="number"||typeof o=="boolean"||o==null||t.isSymbol(o)?!0:typeof o=="string"&&(r.test(o)||!n.test(o))||a!=null&&Object.hasOwn(a,o)}e.isKey=i})(dg)),dg}var iS;function OW(){return iS||(iS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SW(),n=EW(),r=_b();function i(o,a,s,l){if(o==null)return[];s=l?void 0:s,Array.isArray(o)||(o=Object.values(o)),Array.isArray(a)||(a=a==null?[null]:[a]),a.length===0&&(a=[null]),Array.isArray(s)||(s=s==null?[]:[s]),s=s.map(p=>String(p));const c=(p,h)=>{let m=p;for(let v=0;v<h.length&&m!=null;++v)m=m[h[v]];return m},u=(p,h)=>h==null||p==null?h:typeof p=="object"&&"key"in p?Object.hasOwn(h,p.key)?h[p.key]:c(h,p.path):typeof p=="function"?p(h):Array.isArray(p)?c(h,p):typeof h=="object"?h[p]:h,d=a.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||n.isKey(p)?p:{key:p,path:r.toPath(p)}));return o.map(p=>({original:p,criteria:d.map(h=>u(h,p))})).slice().sort((p,h)=>{for(let m=0;m<d.length;m++){const v=t.compareValues(p.criteria[m],h.criteria[m],s[m]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=i})(cg)),cg}var pg={},oS;function CW(){return oS||(oS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],o=Math.floor(r),a=(s,l)=>{for(let c=0;c<s.length;c++){const u=s[c];Array.isArray(u)&&l<o?a(u,l+1):i.push(u)}};return a(n,0),i}e.flatten=t})(pg)),pg}var hg={},aS;function ND(){return aS||(aS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kD(),n=jb(),r=_D(),i=ED();function o(a,s,l){return r.isObject(l)&&(typeof s=="number"&&n.isArrayLike(l)&&t.isIndex(s)&&s<l.length||typeof s=="string"&&s in l)?i.eq(l[s],a):!1}e.isIterateeCall=o})(hg)),hg}var sS;function PW(){return sS||(sS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OW(),n=CW(),r=ND();function i(o,...a){const s=a.length;return s>1&&r.isIterateeCall(o,a[0],a[1])?a=[]:s>2&&r.isIterateeCall(a[0],a[1],a[2])&&(a=[a[0]]),t.orderBy(o,n.flatten(a),["asc"])}e.sortBy=i})(lg)),lg}var mg,lS;function kW(){return lS||(lS=1,mg=PW().sortBy),mg}var DW=kW();const oh=go(DW);var jD=e=>e.legend.settings,AW=e=>e.legend.size,TW=e=>e.legend.payload,MW=z([TW,jD],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?oh(r,n):r});function NW(){return ue(MW)}var od=1;function RD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=P.useState({height:0,left:0,top:0,width:0}),r=P.useCallback(i=>{if(i!=null){var o=i.getBoundingClientRect(),a={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(a.height-t.height)>od||Math.abs(a.left-t.left)>od||Math.abs(a.top-t.top)>od||Math.abs(a.width-t.width)>od)&&n({height:a.height,left:a.left,top:a.top,width:a.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function ln(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var jW=typeof Symbol=="function"&&Symbol.observable||"@@observable",cS=jW,gg=()=>Math.random().toString(36).substring(7).split("").join("."),RW={INIT:`@@redux/INIT${gg()}`,REPLACE:`@@redux/REPLACE${gg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${gg()}`},$a=RW;function mu(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function IW(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if($W(e))return"date";if(LW(e))return"error";const n=FW(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function FW(e){return typeof e.constructor=="function"?e.constructor.name:null}function LW(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function $W(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function To(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=IW(e)),t}function ID(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?ln(2):`Expected the root reducer to be a function. Instead, received: '${To(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?ln(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?ln(1):`Expected the enhancer to be a function. Instead, received: '${To(n)}'`);return n(ID)(e,t)}let r=e,i=t,o=new Map,a=o,s=0,l=!1;function c(){a===o&&(a=new Map,o.forEach((v,b)=>{a.set(b,v)}))}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?ln(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function d(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ln(4):`Expected the listener to be a function. Instead, received: '${To(v)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?ln(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;c();const S=s++;return a.set(S,v),function(){if(b){if(l)throw new Error(process.env.NODE_ENV==="production"?ln(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c(),a.delete(S),o=null}}}function f(v){if(!mu(v))throw new Error(process.env.NODE_ENV==="production"?ln(7):`Actions must be plain objects. Instead, the actual type was: '${To(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?ln(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?ln(17):`Action "type" property must be a string. Instead, the actual type was: '${To(v.type)}'. Value was: '${v.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?ln(9):"Reducers may not dispatch actions.");try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(S=>{S()}),v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?ln(10):`Expected the nextReducer to be a function. Instead, received: '${To(v)}`);r=v,f({type:$a.REPLACE})}function h(){const v=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?ln(11):`Expected the observer to be an object. Instead, received: '${To(b)}'`);function S(){const x=b;x.next&&x.next(u())}return S(),{unsubscribe:v(S)}},[cS](){return this}}}return f({type:$a.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[cS]:h}}function uS(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function BW(e,t,n,r){const i=Object.keys(t),o=n&&n.type===$a.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!mu(e))return`The ${o} has unexpected type of "${To(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const a=Object.keys(e).filter(s=>!t.hasOwnProperty(s)&&!r[s]);if(a.forEach(s=>{r[s]=!0}),!(n&&n.type===$a.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function WW(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:$a.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?ln(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:$a.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?ln(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${$a.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function FD(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];process.env.NODE_ENV!=="production"&&typeof e[s]>"u"&&uS(`No reducer provided for key "${s}"`),typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let o;try{WW(n)}catch(a){o=a}return function(s={},l){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=BW(s,n,l,i);d&&uS(d)}let c=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],p=n[f],h=s[f],m=p(h,l);if(typeof m>"u"){const v=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?ln(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[f]=m,c=c||m!==h}return c=c||r.length!==Object.keys(s).length,c?u:s}}function Tf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function zW(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?ln(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},s=e.map(l=>l(a));return o=Tf(...s)(i.dispatch),{...i,dispatch:o}}}function Fb(e){return mu(e)&&"type"in e&&typeof e.type=="string"}var LD=Symbol.for("immer-nothing"),dS=Symbol.for("immer-draftable"),yr=Symbol.for("immer-state"),VW=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Xn(e,...t){if(process.env.NODE_ENV!=="production"){const n=VW[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zs=Object.getPrototypeOf;function Qa(e){return!!e&&!!e[yr]}function co(e){return e?$D(e)||Array.isArray(e)||!!e[dS]||!!e.constructor?.[dS]||gu(e)||sh(e):!1}var HW=Object.prototype.constructor.toString();function $D(e){if(!e||typeof e!="object")return!1;const t=Zs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===HW}function Mf(e,t){ah(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ah(e){const t=e[yr];return t?t.type_:Array.isArray(e)?1:gu(e)?2:sh(e)?3:0}function Wv(e,t){return ah(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function BD(e,t,n){const r=ah(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function YW(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function gu(e){return e instanceof Map}function sh(e){return e instanceof Set}function wa(e){return e.copy_||e.base_}function zv(e,t){if(gu(e))return new Map(e);if(sh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=$D(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[yr];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const a=i[o],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Zs(e),r)}else{const r=Zs(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Lb(e,t=!1){return lh(e)||Qa(e)||!co(e)||(ah(e)>1&&Object.defineProperties(e,{set:{value:ad},add:{value:ad},clear:{value:ad},delete:{value:ad}}),Object.freeze(e),t&&Object.values(e).forEach(n=>Lb(n,!0))),e}function ad(){Xn(2)}function lh(e){return Object.isFrozen(e)}var UW={};function Za(e){const t=UW[e];return t||Xn(0,e),t}var Fc;function WD(){return Fc}function KW(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fS(e,t){t&&(Za("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vv(e){Hv(e),e.drafts_.forEach(qW),e.drafts_=null}function Hv(e){e===Fc&&(Fc=e.parent_)}function pS(e){return Fc=KW(Fc,e)}function qW(e){const t=e[yr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[yr].modified_&&(Vv(t),Xn(4)),co(e)&&(e=Nf(t,e),t.parent_||jf(t,e)),t.patches_&&Za("Patches").generateReplacementPatches_(n[yr].base_,e,t.patches_,t.inversePatches_)):e=Nf(t,n,[]),Vv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==LD?e:void 0}function Nf(e,t,n){if(lh(t))return t;const r=t[yr];if(!r)return Mf(t,(i,o)=>mS(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return jf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),Mf(o,(s,l)=>mS(e,r,i,s,l,n,a)),jf(e,i,!1),n&&e.patches_&&Za("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function mS(e,t,n,r,i,o,a){if(process.env.NODE_ENV!=="production"&&i===n&&Xn(5),Qa(i)){const s=o&&t&&t.type_!==3&&!Wv(t.assigned_,r)?o.concat(r):void 0,l=Nf(e,i,s);if(BD(n,r,l),Qa(l))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(co(i)&&!lh(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Nf(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(gu(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&jf(e,i)}}function jf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lb(t,n)}function GW(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:WD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=$b;n&&(i=[r],o=Lc);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}var $b={get(e,t){if(t===yr)return e;const n=wa(e);if(!Wv(n,t))return XW(e,n,t);const r=n[t];return e.finalized_||!co(r)?r:r===vg(e.base_,t)?(yg(e),e.copy_[t]=Uv(r,e)):r},has(e,t){return t in wa(e)},ownKeys(e){return Reflect.ownKeys(wa(e))},set(e,t,n){const r=zD(wa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=vg(wa(e),t),o=i?.[yr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(YW(n,i)&&(n!==void 0||Wv(e.base_,t)))return!0;yg(e),Yv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return vg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,yg(e),Yv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=wa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Xn(11)},getPrototypeOf(e){return Zs(e.base_)},setPrototypeOf(){Xn(12)}},Lc={};Mf($b,(e,t)=>{Lc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Lc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Xn(13),Lc.set.call(this,e,t,void 0)};Lc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Xn(14),$b.set.call(this,e[0],t,n,e[0])};function vg(e,t){const n=e[yr];return(n?wa(n):e)[t]}function XW(e,t,n){const r=zD(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function zD(e,t){if(!(t in e))return;let n=Zs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Zs(n)}}function Yv(e){e.modified_||(e.modified_=!0,e.parent_&&Yv(e.parent_))}function yg(e){e.copy_||(e.copy_=zv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var QW=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(l=o,...c){return a.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Xn(6),r!==void 0&&typeof r!="function"&&Xn(7);let i;if(co(t)){const o=pS(this),a=Uv(t,void 0);let s=!0;try{i=n(a),s=!1}finally{s?Vv(o):Hv(o)}return fS(o,r),hS(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===LD&&(i=void 0),this.autoFreeze_&&Lb(i,!0),r){const o=[],a=[];Za("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else Xn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let r,i;return[this.produce(t,n,(a,s)=>{r=a,i=s}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){co(e)||Xn(8),Qa(e)&&(e=no(e));const t=pS(this),n=Uv(e,void 0);return n[yr].isManual_=!0,Hv(t),n}finishDraft(e,t){const n=e&&e[yr];(!n||!n.isManual_)&&Xn(9);const{scope_:r}=n;return fS(r,t),hS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Za("Patches").applyPatches_;return Qa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Uv(e,t){const n=gu(e)?Za("MapSet").proxyMap_(e,t):sh(e)?Za("MapSet").proxySet_(e,t):GW(e,t);return(t?t.scope_:WD()).drafts_.push(n),n}function no(e){return Qa(e)||Xn(10,e),VD(e)}function VD(e){if(!co(e)||lh(e))return e;const t=e[yr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=zv(e,t.scope_.immer_.useStrictShallowCopy_)}else n=zv(e,!0);return Mf(n,(r,i)=>{BD(n,r,VD(i))}),t&&(t.finalized_=!1),n}var ZW=new QW,HD=ZW.produce;function YD(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var JW=YD(),ez=YD,tz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tf:Tf.apply(null,arguments)},nz=e=>e&&typeof e.match=="function";function Fr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(process.env.NODE_ENV==="production"?Ie(0):"prepareAction did not return an object");return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Fb(r)&&r.type===e,n}function rz(e){return typeof e=="function"&&"type"in e&&nz(e)}function iz(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
169
169
  Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function oz(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=rz}=e;return()=>n=>r=>(t(r)&&console.warn(iz(r.type)),n(r))}function UD(e,t){let n=0;return{measureTime(r){const i=Date.now();try{return r()}finally{const o=Date.now();n+=o-i}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
170
170
  If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
171
- It is disabled in production builds, so you don't need to worry about that.`)}}}var KD=class cc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,cc.prototype)}static get[Symbol.species](){return cc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new cc(...t[0].concat(this)):new cc(...t.concat(this))}};function gS(e){return co(e)?HD(e,()=>{}):e}function sd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function az(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function sz(e,t,n){const r=qD(e,t,n);return{detectMutations(){return GD(e,t,r,n)}}}function qD(e,t=[],n,r="",i=new Set){const o={value:n};if(!e(n)&&!i.has(n)){i.add(n),o.children={};for(const a in n){const s=r?r+"."+a:a;t.length&&t.indexOf(s)!==-1||(o.children[a]=qD(e,t,n[a],s))}}return o}function GD(e,t=[],n,r,i=!1,o=""){const a=n?n.value:void 0,s=a===r;if(i&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:o};if(e(a)||e(r))return{wasMutated:!1};const l={};for(let u in n.children)l[u]=!0;for(let u in r)l[u]=!0;const c=t.length>0;for(let u in l){const d=o?o+"."+u:u;if(c&&t.some(h=>h instanceof RegExp?h.test(d):d===h))continue;const f=GD(e,t,n.children[u],r[u],s,d);if(f.wasMutated)return f}return{wasMutated:!1}}function lz(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(s,l,c,u){return JSON.stringify(s,n(l,u),c)},n=function(s,l){let c=[],u=[];return l||(l=function(d,f){return c[0]===f?"[Circular ~]":"[Circular ~."+u.slice(0,c.indexOf(f)).join(".")+"]"}),function(d,f){if(c.length>0){var p=c.indexOf(this);~p?c.splice(p+1):c.push(this),~p?u.splice(p,1/0,d):u.push(d),~c.indexOf(f)&&(f=l.call(this,d,f))}else c.push(f);return s==null?f:s.call(this,d,f)}},{isImmutable:r=az,ignoredPaths:i,warnAfter:o=32}=e;const a=sz.bind(null,r,i);return({getState:s})=>{let l=s(),c=a(l),u;return d=>f=>{const p=UD(o,"ImmutableStateInvariantMiddleware");p.measureTime(()=>{if(l=s(),u=c.detectMutations(),c=a(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Re(19):`A state mutation was detected between dispatches, in the path '${u.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const h=d(f);return p.measureTime(()=>{if(l=s(),u=c.detectMutations(),c=a(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Re(20):`A state mutation was detected inside a dispatch, in the path: ${u.path||""}. Take a look at the reducer(s) handling the action ${t(f)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),p.warnIfExceeded(),h}}}}function XD(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||mu(e)}function Kv(e,t="",n=XD,r,i=[],o){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o?.has(e))return!1;const s=r!=null?r(e):Object.entries(e),l=i.length>0;for(const[c,u]of s){const d=t?t+"."+c:c;if(!(l&&i.some(p=>p instanceof RegExp?p.test(d):d===p))){if(!n(u))return{keyPath:d,value:u};if(typeof u=="object"&&(a=Kv(u,d,n,r,i,o),a))return a}}return o&&QD(e)&&o.add(e),!1}function QD(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!QD(t))return!1;return!0}function cz(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=XD,getEntries:n,ignoredActions:r=[],ignoredActionPaths:i=["meta.arg","meta.baseQueryMeta"],ignoredPaths:o=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:l=!1,disableCache:c=!1}=e,u=!c&&WeakSet?new WeakSet:void 0;return d=>f=>p=>{if(!Fb(p))return f(p);const h=f(p),m=UD(a,"SerializableStateInvariantMiddleware");return!l&&!(r.length&&r.indexOf(p.type)!==-1)&&m.measureTime(()=>{const v=Kv(p,"",t,n,i,u);if(v){const{keyPath:b,value:S}=v;console.error(`A non-serializable value was detected in an action, in the path: \`${b}\`. Value:`,S,`
171
+ It is disabled in production builds, so you don't need to worry about that.`)}}}var KD=class cc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,cc.prototype)}static get[Symbol.species](){return cc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new cc(...t[0].concat(this)):new cc(...t.concat(this))}};function gS(e){return co(e)?HD(e,()=>{}):e}function sd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function az(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function sz(e,t,n){const r=qD(e,t,n);return{detectMutations(){return GD(e,t,r,n)}}}function qD(e,t=[],n,r="",i=new Set){const o={value:n};if(!e(n)&&!i.has(n)){i.add(n),o.children={};for(const a in n){const s=r?r+"."+a:a;t.length&&t.indexOf(s)!==-1||(o.children[a]=qD(e,t,n[a],s))}}return o}function GD(e,t=[],n,r,i=!1,o=""){const a=n?n.value:void 0,s=a===r;if(i&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:o};if(e(a)||e(r))return{wasMutated:!1};const l={};for(let u in n.children)l[u]=!0;for(let u in r)l[u]=!0;const c=t.length>0;for(let u in l){const d=o?o+"."+u:u;if(c&&t.some(h=>h instanceof RegExp?h.test(d):d===h))continue;const f=GD(e,t,n.children[u],r[u],s,d);if(f.wasMutated)return f}return{wasMutated:!1}}function lz(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(s,l,c,u){return JSON.stringify(s,n(l,u),c)},n=function(s,l){let c=[],u=[];return l||(l=function(d,f){return c[0]===f?"[Circular ~]":"[Circular ~."+u.slice(0,c.indexOf(f)).join(".")+"]"}),function(d,f){if(c.length>0){var p=c.indexOf(this);~p?c.splice(p+1):c.push(this),~p?u.splice(p,1/0,d):u.push(d),~c.indexOf(f)&&(f=l.call(this,d,f))}else c.push(f);return s==null?f:s.call(this,d,f)}},{isImmutable:r=az,ignoredPaths:i,warnAfter:o=32}=e;const a=sz.bind(null,r,i);return({getState:s})=>{let l=s(),c=a(l),u;return d=>f=>{const p=UD(o,"ImmutableStateInvariantMiddleware");p.measureTime(()=>{if(l=s(),u=c.detectMutations(),c=a(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Ie(19):`A state mutation was detected between dispatches, in the path '${u.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const h=d(f);return p.measureTime(()=>{if(l=s(),u=c.detectMutations(),c=a(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Ie(20):`A state mutation was detected inside a dispatch, in the path: ${u.path||""}. Take a look at the reducer(s) handling the action ${t(f)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),p.warnIfExceeded(),h}}}}function XD(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||mu(e)}function Kv(e,t="",n=XD,r,i=[],o){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o?.has(e))return!1;const s=r!=null?r(e):Object.entries(e),l=i.length>0;for(const[c,u]of s){const d=t?t+"."+c:c;if(!(l&&i.some(p=>p instanceof RegExp?p.test(d):d===p))){if(!n(u))return{keyPath:d,value:u};if(typeof u=="object"&&(a=Kv(u,d,n,r,i,o),a))return a}}return o&&QD(e)&&o.add(e),!1}function QD(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!QD(t))return!1;return!0}function cz(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=XD,getEntries:n,ignoredActions:r=[],ignoredActionPaths:i=["meta.arg","meta.baseQueryMeta"],ignoredPaths:o=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:l=!1,disableCache:c=!1}=e,u=!c&&WeakSet?new WeakSet:void 0;return d=>f=>p=>{if(!Fb(p))return f(p);const h=f(p),m=UD(a,"SerializableStateInvariantMiddleware");return!l&&!(r.length&&r.indexOf(p.type)!==-1)&&m.measureTime(()=>{const v=Kv(p,"",t,n,i,u);if(v){const{keyPath:b,value:S}=v;console.error(`A non-serializable value was detected in an action, in the path: \`${b}\`. Value:`,S,`
172
172
  Take a look at the logic that dispatched this action: `,p,`
173
173
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
174
174
  (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),s||(m.measureTime(()=>{const v=d.getState(),b=Kv(v,"",t,n,o,u);if(b){const{keyPath:S,value:w}=b;console.error(`A non-serializable value was detected in the state, in the path: \`${S}\`. Value:`,w,`
175
175
  Take a look at the reducer(s) handling this action type: ${p.type}.
176
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),m.warnIfExceeded()),h}}}function ld(e){return typeof e=="boolean"}var uz=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new KD;if(n&&(ld(n)?a.push(JW):a.push(ez(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let s={};ld(r)||(s=r),a.unshift(lz(s))}if(i){let s={};ld(i)||(s=i),a.push(cz(s))}if(o){let s={};ld(o)||(s=o),a.unshift(oz(s))}}return a},dz="RTK_autoBatch",vS=e=>t=>{setTimeout(t,e)},fz=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:vS(10):e.type==="callback"?e.queueNotification:vS(e.timeout),c=()=>{a=!1,o&&(o=!1,s.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>i&&u(),f=r.subscribe(d);return s.add(u),()=>{f(),s.delete(u)}},dispatch(u){try{return i=!u?.meta?.[dz],o=!i,o&&(a||(a=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},pz=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new KD(e);return r&&i.push(fz(typeof r=="object"?r:void 0)),i};function hz(e){const t=uz(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:o=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(mu(n))l=FD(n);else throw new Error(process.env.NODE_ENV==="production"?Re(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Re(2):"`middleware` field must be a callback");let c;if(typeof r=="function"){if(c=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(c))throw new Error(process.env.NODE_ENV==="production"?Re(3):"when using a middleware builder function, an array of middleware must be returned")}else c=t();if(process.env.NODE_ENV!=="production"&&c.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Re(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let m=new Set;c.forEach(v=>{if(m.has(v))throw new Error(process.env.NODE_ENV==="production"?Re(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");m.add(v)})}let u=Tf;i&&(u=tz({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const d=zW(...c),f=pz(d);if(process.env.NODE_ENV!=="production"&&s&&typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?Re(5):"`enhancers` field must be a callback");let p=typeof s=="function"?s(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(p))throw new Error(process.env.NODE_ENV==="production"?Re(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&p.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Re(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&c.length&&!p.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=u(...p);return ID(l,a,h)}function ZD(e){const t={},n=[];let r;const i={addCase(o,a){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Re(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Re(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const s=typeof o=="string"?o:o.type;if(!s)throw new Error(process.env.NODE_ENV==="production"?Re(28):"`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error(process.env.NODE_ENV==="production"?Re(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);return t[s]=a,i},addAsyncThunk(o,a){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Re(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return a.pending&&(t[o.pending.type]=a.pending),a.rejected&&(t[o.rejected.type]=a.rejected),a.fulfilled&&(t[o.fulfilled.type]=a.fulfilled),a.settled&&n.push({matcher:o.settled,reducer:a.settled}),i},addMatcher(o,a){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Re(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:a}),i},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Re(31):"`builder.addDefaultCase` can only be called once");return r=o,i}};return e(i),[t,n,r]}function mz(e){return typeof e=="function"}function gz(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Re(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=ZD(t),o;if(mz(e))o=()=>gS(e());else{const s=gS(e);o=()=>s}function a(s=o(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[i]),c.reduce((u,d)=>{if(d)if(Qa(u)){const p=d(u,l);return p===void 0?u:p}else{if(co(u))return HD(u,f=>d(f,l));{const f=d(u,l);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},s)}return a.getInitialState=o,a}var vz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",yz=(e=21)=>{let t="",n=e;for(;n--;)t+=vz[Math.random()*64|0];return t},bz=Symbol.for("rtk-slice-createasyncthunk");function xz(e,t){return`${e}/${t}`}function wz({creators:e}={}){const t=e?.asyncThunk?.[bz];return function(r){const{name:i,reducerPath:o=i}=r;if(!i)throw new Error(process.env.NODE_ENV==="production"?Re(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof r.reducers=="function"?r.reducers(Sz()):r.reducers)||{},s=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(w,x){const _=typeof w=="string"?w:w.type;if(!_)throw new Error(process.env.NODE_ENV==="production"?Re(12):"`context.addCase` cannot be called with an empty action type");if(_ in l.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Re(13):"`context.addCase` cannot be called with two reducers for the same action type: "+_);return l.sliceCaseReducersByType[_]=x,c},addMatcher(w,x){return l.sliceMatchers.push({matcher:w,reducer:x}),c},exposeAction(w,x){return l.actionCreators[w]=x,c},exposeCaseReducer(w,x){return l.sliceCaseReducersByName[w]=x,c}};s.forEach(w=>{const x=a[w],_={reducerName:w,type:xz(i,w),createNotation:typeof r.reducers=="function"};Oz(x)?Pz(_,x,c,t):Ez(_,x,c)});function u(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Re(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[w={},x=[],_=void 0]=typeof r.extraReducers=="function"?ZD(r.extraReducers):[r.extraReducers],O={...w,...l.sliceCaseReducersByType};return gz(r.initialState,k=>{for(let D in O)k.addCase(D,O[D]);for(let D of l.sliceMatchers)k.addMatcher(D.matcher,D.reducer);for(let D of x)k.addMatcher(D.matcher,D.reducer);_&&k.addDefaultCase(_)})}const d=w=>w,f=new Map,p=new WeakMap;let h;function m(w,x){return h||(h=u()),h(w,x)}function v(){return h||(h=u()),h.getInitialState()}function b(w,x=!1){function _(k){let D=k[w];if(typeof D>"u"){if(x)D=sd(p,_,v);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Re(15):"selectSlice returned undefined for an uninjected slice reducer")}return D}function O(k=d){const D=sd(f,x,()=>new WeakMap);return sd(D,k,()=>{const T={};for(const[j,A]of Object.entries(r.selectors??{}))T[j]=_z(A,k,()=>sd(p,k,v),x);return T})}return{reducerPath:w,getSelectors:O,get selectors(){return O(_)},selectSlice:_}}const S={name:i,reducer:m,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:v,...b(o),injectInto(w,{reducerPath:x,..._}={}){const O=x??o;return w.inject({reducerPath:O,reducer:m},_),{...S,...b(O,!0)}}};return S}}function _z(e,t,n,r){function i(o,...a){let s=t(o);if(typeof s>"u"){if(r)s=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Re(16):"selectState returned undefined for an uninjected slice reducer")}return e(s,...a)}return i.unwrapped=e,i}var xr=wz();function Sz(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Ez({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!Cz(r))throw new Error(process.env.NODE_ENV==="production"?Re(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?Fr(e,a):Fr(e))}function Oz(e){return e._reducerDefinitionType==="asyncThunk"}function Cz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Pz({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?Re(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:a,pending:s,rejected:l,settled:c,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),l&&r.addCase(d.rejected,l),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:a||cd,pending:s||cd,rejected:l||cd,settled:c||cd})}function cd(){}var kz="task",JD="listener",eA="completed",Bb="cancelled",Dz=`task-${Bb}`,Az=`task-${eA}`,qv=`${JD}-${Bb}`,Tz=`${JD}-${eA}`,ch=class{constructor(e){this.code=e,this.message=`${kz} ${Bb} (reason: ${e})`}name="TaskAbortError";message},Wb=(e,t)=>{if(typeof e!="function")throw new TypeError(process.env.NODE_ENV==="production"?Re(32):`${t} is not a function`)},Rf=()=>{},tA=(e,t=Rf)=>(e.catch(t),e),nA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ba=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Wa=e=>{if(e.aborted){const{reason:t}=e;throw new ch(t)}};function rA(e,t){let n=Rf;return new Promise((r,i)=>{const o=()=>i(new ch(e.reason));if(e.aborted){o();return}n=nA(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Rf})}var Mz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ch?"cancelled":"rejected",error:n}}finally{t?.()}},If=e=>t=>tA(rA(e,t).then(n=>(Wa(e),n))),iA=e=>{const t=If(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Fs}=Object,yS={},vu="listenerMiddleware",Nz=(e,t)=>{const n=r=>nA(e,()=>Ba(r,e.reason));return(r,i)=>{Wb(r,"taskExecutor");const o=new AbortController;n(o);const a=Mz(async()=>{Wa(e),Wa(o.signal);const s=await r({pause:If(o.signal),delay:iA(o.signal),signal:o.signal});return Wa(o.signal),s},()=>Ba(o,Az));return i?.autoJoin&&t.push(a.catch(Rf)),{result:If(e)(a),cancel(){Ba(o,Dz)}}}},jz=(e,t)=>{const n=async(r,i)=>{Wa(t);let o=()=>{};const s=[new Promise((l,c)=>{let u=e({predicate:r,effect:(d,f)=>{f.unsubscribe(),l([d,f.getState(),f.getOriginalState()])}});o=()=>{u(),c()}})];i!=null&&s.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await rA(t,Promise.race(s));return Wa(t),l}finally{o()}};return(r,i)=>tA(n(r,i))},oA=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=Fr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(process.env.NODE_ENV==="production"?Re(21):"Creating or removing a listener requires one of the known fields for matching an action");return Wb(o,"options.listener"),{predicate:i,type:t,effect:o}},aA=Fs(e=>{const{type:t,predicate:n,effect:r}=oA(e);return{id:yz(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(process.env.NODE_ENV==="production"?Re(22):"Unsubscribe not initialized")}}},{withTypes:()=>aA}),bS=(e,t)=>{const{type:n,effect:r,predicate:i}=oA(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===i)&&o.effect===r)},Gv=e=>{e.pending.forEach(t=>{Ba(t,qv)})},Rz=e=>()=>{e.forEach(Gv),e.clear()},xS=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},sA=Fs(Fr(`${vu}/add`),{withTypes:()=>sA}),Iz=Fr(`${vu}/removeAll`),lA=Fs(Fr(`${vu}/remove`),{withTypes:()=>lA}),Fz=(...e)=>{console.error(`${vu}/error`,...e)},yu=(e={})=>{const t=new Map,{extra:n,onError:r=Fz}=e;Wb(r,"onError");const i=u=>(u.unsubscribe=()=>t.delete(u.id),t.set(u.id,u),d=>{u.unsubscribe(),d?.cancelActive&&Gv(u)}),o=u=>{const d=bS(t,u)??aA(u);return i(d)};Fs(o,{withTypes:()=>o});const a=u=>{const d=bS(t,u);return d&&(d.unsubscribe(),u.cancelActive&&Gv(d)),!!d};Fs(a,{withTypes:()=>a});const s=async(u,d,f,p)=>{const h=new AbortController,m=jz(o,h.signal),v=[];try{u.pending.add(h),await Promise.resolve(u.effect(d,Fs({},f,{getOriginalState:p,condition:(b,S)=>m(b,S).then(Boolean),take:m,delay:iA(h.signal),pause:If(h.signal),extra:n,signal:h.signal,fork:Nz(h.signal,v),unsubscribe:u.unsubscribe,subscribe:()=>{t.set(u.id,u)},cancelActiveListeners:()=>{u.pending.forEach((b,S,w)=>{b!==h&&(Ba(b,qv),w.delete(b))})},cancel:()=>{Ba(h,qv),u.pending.delete(h)},throwIfCancelled:()=>{Wa(h.signal)}})))}catch(b){b instanceof ch||xS(r,b,{raisedBy:"effect"})}finally{await Promise.all(v),Ba(h,Tz),u.pending.delete(h)}},l=Rz(t);return{middleware:u=>d=>f=>{if(!Fb(f))return d(f);if(sA.match(f))return o(f.payload);if(Iz.match(f)){l();return}if(lA.match(f))return a(f.payload);let p=u.getState();const h=()=>{if(p===yS)throw new Error(process.env.NODE_ENV==="production"?Re(23):`${vu}: getOriginalState can only be called synchronously`);return p};let m;try{if(m=d(f),t.size>0){const v=u.getState(),b=Array.from(t.values());for(const S of b){let w=!1;try{w=S.predicate(f,v,p)}catch(x){w=!1,xS(r,x,{raisedBy:"predicate"})}w&&s(S,f,u,h)}}}finally{p=yS}return m},startListening:o,stopListening:a,clearListeners:l}};function Re(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Lz={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},cA=xr({name:"chartLayout",initialState:Lz,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:$z,setLayout:Bz,setChartSize:Wz,setScale:zz}=cA.actions,Vz=cA.reducer;function wS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wS(Object(n),!0).forEach(function(r){Hz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hz(e,t,n){return(t=Yz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yz(e){var t=Uz(e,"string");return typeof t=="symbol"?t:t+""}function Uz(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ff=Math.PI/180,Kz=e=>e*180/Math.PI,Vt=(e,t,n,r)=>({x:e+Math.cos(-Ff*r)*n,y:t+Math.sin(-Ff*r)*n}),uA=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},qz=(e,t)=>{var{x:n,y:r}=e,{x:i,y:o}=t;return Math.sqrt((n-i)**2+(r-o)**2)},Gz=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:o}=t,a=qz({x:n,y:r},{x:i,y:o});if(a<=0)return{radius:a,angle:0};var s=(n-i)/a,l=Math.acos(s);return r>o&&(l=2*Math.PI-l),{radius:a,angle:Kz(l),angleInRadian:l}},Xz=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:t-o*360,endAngle:n-o*360}},Qz=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return e+a*360},Zz=(e,t)=>{var{x:n,y:r}=e,{radius:i,angle:o}=Gz({x:n,y:r},t),{innerRadius:a,outerRadius:s}=t;if(i<a||i>s||i===0)return null;var{startAngle:l,endAngle:c}=Xz(t),u=o,d;if(l<=c){for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}else{for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}return d?_S(_S({},t),{},{radius:i,angle:Qz(u,t)}):null};function dA(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function SS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SS(Object(n),!0).forEach(function(r){Jz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jz(e,t,n){return(t=e7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e7(e){var t=t7(e,"string");return typeof t=="symbol"?t:t+""}function t7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tt(e,t,n){return ht(e)||ht(t)?n:Ir(t)?Xa(e,t,n):typeof t=="function"?t(e):n}var n7=(e,t,n,r,i)=>{var o,a=-1,s=(o=t?.length)!==null&&o!==void 0?o:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<s;l++){var c=l>0?n[l-1].coordinate:n[s-1].coordinate,u=n[l].coordinate,d=l>=s-1?n[0].coordinate:n[l+1].coordinate,f=void 0;if(rn(u-c)!==rn(d-u)){var p=[];if(rn(d-u)===rn(i[1]-i[0])){f=d;var h=u+i[1]-i[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+i[1]-i[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var v=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){({index:a}=n[l]);break}}else{var b=Math.min(c,d),S=Math.max(c,d);if(e>(b+u)/2&&e<=(S+u)/2){({index:a}=n[l]);break}}}else if(t){for(var w=0;w<s;w++)if(w===0&&e<=(t[w].coordinate+t[w+1].coordinate)/2||w>0&&w<s-1&&e>(t[w].coordinate+t[w-1].coordinate)/2&&e<=(t[w].coordinate+t[w+1].coordinate)/2||w===s-1&&e>(t[w].coordinate+t[w-1].coordinate)/2){({index:a}=t[w]);break}}return a},r7=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:o,verticalAlign:a,layout:s}=t;if((s==="vertical"||s==="horizontal"&&a==="middle")&&o!=="center"&&pe(e[o]))return Mr(Mr({},e),{},{[o]:e[o]+(r||0)});if((s==="horizontal"||s==="vertical"&&o==="center")&&a!=="middle"&&pe(e[a]))return Mr(Mr({},e),{},{[a]:e[a]+(i||0)})}return e},Ai=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",fA=(e,t,n,r)=>{if(r)return e.map(s=>s.coordinate);var i,o,a=e.map(s=>(s.coordinate===t&&(i=!0),s.coordinate===n&&(o=!0),s.coordinate));return i||a.push(t),o||a.push(n),a},pA=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:o,scale:a,realScaleType:s,isCategorical:l,categoricalDomain:c,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!a)return null;var h=s==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,m=i==="category"&&a.bandwidth?a.bandwidth()/h:0;if(m=p==="angleAxis"&&o&&o.length>=2?rn(o[0]-o[1])*2*m:m,d||f){var v=(d||f||[]).map((b,S)=>{var w=r?r.indexOf(b):b;return{coordinate:a(w)+m,value:b,offset:m,index:S}});return v.filter(b=>!Dn(b.coordinate))}return l&&c?c.map((b,S)=>({coordinate:a(b)+m,value:b,index:S,offset:m})):a.ticks&&u!=null?a.ticks(u).map((b,S)=>({coordinate:a(b)+m,value:b,offset:m,index:S})):a.domain().map((b,S)=>({coordinate:a(b)+m,value:r?r[b]:b,index:S,offset:m}))},ES=1e-4,i7=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-ES,o=Math.max(r[0],r[1])+ES,a=e(t[0]),s=e(t[n-1]);(a<i||a>o||s<i||s>o)&&e.domain([t[0],t[n-1]])}},o7=(e,t)=>{if(!t||t.length!==2||!pe(t[0])||!pe(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!pe(e[0])||e[0]<n)&&(i[0]=n),(!pe(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},a7=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0,a=0;a<t;++a){var s=Dn(e[a][n][1])?e[a][n][0]:e[a][n][1];s>=0?(e[a][n][0]=i,e[a][n][1]=i+s,i=e[a][n][1]):(e[a][n][0]=o,e[a][n][1]=o+s,o=e[a][n][1])}},s7=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0;o<t;++o){var a=Dn(e[o][n][1])?e[o][n][0]:e[o][n][1];a>=0?(e[o][n][0]=i,e[o][n][1]=i+a,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},l7={sign:a7,expand:x8,none:Qs,silhouette:w8,wiggle:_8,positive:s7},c7=(e,t,n)=>{var r=l7[n],i=b8().keys(t).value((o,a)=>+tt(o,a,0)).order(Lv).offset(r);return i(e)};function hA(e){return e==null?void 0:String(e)}function Lf(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:o,dataKey:a}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ht(i[t.dataKey])){var s=eD(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=tt(i,ht(a)?t.dataKey:a);return ht(l)?null:t.scale(l)}var OS=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:o,index:a}=e;if(t.type==="category")return n[a]?n[a].coordinate+r:null;var s=tt(o,t.dataKey,t.scale.domain()[a]);return ht(s)?null:t.scale(s)-i/2+r},u7=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},d7=e=>{var t=e.flat(2).filter(pe);return[Math.min(...t),Math.max(...t)]},f7=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],p7=(e,t,n)=>{if(e!=null)return f7(Object.keys(e).reduce((r,i)=>{var o=e[i],{stackedData:a}=o,s=a.reduce((l,c)=>{var u=dA(c,t,n),d=d7(u);return[Math.min(l[0],d[0]),Math.max(l[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},CS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ja=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=oh(t,u=>u.coordinate),o=1/0,a=1,s=i.length;a<s;a++){var l=i[a],c=i[a-1];o=Math.min((l.coordinate||0)-(c.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0};function kS(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:o}=e;return Mr(Mr({},t),{},{dataKey:n,payload:r,value:i,name:o})}function na(e,t){if(e)return String(e);if(typeof t=="string")return t}function h7(e,t,n,r,i){if(n==="horizontal"||n==="vertical"){var o=e>=i.left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height;return o?{x:e,y:t}:null}return r?Zz({x:e,y:t},r):null}var m7=(e,t,n,r)=>{var i=t.find(c=>c&&c.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.y};if(e==="vertical")return{x:r.x,y:i.coordinate};if(e==="centric"){var o=i.coordinate,{radius:a}=r;return Mr(Mr(Mr({},r),Vt(r.cx,r.cy,a,o)),{},{angle:o,radius:a})}var s=i.coordinate,{angle:l}=r;return Mr(Mr(Mr({},r),Vt(r.cx,r.cy,s,l)),{},{angle:l,radius:s})}return{x:0,y:0}},g7=(e,t)=>t==="horizontal"?e.x:t==="vertical"?e.y:t==="centric"?e.angle:e.radius,xo=e=>e.layout.width,wo=e=>e.layout.height,v7=e=>e.layout.scale,mA=e=>e.layout.margin,uh=z(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),dh=z(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),gA="data-recharts-item-index",vA="data-recharts-item-data-key",bu=60;function DS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DS(Object(n),!0).forEach(function(r){y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y7(e,t,n){return(t=b7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b7(e){var t=x7(e,"string");return typeof t=="symbol"?t:t+""}function x7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w7=e=>e.brush.height;function _7(e){var t=dh(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bu;return n+i}return n},0)}function S7(e){var t=dh(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bu;return n+i}return n},0)}function E7(e){var t=uh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function O7(e){var t=uh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Gt=z([xo,wo,mA,w7,_7,S7,E7,O7,jD,AW],(e,t,n,r,i,o,a,s,l,c)=>{var u={left:(n.left||0)+i,right:(n.right||0)+o},d={top:(n.top||0)+a,bottom:(n.bottom||0)+s},f=ud(ud({},d),u),p=f.bottom;f.bottom+=r,f=r7(f,l,c);var h=e-f.left-f.right,m=t-f.top-f.bottom;return ud(ud({brushBottom:p},f),{},{width:Math.max(h,0),height:Math.max(m,0)})}),C7=z(Gt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),zb=z(xo,wo,(e,t)=>({x:0,y:0,width:e,height:t})),P7=P.createContext(null),gn=()=>P.useContext(P7)!=null,fh=e=>e.brush,ph=z([fh,Gt,mA],(e,t,n)=>({height:e.height,x:pe(e.x)?e.x:t.left,y:pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:pe(e.width)?e.width:t.width})),hh=()=>{var e,t=gn(),n=ue(C7),r=ue(ph),i=(e=ue(fh))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},k7={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},yA=()=>{var e;return(e=ue(Gt))!==null&&e!==void 0?e:k7},Vb=()=>ue(xo),Hb=()=>ue(wo),D7=()=>ue(e=>e.layout.margin),Oe=e=>e.layout.layoutType,xu=()=>ue(Oe),A7={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},bA=xr({name:"legend",initialState:A7,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload(e,t){e.payload.push(t.payload)},removeLegendPayload(e,t){var n=no(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)}}}),{setLegendSize:AS,setLegendSettings:T7,addLegendPayload:xA,removeLegendPayload:wA}=bA.actions,M7=bA.reducer,N7=["contextPayload"];function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xv.apply(null,arguments)}function TS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Js(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TS(Object(n),!0).forEach(function(r){Yb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yb(e,t,n){return(t=j7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j7(e){var t=R7(e,"string");return typeof t=="symbol"?t:t+""}function R7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I7(e,t){if(e==null)return{};var n,r,i=F7(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function L7(e){return e.value}function $7(e){var{contextPayload:t}=e,n=I7(e,N7),r=DD(t,e.payloadUniqBy,L7),i=Js(Js({},n),{},{payload:r});return E.isValidElement(e.content)?E.cloneElement(e.content,i):typeof e.content=="function"?E.createElement(e.content,i):E.createElement(Nb,i)}function B7(e,t,n,r,i,o){var{layout:a,align:s,verticalAlign:l}=t,c,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(s==="center"&&a==="vertical"?c={left:((r||0)-o.width)/2}:c=s==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(l==="middle"?u={top:((i||0)-o.height)/2}:u=l==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Js(Js({},c),u)}function W7(e){var t=xt();return P.useEffect(()=>{t(T7(e))},[t,e]),null}function z7(e){var t=xt();return P.useEffect(()=>(t(AS(e)),()=>{t(AS({width:0,height:0}))}),[t,e]),null}function V7(e){var t=NW(),n=V3(),r=D7(),{width:i,height:o,wrapperStyle:a,portal:s}=e,[l,c]=RD([t]),u=Vb(),d=Hb();if(u==null||d==null)return null;var f=u-(r.left||0)-(r.right||0),p=wu.getWidthOrHeight(e.layout,o,i,f),h=s?a:Js(Js({position:"absolute",width:p?.width||i||"auto",height:p?.height||o||"auto"},B7(a,e,r,u,d,l)),a),m=s??n;if(m==null)return null;var v=E.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:c},E.createElement(W7,{layout:e.layout,align:e.align,verticalAlign:e.verticalAlign,itemSorter:e.itemSorter}),E.createElement(z7,{width:l.width,height:l.height}),E.createElement($7,Xv({},e,p,{margin:r,chartWidth:u,chartHeight:d,contextPayload:t})));return qi.createPortal(v,m)}let wu=class extends P.PureComponent{static getWidthOrHeight(t,n,r,i){return t==="vertical"&&pe(n)?{height:n}:t==="horizontal"?{width:r||i}:null}render(){return E.createElement(V7,this.props)}};Yb(wu,"displayName","Legend");Yb(wu,"defaultProps",{align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"});function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qv.apply(null,arguments)}function MS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MS(Object(n),!0).forEach(function(r){H7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H7(e,t,n){return(t=Y7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y7(e){var t=U7(e,"string");return typeof t=="symbol"?t:t+""}function U7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K7(e){return Array.isArray(e)&&Ir(e[0])&&Ir(e[1])?e.join(" ~ "):e}var q7=e=>{var{separator:t=" : ",contentStyle:n={},itemStyle:r={},labelStyle:i={},payload:o,formatter:a,itemSorter:s,wrapperClassName:l,labelClassName:c,label:u,labelFormatter:d,accessibilityLayer:f=!1}=e,p=()=>{if(o&&o.length){var _={padding:0,margin:0},O=(s?oh(o,s):o).map((k,D)=>{if(k.type==="none")return null;var T=k.formatter||a||K7,{value:j,name:A}=k,C=j,N=A;if(T){var M=T(j,A,k,D,o);if(Array.isArray(M))[C,N]=M;else if(M!=null)C=M;else return null}var R=bg({display:"block",paddingTop:4,paddingBottom:4,color:k.color||"#000"},r);return E.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:R},Ir(N)?E.createElement("span",{className:"recharts-tooltip-item-name"},N):null,Ir(N)?E.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,E.createElement("span",{className:"recharts-tooltip-item-value"},C),E.createElement("span",{className:"recharts-tooltip-item-unit"},k.unit||""))});return E.createElement("ul",{className:"recharts-tooltip-item-list",style:_},O)}return null},h=bg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),m=bg({margin:0},i),v=!ht(u),b=v?u:"",S=ae("recharts-default-tooltip",l),w=ae("recharts-tooltip-label",c);v&&d&&o!==void 0&&o!==null&&(b=d(u,o));var x=f?{role:"status","aria-live":"assertive"}:{};return E.createElement("div",Qv({className:S,style:h},x),E.createElement("p",{className:w,style:m},E.isValidElement(b)?b:"".concat(b)),p())},Wl="recharts-tooltip-wrapper",G7={visibility:"hidden"};function X7(e){var{coordinate:t,translateX:n,translateY:r}=e;return ae(Wl,{["".concat(Wl,"-right")]:pe(n)&&t&&pe(t.x)&&n>=t.x,["".concat(Wl,"-left")]:pe(n)&&t&&pe(t.x)&&n<t.x,["".concat(Wl,"-bottom")]:pe(r)&&t&&pe(t.y)&&r>=t.y,["".concat(Wl,"-top")]:pe(r)&&t&&pe(t.y)&&r<t.y})}function NS(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offsetTopLeft:i,position:o,reverseDirection:a,tooltipDimension:s,viewBox:l,viewBoxDimension:c}=e;if(o&&pe(o[r]))return o[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return a[r]?u:d;var f=l[r];if(f==null)return 0;if(a[r]){var p=u,h=f;return p<h?Math.max(d,f):Math.max(u,f)}if(c==null)return 0;var m=d+s,v=f+c;return m>v?Math.max(u,f):Math.max(d,f)}function Q7(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Z7(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:r,position:i,reverseDirection:o,tooltipBox:a,useTranslate3d:s,viewBox:l}=e,c,u,d;return a.height>0&&a.width>0&&n?(u=NS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=NS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=Q7({translateX:u,translateY:d,useTranslate3d:s})):c=G7,{cssProperties:c,cssClasses:X7({translateX:u,translateY:d,coordinate:n})}}function jS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(r){Zv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zv(e,t,n){return(t=J7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J7(e){var t=eV(e,"string");return typeof t=="symbol"?t:t+""}function eV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class tV extends P.PureComponent{constructor(){super(...arguments),Zv(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Zv(this,"handleKeyDown",t=>{if(t.key==="Escape"){var n,r,i,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:o,coordinate:a,hasPayload:s,isAnimationActive:l,offset:c,position:u,reverseDirection:d,useTranslate3d:f,viewBox:p,wrapperStyle:h,lastBoundingBox:m,innerRef:v,hasPortalFromProps:b}=this.props,{cssClasses:S,cssProperties:w}=Z7({allowEscapeViewBox:n,coordinate:a,offsetTopLeft:c,position:u,reverseDirection:d,tooltipBox:{height:m.height,width:m.width},useTranslate3d:f,viewBox:p}),x=b?{}:dd(dd({transition:l&&t?"transform ".concat(r,"ms ").concat(i):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&s?"visible":"hidden",position:"absolute",top:0,left:0}),_=dd(dd({},x),{},{visibility:!this.state.dismissed&&t&&s?"visible":"hidden"},h);return E.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:S,style:_,ref:v},o)}}var nV=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),_o={devToolsEnabled:!1,isSsr:nV()},_A=()=>ue(e=>e.rootProps.accessibilityLayer);function fn(e){return Number.isFinite(e)}function el(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jv.apply(null,arguments)}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(r){rV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rV(e,t,n){return(t=iV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iV(e){var t=oV(e,"string");return typeof t=="symbol"?t:t+""}function oV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FS={curveBasisClosed:l8,curveBasisOpen:c8,curveBasis:s8,curveBumpX:K3,curveBumpY:q3,curveLinearClosed:u8,curveLinear:rh,curveMonotoneX:d8,curveMonotoneY:f8,curveNatural:p8,curveStep:h8,curveStepAfter:g8,curveStepBefore:m8},fd=e=>fn(e.x)&&fn(e.y),zl=e=>e.x,Vl=e=>e.y,aV=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(pu(e));return(n==="curveMonotone"||n==="curveBump")&&t?FS["".concat(n).concat(t==="vertical"?"Y":"X")]:FS[n]||rh},sV=e=>{var{type:t="linear",points:n=[],baseLine:r,layout:i,connectNulls:o=!1}=e,a=aV(t,i),s=o?n.filter(fd):n,l;if(Array.isArray(r)){var c=o?r.filter(d=>fd(d)):r,u=s.map((d,f)=>IS(IS({},d),{},{base:c[f]}));return i==="vertical"?l=td().y(Vl).x1(zl).x0(d=>d.base.x):l=td().x(zl).y1(Vl).y0(d=>d.base.y),l.defined(fd).curve(a),l(u)}return i==="vertical"&&pe(r)?l=td().y(Vl).x1(zl).x0(r):pe(r)?l=td().x(zl).y1(Vl).y0(r):l=cD().x(zl).y(Vl),l.defined(fd).curve(a),l(s)},Ls=e=>{var{className:t,points:n,path:r,pathRef:i}=e;if((!n||!n.length)&&!r)return null;var o=n&&n.length?sV(e):r;return E.createElement("path",Jv({},Vr(e),Ob(e),{className:ae("recharts-curve",t),d:o===null?void 0:o,ref:i}))},lV=["x","y","top","left","width","height","className"];function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ey.apply(null,arguments)}function LS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LS(Object(n),!0).forEach(function(r){uV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uV(e,t,n){return(t=dV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pV(e,t){if(e==null)return{};var n,r,i=hV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mV=(e,t,n,r,i,o)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(n),gV=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:o=0,height:a=0,className:s}=e,l=pV(e,lV),c=cV({x:t,y:n,top:r,left:i,width:o,height:a},l);return!pe(t)||!pe(n)||!pe(o)||!pe(a)||!pe(r)||!pe(i)?null:E.createElement("path",ey({},ct(c,!0),{className:ae("recharts-cross",s),d:mV(t,n,o,a,r,i)}))};function vV(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){bV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bV(e,t,n){return(t=xV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xV(e){var t=wV(e,"string");return typeof t=="symbol"?t:t+""}function wV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xt(e,t){var n=yV({},e),r=t,i=Object.keys(t),o=i.reduce((a,s)=>(a[s]===void 0&&r[s]!==void 0&&(a[s]=r[s]),a),n);return o}function _V(){}function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){SV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SV(e,t,n){return(t=EV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=OV(e,"string");return typeof t=="symbol"?t:t+""}function OV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CV=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),SA=(e,t,n)=>e.map(r=>"".concat(CV(r)," ").concat(t,"ms ").concat(n)).join(","),PV=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),$c=(e,t)=>Object.keys(t).reduce((n,r)=>WS(WS({},n),{},{[r]:e(r,t[r])}),{});function zS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(r){kV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kV(e,t,n){return(t=DV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DV(e){var t=AV(e,"string");return typeof t=="symbol"?t:t+""}function AV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $f=(e,t,n)=>e+(t-e)*n,ty=e=>{var{from:t,to:n}=e;return t!==n},EA=(e,t,n)=>{var r=$c((i,o)=>{if(ty(o)){var[a,s]=e(o.from,o.to,o.velocity);return cn(cn({},o),{},{from:a,velocity:s})}return o},t);return n<1?$c((i,o)=>ty(o)?cn(cn({},o),{},{velocity:$f(o.velocity,r[i].velocity,n),from:$f(o.from,r[i].from,n)}):o,t):EA(e,r,n-1)};function TV(e,t,n,r,i,o){var a,s=r.reduce((f,p)=>cn(cn({},f),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),l=()=>$c((f,p)=>p.from,s),c=()=>!Object.values(s).filter(ty).length,u=null,d=f=>{a||(a=f);var p=f-a,h=p/n.dt;s=EA(n,s,h),i(cn(cn(cn({},e),t),l())),a=f,c()||(u=o.setTimeout(d))};return()=>(u=o.setTimeout(d),()=>{u()})}function MV(e,t,n,r,i,o,a){var s=null,l=i.reduce((d,f)=>cn(cn({},d),{},{[f]:[e[f],t[f]]}),{}),c,u=d=>{c||(c=d);var f=(d-c)/r,p=$c((m,v)=>$f(...v,n(f)),l);if(o(cn(cn(cn({},e),t),p)),f<1)s=a.setTimeout(u);else{var h=$c((m,v)=>$f(...v,n(1)),l);o(cn(cn(cn({},e),t),h))}};return()=>(s=a.setTimeout(u),()=>{s()})}const NV=(e,t,n,r,i,o)=>{var a=PV(e,t);return n.isStepper===!0?TV(e,t,n,a,i,o):MV(e,t,n,r,a,i,o)};var Bf=1e-4,OA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],CA=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),VS=(e,t)=>n=>{var r=OA(e,t);return CA(r,n)},jV=(e,t)=>n=>{var r=OA(e,t),i=[...r.map((o,a)=>o*a).slice(1),0];return CA(i,n)},HS=function(){for(var t,n,r,i,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];if(a.length===1)switch(a[0]){case"linear":[t,r,n,i]=[0,0,1,1];break;case"ease":[t,r,n,i]=[.25,.1,.25,1];break;case"ease-in":[t,r,n,i]=[.42,0,1,1];break;case"ease-out":[t,r,n,i]=[.42,0,.58,1];break;case"ease-in-out":[t,r,n,i]=[0,0,.58,1];break;default:{var l=a[0].split("(");l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4&&([t,r,n,i]=l[1].split(")")[0].split(",").map(h=>parseFloat(h)))}}else a.length===4&&([t,r,n,i]=a);var c=VS(t,n),u=VS(r,i),d=jV(t,n),f=h=>h>1?1:h<0?0:h,p=h=>{for(var m=h>1?1:h,v=m,b=0;b<8;++b){var S=c(v)-m,w=d(v);if(Math.abs(S-m)<Bf||w<Bf)return u(v);v=f(v-S/w)}return u(v)};return p.isStepper=!1,p},RV=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,o=(a,s,l)=>{var c=-(a-s)*n,u=l*r,d=l+(c-u)*i/1e3,f=l*i/1e3+a;return Math.abs(f-s)<Bf&&Math.abs(d)<Bf?[s,0]:[f,d]};return o.isStepper=!0,o.dt=i,o},IV=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return HS(e);case"spring":return RV();default:if(e.split("(")[0]==="cubic-bezier")return HS(e)}return typeof e=="function"?e:null};function FV(e){var t,n=()=>null,r=!1,i=null,o=a=>{if(!r){if(Array.isArray(a)){if(!a.length)return;var s=a,[l,...c]=s;if(typeof l=="number"){i=e.setTimeout(o.bind(null,c),l);return}o(l),i=e.setTimeout(o.bind(null,c));return}typeof a=="string"&&(t=a,n(t)),typeof a=="object"&&(t=a,n(t)),typeof a=="function"&&a()}};return{stop:()=>{r=!0},start:a=>{r=!1,i&&(i(),i=null),o(a)},subscribe:a=>(n=a,()=>{n=()=>null}),getTimeoutController:()=>e}}class LV{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,o=a=>{a-r>=n?t(a):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(o))};return i=requestAnimationFrame(o),()=>{cancelAnimationFrame(i)}}}function $V(){return FV(new LV)}var BV=P.createContext($V);function WV(e,t){var n=P.useContext(BV);return P.useMemo(()=>t??n(e),[e,t,n])}var zV={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},YS={t:0},xg={t:1};function gl(e){var t=Xt(e,zV),{isActive:n,canBegin:r,duration:i,easing:o,begin:a,onAnimationEnd:s,onAnimationStart:l,children:c}=t,u=WV(t.animationId,t.animationManager),[d,f]=P.useState(n?YS:xg),p=P.useRef(null);return P.useEffect(()=>{n||f(xg)},[n]),P.useEffect(()=>{if(!n||!r)return _V;var h=NV(YS,xg,IV(o),i,f,u.getTimeoutController()),m=()=>{p.current=h()};return u.start([l,a,m,i,s]),()=>{u.stop(),p.current&&p.current(),s()}},[n,r,i,o,a,l,s,u]),c(d.t)}function vl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=P.useRef(Ic(t)),r=P.useRef(e);return r.current!==e&&(n.current=Ic(t),r.current=e),n.current}function US(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?US(Object(n),!0).forEach(function(r){VV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):US(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VV(e,t,n){return(t=HV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HV(e){var t=YV(e,"string");return typeof t=="symbol"?t:t+""}function YV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wf(){return Wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wf.apply(null,arguments)}var qS=(e,t,n,r,i)=>{var o=Math.min(Math.abs(n)/2,Math.abs(r)/2),a=r>=0?1:-1,s=n>=0?1:-1,l=r>=0&&n>=0||r<0&&n<0?1:0,c;if(o>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>o?o:i[d];c="M".concat(e,",").concat(t+a*u[0]),u[0]>0&&(c+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(l,",").concat(e+s*u[0],",").concat(t)),c+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(c+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(l,`,
176
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),m.warnIfExceeded()),h}}}function ld(e){return typeof e=="boolean"}var uz=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new KD;if(n&&(ld(n)?a.push(JW):a.push(ez(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let s={};ld(r)||(s=r),a.unshift(lz(s))}if(i){let s={};ld(i)||(s=i),a.push(cz(s))}if(o){let s={};ld(o)||(s=o),a.unshift(oz(s))}}return a},dz="RTK_autoBatch",vS=e=>t=>{setTimeout(t,e)},fz=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:vS(10):e.type==="callback"?e.queueNotification:vS(e.timeout),c=()=>{a=!1,o&&(o=!1,s.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>i&&u(),f=r.subscribe(d);return s.add(u),()=>{f(),s.delete(u)}},dispatch(u){try{return i=!u?.meta?.[dz],o=!i,o&&(a||(a=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},pz=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new KD(e);return r&&i.push(fz(typeof r=="object"?r:void 0)),i};function hz(e){const t=uz(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:o=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(mu(n))l=FD(n);else throw new Error(process.env.NODE_ENV==="production"?Ie(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Ie(2):"`middleware` field must be a callback");let c;if(typeof r=="function"){if(c=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(c))throw new Error(process.env.NODE_ENV==="production"?Ie(3):"when using a middleware builder function, an array of middleware must be returned")}else c=t();if(process.env.NODE_ENV!=="production"&&c.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Ie(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let m=new Set;c.forEach(v=>{if(m.has(v))throw new Error(process.env.NODE_ENV==="production"?Ie(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");m.add(v)})}let u=Tf;i&&(u=tz({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const d=zW(...c),f=pz(d);if(process.env.NODE_ENV!=="production"&&s&&typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?Ie(5):"`enhancers` field must be a callback");let p=typeof s=="function"?s(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(p))throw new Error(process.env.NODE_ENV==="production"?Ie(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&p.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Ie(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&c.length&&!p.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=u(...p);return ID(l,a,h)}function ZD(e){const t={},n=[];let r;const i={addCase(o,a){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Ie(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Ie(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const s=typeof o=="string"?o:o.type;if(!s)throw new Error(process.env.NODE_ENV==="production"?Ie(28):"`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error(process.env.NODE_ENV==="production"?Ie(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);return t[s]=a,i},addAsyncThunk(o,a){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Ie(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return a.pending&&(t[o.pending.type]=a.pending),a.rejected&&(t[o.rejected.type]=a.rejected),a.fulfilled&&(t[o.fulfilled.type]=a.fulfilled),a.settled&&n.push({matcher:o.settled,reducer:a.settled}),i},addMatcher(o,a){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Ie(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:a}),i},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Ie(31):"`builder.addDefaultCase` can only be called once");return r=o,i}};return e(i),[t,n,r]}function mz(e){return typeof e=="function"}function gz(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Ie(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=ZD(t),o;if(mz(e))o=()=>gS(e());else{const s=gS(e);o=()=>s}function a(s=o(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[i]),c.reduce((u,d)=>{if(d)if(Qa(u)){const p=d(u,l);return p===void 0?u:p}else{if(co(u))return HD(u,f=>d(f,l));{const f=d(u,l);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},s)}return a.getInitialState=o,a}var vz="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",yz=(e=21)=>{let t="",n=e;for(;n--;)t+=vz[Math.random()*64|0];return t},bz=Symbol.for("rtk-slice-createasyncthunk");function xz(e,t){return`${e}/${t}`}function wz({creators:e}={}){const t=e?.asyncThunk?.[bz];return function(r){const{name:i,reducerPath:o=i}=r;if(!i)throw new Error(process.env.NODE_ENV==="production"?Ie(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof r.reducers=="function"?r.reducers(Sz()):r.reducers)||{},s=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(w,x){const _=typeof w=="string"?w:w.type;if(!_)throw new Error(process.env.NODE_ENV==="production"?Ie(12):"`context.addCase` cannot be called with an empty action type");if(_ in l.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Ie(13):"`context.addCase` cannot be called with two reducers for the same action type: "+_);return l.sliceCaseReducersByType[_]=x,c},addMatcher(w,x){return l.sliceMatchers.push({matcher:w,reducer:x}),c},exposeAction(w,x){return l.actionCreators[w]=x,c},exposeCaseReducer(w,x){return l.sliceCaseReducersByName[w]=x,c}};s.forEach(w=>{const x=a[w],_={reducerName:w,type:xz(i,w),createNotation:typeof r.reducers=="function"};Oz(x)?Pz(_,x,c,t):Ez(_,x,c)});function u(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Ie(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[w={},x=[],_=void 0]=typeof r.extraReducers=="function"?ZD(r.extraReducers):[r.extraReducers],O={...w,...l.sliceCaseReducersByType};return gz(r.initialState,k=>{for(let D in O)k.addCase(D,O[D]);for(let D of l.sliceMatchers)k.addMatcher(D.matcher,D.reducer);for(let D of x)k.addMatcher(D.matcher,D.reducer);_&&k.addDefaultCase(_)})}const d=w=>w,f=new Map,p=new WeakMap;let h;function m(w,x){return h||(h=u()),h(w,x)}function v(){return h||(h=u()),h.getInitialState()}function b(w,x=!1){function _(k){let D=k[w];if(typeof D>"u"){if(x)D=sd(p,_,v);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Ie(15):"selectSlice returned undefined for an uninjected slice reducer")}return D}function O(k=d){const D=sd(f,x,()=>new WeakMap);return sd(D,k,()=>{const T={};for(const[j,A]of Object.entries(r.selectors??{}))T[j]=_z(A,k,()=>sd(p,k,v),x);return T})}return{reducerPath:w,getSelectors:O,get selectors(){return O(_)},selectSlice:_}}const S={name:i,reducer:m,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:v,...b(o),injectInto(w,{reducerPath:x,..._}={}){const O=x??o;return w.inject({reducerPath:O,reducer:m},_),{...S,...b(O,!0)}}};return S}}function _z(e,t,n,r){function i(o,...a){let s=t(o);if(typeof s>"u"){if(r)s=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Ie(16):"selectState returned undefined for an uninjected slice reducer")}return e(s,...a)}return i.unwrapped=e,i}var xr=wz();function Sz(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Ez({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!Cz(r))throw new Error(process.env.NODE_ENV==="production"?Ie(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?Fr(e,a):Fr(e))}function Oz(e){return e._reducerDefinitionType==="asyncThunk"}function Cz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Pz({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?Ie(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:a,pending:s,rejected:l,settled:c,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),l&&r.addCase(d.rejected,l),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:a||cd,pending:s||cd,rejected:l||cd,settled:c||cd})}function cd(){}var kz="task",JD="listener",eA="completed",Bb="cancelled",Dz=`task-${Bb}`,Az=`task-${eA}`,qv=`${JD}-${Bb}`,Tz=`${JD}-${eA}`,ch=class{constructor(e){this.code=e,this.message=`${kz} ${Bb} (reason: ${e})`}name="TaskAbortError";message},Wb=(e,t)=>{if(typeof e!="function")throw new TypeError(process.env.NODE_ENV==="production"?Ie(32):`${t} is not a function`)},Rf=()=>{},tA=(e,t=Rf)=>(e.catch(t),e),nA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ba=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Wa=e=>{if(e.aborted){const{reason:t}=e;throw new ch(t)}};function rA(e,t){let n=Rf;return new Promise((r,i)=>{const o=()=>i(new ch(e.reason));if(e.aborted){o();return}n=nA(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Rf})}var Mz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ch?"cancelled":"rejected",error:n}}finally{t?.()}},If=e=>t=>tA(rA(e,t).then(n=>(Wa(e),n))),iA=e=>{const t=If(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Fs}=Object,yS={},vu="listenerMiddleware",Nz=(e,t)=>{const n=r=>nA(e,()=>Ba(r,e.reason));return(r,i)=>{Wb(r,"taskExecutor");const o=new AbortController;n(o);const a=Mz(async()=>{Wa(e),Wa(o.signal);const s=await r({pause:If(o.signal),delay:iA(o.signal),signal:o.signal});return Wa(o.signal),s},()=>Ba(o,Az));return i?.autoJoin&&t.push(a.catch(Rf)),{result:If(e)(a),cancel(){Ba(o,Dz)}}}},jz=(e,t)=>{const n=async(r,i)=>{Wa(t);let o=()=>{};const s=[new Promise((l,c)=>{let u=e({predicate:r,effect:(d,f)=>{f.unsubscribe(),l([d,f.getState(),f.getOriginalState()])}});o=()=>{u(),c()}})];i!=null&&s.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await rA(t,Promise.race(s));return Wa(t),l}finally{o()}};return(r,i)=>tA(n(r,i))},oA=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=Fr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(process.env.NODE_ENV==="production"?Ie(21):"Creating or removing a listener requires one of the known fields for matching an action");return Wb(o,"options.listener"),{predicate:i,type:t,effect:o}},aA=Fs(e=>{const{type:t,predicate:n,effect:r}=oA(e);return{id:yz(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(process.env.NODE_ENV==="production"?Ie(22):"Unsubscribe not initialized")}}},{withTypes:()=>aA}),bS=(e,t)=>{const{type:n,effect:r,predicate:i}=oA(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===i)&&o.effect===r)},Gv=e=>{e.pending.forEach(t=>{Ba(t,qv)})},Rz=e=>()=>{e.forEach(Gv),e.clear()},xS=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},sA=Fs(Fr(`${vu}/add`),{withTypes:()=>sA}),Iz=Fr(`${vu}/removeAll`),lA=Fs(Fr(`${vu}/remove`),{withTypes:()=>lA}),Fz=(...e)=>{console.error(`${vu}/error`,...e)},yu=(e={})=>{const t=new Map,{extra:n,onError:r=Fz}=e;Wb(r,"onError");const i=u=>(u.unsubscribe=()=>t.delete(u.id),t.set(u.id,u),d=>{u.unsubscribe(),d?.cancelActive&&Gv(u)}),o=u=>{const d=bS(t,u)??aA(u);return i(d)};Fs(o,{withTypes:()=>o});const a=u=>{const d=bS(t,u);return d&&(d.unsubscribe(),u.cancelActive&&Gv(d)),!!d};Fs(a,{withTypes:()=>a});const s=async(u,d,f,p)=>{const h=new AbortController,m=jz(o,h.signal),v=[];try{u.pending.add(h),await Promise.resolve(u.effect(d,Fs({},f,{getOriginalState:p,condition:(b,S)=>m(b,S).then(Boolean),take:m,delay:iA(h.signal),pause:If(h.signal),extra:n,signal:h.signal,fork:Nz(h.signal,v),unsubscribe:u.unsubscribe,subscribe:()=>{t.set(u.id,u)},cancelActiveListeners:()=>{u.pending.forEach((b,S,w)=>{b!==h&&(Ba(b,qv),w.delete(b))})},cancel:()=>{Ba(h,qv),u.pending.delete(h)},throwIfCancelled:()=>{Wa(h.signal)}})))}catch(b){b instanceof ch||xS(r,b,{raisedBy:"effect"})}finally{await Promise.all(v),Ba(h,Tz),u.pending.delete(h)}},l=Rz(t);return{middleware:u=>d=>f=>{if(!Fb(f))return d(f);if(sA.match(f))return o(f.payload);if(Iz.match(f)){l();return}if(lA.match(f))return a(f.payload);let p=u.getState();const h=()=>{if(p===yS)throw new Error(process.env.NODE_ENV==="production"?Ie(23):`${vu}: getOriginalState can only be called synchronously`);return p};let m;try{if(m=d(f),t.size>0){const v=u.getState(),b=Array.from(t.values());for(const S of b){let w=!1;try{w=S.predicate(f,v,p)}catch(x){w=!1,xS(r,x,{raisedBy:"predicate"})}w&&s(S,f,u,h)}}}finally{p=yS}return m},startListening:o,stopListening:a,clearListeners:l}};function Ie(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Lz={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},cA=xr({name:"chartLayout",initialState:Lz,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:$z,setLayout:Bz,setChartSize:Wz,setScale:zz}=cA.actions,Vz=cA.reducer;function wS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wS(Object(n),!0).forEach(function(r){Hz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hz(e,t,n){return(t=Yz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yz(e){var t=Uz(e,"string");return typeof t=="symbol"?t:t+""}function Uz(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ff=Math.PI/180,Kz=e=>e*180/Math.PI,Vt=(e,t,n,r)=>({x:e+Math.cos(-Ff*r)*n,y:t+Math.sin(-Ff*r)*n}),uA=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},qz=(e,t)=>{var{x:n,y:r}=e,{x:i,y:o}=t;return Math.sqrt((n-i)**2+(r-o)**2)},Gz=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:o}=t,a=qz({x:n,y:r},{x:i,y:o});if(a<=0)return{radius:a,angle:0};var s=(n-i)/a,l=Math.acos(s);return r>o&&(l=2*Math.PI-l),{radius:a,angle:Kz(l),angleInRadian:l}},Xz=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:t-o*360,endAngle:n-o*360}},Qz=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return e+a*360},Zz=(e,t)=>{var{x:n,y:r}=e,{radius:i,angle:o}=Gz({x:n,y:r},t),{innerRadius:a,outerRadius:s}=t;if(i<a||i>s||i===0)return null;var{startAngle:l,endAngle:c}=Xz(t),u=o,d;if(l<=c){for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}else{for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}return d?_S(_S({},t),{},{radius:i,angle:Qz(u,t)}):null};function dA(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function SS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SS(Object(n),!0).forEach(function(r){Jz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jz(e,t,n){return(t=e7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e7(e){var t=t7(e,"string");return typeof t=="symbol"?t:t+""}function t7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tt(e,t,n){return ht(e)||ht(t)?n:Ir(t)?Xa(e,t,n):typeof t=="function"?t(e):n}var n7=(e,t,n,r,i)=>{var o,a=-1,s=(o=t?.length)!==null&&o!==void 0?o:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<s;l++){var c=l>0?n[l-1].coordinate:n[s-1].coordinate,u=n[l].coordinate,d=l>=s-1?n[0].coordinate:n[l+1].coordinate,f=void 0;if(rn(u-c)!==rn(d-u)){var p=[];if(rn(d-u)===rn(i[1]-i[0])){f=d;var h=u+i[1]-i[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+i[1]-i[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var v=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){({index:a}=n[l]);break}}else{var b=Math.min(c,d),S=Math.max(c,d);if(e>(b+u)/2&&e<=(S+u)/2){({index:a}=n[l]);break}}}else if(t){for(var w=0;w<s;w++)if(w===0&&e<=(t[w].coordinate+t[w+1].coordinate)/2||w>0&&w<s-1&&e>(t[w].coordinate+t[w-1].coordinate)/2&&e<=(t[w].coordinate+t[w+1].coordinate)/2||w===s-1&&e>(t[w].coordinate+t[w-1].coordinate)/2){({index:a}=t[w]);break}}return a},r7=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:o,verticalAlign:a,layout:s}=t;if((s==="vertical"||s==="horizontal"&&a==="middle")&&o!=="center"&&pe(e[o]))return Mr(Mr({},e),{},{[o]:e[o]+(r||0)});if((s==="horizontal"||s==="vertical"&&o==="center")&&a!=="middle"&&pe(e[a]))return Mr(Mr({},e),{},{[a]:e[a]+(i||0)})}return e},Ai=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",fA=(e,t,n,r)=>{if(r)return e.map(s=>s.coordinate);var i,o,a=e.map(s=>(s.coordinate===t&&(i=!0),s.coordinate===n&&(o=!0),s.coordinate));return i||a.push(t),o||a.push(n),a},pA=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:o,scale:a,realScaleType:s,isCategorical:l,categoricalDomain:c,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!a)return null;var h=s==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,m=i==="category"&&a.bandwidth?a.bandwidth()/h:0;if(m=p==="angleAxis"&&o&&o.length>=2?rn(o[0]-o[1])*2*m:m,d||f){var v=(d||f||[]).map((b,S)=>{var w=r?r.indexOf(b):b;return{coordinate:a(w)+m,value:b,offset:m,index:S}});return v.filter(b=>!Dn(b.coordinate))}return l&&c?c.map((b,S)=>({coordinate:a(b)+m,value:b,index:S,offset:m})):a.ticks&&u!=null?a.ticks(u).map((b,S)=>({coordinate:a(b)+m,value:b,offset:m,index:S})):a.domain().map((b,S)=>({coordinate:a(b)+m,value:r?r[b]:b,index:S,offset:m}))},ES=1e-4,i7=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-ES,o=Math.max(r[0],r[1])+ES,a=e(t[0]),s=e(t[n-1]);(a<i||a>o||s<i||s>o)&&e.domain([t[0],t[n-1]])}},o7=(e,t)=>{if(!t||t.length!==2||!pe(t[0])||!pe(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!pe(e[0])||e[0]<n)&&(i[0]=n),(!pe(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},a7=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0,a=0;a<t;++a){var s=Dn(e[a][n][1])?e[a][n][0]:e[a][n][1];s>=0?(e[a][n][0]=i,e[a][n][1]=i+s,i=e[a][n][1]):(e[a][n][0]=o,e[a][n][1]=o+s,o=e[a][n][1])}},s7=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,o=0;o<t;++o){var a=Dn(e[o][n][1])?e[o][n][0]:e[o][n][1];a>=0?(e[o][n][0]=i,e[o][n][1]=i+a,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},l7={sign:a7,expand:x8,none:Qs,silhouette:w8,wiggle:_8,positive:s7},c7=(e,t,n)=>{var r=l7[n],i=b8().keys(t).value((o,a)=>+tt(o,a,0)).order(Lv).offset(r);return i(e)};function hA(e){return e==null?void 0:String(e)}function Lf(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:o,dataKey:a}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ht(i[t.dataKey])){var s=eD(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=tt(i,ht(a)?t.dataKey:a);return ht(l)?null:t.scale(l)}var OS=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:o,index:a}=e;if(t.type==="category")return n[a]?n[a].coordinate+r:null;var s=tt(o,t.dataKey,t.scale.domain()[a]);return ht(s)?null:t.scale(s)-i/2+r},u7=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},d7=e=>{var t=e.flat(2).filter(pe);return[Math.min(...t),Math.max(...t)]},f7=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],p7=(e,t,n)=>{if(e!=null)return f7(Object.keys(e).reduce((r,i)=>{var o=e[i],{stackedData:a}=o,s=a.reduce((l,c)=>{var u=dA(c,t,n),d=d7(u);return[Math.min(l[0],d[0]),Math.max(l[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},CS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ja=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=oh(t,u=>u.coordinate),o=1/0,a=1,s=i.length;a<s;a++){var l=i[a],c=i[a-1];o=Math.min((l.coordinate||0)-(c.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0};function kS(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:o}=e;return Mr(Mr({},t),{},{dataKey:n,payload:r,value:i,name:o})}function na(e,t){if(e)return String(e);if(typeof t=="string")return t}function h7(e,t,n,r,i){if(n==="horizontal"||n==="vertical"){var o=e>=i.left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height;return o?{x:e,y:t}:null}return r?Zz({x:e,y:t},r):null}var m7=(e,t,n,r)=>{var i=t.find(c=>c&&c.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.y};if(e==="vertical")return{x:r.x,y:i.coordinate};if(e==="centric"){var o=i.coordinate,{radius:a}=r;return Mr(Mr(Mr({},r),Vt(r.cx,r.cy,a,o)),{},{angle:o,radius:a})}var s=i.coordinate,{angle:l}=r;return Mr(Mr(Mr({},r),Vt(r.cx,r.cy,s,l)),{},{angle:l,radius:s})}return{x:0,y:0}},g7=(e,t)=>t==="horizontal"?e.x:t==="vertical"?e.y:t==="centric"?e.angle:e.radius,xo=e=>e.layout.width,wo=e=>e.layout.height,v7=e=>e.layout.scale,mA=e=>e.layout.margin,uh=z(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),dh=z(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),gA="data-recharts-item-index",vA="data-recharts-item-data-key",bu=60;function DS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DS(Object(n),!0).forEach(function(r){y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y7(e,t,n){return(t=b7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b7(e){var t=x7(e,"string");return typeof t=="symbol"?t:t+""}function x7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w7=e=>e.brush.height;function _7(e){var t=dh(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bu;return n+i}return n},0)}function S7(e){var t=dh(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bu;return n+i}return n},0)}function E7(e){var t=uh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function O7(e){var t=uh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Gt=z([xo,wo,mA,w7,_7,S7,E7,O7,jD,AW],(e,t,n,r,i,o,a,s,l,c)=>{var u={left:(n.left||0)+i,right:(n.right||0)+o},d={top:(n.top||0)+a,bottom:(n.bottom||0)+s},f=ud(ud({},d),u),p=f.bottom;f.bottom+=r,f=r7(f,l,c);var h=e-f.left-f.right,m=t-f.top-f.bottom;return ud(ud({brushBottom:p},f),{},{width:Math.max(h,0),height:Math.max(m,0)})}),C7=z(Gt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),zb=z(xo,wo,(e,t)=>({x:0,y:0,width:e,height:t})),P7=P.createContext(null),gn=()=>P.useContext(P7)!=null,fh=e=>e.brush,ph=z([fh,Gt,mA],(e,t,n)=>({height:e.height,x:pe(e.x)?e.x:t.left,y:pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:pe(e.width)?e.width:t.width})),hh=()=>{var e,t=gn(),n=ue(C7),r=ue(ph),i=(e=ue(fh))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},k7={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},yA=()=>{var e;return(e=ue(Gt))!==null&&e!==void 0?e:k7},Vb=()=>ue(xo),Hb=()=>ue(wo),D7=()=>ue(e=>e.layout.margin),Oe=e=>e.layout.layoutType,xu=()=>ue(Oe),A7={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},bA=xr({name:"legend",initialState:A7,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload(e,t){e.payload.push(t.payload)},removeLegendPayload(e,t){var n=no(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)}}}),{setLegendSize:AS,setLegendSettings:T7,addLegendPayload:xA,removeLegendPayload:wA}=bA.actions,M7=bA.reducer,N7=["contextPayload"];function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xv.apply(null,arguments)}function TS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Js(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TS(Object(n),!0).forEach(function(r){Yb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yb(e,t,n){return(t=j7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j7(e){var t=R7(e,"string");return typeof t=="symbol"?t:t+""}function R7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I7(e,t){if(e==null)return{};var n,r,i=F7(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function L7(e){return e.value}function $7(e){var{contextPayload:t}=e,n=I7(e,N7),r=DD(t,e.payloadUniqBy,L7),i=Js(Js({},n),{},{payload:r});return E.isValidElement(e.content)?E.cloneElement(e.content,i):typeof e.content=="function"?E.createElement(e.content,i):E.createElement(Nb,i)}function B7(e,t,n,r,i,o){var{layout:a,align:s,verticalAlign:l}=t,c,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(s==="center"&&a==="vertical"?c={left:((r||0)-o.width)/2}:c=s==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(l==="middle"?u={top:((i||0)-o.height)/2}:u=l==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Js(Js({},c),u)}function W7(e){var t=xt();return P.useEffect(()=>{t(T7(e))},[t,e]),null}function z7(e){var t=xt();return P.useEffect(()=>(t(AS(e)),()=>{t(AS({width:0,height:0}))}),[t,e]),null}function V7(e){var t=NW(),n=V3(),r=D7(),{width:i,height:o,wrapperStyle:a,portal:s}=e,[l,c]=RD([t]),u=Vb(),d=Hb();if(u==null||d==null)return null;var f=u-(r.left||0)-(r.right||0),p=wu.getWidthOrHeight(e.layout,o,i,f),h=s?a:Js(Js({position:"absolute",width:p?.width||i||"auto",height:p?.height||o||"auto"},B7(a,e,r,u,d,l)),a),m=s??n;if(m==null)return null;var v=E.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:c},E.createElement(W7,{layout:e.layout,align:e.align,verticalAlign:e.verticalAlign,itemSorter:e.itemSorter}),E.createElement(z7,{width:l.width,height:l.height}),E.createElement($7,Xv({},e,p,{margin:r,chartWidth:u,chartHeight:d,contextPayload:t})));return qi.createPortal(v,m)}let wu=class extends P.PureComponent{static getWidthOrHeight(t,n,r,i){return t==="vertical"&&pe(n)?{height:n}:t==="horizontal"?{width:r||i}:null}render(){return E.createElement(V7,this.props)}};Yb(wu,"displayName","Legend");Yb(wu,"defaultProps",{align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"});function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qv.apply(null,arguments)}function MS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MS(Object(n),!0).forEach(function(r){H7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H7(e,t,n){return(t=Y7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y7(e){var t=U7(e,"string");return typeof t=="symbol"?t:t+""}function U7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K7(e){return Array.isArray(e)&&Ir(e[0])&&Ir(e[1])?e.join(" ~ "):e}var q7=e=>{var{separator:t=" : ",contentStyle:n={},itemStyle:r={},labelStyle:i={},payload:o,formatter:a,itemSorter:s,wrapperClassName:l,labelClassName:c,label:u,labelFormatter:d,accessibilityLayer:f=!1}=e,p=()=>{if(o&&o.length){var _={padding:0,margin:0},O=(s?oh(o,s):o).map((k,D)=>{if(k.type==="none")return null;var T=k.formatter||a||K7,{value:j,name:A}=k,C=j,N=A;if(T){var M=T(j,A,k,D,o);if(Array.isArray(M))[C,N]=M;else if(M!=null)C=M;else return null}var R=bg({display:"block",paddingTop:4,paddingBottom:4,color:k.color||"#000"},r);return E.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:R},Ir(N)?E.createElement("span",{className:"recharts-tooltip-item-name"},N):null,Ir(N)?E.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,E.createElement("span",{className:"recharts-tooltip-item-value"},C),E.createElement("span",{className:"recharts-tooltip-item-unit"},k.unit||""))});return E.createElement("ul",{className:"recharts-tooltip-item-list",style:_},O)}return null},h=bg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),m=bg({margin:0},i),v=!ht(u),b=v?u:"",S=ae("recharts-default-tooltip",l),w=ae("recharts-tooltip-label",c);v&&d&&o!==void 0&&o!==null&&(b=d(u,o));var x=f?{role:"status","aria-live":"assertive"}:{};return E.createElement("div",Qv({className:S,style:h},x),E.createElement("p",{className:w,style:m},E.isValidElement(b)?b:"".concat(b)),p())},Wl="recharts-tooltip-wrapper",G7={visibility:"hidden"};function X7(e){var{coordinate:t,translateX:n,translateY:r}=e;return ae(Wl,{["".concat(Wl,"-right")]:pe(n)&&t&&pe(t.x)&&n>=t.x,["".concat(Wl,"-left")]:pe(n)&&t&&pe(t.x)&&n<t.x,["".concat(Wl,"-bottom")]:pe(r)&&t&&pe(t.y)&&r>=t.y,["".concat(Wl,"-top")]:pe(r)&&t&&pe(t.y)&&r<t.y})}function NS(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offsetTopLeft:i,position:o,reverseDirection:a,tooltipDimension:s,viewBox:l,viewBoxDimension:c}=e;if(o&&pe(o[r]))return o[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return a[r]?u:d;var f=l[r];if(f==null)return 0;if(a[r]){var p=u,h=f;return p<h?Math.max(d,f):Math.max(u,f)}if(c==null)return 0;var m=d+s,v=f+c;return m>v?Math.max(u,f):Math.max(d,f)}function Q7(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Z7(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:r,position:i,reverseDirection:o,tooltipBox:a,useTranslate3d:s,viewBox:l}=e,c,u,d;return a.height>0&&a.width>0&&n?(u=NS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=NS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=Q7({translateX:u,translateY:d,useTranslate3d:s})):c=G7,{cssProperties:c,cssClasses:X7({translateX:u,translateY:d,coordinate:n})}}function jS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(r){Zv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zv(e,t,n){return(t=J7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J7(e){var t=eV(e,"string");return typeof t=="symbol"?t:t+""}function eV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class tV extends P.PureComponent{constructor(){super(...arguments),Zv(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Zv(this,"handleKeyDown",t=>{if(t.key==="Escape"){var n,r,i,o;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:o,coordinate:a,hasPayload:s,isAnimationActive:l,offset:c,position:u,reverseDirection:d,useTranslate3d:f,viewBox:p,wrapperStyle:h,lastBoundingBox:m,innerRef:v,hasPortalFromProps:b}=this.props,{cssClasses:S,cssProperties:w}=Z7({allowEscapeViewBox:n,coordinate:a,offsetTopLeft:c,position:u,reverseDirection:d,tooltipBox:{height:m.height,width:m.width},useTranslate3d:f,viewBox:p}),x=b?{}:dd(dd({transition:l&&t?"transform ".concat(r,"ms ").concat(i):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&s?"visible":"hidden",position:"absolute",top:0,left:0}),_=dd(dd({},x),{},{visibility:!this.state.dismissed&&t&&s?"visible":"hidden"},h);return E.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:S,style:_,ref:v},o)}}var nV=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),_o={devToolsEnabled:!1,isSsr:nV()},_A=()=>ue(e=>e.rootProps.accessibilityLayer);function fn(e){return Number.isFinite(e)}function el(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jv.apply(null,arguments)}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(r){rV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rV(e,t,n){return(t=iV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iV(e){var t=oV(e,"string");return typeof t=="symbol"?t:t+""}function oV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FS={curveBasisClosed:l8,curveBasisOpen:c8,curveBasis:s8,curveBumpX:K3,curveBumpY:q3,curveLinearClosed:u8,curveLinear:rh,curveMonotoneX:d8,curveMonotoneY:f8,curveNatural:p8,curveStep:h8,curveStepAfter:g8,curveStepBefore:m8},fd=e=>fn(e.x)&&fn(e.y),zl=e=>e.x,Vl=e=>e.y,aV=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(pu(e));return(n==="curveMonotone"||n==="curveBump")&&t?FS["".concat(n).concat(t==="vertical"?"Y":"X")]:FS[n]||rh},sV=e=>{var{type:t="linear",points:n=[],baseLine:r,layout:i,connectNulls:o=!1}=e,a=aV(t,i),s=o?n.filter(fd):n,l;if(Array.isArray(r)){var c=o?r.filter(d=>fd(d)):r,u=s.map((d,f)=>IS(IS({},d),{},{base:c[f]}));return i==="vertical"?l=td().y(Vl).x1(zl).x0(d=>d.base.x):l=td().x(zl).y1(Vl).y0(d=>d.base.y),l.defined(fd).curve(a),l(u)}return i==="vertical"&&pe(r)?l=td().y(Vl).x1(zl).x0(r):pe(r)?l=td().x(zl).y1(Vl).y0(r):l=cD().x(zl).y(Vl),l.defined(fd).curve(a),l(s)},Ls=e=>{var{className:t,points:n,path:r,pathRef:i}=e;if((!n||!n.length)&&!r)return null;var o=n&&n.length?sV(e):r;return E.createElement("path",Jv({},Vr(e),Ob(e),{className:ae("recharts-curve",t),d:o===null?void 0:o,ref:i}))},lV=["x","y","top","left","width","height","className"];function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ey.apply(null,arguments)}function LS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LS(Object(n),!0).forEach(function(r){uV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uV(e,t,n){return(t=dV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pV(e,t){if(e==null)return{};var n,r,i=hV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mV=(e,t,n,r,i,o)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(n),gV=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:o=0,height:a=0,className:s}=e,l=pV(e,lV),c=cV({x:t,y:n,top:r,left:i,width:o,height:a},l);return!pe(t)||!pe(n)||!pe(o)||!pe(a)||!pe(r)||!pe(i)?null:E.createElement("path",ey({},ct(c,!0),{className:ae("recharts-cross",s),d:mV(t,n,o,a,r,i)}))};function vV(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){bV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bV(e,t,n){return(t=xV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xV(e){var t=wV(e,"string");return typeof t=="symbol"?t:t+""}function wV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xt(e,t){var n=yV({},e),r=t,i=Object.keys(t),o=i.reduce((a,s)=>(a[s]===void 0&&r[s]!==void 0&&(a[s]=r[s]),a),n);return o}function _V(){}function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){SV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SV(e,t,n){return(t=EV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=OV(e,"string");return typeof t=="symbol"?t:t+""}function OV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CV=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),SA=(e,t,n)=>e.map(r=>"".concat(CV(r)," ").concat(t,"ms ").concat(n)).join(","),PV=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),$c=(e,t)=>Object.keys(t).reduce((n,r)=>WS(WS({},n),{},{[r]:e(r,t[r])}),{});function zS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(r){kV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kV(e,t,n){return(t=DV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DV(e){var t=AV(e,"string");return typeof t=="symbol"?t:t+""}function AV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $f=(e,t,n)=>e+(t-e)*n,ty=e=>{var{from:t,to:n}=e;return t!==n},EA=(e,t,n)=>{var r=$c((i,o)=>{if(ty(o)){var[a,s]=e(o.from,o.to,o.velocity);return cn(cn({},o),{},{from:a,velocity:s})}return o},t);return n<1?$c((i,o)=>ty(o)?cn(cn({},o),{},{velocity:$f(o.velocity,r[i].velocity,n),from:$f(o.from,r[i].from,n)}):o,t):EA(e,r,n-1)};function TV(e,t,n,r,i,o){var a,s=r.reduce((f,p)=>cn(cn({},f),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),l=()=>$c((f,p)=>p.from,s),c=()=>!Object.values(s).filter(ty).length,u=null,d=f=>{a||(a=f);var p=f-a,h=p/n.dt;s=EA(n,s,h),i(cn(cn(cn({},e),t),l())),a=f,c()||(u=o.setTimeout(d))};return()=>(u=o.setTimeout(d),()=>{u()})}function MV(e,t,n,r,i,o,a){var s=null,l=i.reduce((d,f)=>cn(cn({},d),{},{[f]:[e[f],t[f]]}),{}),c,u=d=>{c||(c=d);var f=(d-c)/r,p=$c((m,v)=>$f(...v,n(f)),l);if(o(cn(cn(cn({},e),t),p)),f<1)s=a.setTimeout(u);else{var h=$c((m,v)=>$f(...v,n(1)),l);o(cn(cn(cn({},e),t),h))}};return()=>(s=a.setTimeout(u),()=>{s()})}const NV=(e,t,n,r,i,o)=>{var a=PV(e,t);return n.isStepper===!0?TV(e,t,n,a,i,o):MV(e,t,n,r,a,i,o)};var Bf=1e-4,OA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],CA=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),VS=(e,t)=>n=>{var r=OA(e,t);return CA(r,n)},jV=(e,t)=>n=>{var r=OA(e,t),i=[...r.map((o,a)=>o*a).slice(1),0];return CA(i,n)},HS=function(){for(var t,n,r,i,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];if(a.length===1)switch(a[0]){case"linear":[t,r,n,i]=[0,0,1,1];break;case"ease":[t,r,n,i]=[.25,.1,.25,1];break;case"ease-in":[t,r,n,i]=[.42,0,1,1];break;case"ease-out":[t,r,n,i]=[.42,0,.58,1];break;case"ease-in-out":[t,r,n,i]=[0,0,.58,1];break;default:{var l=a[0].split("(");l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4&&([t,r,n,i]=l[1].split(")")[0].split(",").map(h=>parseFloat(h)))}}else a.length===4&&([t,r,n,i]=a);var c=VS(t,n),u=VS(r,i),d=jV(t,n),f=h=>h>1?1:h<0?0:h,p=h=>{for(var m=h>1?1:h,v=m,b=0;b<8;++b){var S=c(v)-m,w=d(v);if(Math.abs(S-m)<Bf||w<Bf)return u(v);v=f(v-S/w)}return u(v)};return p.isStepper=!1,p},RV=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,o=(a,s,l)=>{var c=-(a-s)*n,u=l*r,d=l+(c-u)*i/1e3,f=l*i/1e3+a;return Math.abs(f-s)<Bf&&Math.abs(d)<Bf?[s,0]:[f,d]};return o.isStepper=!0,o.dt=i,o},IV=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return HS(e);case"spring":return RV();default:if(e.split("(")[0]==="cubic-bezier")return HS(e)}return typeof e=="function"?e:null};function FV(e){var t,n=()=>null,r=!1,i=null,o=a=>{if(!r){if(Array.isArray(a)){if(!a.length)return;var s=a,[l,...c]=s;if(typeof l=="number"){i=e.setTimeout(o.bind(null,c),l);return}o(l),i=e.setTimeout(o.bind(null,c));return}typeof a=="string"&&(t=a,n(t)),typeof a=="object"&&(t=a,n(t)),typeof a=="function"&&a()}};return{stop:()=>{r=!0},start:a=>{r=!1,i&&(i(),i=null),o(a)},subscribe:a=>(n=a,()=>{n=()=>null}),getTimeoutController:()=>e}}class LV{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,o=a=>{a-r>=n?t(a):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(o))};return i=requestAnimationFrame(o),()=>{cancelAnimationFrame(i)}}}function $V(){return FV(new LV)}var BV=P.createContext($V);function WV(e,t){var n=P.useContext(BV);return P.useMemo(()=>t??n(e),[e,t,n])}var zV={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},YS={t:0},xg={t:1};function gl(e){var t=Xt(e,zV),{isActive:n,canBegin:r,duration:i,easing:o,begin:a,onAnimationEnd:s,onAnimationStart:l,children:c}=t,u=WV(t.animationId,t.animationManager),[d,f]=P.useState(n?YS:xg),p=P.useRef(null);return P.useEffect(()=>{n||f(xg)},[n]),P.useEffect(()=>{if(!n||!r)return _V;var h=NV(YS,xg,IV(o),i,f,u.getTimeoutController()),m=()=>{p.current=h()};return u.start([l,a,m,i,s]),()=>{u.stop(),p.current&&p.current(),s()}},[n,r,i,o,a,l,s,u]),c(d.t)}function vl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=P.useRef(Ic(t)),r=P.useRef(e);return r.current!==e&&(n.current=Ic(t),r.current=e),n.current}function US(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?US(Object(n),!0).forEach(function(r){VV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):US(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VV(e,t,n){return(t=HV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HV(e){var t=YV(e,"string");return typeof t=="symbol"?t:t+""}function YV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wf(){return Wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wf.apply(null,arguments)}var qS=(e,t,n,r,i)=>{var o=Math.min(Math.abs(n)/2,Math.abs(r)/2),a=r>=0?1:-1,s=n>=0?1:-1,l=r>=0&&n>=0||r<0&&n<0?1:0,c;if(o>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>o?o:i[d];c="M".concat(e,",").concat(t+a*u[0]),u[0]>0&&(c+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(l,",").concat(e+s*u[0],",").concat(t)),c+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(c+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(l,`,
177
177
  `).concat(e+n,",").concat(t+a*u[1])),c+="L ".concat(e+n,",").concat(t+r-a*u[2]),u[2]>0&&(c+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(l,`,
178
178
  `).concat(e+n-s*u[2],",").concat(t+r)),c+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(c+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(l,`,
179
179
  `).concat(e,",").concat(t+r-a*u[3])),c+="Z"}else if(o>0&&i===+i&&i>0){var p=Math.min(o,i);c="M ".concat(e,",").concat(t+a*p,`
@@ -279,7 +279,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
279
279
  * Released under the MIT License
280
280
  */class $se{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],a=n.duration;o.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=tR.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Wi=new $se;const gC="transparent",Bse={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=oC(e||gC),i=r.valid&&oC(t||gC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Wse{constructor(t,n,r,i){const o=n[r];i=Md([t.to,i,o,t.from]);const a=Md([t.from,o,i]);this._active=!0,this._fn=t.fn||Bse[t.type||typeof a],this._easing=Oc[t.easing]||Oc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Md([t.to,n,i,t.from]),this._from=Md([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,a=this._loop,s=this._to;let l;if(this._active=o!==s&&(a||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class mR{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Te(t))return;const n=Object.keys(Lt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Te(o))return;const a={};for(const s of n)a[s]=o[s];(nn(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,i=Vse(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&zse(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,s);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Wse(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Wi.add(this._chart,r),!0}}function zse(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Vse(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function vC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function Hse(e,t,n){if(n===!1)return!1;const r=vC(e,n),i=vC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Yse(e){let t,n,r,i;return Te(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function gR(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function yC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let a,s,l,c;if(t===null)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Wr(c)&&(o||t===0||_i(t)===_i(c))&&(t+=c)}return!u&&!r.all?0:t}function Use(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:e[u]};return s}function sv(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Kse(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function qse(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Gse(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function bC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function xC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=Kse(o,a,r),d=t.length;let f;for(let p=0;p<d;++p){const h=t[p],{[l]:m,[c]:v}=h,b=h._stacks||(h._stacks={});f=b[c]=Gse(i,u,m),f[s]=v,f._top=bC(f,a,!0,r.type),f._bottom=bC(f,a,!1,r.type);const S=f._visualValues||(f._visualValues={});S[s]=v}}function lv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Xse(e,t){return ps(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qse(e,t,n){return ps(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ec(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const cv=e=>e==="reset"||e==="none",wC=(e,t)=>t?e:Object.assign({},e),Zse=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:gR(n,!0),values:null};class qh{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=sv(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ec(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,p,h)=>d==="x"?f:d==="r"?h:p,o=n.xAxisID=Se(r.xAxisID,lv(t,"x")),a=n.yAxisID=Se(r.yAxisID,lv(t,"y")),s=n.rAxisID=Se(r.rAxisID,lv(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,a,s),u=n.vAxisID=i(l,a,o,s);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nC(this._data,this),t._stacked&&ec(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Te(n)){const i=this._cachedMeta;this._data=Use(n,i)}else if(r!==n){if(r){nC(r,this);const i=this._cachedMeta;ec(i),i._parsed=[]}n&&Object.isExtensible(n)&&Tae(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=sv(n.vScale,n),n.stack!==r.stack&&(i=!0,ec(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(xC(this,n._parsed),n._stacked=sv(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:a}=r,s=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{nn(i[t])?f=this.parseArrayData(r,i,t,n):Te(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&xC(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:a}=t,s=o.axis,l=a.axis,c=o.getLabels(),u=o===a,d=new Array(i);let f,p,h;for(f=0,p=i;f<p;++f)h=f+r,d[f]={[s]:u||o.parse(c[h],h),[l]:a.parse(n[h],h)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:a}=t,s=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],s[l]={x:o.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=n[f],c[u]={x:o.parse(is(p,s),f),y:a.parse(is(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,a=n[t.axis],s={keys:gR(i,!0),values:n._stacks[t.axis]._visualValues};return yC(s,a,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let a=o===null?NaN:o;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,a=yC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,a=i.length,s=this._getOtherScale(t),l=Zse(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=qse(s);let f,p;function h(){p=i[f];const m=p[s.axis];return!Wr(p[t.axis])||u>m||d<m}for(f=0;f<a&&!(!h()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!h()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,a;for(i=0,o=n.length;i<o;++i)a=n[i][t.axis],Wr(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Yse(Se(this.options.clip,Hse(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,s,l),u=s;u<s+l;++u){const d=i[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(u=0;u<a.length;++u)a[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Qse(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Xse(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,a=t+"-"+n,s=o[a],l=this.enableOptionSharing&&eu(r);if(s)return wC(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Lt.elements[t]),h=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,p,h,d);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(wC(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,s=o[a];if(s)return s;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new mR(i,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||cv(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(t,n,r,i){cv(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!cv(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const i=r.length,o=n.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(o),s=t;s<a;++s)o[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ec(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Jse(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=eR(r.sort((i,o)=>i-o))}return e._cache.$bar}function ele(e){const t=e.iScale,n=Jse(t,e.type);let r=t._length,i,o,a,s;const l=()=>{a===32767||a===-32768||(eu(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(i=0,o=n.length;i<o;++i)a=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),l();return r}function tle(e,t,n,r){const i=n.barThickness;let o,a;return He(i)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:t.pixels[e]-o/2}}function nle(e,t,n,r){const i=t.pixels,o=i[e];let a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(s===null?t.end-t.start:s-o)),s===null&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function rle(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}function vR(e,t,n,r){return nn(e)?rle(e,t,n,r):t[n.axis]=n.parse(e,r),t}function _C(e,t,n,r){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(vR(f,d,o,c));return l}function uv(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ile(e,t,n){return e!==0?_i(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function ole(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function ale(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=ole(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[SC(u,a,s,l)]=!0,i=c)),o[SC(i,a,s,l)]=!0,e.borderSkipped=o}function SC(e,t,n,r){return r?(e=sle(e,t,n),e=EC(e,n,t)):e=EC(e,t,n),e}function sle(e,t,n){return e===t?n:e===n?t:e}function EC(e,t,n){return e==="start"?t:e==="end"?n:e}function lle(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class cle extends qh{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,i){return _C(t,n,r,i)}parseArrayData(t,n,r,i){return _C(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let f,p,h,m;for(f=r,p=r+i;f<p;++f)m=n[f],h={},h[o.axis]=o.parse(is(m,c),f),d.push(vR(is(m,u),h,a,f));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),a=o._custom,s=uv(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const h=this.getParsed(p),m=o||He(h[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),v=this._calculateBarIndexPixels(p,u),b=(h._stacks||{})[s.axis],S={horizontal:c,base:m.base,enableBorderRadius:!b||uv(h._custom)||a===b._top||a===b._bottom,x:c?m.head:v.center,y:c?v.center:m.head,height:c?v.size:Math.abs(m.size),width:c?Math.abs(m.size):v.size};f&&(S.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const w=S.options||t[p].options;ale(S,w,b,a),lle(S,w,u.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,a=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],c=u=>{const d=u._parsed.find(p=>p[r.axis]===l),f=d&&d[u.vScale.axis];if(He(f)||isNaN(f))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Se(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,a;for(o=0,a=n.data.length;o<a;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=t.barThickness;return{min:s||ele(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:a}}=this,s=o||0,l=this.getParsed(t),c=l._custom,u=uv(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,h,m;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&_i(d)!==_i(c.barEnd)&&(f=0),f+=d);const v=!He(o)&&!u?o:f;let b=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?h=n.getPixelForValue(f+p):h=b,m=h-b,Math.abs(m)<a){m=ile(m,n,s)*a,d===s&&(b-=m/2);const S=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),x=Math.min(S,w),_=Math.max(S,w);b=Math.max(Math.min(b,_),x),h=b+m,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(h)-n.getValueForPixel(b))}if(b===n.getPixelForValue(s)){const S=_i(m)*n.getLineWidthForValue(s)/2;b+=S,m-=S}return{size:m,base:b,head:h,center:h+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,a=Se(i.maxBarThickness,1/0);let s,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?nle(t,n,i,u*c):tle(t,n,i,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Se(f,this.getFirstScaleIdForIndexAxis())),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+p;s=d.start+d.chunk*h+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}function ule(e,t,n){let r=1,i=1,o=0,a=0;if(t<Tt){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),f=Math.sin(l),p=(w,x,_)=>nu(w,s,l,!0)?1:Math.max(x,x*n,_,_*n),h=(w,x,_)=>nu(w,s,l,!0)?-1:Math.min(x,x*n,_,_*n),m=p(0,c,d),v=p(qt,u,f),b=h(it,c,d),S=h(it+qt,u,f);r=(m-b)/2,i=(v-S)/2,o=-(m+b)/2,a=-(v+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}class dle extends qh{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Te(r[t])){const{key:l="value"}=this._parsing;o=c=>+is(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)i._parsed[a]=o(a)}}_getRotation(){return Ji(this.options.rotation-90)}_getCircumference(){return Ji(this.options.circumference)}_getRotationExtents(){let t=Tt,n=-Tt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(hae(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:h,offsetY:m}=ule(d,u,l),v=(r.width-a)/f,b=(r.height-a)/p,S=Math.max(Math.min(v,b)/2,0),w=Gj(this.options.radius,S),x=Math.max(w*l,0),_=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=h*w,this.offsetY=m*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Tt)}updateElements(t,n,r,i){const o=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,f=o&&c.animateScale,p=f?0:this.innerRadius,h=f?0:this.outerRadius,{sharedOptions:m,includeOptions:v}=this._getSharedOptions(n,i);let b=this._getRotation(),S;for(S=0;S<n;++S)b+=this._circumference(S,o);for(S=n;S<n+r;++S){const w=this._circumference(S,o),x=t[S],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:h,innerRadius:p};v&&(_.options=m||this.resolveDataElementOptions(S,x.active?"active":i)),b+=w,this.updateElement(x,S,_,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Tt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=qx(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,a,s,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){a=r.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Se(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class fle extends qh{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=jae(n,i,a);this._drawStart=s,this._drawCount=l,Rae(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=a.axis,p=s.axis,{spanGaps:h,segment:m}=this.options,v=tu(h)?h:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||i==="none",S=n+r,w=t.length;let x=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const O=t[_],k=b?O:{};if(_<n||_>=S){k.skip=!0;continue}const D=this.getParsed(_),T=He(D[p]),j=k[f]=a.getPixelForValue(D[f],_),A=k[p]=o||T?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],_);k.skip=isNaN(j)||isNaN(A)||T,k.stop=_>0&&Math.abs(D[f]-x[f])>v,m&&(k.parsed=D,k.raw=c.data[_]),d&&(k.options=u||this.resolveDataElementOptions(_,O.active?"active":i)),b||this.updateElement(O,_,k,i),x=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function ga(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class r1{static override(t){Object.assign(r1.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ga()}parse(){return ga()}format(){return ga()}add(){return ga()}diff(){return ga()}startOf(){return ga()}endOf(){return ga()}}var ple={_date:r1};function hle(e,t,n,r){const{controller:i,data:o,_sorted:a}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&a&&o.length){const c=s._reversePixels?Dae:Ia;if(r){if(i._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(m=>!He(m[d.axis]));u.lo-=Math.max(0,p);const h=f.slice(u.hi).findIndex(m=>!He(m[d.axis]));u.hi+=Math.max(0,h)}return u}}return{lo:0,hi:o.length-1}}function Gh(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=o.length;s<l;++s){const{index:c,data:u}=o[s],{lo:d,hi:f}=hle(o[s],t,a,i);for(let p=d;p<=f;++p){const h=u[p];h.skip||r(h,c,p)}}}function mle(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,a=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function dv(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||Gh(e,n,t,function(s,l,c){!i&&!ru(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&o.push({element:s,datasetIndex:l,index:c})},!0),o}function gle(e,t,n,r){let i=[];function o(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=Zj(a,{x:t.x,y:t.y});nu(d,c,u)&&i.push({element:a,datasetIndex:s,index:l})}return Gh(e,n,t,o),i}function vle(e,t,n,r,i,o){let a=[];const s=mle(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const h=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(h))&&!p)return;const v=s(t,h);v<l?(a=[{element:u,datasetIndex:d,index:f}],l=v):v===l&&a.push({element:u,datasetIndex:d,index:f})}return Gh(e,n,t,c),a}function fv(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?gle(e,t,n,i):vle(e,t,n,r,i,o)}function OC(e,t,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return Gh(e,n,t,(l,c,u)=>{l[a]&&l[a](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:o}var yle={modes:{index(e,t,n,r){const i=Ca(t,e),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?dv(e,i,o,r,a):fv(e,i,o,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Ca(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?dv(e,i,o,r,a):fv(e,i,o,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const i=Ca(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return dv(e,i,o,r,a)},nearest(e,t,n,r){const i=Ca(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return fv(e,i,o,n.intersect,r,a)},x(e,t,n,r){const i=Ca(t,e);return OC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Ca(t,e);return OC(e,i,"y",n.intersect,r)}}};const yR=["left","top","right","bottom"];function tc(e,t){return e.filter(n=>n.pos===t)}function CC(e,t){return e.filter(n=>yR.indexOf(n.pos)===-1&&n.box.axis===t)}function nc(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function ble(e){const t=[];let n,r,i,o,a,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:a,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return t}function xle(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!yR.includes(i))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function wle(e,t){const n=xle(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,a,s;for(o=0,a=e.length;o<a;++o){s=e[o];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=u?u*i:l&&t.availableHeight)}return n}function _le(e){const t=ble(e),n=nc(t.filter(c=>c.box.fullSize),!0),r=nc(tc(t,"left"),!0),i=nc(tc(t,"right")),o=nc(tc(t,"top"),!0),a=nc(tc(t,"bottom")),s=CC(t,"x"),l=CC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:tc(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function PC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function bR(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Sle(e,t,n,r){const{pos:i,box:o}=n,a=e.maxPadding;if(!Te(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&bR(a,o.getPadding());const s=Math.max(0,t.outerWidth-PC(a,e,"left","right")),l=Math.max(0,t.outerHeight-PC(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Ele(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Ole(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return r(e?["left","right"]:["top","bottom"])}function mc(e,t,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=e.length,c=0;o<a;++o){s=e[o],l=s.box,l.update(s.width||t.w,s.height||t.h,Ole(s.horizontal,t));const{same:d,other:f}=Sle(t,n,s,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(s)}return c&&mc(i,t,n,r)||u}function Id(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function kC(e,t,n,r){const i=n.padding;let{x:o,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,f=c.size||l.height;eu(c.start)&&(a=c.start),l.fullSize?Id(l,i.left,a,n.outerWidth-i.right-i.left,f):Id(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,f=c.size||l.width;eu(c.start)&&(o=c.start),l.fullSize?Id(l,o,i.top,f,n.outerHeight-i.bottom-i.top):Id(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var Lo={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Qr(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(n-i.height,0),s=_le(e.boxes),l=s.vertical,c=s.horizontal;Ge(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},i);bR(f,Qr(r));const p=Object.assign({maxPadding:f,w:o,h:a,x:i.left,y:i.top},i),h=wle(l.concat(c),d);mc(s.fullSize,p,d,h),mc(l,p,d,h),mc(c,p,d,h)&&mc(l,p,d,h),Ele(p),kC(s.leftAndTop,p,d,h),p.x+=p.w,p.y+=p.h,kC(s.rightAndBottom,p,d,h),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Ge(s.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class xR{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class Cle extends xR{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const of="$chartjs",Ple={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DC=e=>e===null||e==="";function kle(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[of]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",DC(i)){const o=fC(e,"width");o!==void 0&&(e.width=o)}if(DC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=fC(e,"height");o!==void 0&&(e.height=o)}return e}const wR=Ese?{passive:!0}:!1;function Dle(e,t,n){e&&e.addEventListener(t,n,wR)}function Ale(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,wR)}function Tle(e,t){const n=Ple[e.type]||e.type,{x:r,y:i}=Ca(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Sp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Mle(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Sp(s.addedNodes,r),a=a&&!Sp(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Nle(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Sp(s.removedNodes,r),a=a&&!Sp(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const iu=new Map;let AC=0;function _R(){const e=window.devicePixelRatio;e!==AC&&(AC=e,iu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function jle(e,t){iu.size||window.addEventListener("resize",_R),iu.set(e,t)}function Rle(e){iu.delete(e),iu.size||window.removeEventListener("resize",_R)}function Ile(e,t,n){const r=e.canvas,i=r&&n1(r);if(!i)return;const o=nR((s,l)=>{const c=i.clientWidth;n(s,l),c<i.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return a.observe(i),jle(e,o),a}function pv(e,t,n){n&&n.disconnect(),t==="resize"&&Rle(e)}function Fle(e,t,n){const r=e.canvas,i=nR(o=>{e.ctx!==null&&n(Tle(o,e))},e);return Dle(r,t,i),i}class Lle extends xR{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(kle(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[of])return!1;const r=n[of].initial;["height","width"].forEach(o=>{const a=r[o];He(a)?n.removeAttribute(o):n.setAttribute(o,a)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[of],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),a={attach:Mle,detach:Nle,resize:Ile}[n]||Fle;i[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:pv,detach:pv,resize:pv}[n]||Ale)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return Sse(t,n,r,i)}isAttached(t){const n=t&&n1(t);return!!(n&&n.isConnected)}}function $le(e){return!t1()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Cle:Lle}let sa=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return tu(this.x)&&tu(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}};function Ble(e,t){const n=e.options.ticks,r=Wle(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Vle(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return Hle(t,c,o,a/i),c;const u=zle(o,t,i);if(a>0){let d,f;const p=a>1?Math.round((l-s)/(a-1)):null;for(Fd(t,c,u,He(p)?0:s-p,s),d=0,f=a-1;d<f;d++)Fd(t,c,u,o[d],o[d+1]);return Fd(t,c,u,l,He(p)?t.length:l+p),c}return Fd(t,c,u),c}function Wle(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function zle(e,t,n){const r=Yle(e),i=t.length/n;if(!r)return Math.max(i,1);const o=_ae(r);for(let a=0,s=o.length-1;a<s;a++){const l=o[a];if(l>i)return l}return Math.max(i,1)}function Vle(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Hle(e,t,n,r){let i=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),i++,o=n[i*r])}function Fd(e,t,n,r,i){const o=Se(r,0),a=Math.min(Se(i,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)s++,u=Math.round(o+s*n);for(c=Math.max(o,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(o+s*n))}function Yle(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const Ule=e=>e==="left"?"right":e==="right"?"left":e,TC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,MC=(e,t)=>Math.min(t||e,e);function NC(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Kle(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-s||l>a+s)))return l}function qle(e,t){Ge(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function rc(e){return e.drawTicks?e.tickLength:0}function jC(e,t){if(!e.display)return 0;const n=er(e.font,t),r=Qr(e.padding);return(nn(e.text)?e.text.length:1)*n.lineHeight+r.height}function Gle(e,t){return ps(e,{scale:t,type:"scale"})}function Xle(e,t,n){return ps(e,{tick:n,index:t,type:"tick"})}function Qle(e,t,n){let r=rR(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Ule(r)),r}function Zle(e,t,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,h;const m=a-i,v=s-o;if(e.isHorizontal()){if(p=lr(r,o,s),Te(n)){const b=Object.keys(n)[0],S=n[b];h=u[b].getPixelForValue(S)+m-t}else n==="center"?h=(c.bottom+c.top)/2+m-t:h=TC(e,n,t);f=s-o}else{if(Te(n)){const b=Object.keys(n)[0],S=n[b];p=u[b].getPixelForValue(S)-v+t}else n==="center"?p=(c.left+c.right)/2-v+t:p=TC(e,n,t);h=lr(r,a,i),d=n==="left"?-qt:qt}return{titleX:p,titleY:h,maxWidth:f,rotation:d}}class Al extends sa{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=ii(t,Number.POSITIVE_INFINITY),n=ii(n,Number.NEGATIVE_INFINITY),r=ii(r,Number.POSITIVE_INFINITY),i=ii(i,Number.NEGATIVE_INFINITY),{min:ii(t,r),max:ii(n,i),minDefined:Wr(t),maxDefined:Wr(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:ii(n,ii(r,n)),max:ii(r,ii(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){dt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tse(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?NC(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ble(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dt(this.options.afterUpdate,[this])}beforeSetDimensions(){dt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=dt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=MC(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let a=i,s,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Cn(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-rc(t.grid)-n.padding-jC(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=Cae(Math.min(Math.asin(Cn((u.highest.height+6)/s,-1,1)),Math.asin(Cn(l/c,-1,1))-Math.asin(Cn(f/c,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=jC(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=rc(o)+l):(t.height=this.maxHeight,t.width=rc(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,h=Ji(this.labelRotation),m=Math.cos(h),v=Math.sin(h);if(s){const b=r.mirror?0:v*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{const b=r.mirror?0:m*d.width+v*f.height;t.width=Math.min(this.maxWidth,t.width+b+p)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=i*t.width,p=r*n.height):(f=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){dt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)He(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=NC(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,a=[],s=[],l=Math.floor(n/MC(n,r));let c=0,u=0,d,f,p,h,m,v,b,S,w,x,_;for(d=0;d<n;d+=l){if(h=t[d].label,m=this._resolveTickFontOptions(d),i.font=v=m.string,b=o[v]=o[v]||{data:{},gc:[]},S=m.lineHeight,w=x=0,!He(h)&&!nn(h))w=sC(i,b.data,b.gc,w,h),x=S;else if(nn(h))for(f=0,p=h.length;f<p;++f)_=h[f],!He(_)&&!nn(_)&&(w=sC(i,b.data,b.gc,w,_),x+=S);a.push(w),s.push(x),c=Math.max(w,c),u=Math.max(x,u)}qle(o,n);const O=a.indexOf(c),k=s.indexOf(u),D=T=>({width:a[T]||0,height:s[T]||0});return{first:D(0),last:D(n-1),widest:D(O),highest:D(k),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return kae(this._alignToPixels?ma(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=Xle(this.getContext(),t,r))}return this.$context||(this.$context=Gle(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ji(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:a,border:s}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=rc(o),p=[],h=s.setContext(this.getContext()),m=h.display?h.width:0,v=m/2,b=function(F){return ma(r,F,m)};let S,w,x,_,O,k,D,T,j,A,C,N;if(a==="top")S=b(this.bottom),k=this.bottom-f,T=S-v,A=b(t.top)+v,N=t.bottom;else if(a==="bottom")S=b(this.top),A=t.top,N=b(t.bottom)-v,k=S+v,T=this.top+f;else if(a==="left")S=b(this.right),O=this.right-f,D=S-v,j=b(t.left)+v,C=t.right;else if(a==="right")S=b(this.left),j=t.left,C=b(t.right)-v,O=S+v,D=this.left+f;else if(n==="x"){if(a==="center")S=b((t.top+t.bottom)/2+.5);else if(Te(a)){const F=Object.keys(a)[0],$=a[F];S=b(this.chart.scales[F].getPixelForValue($))}A=t.top,N=t.bottom,k=S+v,T=k+f}else if(n==="y"){if(a==="center")S=b((t.left+t.right)/2);else if(Te(a)){const F=Object.keys(a)[0],$=a[F];S=b(this.chart.scales[F].getPixelForValue($))}O=S-v,D=O-f,j=t.left,C=t.right}const M=Se(i.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/M));for(w=0;w<d;w+=R){const F=this.getContext(w),$=o.setContext(F),V=s.setContext(F),W=$.lineWidth,B=$.color,X=V.dash||[],q=V.dashOffset,ne=$.tickWidth,Z=$.tickColor,ee=$.tickBorderDash||[],ie=$.tickBorderDashOffset;x=Kle(this,w,l),x!==void 0&&(_=ma(r,x,W),c?O=D=j=C=_:k=T=A=N=_,p.push({tx1:O,ty1:k,tx2:D,ty2:T,x1:j,y1:A,x2:C,y2:N,width:W,color:B,borderDash:X,borderDashOffset:q,tickWidth:ne,tickColor:Z,tickBorderDash:ee,tickBorderDashOffset:ie}))}return this._ticksLength=d,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=rc(r.grid),p=f+u,h=d?-u:p,m=-Ji(this.labelRotation),v=[];let b,S,w,x,_,O,k,D,T,j,A,C,N="middle";if(i==="top")O=this.bottom-h,k=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+h,k=this._getXAxisLabelAlignment();else if(i==="left"){const R=this._getYAxisLabelAlignment(f);k=R.textAlign,_=R.x}else if(i==="right"){const R=this._getYAxisLabelAlignment(f);k=R.textAlign,_=R.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+p;else if(Te(i)){const R=Object.keys(i)[0],F=i[R];O=this.chart.scales[R].getPixelForValue(F)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(Te(i)){const R=Object.keys(i)[0],F=i[R];_=this.chart.scales[R].getPixelForValue(F)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const M=this._getLabelSizes();for(b=0,S=s.length;b<S;++b){w=s[b],x=w.label;const R=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,T=this._resolveTickFontOptions(b),j=T.lineHeight,A=nn(x)?x.length:1;const F=A/2,$=R.color,V=R.textStrokeColor,W=R.textStrokeWidth;let B=k;a?(_=D,k==="inner"&&(b===S-1?B=this.options.reverse?"left":"right":b===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?C=-A*j+j/2:c==="center"?C=-M.highest.height/2-F*j+j:C=-M.highest.height+j/2:c==="near"||m!==0?C=j/2:c==="center"?C=M.highest.height/2-F*j:C=M.highest.height-A*j,d&&(C*=-1),m!==0&&!R.showLabelBackdrop&&(_+=j/2*Math.sin(m))):(O=D,C=(1-A)*j/2);let X;if(R.showLabelBackdrop){const q=Qr(R.backdropPadding),ne=M.heights[b],Z=M.widths[b];let ee=C-q.top,ie=0-q.left;switch(N){case"middle":ee-=ne/2;break;case"bottom":ee-=ne;break}switch(k){case"center":ie-=Z/2;break;case"right":ie-=Z;break;case"inner":b===S-1?ie-=Z:b>0&&(ie-=Z/2);break}X={left:ie,top:ee,width:Z+q.width,height:ne+q.height,color:R.backdropColor}}v.push({label:x,font:T,textOffset:C,options:{rotation:m,color:$,strokeColor:V,strokeWidth:W,textAlign:B,textBaseline:N,translation:[_,O],backdrop:X}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ji(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),s=t+o,l=a.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=i.length;o<a;++o){const l=i[o];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=ma(t,this.left,a)-a/2,u=ma(t,this.right,s)+s/2,d=f=l):(d=ma(t,this.top,a)-a/2,f=ma(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Gx(r,i);const o=this.getLabelItems(t);for(const a of o){const s=a.options,l=a.font,c=a.label,u=a.textOffset;xp(r,c,0,u,l,s)}i&&Xx(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=er(r.font),a=Qr(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Te(n)?(l+=a.bottom,nn(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=Zle(this,l,n,s);xp(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:Qle(s,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Se(t.grid&&t.grid.z,-1),i=Se(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Al.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,a;for(o=0,a=n.length;o<a;++o){const s=n[o];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return er(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ld{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;tce(n)&&(r=this.register(n));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,Jle(t,a,r),this.override&&Lt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Lt[i]&&(delete Lt[i][r],this.override&&delete os[r])}}function Jle(e,t,n){const r=Jc(Object.create(null),[n?Lt.get(n):{},Lt.get(t),e.defaults]);Lt.set(t,r),e.defaultRoutes&&ece(t,e.defaultRoutes),e.descriptors&&Lt.describe(t,e.descriptors)}function ece(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Lt.route(o,i,l,s)})}function tce(e){return"id"in e&&"defaults"in e}class nce{constructor(){this.controllers=new Ld(qh,"datasets",!0),this.elements=new Ld(sa,"elements"),this.plugins=new Ld(Object,"plugins"),this.scales=new Ld(Al,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Ge(i,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const i=Yx(t);dt(r["before"+i],[],r),n[t](r),dt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var ai=new nce;class rce{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,i){i=i||{};for(const o of t){const a=o.plugin,s=a[r],l=[n,i,o.options];if(dt(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){He(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Se(r.options&&r.options.plugins,{}),o=ice(r);return i===!1&&!n?[]:ace(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,a)=>o.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function ice(e){const t={},n=[],r=Object.keys(ai.plugins.items);for(let o=0;o<r.length;o++)n.push(ai.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function oce(e,t){return!t&&e===!1?null:e===!0?{}:e}function ace(e,{plugins:t,localIds:n},r,i){const o=[],a=e.getContext();for(const s of t){const l=s.id,c=oce(r[l],i);c!==null&&o.push({plugin:s,options:sce(e.config,{plugin:s,local:n[l]},c,a)})}return o}function sce(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(r,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wy(e,t){const n=Lt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function lce(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function cce(e,t){return e===t?"_index_":"_value_"}function RC(e){if(e==="x"||e==="y"||e==="r")return e}function uce(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function zy(e,...t){if(RC(e))return e;for(const n of t){const r=n.axis||uce(n.position)||e.length>1&&RC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function IC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function dce(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return IC(e,"x",n[0])||IC(e,"y",n[0])}return{}}function fce(e,t){const n=os[e.type]||{scales:{}},r=t.scales||{},i=Wy(e.type,t),o=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!Te(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=zy(a,s,dce(a,e),Lt.scales[s.type]),c=cce(l,i),u=n.scales||{};o[a]=Sc(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||Wy(s,t),u=(os[s]||{}).scales||{};Object.keys(u).forEach(d=>{const f=lce(d,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Sc(o[p],[{axis:f},r[p],u[d]])})}),Object.keys(o).forEach(a=>{const s=o[a];Sc(s,[Lt.scales[s.type],Lt.scale])}),o}function SR(e){const t=e.options||(e.options={});t.plugins=Se(t.plugins,{}),t.scales=fce(e,t)}function ER(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function pce(e){return e=e||{},e.data=ER(e.data),SR(e),e}const FC=new Map,OR=new Set;function $d(e,t){let n=FC.get(e);return n||(n=t(),FC.set(e,n),OR.add(n)),n}const ic=(e,t,n)=>{const r=is(t,n);r!==void 0&&e.add(r)};class hce{constructor(t){this._config=pce(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ER(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),SR(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $d(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $d(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $d(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return $d(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ic(l,t,d))),u.forEach(d=>ic(l,i,d)),u.forEach(d=>ic(l,os[o]||{},d)),u.forEach(d=>ic(l,Lt,d)),u.forEach(d=>ic(l,$y,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),OR.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,os[n]||{},Lt.datasets[n]||{},{type:n},Lt,$y]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=LC(this._resolverCache,t,i);let l=a;if(gce(a,n)){o.$shared=!1,r=ea(r)?r():r;const c=this.createResolver(t,r,s);l=dl(a,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=LC(this._resolverCache,t,r);return Te(n)?dl(o,n,void 0,i):o}}function LC(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Zx(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const mce=e=>Te(e)&&Object.getOwnPropertyNames(e).some(t=>ea(e[t]));function gce(e,t){const{isScriptable:n,isIndexable:r}=sR(e);for(const i of t){const o=n(i),a=r(i),s=(a||o)&&e[i];if(o&&(ea(s)||mce(s))||a&&nn(s))return!0}return!1}var vce="4.5.0";const yce=["top","bottom","left","right","chartArea"];function $C(e,t){return e==="top"||e==="bottom"||yce.indexOf(e)===-1&&t==="x"}function BC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function WC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),dt(n&&n.onComplete,[e],t)}function bce(e){const t=e.chart,n=t.options.animation;dt(n&&n.onProgress,[e],t)}function CR(e){return t1()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const af={},zC=e=>{const t=CR(e);return Object.values(af).filter(n=>n.canvas===t).pop()};function xce(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const a=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=a)}}}function wce(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Wn=class{static defaults=Lt;static instances=af;static overrides=os;static registry=ai;static version=vce;static getChart=zC;static register(...t){ai.add(...t),VC()}static unregister(...t){ai.remove(...t),VC()}constructor(t,n){const r=this.config=new hce(n),i=CR(t),o=zC(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||$le(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=pae(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new rce,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Mae(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],af[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Wi.listen(this,"complete",WC),Wi.listen(this,"progress",bce),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return He(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ai}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return lC(this.canvas,this.ctx),this}stop(){return Wi.stop(this),this}resize(t,n){Wi.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,n,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,dC(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),dt(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ge(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const s=n[a],l=zy(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ge(o,a=>{const s=a.options,l=s.id,c=zy(l,s),u=Se(s.type,a.dtype);(s.position===void 0||$C(s.position,c)!==$C(a.dposition))&&(s.position=a.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=ai.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),Ge(i,(a,s)=>{a||delete r[s]}),Ge(r,a=>{Lo.configure(this,a,a.options),Lo.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(BC("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||Wy(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=ai.getController(s),{datasetElementType:c,dataElementType:u}=Lt.datasets[s];Object.assign(l,{dataElementType:ai.getElement(u),datasetElementType:c&&ai.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Ge(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||Ge(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(BC("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ge(this.scales,t=>{Lo.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Z2(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const a=r==="_removeElements"?-o:o;xce(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!Z2(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Lo.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ge(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ea(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Wi.has(this)?this.attached&&!Wi.running(this)&&Wi.start(this):(this.draw(),WC({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=Lse(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Gx(n,i),t.controller.draw(),i&&Xx(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ru(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=yle.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ps(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);eu(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Wi.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),lC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete af[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},i=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};Ge(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){Ge(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ge(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,a,s,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!vp(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=o(n,t),s=r?t:o(t,n);a.length&&this.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,a=n,s=this._getActiveElements(t,i,r,a),l=bae(t),c=wce(t,this._lastEvent,r,l);r&&(this._lastEvent=null,dt(o.onHover,[t,s,this],this),l&&dt(o.onClick,[t,s,this],this));const u=!vp(s,i);return(u||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}};function VC(){return Ge(Wn.instances,e=>e._plugins.invalidate())}function _ce(e,t,n){const{startAngle:r,x:i,y:o,outerRadius:a,innerRadius:s,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/a,Ur(r-n));if(e.beginPath(),e.arc(i,o,a-c/2,r+d/2,n-d/2),s>0){const f=Math.min(c/s,Ur(r-n));e.arc(i,o,s+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,a*Ur(r-n));if(u==="round")e.arc(i,o,f,n-it/2,r+it/2,!0);else if(u==="bevel"){const p=2*f*f,h=-p*Math.cos(n+it/2)+i,m=-p*Math.sin(n+it/2)+o,v=p*Math.cos(r+it/2)+i,b=p*Math.sin(r+it/2)+o;e.lineTo(h,m),e.lineTo(v,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Sce(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=t;let c=i/s;e.beginPath(),e.arc(o,a,s,r-c,n+c),l>i?(c=i/l,e.arc(o,a,l,n+c,r-c,!0)):e.arc(o,a,i,n+qt,r-qt),e.closePath(),e.clip()}function Ece(e){return Qx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Oce(e,t,n,r){const i=Ece(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,r*t/2),s=l=>{const c=(n-Math.min(o,l))*r/2;return Cn(l,0,Math.min(o,c))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Cn(i.innerStart,0,a),innerEnd:Cn(i.innerEnd,0,a)}}function ks(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ep(e,t,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let p=0;const h=i-l;if(r){const R=u>0?u-r:0,F=d>0?d-r:0,$=(R+F)/2,V=$!==0?h*$/($+r):h;p=(h-V)/2}const m=Math.max(.001,h*d-n/it)/d,v=(h-m)/2,b=l+v+p,S=i-v-p,{outerStart:w,outerEnd:x,innerStart:_,innerEnd:O}=Oce(t,f,d,S-b),k=d-w,D=d-x,T=b+w/k,j=S-x/D,A=f+_,C=f+O,N=b+_/A,M=S-O/C;if(e.beginPath(),o){const R=(T+j)/2;if(e.arc(a,s,d,T,R),e.arc(a,s,d,R,j),x>0){const W=ks(D,j,a,s);e.arc(W.x,W.y,x,j,S+qt)}const F=ks(C,S,a,s);if(e.lineTo(F.x,F.y),O>0){const W=ks(C,M,a,s);e.arc(W.x,W.y,O,S+qt,M+Math.PI)}const $=(S-O/f+(b+_/f))/2;if(e.arc(a,s,f,S-O/f,$,!0),e.arc(a,s,f,$,b+_/f,!0),_>0){const W=ks(A,N,a,s);e.arc(W.x,W.y,_,N+Math.PI,b-qt)}const V=ks(k,b,a,s);if(e.lineTo(V.x,V.y),w>0){const W=ks(k,T,a,s);e.arc(W.x,W.y,w,b-qt,T)}}else{e.moveTo(a,s);const R=Math.cos(T)*d+a,F=Math.sin(T)*d+s;e.lineTo(R,F);const $=Math.cos(j)*d+a,V=Math.sin(j)*d+s;e.lineTo($,V)}e.closePath()}function Cce(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){Ep(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(s)||(l=a+(s%Tt||Tt))}return Ep(e,t,n,r,l,i),e.fill(),l}function Pce(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Ep(e,t,n,r,m,i);for(let v=0;v<o;++v)e.stroke();isNaN(s)||(m=a+(s%Tt||Tt))}h&&Sce(e,t,m),l.selfJoin&&m-a>=it&&p===0&&u!=="miter"&&_ce(e,t,m),o||(Ep(e,t,n,r,m,i),e.stroke())}class i1 extends sa{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:a}=Zj(i,{x:t,y:n}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,p=Se(d,l-s),h=nu(o,s,l)&&s!==l,m=p>=Tt||h,v=Fo(a,c+f,u+f);return m&&v}getCenterPoint(t){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(i+o)/2,d=(a+s+c+l)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Tt?Math.floor(r/Tt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*i,Math.sin(s)*i);const l=1-Math.sin(Math.min(it,r||0)),c=i*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Cce(t,this,c,o,a),Pce(t,this,c,o,a),t.restore()}}function PR(e,t,n=t){e.lineCap=Se(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Se(n.borderDash,t.borderDash)),e.lineDashOffset=Se(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Se(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Se(n.borderWidth,t.borderWidth),e.strokeStyle=Se(n.borderColor,t.borderColor)}function kce(e,t,n){e.lineTo(n.x,n.y)}function Dce(e){return e.stepped?Uae:e.tension||e.cubicInterpolationMode==="monotone"?Kae:kce}function kR(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Ace(e,t,n,r){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=kR(i,n,r),u=Dce(o);let{move:d=!0,reverse:f}=r||{},p,h,m;for(p=0;p<=c;++p)h=i[(s+(f?c-p:p))%a],!h.skip&&(d?(e.moveTo(h.x,h.y),d=!1):u(e,m,h,f,o.stepped),m=h);return l&&(h=i[(s+(f?c:0))%a],u(e,m,h,f,o.stepped)),!!l}function Tce(e,t,n,r){const i=t.points,{count:o,start:a,ilen:s}=kR(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,h,m,v,b;const S=x=>(a+(c?s-x:x))%o,w=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,b))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[S(f)],p.skip)continue;const x=p.x,_=p.y,O=x|0;O===h?(_<m?m=_:_>v&&(v=_),u=(d*u+x)/++d):(w(),e.lineTo(x,_),h=O,d=0,m=v=_),b=_}w()}function Vy(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Tce:Ace}function Mce(e){return e.stepped?Ose:e.tension||e.cubicInterpolationMode==="monotone"?Cse:Pa}function Nce(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),PR(e,t.options),e.stroke(i)}function jce(e,t,n,r){const{segments:i,options:o}=t,a=Vy(t);for(const s of i)PR(e,o,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Rce=typeof Path2D=="function";function Ice(e,t,n,r){Rce&&!t.options.segment?Nce(e,t,n,r):jce(e,t,n,r)}class o1 extends sa{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;vse(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jse(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,a=Tse(this,{property:n,start:i,end:i});if(!a.length)return;const s=[],l=Mce(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:f}=a[c],p=o[d],h=o[f];if(p===h){s.push(p);continue}const m=Math.abs((i-p[n])/(h[n]-p[n])),v=l(p,h,m,r.stepped);v[n]=t[n],s.push(v)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Vy(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Vy(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)a&=o(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ice(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function HC(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class a1 extends sa{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,n){return HC(this,t,"x",n)}inYRange(t,n){return HC(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!ru(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,By(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function DR(e,t){const{x:n,y:r,base:i,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function $o(e,t,n,r){return e?0:Cn(t,n,r)}function Fce(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=aR(r);return{t:$o(i.top,o.top,0,n),r:$o(i.right,o.right,0,t),b:$o(i.bottom,o.bottom,0,n),l:$o(i.left,o.left,0,t)}}function Lce(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Bs(i),a=Math.min(t,n),s=e.borderSkipped,l=r||Te(i);return{topLeft:$o(!l||s.top||s.left,o.topLeft,0,a),topRight:$o(!l||s.top||s.right,o.topRight,0,a),bottomLeft:$o(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:$o(!l||s.bottom||s.right,o.bottomRight,0,a)}}function $ce(e){const t=DR(e),n=t.right-t.left,r=t.bottom-t.top,i=Fce(e,n/2,r/2),o=Lce(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function hv(e,t,n,r){const i=t===null,o=n===null,s=e&&!(i&&o)&&DR(e,r);return s&&(i||Fo(t,s.left,s.right))&&(o||Fo(n,s.top,s.bottom))}function Bce(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Wce(e,t){e.rect(t.x,t.y,t.w,t.h)}function mv(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}class Tl extends sa{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:a}=$ce(this),s=Bce(a.radius)?wp:Wce;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),s(t,mv(a,n,o)),t.clip(),s(t,mv(o,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,mv(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return hv(this,t,n,r)}inXRange(t,n){return hv(this,t,null,n)}inYRange(t,n){return hv(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const YC=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},zce=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class UC extends sa{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=dt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=er(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=YC(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,o,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,i,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((h,m)=>{const v=r+n/2+o.measureText(h.text).width;(m===0||c[c.length-1]+v+2*s>a)&&(d+=u,c[c.length-(m>0?0:1)]=0,p+=u,f++),l[m]={left:0,top:p,row:f,width:v,height:i},c[c.length-1]+=v+s}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,f=0,p=0,h=0,m=0;return this.legendItems.forEach((v,b)=>{const{itemWidth:S,itemHeight:w}=Vce(r,n,o,v,i);b>0&&p+w+2*s>u&&(d+=f+s,c.push({width:f,height:p}),h+=f+s,m++,f=p=0),l[b]={left:h,top:p,col:m,width:S,height:w},f=Math.max(f,S),p+=w+s}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=Ws(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=lr(r,this.left+i,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=lr(r,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i}else{let s=0,l=lr(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=lr(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gx(t,this),this._draw(),Xx(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=t,s=Lt.color,l=Ws(t.rtl,this.left,this.width),c=er(a.font),{padding:u}=a,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:h,boxHeight:m,itemHeight:v}=YC(a,d),b=function(O,k,D){if(isNaN(h)||h<=0||isNaN(m)||m<0)return;i.save();const T=Se(D.lineWidth,1);if(i.fillStyle=Se(D.fillStyle,s),i.lineCap=Se(D.lineCap,"butt"),i.lineDashOffset=Se(D.lineDashOffset,0),i.lineJoin=Se(D.lineJoin,"miter"),i.lineWidth=T,i.strokeStyle=Se(D.strokeStyle,s),i.setLineDash(Se(D.lineDash,[])),a.usePointStyle){const j={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:T},A=l.xPlus(O,h/2),C=k+f;oR(i,j,A,C,a.pointStyleWidth&&h)}else{const j=k+Math.max((d-m)/2,0),A=l.leftForLtr(O,h),C=Bs(D.borderRadius);i.beginPath(),Object.values(C).some(N=>N!==0)?wp(i,{x:A,y:j,w:h,h:m,radius:C}):i.rect(A,j,h,m),i.fill(),T!==0&&i.stroke()}i.restore()},S=function(O,k,D){xp(i,D.text,O,k+v/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?p={x:lr(o,this.left+u,this.right-r[0]),y:this.top+u+x,line:0}:p={x:this.left+u,y:lr(o,this.top+x+u,this.bottom-n[0].height),line:0},fR(this.ctx,t.textDirection);const _=v+u;this.legendItems.forEach((O,k)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const D=i.measureText(O.text).width,T=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),j=h+f+D;let A=p.x,C=p.y;l.setWidth(this.width),w?k>0&&A+j+u>this.right&&(C=p.y+=_,p.line++,A=p.x=lr(o,this.left+u,this.right-r[p.line])):k>0&&C+_>this.bottom&&(A=p.x=A+n[p.line].width+u,p.line++,C=p.y=lr(o,this.top+x+u,this.bottom-n[p.line].height));const N=l.x(A);if(b(N,C,O),A=Nae(T,A+h+f,w?A+j:this.right,t.rtl),S(l.x(A),C,O),w)p.x+=j+u;else if(typeof O.text!="string"){const M=c.lineHeight;p.y+=AR(O,M)+u}else p.y+=_}),pR(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=er(n.font),i=Qr(n.padding);if(!n.display)return;const o=Ws(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=lr(t.align,d,this.right-f);else{const h=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+lr(t.align,this.top,this.bottom-h-t.labels.padding-this._computeTitleHeight())}const p=lr(s,d,d+f);a.textAlign=o.textAlign(rR(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,xp(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=er(t.font),r=Qr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Fo(t,this.left,this.right)&&Fo(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Fo(t,i.left,i.left+i.width)&&Fo(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Uce(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=zce(i,r);i&&!o&&dt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&dt(n.onHover,[t,r,this],this)}else r&&dt(n.onClick,[t,r,this],this)}}function Vce(e,t,n,r,i){const o=Hce(r,e,t,n),a=Yce(i,r,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Hce(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+r.measureText(i).width}function Yce(e,t,n){let r=e;return typeof t.text!="string"&&(r=AR(t,n)),r}function AR(e,t){const n=e.text?e.text.length:0;return t*n}function Uce(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var ei={id:"legend",_element:UC,start(e,t,n){const r=e.legend=new UC({ctx:e.ctx,options:n,chart:e});Lo.configure(e,r,n),Lo.addBox(e,r)},stop(e){Lo.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Lo.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Qr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:a&&(s||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};const gc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Ly(t,c);u<i&&(i=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function oi(e,t){return t&&(nn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function zi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
281
281
  `)>-1?e.split(`
282
- `):e}function Kce(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KC(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=er(t.bodyFont),c=er(t.titleFont),u=er(t.footerFont),d=o.length,f=i.length,p=r.length,h=Qr(t.padding);let m=h.height,v=0,b=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=p*x+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){v=Math.max(v,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),v+=h.width,{width:v,height:m}}function qce(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Gce(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function Xce(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),Gce(c,e,t,n)&&(c="center"),c}function qC(e,t,n){const r=n.yAlign||t.yAlign||qce(e,n);return{xAlign:n.xAlign||t.xAlign||Xce(e,t,n,r),yAlign:r}}function Qce(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Zce(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function GC(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=Bs(a);let h=Qce(t,s);const m=Zce(t,l,c);return l==="center"?s==="left"?h+=c:s==="right"&&(h-=c):s==="left"?h-=Math.max(u,f)+i:s==="right"&&(h+=Math.max(d,p)+i),{x:Cn(h,0,r.width-t.width),y:Cn(m,0,r.height-t.height)}}function Bd(e,t,n){const r=Qr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function XC(e){return oi([],zi(e))}function Jce(e,t,n){return ps(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function QC(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const TR={beforeTitle:Bi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Bi,beforeBody:Bi,beforeLabel:Bi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return He(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bi,afterBody:Bi,beforeFooter:Bi,footer:Bi,afterFooter:Bi};function Yn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?TR[t].call(n,r):i}class ZC extends sa{static positioners=gc;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new mR(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Jce(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Yn(r,"beforeTitle",this,t),o=Yn(r,"title",this,t),a=Yn(r,"afterTitle",this,t);let s=[];return s=oi(s,zi(i)),s=oi(s,zi(o)),s=oi(s,zi(a)),s}getBeforeBody(t,n){return XC(Yn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=QC(r,o);oi(a.before,zi(Yn(s,"beforeLabel",this,o))),oi(a.lines,Yn(s,"label",this,o)),oi(a.after,zi(Yn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return XC(Yn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Yn(r,"beforeFooter",this,t),o=Yn(r,"footer",this,t),a=Yn(r,"afterFooter",this,t);let s=[];return s=oi(s,zi(i)),s=oi(s,zi(o)),s=oi(s,zi(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Kce(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=QC(t.callbacks,u);i.push(Yn(d,"labelColor",this,u)),o.push(Yn(d,"labelPointStyle",this,u)),a.push(Yn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=gc[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=KC(this,r),c=Object.assign({},s,l),u=qC(this.chart,r,c),d=GC(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Bs(s),{x:f,y:p}=t,{width:h,height:m}=n;let v,b,S,w,x,_;return o==="center"?(x=p+m/2,i==="left"?(v=f,b=v-a,w=x+a,_=x-a):(v=f+h,b=v+a,w=x-a,_=x+a),S=v):(i==="left"?b=f+Math.max(l,u)+a:i==="right"?b=f+h-Math.max(c,d)-a:b=this.caretX,o==="top"?(w=p,x=w-a,v=b-a,S=b+a):(w=p+m,x=w+a,v=b+a,S=b-a),_=w),{x1:v,x2:b,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=Ws(r.rtl,this.x,this.width);for(t.x=Bd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=er(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=er(o.bodyFont),d=Bd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},v=i.leftForLtr(f,c)+c/2,b=h+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,By(t,m,v,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,By(t,m,v,b)}else{t.lineWidth=Te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(f,c),v=i.leftForLtr(i.xPlus(f,1),c-2),b=Bs(a.borderRadius);Object.values(b).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,wp(t,{x:m,y:h,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),wp(t,{x:v,y:h+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,h,c,l),t.strokeRect(m,h,c,l),t.fillStyle=a.backgroundColor,t.fillRect(v,h+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=er(r.bodyFont);let f=d.lineHeight,p=0;const h=Ws(r.rtl,this.x,this.width),m=function(D){n.fillText(D,h.x(t.x+p),t.y+f/2),t.y+=f+o},v=h.textAlign(a);let b,S,w,x,_,O,k;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Bd(this,v,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),p=s&&v!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,O=i.length;x<O;++x){for(b=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(b.before,m),w=b.lines,s&&w.length&&(this._drawColorBox(n,t,x,h,r),f=Math.max(d.lineHeight,l)),_=0,k=w.length;_<k;++_)m(w[_]),f=d.lineHeight;Ge(b.after,m)}p=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=Ws(r.rtl,this.x,this.width);for(t.x=Bd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=er(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:h}=Bs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-h),n.quadraticCurveTo(s+c,l+u,s+c-h,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=gc[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=KC(this,t),l=Object.assign({},a,this._size),c=qC(n,t,l),u=GC(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Qr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),fR(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),pR(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!vp(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!vp(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=gc[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var Yr={id:"tooltip",_element:ZC,positioners:gc,afterInit(e,t,n){n&&(e.tooltip=new ZC({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:TR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const eue=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function tue(e,t,n,r){const i=e.indexOf(t);if(i===-1)return eue(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const nue=(e,t)=>e===null?null:Cn(Math.round(e),0,t);function JC(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Po extends Al{static id="category";static defaults={ticks:{callback:JC}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:tue(r,t,Se(n,t),this._addedLabels),nue(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return JC.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function rue(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,h=u-1,{min:m,max:v}=t,b=!He(a),S=!He(s),w=!He(c),x=(v-m)/(d+1);let _=eC((v-m)/h/p)*p,O,k,D,T;if(_<1e-14&&!b&&!S)return[{value:m},{value:v}];T=Math.ceil(v/_)-Math.floor(m/_),T>h&&(_=eC(T*_/h/p)*p),He(l)||(O=Math.pow(10,l),_=Math.ceil(_*O)/O),i==="ticks"?(k=Math.floor(m/_)*_,D=Math.ceil(v/_)*_):(k=m,D=v),b&&S&&o&&Eae((s-a)/o,_/1e3)?(T=Math.round(Math.min((s-a)/_,u)),_=(s-a)/T,k=a,D=s):w?(k=b?a:k,D=S?s:D,T=c-1,_=(D-k)/T):(T=(D-k)/_,Ec(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const j=Math.max(tC(_),tC(k));O=Math.pow(10,He(l)?j:l),k=Math.round(k*O)/O,D=Math.round(D*O)/O;let A=0;for(b&&(f&&k!==a?(n.push({value:a}),k<a&&A++,Ec(Math.round((k+A*_)*O)/O,a,eP(a,x,e))&&A++):k<a&&A++);A<T;++A){const C=Math.round((k+A*_)*O)/O;if(S&&C>s)break;n.push({value:C})}return S&&f&&D!==s?n.length&&Ec(n[n.length-1].value,s,eP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function eP(e,t,{horizontal:n,minRotation:r}){const i=Ji(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class iue extends Al{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return He(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=_i(i),c=_i(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=rue(i,o);return t.bounds==="ticks"&&Oae(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return qx(t,this.chart.options.locale,this.options.ticks.format)}}class ko extends iue{static id="linear";static defaults={ticks:{callback:iR.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wr(t)?t:0,this.max=Wr(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ji(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Xh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Qn=Object.keys(Xh);function tP(e,t){return e-t}function nP(e,t){if(He(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Wr(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(tu(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function rP(e,t,n,r){const i=Qn.length;for(let o=Qn.indexOf(e);o<i-1;++o){const a=Xh[Qn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return Qn[o]}return Qn[i-1]}function oue(e,t,n,r,i){for(let o=Qn.length-1;o>=Qn.indexOf(n);o--){const a=Qn[o];if(Xh[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return Qn[n?Qn.indexOf(n):0]}function aue(e){for(let t=Qn.indexOf(e)+1,n=Qn.length;t<n;++t)if(Xh[Qn[t]].common)return Qn[t]}function iP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function sue(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function oP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:sue(e,r,i,n)}class aP extends Al{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ple._date(t.adapters.date);i.init(n),Sc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Wr(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Wr(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Aae(i,o,a);return this._unit=n.unit||(r.autoSkip?rP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):oue(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:aue(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),oP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Cn(n,0,a),r=Cn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||rP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=tu(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const h=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)iP(u,f,h);return(f===r||i.bounds==="ticks"||p===1)&&iP(u,f,h),Object.keys(u).sort(tP).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return dt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Ji(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,oP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return eR(t.sort(tP))}}function Wd(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ia(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ia(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class ppe extends aP{static id="timeseries";static defaults=aP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Wd(n,this.min),this._tableRange=Wd(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Wd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Wd(this._table,r*this._tableRange+this._minPos,!0)}}const MR="label";function sP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function lue(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function NR(e,t){e.labels=t}function jR(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MR;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function cue(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:MR;const n={labels:[],datasets:[]};return NR(n,e.labels),jR(n,e.datasets,t),n}function uue(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=P.useRef(null),h=P.useRef(null),m=()=>{p.current&&(h.current=new Wn(p.current,{type:a,data:cue(s,o),options:l&&{...l},plugins:c}),sP(t,h.current))},v=()=>{sP(t,null),h.current&&(h.current.destroy(),h.current=null)};return P.useEffect(()=>{!i&&h.current&&l&&lue(h.current,l)},[i,l]),P.useEffect(()=>{!i&&h.current&&NR(h.current.config.data,s.labels)},[i,s.labels]),P.useEffect(()=>{!i&&h.current&&s.datasets&&jR(h.current.config.data,s.datasets,o)},[i,s.datasets]),P.useEffect(()=>{h.current&&(i?(v(),setTimeout(m)):h.current.update(d))},[i,l,s.labels,s.datasets,d]),P.useEffect(()=>{h.current&&(v(),setTimeout(m))},[a]),P.useEffect(()=>(m(),()=>v()),[]),P.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const due=P.forwardRef(uue);function s1(e,t){return Wn.register(t),P.forwardRef((n,r)=>P.createElement(due,{...n,ref:r,type:e}))}const l1=s1("line",fle),Ml=s1("bar",cle),c1=s1("doughnut",dle);Wn.register(i1,Yr,ei);const fue={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},pue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},RR=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:h,showBottomGlow:m=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:b="",resolvedWidgetType:S="",data:w})=>{const x=w?.title??e,_=w?.icon??t,O=w?.firstLabel??n,k=Number(w?.firstValue??r??0),D=w?.firstColor??i,T=w?.secondLabel??o,j=Number(w?.secondValue??a??0),A=w?.secondColor??s,C=w?.growthPercentage??l??"+0%",N=w?.growthText??c,M=w?.totalLabel??u,R=w?.widgetType??b??S,F=w?.centerTopSize??p??(R==="commercial"?34:20),$=w?.centerBottomSize??h??(R==="commercial"?14:10),V=w?.showBottomGlow??m,W=w?.bottomGlowColor??v,B=k+j,X={labels:[O,T],datasets:[{data:[k,j],backgroundColor:[D,A],borderWidth:2,hoverOffset:4}]},q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:oe=>`${oe.label}: ${oe.parsed}`},displayColors:!1},centerText:{top:`${B}`,bottom:M,topSize:F,bottomSize:$,topColor:d,bottomColor:f},bottomGlow:{enabled:V,color:W}}},ne=[{label:O,value:k,color:D},{label:T,value:j,color:A}],Z=C.toString().includes("+"),ee=C.toString().includes("-"),ie=Z?"#1FA05B":"#AB0000";return g.jsx(Ie,{title:x,icon:_,className:R==="commercial"?"h-[362px]":"h-[238px]",children:g.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[g.jsxs("div",{className:"col-span-5 space-y-[16px]",children:[ne.map((oe,se)=>g.jsxs("div",{children:[g.jsx("div",{className:`text-[12px] text-[#64748B] ${R==="commercial"?"mb-[8px]":""}`,children:oe.label}),g.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:oe.color},children:oe.value})]},se)),g.jsxs("div",{className:`text-[12px] flex gap-[4px] ${R==="commercial"?"mt-[20px]":""} items-center`,style:{color:ie},children:[Z&&g.jsx(Ga,{}),ee&&g.jsx(qa,{}),g.jsx("div",{children:C.replace("+","").replace("-","")}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:N})]})]}),g.jsx("div",{className:"col-span-7",children:g.jsx("div",{className:`${R==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:g.jsx(c1,{data:X,options:q,plugins:[fue,pue]})})})]})})},lP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),g.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),g.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},cP=({title:e,value:t,suffix:n,valueClass:r=""})=>g.jsxs("div",{className:"bg-white rounded-[12px] h-[98px] p-[16px] flex flex-col justify-center",children:[g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-[4px]",children:e}),g.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&g.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),hue=({data:e,totalUnits:t=847,occupiedUnits:n=756,ownerCount:r=700,tenantCount:i=56,avgResidents:o=4.4,avgLeaseMonths:a=18})=>{const s=Number(e?.totalUnits??t??0),l=Number(e?.occupiedUnits??n??0),c=Number(e?.ownerCount??r??0),u=Number(e?.tenantCount??i??0),d=e?.avgResidents??o,f=e?.avgLeaseMonths??a,p=c+u;return g.jsxs("div",{children:[g.jsxs("div",{className:"bg-white rounded-[12px] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[g.jsx(wb,{className:"h-6 w-6 text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-center justify-between gap-",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),g.jsxs("div",{className:"flex items-center gap-[4px]",children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:l}),g.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",s]})]})]}),g.jsxs("div",{className:"flex items-end",children:[g.jsx(lP,{value:c,total:p,colorClass:"bg-[#8B5CF6]",label:"Owner"}),g.jsx(lP,{value:u,total:p,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),g.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[g.jsx(cP,{title:"Avg Residents Per Unit",value:d,valueClass:"text-[#8B5CF6]"}),g.jsx(cP,{title:"Avg Lease Period",value:f,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Wn.register(i1,Yr,ei);const mue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},gue=({data:e,ownerCount:t=1e3,tenantCount:n=200,nonResidingOwners:r=26,growthPct:i="+9.1%"})=>{const o=Number(e?.ownerCount??t??0),a=Number(e?.tenantCount??n??0),s=Number(e?.nonResidingOwners??r??0),l=e?.growthPct??i,c=Math.max(o-s,0),u=o+a,d={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[c,a,s],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},f={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:p=>`${p.label}: ${p.parsed}`},displayColors:!1},centerText:{top:`${u}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return g.jsx(Ie,{title:"Resident Overview",icon:g.jsx(Gk,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:g.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[g.jsxs("div",{className:"col-span-5",children:[g.jsxs("div",{children:[g.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),g.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:o})]}),g.jsxs("div",{children:[g.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),g.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:a})]}),g.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center",children:[l," ",g.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),g.jsx("div",{className:"col-span-7",children:g.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:g.jsx(c1,{data:d,options:f,plugins:[mue]})})})]})})};Wn.register(Po,ko,Tl,Yr,ei);const vue=({data:e,blocks:t=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const n=Array.isArray(e?.blocks)&&e.blocks.length>0?e.blocks:Array.isArray(e)&&e.length>0?e:t,r=n.map(c=>c.name),i=n.map(c=>Number(c.owner??0)),o=n.map(c=>Number(c.rented??0)),a=n.map(c=>Number(c.vacant??0)),s={labels:r,datasets:[{label:"Owner",data:i,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:i.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:o,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:o.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:a,backgroundColor:"#08B6D4",barThickness:40}]},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return g.jsx(Ie,{title:"Block-wise Occupancy",period:g.jsx(yo,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:g.jsx(Ml,{data:s,options:l})})};Wn.register(Po,ko,a1,o1,Yr,ei);const yue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},bue=({data:e,labels:t=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:n=[24,27,20,26,23],moveOut:r=[12,17,8,5,16]})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:t,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:n,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:r,s={labels:i,datasets:[{label:"Move-in",data:o,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:a,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>yue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsx(Ie,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:g.jsx(yo,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:g.jsx(l1,{data:s,options:l})})};Wn.register(Po,ko,a1,o1,Yr,ei);const xue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},wue=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],_ue=[24,27,20,26,23],Sue=[4,17,8,5,16],IR=({data:e,labels:t,moveIn:n,moveOut:r})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Array.isArray(t)&&t.length>0?t:wue,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:Array.isArray(n)&&n.length>0?n:_ue,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:Array.isArray(r)&&r.length>0?r:Sue,s={labels:i,datasets:[{label:"Income",data:o,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:a,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>xue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsx(l1,{data:s,options:l})};function uP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} border border-[#EBEBEB] h-[126px]`,children:[g.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),g.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[g.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),g.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Eue({data:e={}}){const t=e?.incomeCard??{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"},n=e?.expenditureCard??{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"};return g.jsxs(Ie,{title:"Accounting",className:"w-full h-[523px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[g.jsx(uP,{...t}),g.jsx(uP,{...n})]}),g.jsx("div",{className:"h-[254px] mt-[35.5px]",children:g.jsx(IR,{data:e?.incomeExpenditure})})]})}Wn.register(Po,ko,Tl,Yr,ei);const Oue=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],Cue=[55e3,56e3,64e3,38e3,54e3,65e3],Pue=[63e3,48e3,51300,28e3,42e3,35e3],kue=({data:e={}})=>{const t=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Oue,n=Array.isArray(e?.budgetValues)&&e.budgetValues.length>0?e.budgetValues:Cue,r=Array.isArray(e?.actualValues)&&e.actualValues.length>0?e.actualValues:Pue,i={labels:t,datasets:[{label:"Budget",data:n,backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:r,backgroundColor:"#3B82F6",barThickness:60}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:a=>t[a[0].dataIndex],label:a=>{const s=a.parsed.y;return`${a.dataset.label}: AED ${(s/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:a=>`${a/1e3}K`}}}};return g.jsx(Ie,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:g.jsx(Ml,{data:i,options:o})})},Due=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],Aue=({data:e})=>{const t=Array.isArray(e?.accounts)&&e.accounts.length>0?e.accounts:Array.isArray(e)&&e.length>0?e:Due,n=t.reduce((i,o)=>i+o.amount,0),r=i=>i>=1e6?`AED ${(i/1e6).toFixed(2)}M`:i>=1e3?`AED ${(i/1e3).toFixed(1)}K`:`AED ${i}`;return g.jsxs(Ie,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((i,o)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:i.title}),g.jsx("div",{className:"!text-[12px] text-[#64748B]",children:i?.subtitle})]}),g.jsx("div",{className:"flex flex-col items-end",children:g.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:r(i.amount)})})]},o))}),g.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-[12px]",children:[g.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),g.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:r(n)})]})]})};Wn.register(Po,ko,Tl,Yr,ei);const Tue=[{label:"Current Month",value:13e3,units:18},{label:"1-3 Months",value:9400,units:12},{label:"3-6 Months",value:8800,units:18},{label:"6+ Months",value:7200,units:6}],Mue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Tue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#EF4444",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return g.jsxs(Ie,{title:"Dues Ageing",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:n.map((s,l)=>g.jsx("div",{className:"p-[8px] rounded-[8px] bg-slate-50",children:g.jsxs("div",{className:"flex justify-between items-start",children:[g.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:s}),g.jsxs("div",{className:"text-right",children:[g.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(r[l]/1e3).toFixed(1),"K"]}),g.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[i[l]," Units"]})]})]})},s))}),g.jsx("div",{className:"h-[192px]",children:g.jsx(Ml,{data:o,options:a})})]})};Wn.register(i1,Yr,ei);const Nue=[{label:"Maintenance",value:45e4,color:"#08B6D4"},{label:"Utilities",value:32e4,color:"#8B5CF6"},{label:"Security",value:28e4,color:"#EF4444"},{label:"Administration",value:18e4,color:"#F69E0A"},{label:"Others",value:12e4,color:"#12B981"}],jue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Nue,n=t.map(l=>l.label),r=t.map(l=>Number(l.value??0)),i=t.map(l=>l.color),o={labels:n,datasets:[{label:"Expenses",data:r,backgroundColor:i,borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},a=r.reduce((l,c)=>l+c,0),s={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:l=>`${l.label}: AED ${l.formattedValue}`}}}};return g.jsxs(Ie,{title:"Expense Categories",className:"w-full h-[523px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[g.jsx(c1,{data:o,options:s}),g.jsxs("div",{className:"absolute text-center",children:[g.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(a/1e6).toFixed(2),"M"]}),g.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),g.jsx("div",{className:"space-y-2",children:n.map((l,c)=>g.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[g.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[g.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:o.datasets[0].backgroundColor[c]}}),l]}),g.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(r[c]/1e3).toFixed(0),"K"]})]},l))})]})},Rue=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function Iue({data:e,currency:t="AED"}){const n=Array.isArray(e)&&e.length>0?e:Rue,r=n.reduce((o,a)=>o+Number(a.value??0),0);let i="";return r>=1e6?i=`${(r/1e6).toFixed(2)}M`:r>=1e3?i=`${(r/1e3).toFixed(2)}K`:i=r.toString(),g.jsx(Ie,{title:"Asset Value Breakdown",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n.map((o,a)=>g.jsx(pn,{fill:o.color},`cell-${a}`))}),g.jsx(Pt,{formatter:o=>`${t} ${Number(o).toLocaleString()}`})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:[t," ",i]}),g.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),g.jsxs("div",{className:"flex justify-between w-full px-[16px] sm:px-[32px] mt-4 text-[14px]",children:[g.jsx("div",{className:"flex flex-col gap-[8px]",children:n.slice(0,3).map(o=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:o.color}}),g.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:o.name})]},o.name))}),g.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:n.slice(3).map(o=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:o.color}}),g.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:o.name})]},o.name))})]})]})})}Wn.register(Po,ko,Tl,Yr,ei);const Fue=[{label:"Gym",value:13e3,units:18},{label:"Parking",value:9400,units:12},{label:"Swimming Pool",value:8800,units:18},{label:"Community Hall",value:7200,units:6},{label:"Tennis Court",value:6e3,units:10}],Lue=({data:e})=>{const t=Array.isArray(e)&&e.length>0?e:Fue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0));console.log(e,t,"daaattttaa");const o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#8B5CF6",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return g.jsx(Ie,{title:"Revenue by Category",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:g.jsx(Ml,{data:o,options:a})})};function $ue(e){return at({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function Bue(e){return at({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Wue({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ie,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const zue=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:qk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Bue,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$ue,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Xk,iconColor:"text-[#DBB467]"}];function Vue({data:e}){const t=Array.isArray(e)&&e.length>0?e:zue;return console.log(e,"carrrr"),g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Wue,{...n},r))})}/**
282
+ `):e}function Kce(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KC(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=er(t.bodyFont),c=er(t.titleFont),u=er(t.footerFont),d=o.length,f=i.length,p=r.length,h=Qr(t.padding);let m=h.height,v=0,b=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=p*x+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){v=Math.max(v,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),v+=h.width,{width:v,height:m}}function qce(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Gce(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function Xce(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),Gce(c,e,t,n)&&(c="center"),c}function qC(e,t,n){const r=n.yAlign||t.yAlign||qce(e,n);return{xAlign:n.xAlign||t.xAlign||Xce(e,t,n,r),yAlign:r}}function Qce(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Zce(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function GC(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=Bs(a);let h=Qce(t,s);const m=Zce(t,l,c);return l==="center"?s==="left"?h+=c:s==="right"&&(h-=c):s==="left"?h-=Math.max(u,f)+i:s==="right"&&(h+=Math.max(d,p)+i),{x:Cn(h,0,r.width-t.width),y:Cn(m,0,r.height-t.height)}}function Bd(e,t,n){const r=Qr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function XC(e){return oi([],zi(e))}function Jce(e,t,n){return ps(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function QC(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const TR={beforeTitle:Bi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Bi,beforeBody:Bi,beforeLabel:Bi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return He(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bi,afterBody:Bi,beforeFooter:Bi,footer:Bi,afterFooter:Bi};function Yn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?TR[t].call(n,r):i}class ZC extends sa{static positioners=gc;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new mR(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Jce(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Yn(r,"beforeTitle",this,t),o=Yn(r,"title",this,t),a=Yn(r,"afterTitle",this,t);let s=[];return s=oi(s,zi(i)),s=oi(s,zi(o)),s=oi(s,zi(a)),s}getBeforeBody(t,n){return XC(Yn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=QC(r,o);oi(a.before,zi(Yn(s,"beforeLabel",this,o))),oi(a.lines,Yn(s,"label",this,o)),oi(a.after,zi(Yn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return XC(Yn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Yn(r,"beforeFooter",this,t),o=Yn(r,"footer",this,t),a=Yn(r,"afterFooter",this,t);let s=[];return s=oi(s,zi(i)),s=oi(s,zi(o)),s=oi(s,zi(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Kce(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=QC(t.callbacks,u);i.push(Yn(d,"labelColor",this,u)),o.push(Yn(d,"labelPointStyle",this,u)),a.push(Yn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=gc[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=KC(this,r),c=Object.assign({},s,l),u=qC(this.chart,r,c),d=GC(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Bs(s),{x:f,y:p}=t,{width:h,height:m}=n;let v,b,S,w,x,_;return o==="center"?(x=p+m/2,i==="left"?(v=f,b=v-a,w=x+a,_=x-a):(v=f+h,b=v+a,w=x-a,_=x+a),S=v):(i==="left"?b=f+Math.max(l,u)+a:i==="right"?b=f+h-Math.max(c,d)-a:b=this.caretX,o==="top"?(w=p,x=w-a,v=b-a,S=b+a):(w=p+m,x=w+a,v=b+a,S=b-a),_=w),{x1:v,x2:b,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=Ws(r.rtl,this.x,this.width);for(t.x=Bd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=er(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=er(o.bodyFont),d=Bd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},v=i.leftForLtr(f,c)+c/2,b=h+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,By(t,m,v,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,By(t,m,v,b)}else{t.lineWidth=Te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(f,c),v=i.leftForLtr(i.xPlus(f,1),c-2),b=Bs(a.borderRadius);Object.values(b).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,wp(t,{x:m,y:h,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),wp(t,{x:v,y:h+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,h,c,l),t.strokeRect(m,h,c,l),t.fillStyle=a.backgroundColor,t.fillRect(v,h+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=er(r.bodyFont);let f=d.lineHeight,p=0;const h=Ws(r.rtl,this.x,this.width),m=function(D){n.fillText(D,h.x(t.x+p),t.y+f/2),t.y+=f+o},v=h.textAlign(a);let b,S,w,x,_,O,k;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Bd(this,v,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),p=s&&v!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,O=i.length;x<O;++x){for(b=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(b.before,m),w=b.lines,s&&w.length&&(this._drawColorBox(n,t,x,h,r),f=Math.max(d.lineHeight,l)),_=0,k=w.length;_<k;++_)m(w[_]),f=d.lineHeight;Ge(b.after,m)}p=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=Ws(r.rtl,this.x,this.width);for(t.x=Bd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=er(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:h}=Bs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-h),n.quadraticCurveTo(s+c,l+u,s+c-h,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=gc[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=KC(this,t),l=Object.assign({},a,this._size),c=qC(n,t,l),u=GC(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Qr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),fR(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),pR(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!vp(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!vp(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=gc[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var Yr={id:"tooltip",_element:ZC,positioners:gc,afterInit(e,t,n){n&&(e.tooltip=new ZC({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:TR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const eue=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function tue(e,t,n,r){const i=e.indexOf(t);if(i===-1)return eue(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const nue=(e,t)=>e===null?null:Cn(Math.round(e),0,t);function JC(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Po extends Al{static id="category";static defaults={ticks:{callback:JC}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:tue(r,t,Se(n,t),this._addedLabels),nue(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return JC.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function rue(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,h=u-1,{min:m,max:v}=t,b=!He(a),S=!He(s),w=!He(c),x=(v-m)/(d+1);let _=eC((v-m)/h/p)*p,O,k,D,T;if(_<1e-14&&!b&&!S)return[{value:m},{value:v}];T=Math.ceil(v/_)-Math.floor(m/_),T>h&&(_=eC(T*_/h/p)*p),He(l)||(O=Math.pow(10,l),_=Math.ceil(_*O)/O),i==="ticks"?(k=Math.floor(m/_)*_,D=Math.ceil(v/_)*_):(k=m,D=v),b&&S&&o&&Eae((s-a)/o,_/1e3)?(T=Math.round(Math.min((s-a)/_,u)),_=(s-a)/T,k=a,D=s):w?(k=b?a:k,D=S?s:D,T=c-1,_=(D-k)/T):(T=(D-k)/_,Ec(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const j=Math.max(tC(_),tC(k));O=Math.pow(10,He(l)?j:l),k=Math.round(k*O)/O,D=Math.round(D*O)/O;let A=0;for(b&&(f&&k!==a?(n.push({value:a}),k<a&&A++,Ec(Math.round((k+A*_)*O)/O,a,eP(a,x,e))&&A++):k<a&&A++);A<T;++A){const C=Math.round((k+A*_)*O)/O;if(S&&C>s)break;n.push({value:C})}return S&&f&&D!==s?n.length&&Ec(n[n.length-1].value,s,eP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function eP(e,t,{horizontal:n,minRotation:r}){const i=Ji(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class iue extends Al{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return He(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=_i(i),c=_i(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=rue(i,o);return t.bounds==="ticks"&&Oae(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return qx(t,this.chart.options.locale,this.options.ticks.format)}}class ko extends iue{static id="linear";static defaults={ticks:{callback:iR.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Wr(t)?t:0,this.max=Wr(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ji(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Xh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Qn=Object.keys(Xh);function tP(e,t){return e-t}function nP(e,t){if(He(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Wr(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(tu(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function rP(e,t,n,r){const i=Qn.length;for(let o=Qn.indexOf(e);o<i-1;++o){const a=Xh[Qn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return Qn[o]}return Qn[i-1]}function oue(e,t,n,r,i){for(let o=Qn.length-1;o>=Qn.indexOf(n);o--){const a=Qn[o];if(Xh[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return Qn[n?Qn.indexOf(n):0]}function aue(e){for(let t=Qn.indexOf(e)+1,n=Qn.length;t<n;++t)if(Xh[Qn[t]].common)return Qn[t]}function iP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function sue(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function oP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:sue(e,r,i,n)}class aP extends Al{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ple._date(t.adapters.date);i.init(n),Sc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Wr(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Wr(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Aae(i,o,a);return this._unit=n.unit||(r.autoSkip?rP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):oue(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:aue(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),oP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Cn(n,0,a),r=Cn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||rP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=tu(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const h=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)iP(u,f,h);return(f===r||i.bounds==="ticks"||p===1)&&iP(u,f,h),Object.keys(u).sort(tP).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return dt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Ji(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,oP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return eR(t.sort(tP))}}function Wd(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ia(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ia(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class ppe extends aP{static id="timeseries";static defaults=aP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Wd(n,this.min),this._tableRange=Wd(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Wd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Wd(this._table,r*this._tableRange+this._minPos,!0)}}const MR="label";function sP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function lue(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function NR(e,t){e.labels=t}function jR(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MR;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function cue(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:MR;const n={labels:[],datasets:[]};return NR(n,e.labels),jR(n,e.datasets,t),n}function uue(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=P.useRef(null),h=P.useRef(null),m=()=>{p.current&&(h.current=new Wn(p.current,{type:a,data:cue(s,o),options:l&&{...l},plugins:c}),sP(t,h.current))},v=()=>{sP(t,null),h.current&&(h.current.destroy(),h.current=null)};return P.useEffect(()=>{!i&&h.current&&l&&lue(h.current,l)},[i,l]),P.useEffect(()=>{!i&&h.current&&NR(h.current.config.data,s.labels)},[i,s.labels]),P.useEffect(()=>{!i&&h.current&&s.datasets&&jR(h.current.config.data,s.datasets,o)},[i,s.datasets]),P.useEffect(()=>{h.current&&(i?(v(),setTimeout(m)):h.current.update(d))},[i,l,s.labels,s.datasets,d]),P.useEffect(()=>{h.current&&(v(),setTimeout(m))},[a]),P.useEffect(()=>(m(),()=>v()),[]),P.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const due=P.forwardRef(uue);function s1(e,t){return Wn.register(t),P.forwardRef((n,r)=>P.createElement(due,{...n,ref:r,type:e}))}const l1=s1("line",fle),Ml=s1("bar",cle),c1=s1("doughnut",dle);Wn.register(i1,Yr,ei);const fue={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},pue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},RR=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:h,showBottomGlow:m=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:b="",resolvedWidgetType:S="",data:w})=>{const x=w?.title??e,_=w?.icon??t,O=w?.firstLabel??n,k=Number(w?.firstValue??r??0),D=w?.firstColor??i,T=w?.secondLabel??o,j=Number(w?.secondValue??a??0),A=w?.secondColor??s,C=w?.growthPercentage??l??"+0%",N=w?.growthText??c,M=w?.totalLabel??u,R=w?.widgetType??b??S,F=w?.centerTopSize??p??(R==="commercial"?34:20),$=w?.centerBottomSize??h??(R==="commercial"?14:10),V=w?.showBottomGlow??m,W=w?.bottomGlowColor??v,B=k+j,X={labels:[O,T],datasets:[{data:[k,j],backgroundColor:[D,A],borderWidth:2,hoverOffset:4}]},q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:oe=>`${oe.label}: ${oe.parsed}`},displayColors:!1},centerText:{top:`${B}`,bottom:M,topSize:F,bottomSize:$,topColor:d,bottomColor:f},bottomGlow:{enabled:V,color:W}}},ne=[{label:O,value:k,color:D},{label:T,value:j,color:A}],Z=C.toString().includes("+"),ee=C.toString().includes("-"),ie=Z?"#1FA05B":"#AB0000";return g.jsx(Ne,{title:x,icon:_,className:R==="commercial"?"h-[362px]":"h-[238px]",children:g.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[g.jsxs("div",{className:"col-span-5 space-y-[16px]",children:[ne.map((oe,se)=>g.jsxs("div",{children:[g.jsx("div",{className:`text-[12px] text-[#64748B] ${R==="commercial"?"mb-[8px]":""}`,children:oe.label}),g.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:oe.color},children:oe.value})]},se)),g.jsxs("div",{className:`text-[12px] flex gap-[4px] ${R==="commercial"?"mt-[20px]":""} items-center`,style:{color:ie},children:[Z&&g.jsx(Ga,{}),ee&&g.jsx(qa,{}),g.jsx("div",{children:C.replace("+","").replace("-","")}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:N})]})]}),g.jsx("div",{className:"col-span-7",children:g.jsx("div",{className:`${R==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:g.jsx(c1,{data:X,options:q,plugins:[fue,pue]})})})]})})},lP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),g.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),g.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},cP=({title:e,value:t,suffix:n,valueClass:r=""})=>g.jsxs(Ne,{className:"bg-white rounded-[12px] h-[98px] p-[16px] flex flex-col justify-center",children:[g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-[4px]",children:e}),g.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&g.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),hue=({data:e,totalUnits:t=847,occupiedUnits:n=756,ownerCount:r=700,tenantCount:i=56,avgResidents:o=4.4,avgLeaseMonths:a=18})=>{const s=Number(e?.totalUnits??t??0),l=Number(e?.occupiedUnits??n??0),c=Number(e?.ownerCount??r??0),u=Number(e?.tenantCount??i??0),d=e?.avgResidents??o,f=e?.avgLeaseMonths??a,p=c+u;return g.jsxs("div",{children:[g.jsxs("div",{className:"bg-white rounded-[12px] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[g.jsx(wb,{className:"h-6 w-6 text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-center justify-between gap-",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),g.jsxs("div",{className:"flex items-center gap-[4px]",children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:l}),g.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",s]})]})]}),g.jsxs("div",{className:"flex items-end",children:[g.jsx(lP,{value:c,total:p,colorClass:"bg-[#8B5CF6]",label:"Owner"}),g.jsx(lP,{value:u,total:p,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),g.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[g.jsx(cP,{title:"Avg Residents Per Unit",value:d,valueClass:"text-[#8B5CF6]"}),g.jsx(cP,{title:"Avg Lease Period",value:f,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Wn.register(i1,Yr,ei);const mue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},gue=({data:e,ownerCount:t=1e3,tenantCount:n=200,nonResidingOwners:r=26,growthPct:i="+9.1%"})=>{const o=Number(e?.ownerCount??t??0),a=Number(e?.tenantCount??n??0),s=Number(e?.nonResidingOwners??r??0),l=e?.growthPct??i,c=Math.max(o-s,0),u=o+a,d={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[c,a,s],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},f={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:p=>`${p.label}: ${p.parsed}`},displayColors:!1},centerText:{top:`${u}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return g.jsx(Ne,{title:"Resident Overview",icon:g.jsx(Gk,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:g.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[g.jsxs("div",{className:"col-span-5",children:[g.jsxs("div",{children:[g.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),g.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:o})]}),g.jsxs("div",{children:[g.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),g.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:a})]}),g.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center",children:[l," ",g.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),g.jsx("div",{className:"col-span-7",children:g.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:g.jsx(c1,{data:d,options:f,plugins:[mue]})})})]})})};Wn.register(Po,ko,Tl,Yr,ei);const vue=({data:e,blocks:t=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const n=Array.isArray(e?.blocks)&&e.blocks.length>0?e.blocks:Array.isArray(e)&&e.length>0?e:t,r=n.map(c=>c.name),i=n.map(c=>Number(c.owner??0)),o=n.map(c=>Number(c.rented??0)),a=n.map(c=>Number(c.vacant??0)),s={labels:r,datasets:[{label:"Owner",data:i,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:i.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:o,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:o.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:a,backgroundColor:"#08B6D4",barThickness:40}]},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return g.jsx(Ne,{title:"Block-wise Occupancy",period:g.jsx(yo,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:g.jsx(Ml,{data:s,options:l})})};Wn.register(Po,ko,a1,o1,Yr,ei);const yue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},bue=({data:e,labels:t=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:n=[24,27,20,26,23],moveOut:r=[12,17,8,5,16]})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:t,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:n,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:r,s={labels:i,datasets:[{label:"Move-in",data:o,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:a,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>yue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsx(Ne,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:g.jsx(yo,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:g.jsx(l1,{data:s,options:l})})};Wn.register(Po,ko,a1,o1,Yr,ei);const xue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},wue=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],_ue=[24,27,20,26,23],Sue=[4,17,8,5,16],IR=({data:e,labels:t,moveIn:n,moveOut:r})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Array.isArray(t)&&t.length>0?t:wue,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:Array.isArray(n)&&n.length>0?n:_ue,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:Array.isArray(r)&&r.length>0?r:Sue,s={labels:i,datasets:[{label:"Income",data:o,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:a,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>xue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsx(l1,{data:s,options:l})};function uP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} border border-[#EBEBEB] h-[126px]`,children:[g.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),g.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[g.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),g.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Eue({data:e={}}){const t=e?.incomeCard??{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"},n=e?.expenditureCard??{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"};return g.jsxs(Ne,{title:"Accounting",className:"w-full h-[523px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[g.jsx(uP,{...t}),g.jsx(uP,{...n})]}),g.jsx("div",{className:"h-[254px] mt-[35.5px]",children:g.jsx(IR,{data:e?.incomeExpenditure})})]})}Wn.register(Po,ko,Tl,Yr,ei);const Oue=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],Cue=[55e3,56e3,64e3,38e3,54e3,65e3],Pue=[63e3,48e3,51300,28e3,42e3,35e3],kue=({data:e={}})=>{const t=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Oue,n=Array.isArray(e?.budgetValues)&&e.budgetValues.length>0?e.budgetValues:Cue,r=Array.isArray(e?.actualValues)&&e.actualValues.length>0?e.actualValues:Pue,i={labels:t,datasets:[{label:"Budget",data:n,backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:r,backgroundColor:"#3B82F6",barThickness:60}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:a=>t[a[0].dataIndex],label:a=>{const s=a.parsed.y;return`${a.dataset.label}: AED ${(s/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:a=>`${a/1e3}K`}}}};return g.jsx(Ne,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:g.jsx(Ml,{data:i,options:o})})},Due=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],Aue=({data:e})=>{const t=Array.isArray(e?.accounts)&&e.accounts.length>0?e.accounts:Array.isArray(e)&&e.length>0?e:Due,n=t.reduce((i,o)=>i+o.amount,0),r=i=>i>=1e6?`AED ${(i/1e6).toFixed(2)}M`:i>=1e3?`AED ${(i/1e3).toFixed(1)}K`:`AED ${i}`;return g.jsxs(Ne,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((i,o)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:i.title}),g.jsx("div",{className:"!text-[12px] text-[#64748B]",children:i?.subtitle})]}),g.jsx("div",{className:"flex flex-col items-end",children:g.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:r(i.amount)})})]},o))}),g.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-[12px]",children:[g.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),g.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:r(n)})]})]})};Wn.register(Po,ko,Tl,Yr,ei);const Tue=[{label:"Current Month",value:13e3,units:18},{label:"1-3 Months",value:9400,units:12},{label:"3-6 Months",value:8800,units:18},{label:"6+ Months",value:7200,units:6}],Mue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Tue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#EF4444",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return g.jsxs(Ne,{title:"Dues Ageing",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:n.map((s,l)=>g.jsx("div",{className:"p-[8px] rounded-[8px] bg-slate-50",children:g.jsxs("div",{className:"flex justify-between items-start",children:[g.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:s}),g.jsxs("div",{className:"text-right",children:[g.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(r[l]/1e3).toFixed(1),"K"]}),g.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[i[l]," Units"]})]})]})},s))}),g.jsx("div",{className:"h-[192px]",children:g.jsx(Ml,{data:o,options:a})})]})};Wn.register(i1,Yr,ei);const Nue=[{label:"Maintenance",value:45e4,color:"#08B6D4"},{label:"Utilities",value:32e4,color:"#8B5CF6"},{label:"Security",value:28e4,color:"#EF4444"},{label:"Administration",value:18e4,color:"#F69E0A"},{label:"Others",value:12e4,color:"#12B981"}],jue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Nue,n=t.map(l=>l.label),r=t.map(l=>Number(l.value??0)),i=t.map(l=>l.color),o={labels:n,datasets:[{label:"Expenses",data:r,backgroundColor:i,borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},a=r.reduce((l,c)=>l+c,0),s={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:l=>`${l.label}: AED ${l.formattedValue}`}}}};return g.jsxs(Ne,{title:"Expense Categories",className:"w-full h-[523px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[g.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[g.jsx(c1,{data:o,options:s}),g.jsxs("div",{className:"absolute text-center",children:[g.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(a/1e6).toFixed(2),"M"]}),g.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),g.jsx("div",{className:"space-y-2",children:n.map((l,c)=>g.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[g.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[g.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:o.datasets[0].backgroundColor[c]}}),l]}),g.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(r[c]/1e3).toFixed(0),"K"]})]},l))})]})},Rue=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function Iue({data:e,currency:t="AED"}){const n=Array.isArray(e)&&e.length>0?e:Rue,r=n.reduce((o,a)=>o+Number(a.value??0),0);let i="";return r>=1e6?i=`${(r/1e6).toFixed(2)}M`:r>=1e3?i=`${(r/1e3).toFixed(2)}K`:i=r.toString(),g.jsx(Ne,{title:"Asset Value Breakdown",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n.map((o,a)=>g.jsx(pn,{fill:o.color},`cell-${a}`))}),g.jsx(Pt,{formatter:o=>`${t} ${Number(o).toLocaleString()}`})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:[t," ",i]}),g.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),g.jsxs("div",{className:"flex justify-between w-full px-[16px] sm:px-[32px] mt-4 text-[14px]",children:[g.jsx("div",{className:"flex flex-col gap-[8px]",children:n.slice(0,3).map(o=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:o.color}}),g.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:o.name})]},o.name))}),g.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:n.slice(3).map(o=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:o.color}}),g.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:o.name})]},o.name))})]})]})})}Wn.register(Po,ko,Tl,Yr,ei);const Fue=[{label:"Gym",value:13e3,units:18},{label:"Parking",value:9400,units:12},{label:"Swimming Pool",value:8800,units:18},{label:"Community Hall",value:7200,units:6},{label:"Tennis Court",value:6e3,units:10}],Lue=({data:e})=>{const t=Array.isArray(e)&&e.length>0?e:Fue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0));console.log(e,t,"daaattttaa");const o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#8B5CF6",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return g.jsx(Ne,{title:"Revenue by Category",className:"w-full h-[362px]",period:g.jsx(yo,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:g.jsx(Ml,{data:o,options:a})})};function $ue(e){return at({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function Bue(e){return at({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Wue({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ne,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const zue=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:qk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Bue,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$ue,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Xk,iconColor:"text-[#DBB467]"}];function Vue({data:e}){const t=Array.isArray(e)&&e.length>0?e:zue;return console.log(e,"carrrr"),g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Wue,{...n},r))})}/**
283
283
  * @license lucide-react v0.564.0 - ISC
284
284
  *
285
285
  * This source code is licensed under the ISC license.
@@ -369,6 +369,6 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
369
369
  *
370
370
  * This source code is licensed under the ISC license.
371
371
  * See the LICENSE file in the root directory of this source tree.
372
- */const dde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],fde=Ri("waves-ladder",dde),Ct=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx(Zue,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx(LR,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx($R,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},pde={completed:18,not_completed:6,missed:4};function hde({data:e={}}){const t=e&&Object.keys(e).length>0?e:pde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(Ct,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(pn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(Pt,{formatter:o=>Number(o??0).toLocaleString()})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Wn.register(Po,ko,a1,o1,Yr,ei);const mde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},gde=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],vde=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),yde=({chartRef:e})=>{const[t,n]=P.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:gde.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(vde,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},bde=({data:e})=>{const t=P.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:mde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(yde,{chartRef:t})]})},xde={open:4,in_progress:7,closed:12},wde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function _de({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:xde,r=Array.isArray(t)?t:wde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Sde=[{total_staff:42,absent_staff:6}],Ede=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Ode({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Sde,r=Array.isArray(t)&&t.length>0?t:Ede,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(Ct,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function Cde(e){return at({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Pde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ie,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const kde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Zie,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Cde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:b3,iconColor:"text-[#36AB6C]"}];function Dde({data:e}){const t=Array.isArray(e)&&e.length>0?e:kde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Pde,{...n},r))})}const Ade=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Tde=(e="")=>e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<[^>]*>/g,"").trim();function Mde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Tde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ade;return g.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Nde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},jde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Rde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Nde(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ide=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Fde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:jde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=P.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(_t,{width:"100%",height:"85%",children:g.jsxs(Oo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(or,{strokeDasharray:"0",vertical:!1}),g.jsx(Bn,{dataKey:"level"}),g.jsx(An,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(Pt,{content:g.jsx(Rde,{}),cursor:!1}),g.jsx(Kt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx(Ide,{})]})},Lde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function $de({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Lde;return g.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Bde(e){return at({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Wde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],zde={open_complaints:{title:"Open Complaints",Icon:qk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:C3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:E3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Vde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Hde={primary:{size:28,lineHeight:32,weight:500}},Yde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ude({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(fP,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Wde.map(n=>g.jsx(fP,{id:n},n))})}function fP({id:e,data:t}){const n=zde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Yde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(Ie,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(Vde,{...Hde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(eh,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function wr({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-[16px]",children:[g.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),g.jsx("div",{className:"text-[16px] font-semibold text-gray-900 mb-[4px]",children:t}),g.jsx("div",{className:"text-[12px] text-gray-500 max-w-[260px]",children:n})]})}const Kde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Gde({data:e}){const t=Array.isArray(e)?e:Kde;return g.jsx(Ie,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(qde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(wr,{})})})})}const Xde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Qde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Xde;return g.jsx(Ie,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(Qde,{...n},`${n.label}-${r}`))})})}function Jde(e){return at({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function efe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(eh,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function tfe({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(efe,{...n},r))})}function nfe(e){return at({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function rfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const ife=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Jde,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:x3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Xie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:nfe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function ofe({data:e}){const t=Array.isArray(e)&&e.length>0?e:ife;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(rfe,{...n},r))})}const pP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},afe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(wb,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(pP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(pP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Wn.register(Po,ko,Tl,Yr);const sfe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Xue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Ml,{data:t,options:n})})]})},lfe="₹",hP=["bg-blue-500","bg-red-500","bg-purple-700"],va={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function Op(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mP(e){if(e==null||e==="")return"0";if(typeof e=="number")return e_(e);const t=Number(e);return Number.isNaN(t)?String(e):e_(t)}function cfe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||hP[p%hP.length]})),o=n?.totalOrders??n?.orders??va.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??va.summary.revenueGenerated,s=Op(n?.growthPercentage??n?.revenueGrowth,va.summary.growthPercentage),l=Op(n?.growthTotalPercentage??n?.orderGrowth,va.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||lfe,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||va.title,period:t?.period||va.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:va.outlets}}function ufe({data:e,title:t,period:n,icon:r}){const i=cfe(e),o=t||i.title,a=n||i.period,s=r||g.jsx(ude,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mP(i.summary.revenueGenerated),u=Op(i.summary.growthPercentage,0),d=Op(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Ga,{}):g.jsx(qa,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]! items-end mr-[10px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(Ga,{}):g.jsx(qa,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mP(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function dfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(fde,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(Ga,{}):g.jsx(qa,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"flex flex-col gap-[8px]! items-end mr-[10px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Ga,{}):g.jsx(qa,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Wn.register(Po,ko,Tl,Yr,ei);function ffe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(O3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Ml,{data:l,options:c})})})}const pfe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function hfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(Mv,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(Pt,{content:g.jsx(pfe,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function mfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function gfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function vfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>gfe(i?.hour)===n)||{};return{hour:n,time:mfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vP({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(Yj,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function yfe({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function bfe({data:e}){const t=e&&Object.keys(e).length?e:gP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return vfe(l.length?l:gP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(bb,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx(vP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx(vP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(_x,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(or,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx(Bn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(An,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(Pt,{content:g.jsx(yfe,{})}),g.jsx(Ho,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Ho,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const xfe=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),wfe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(xfe,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function _fe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(Ct,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(Pt,{content:g.jsx(wfe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(Ct,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function Sfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(Ct,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"8 8",vertical:!1}),g.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx(Bn,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(An,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Pt,{cursor:!1}),g.jsx(Kt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(pn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const Efe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Ofe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(Ct,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(An,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(Efe,{})}),g.jsx(Pt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(wr,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Cfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(Ga,{}):g.jsx(qa,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Pfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(Ct,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(Vk,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Pt,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(ls,{active:v,payload:b,label:x})})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},kfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Dfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?kfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(An,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Afe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(Ie,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[132px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
372
+ */const dde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],fde=Ri("waves-ladder",dde),Ct=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx(Zue,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx(LR,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx($R,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},pde={completed:18,not_completed:6,missed:4};function hde({data:e={}}){const t=e&&Object.keys(e).length>0?e:pde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(Ct,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(pn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(Pt,{formatter:o=>Number(o??0).toLocaleString()})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Wn.register(Po,ko,a1,o1,Yr,ei);const mde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},gde=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],vde=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),yde=({chartRef:e})=>{const[t,n]=P.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:gde.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(vde,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},bde=({data:e})=>{const t=P.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:mde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(Ne,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(yde,{chartRef:t})]})},xde={open:4,in_progress:7,closed:12},wde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function _de({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:xde,r=Array.isArray(t)?t:wde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Sde=[{total_staff:42,absent_staff:6}],Ede=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Ode({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Sde,r=Array.isArray(t)&&t.length>0?t:Ede,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(Ct,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function Cde(e){return at({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Pde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ne,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const kde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Zie,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Cde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:b3,iconColor:"text-[#36AB6C]"}];function Dde({data:e}){const t=Array.isArray(e)&&e.length>0?e:kde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Pde,{...n},r))})}const Ade=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Tde=(e="")=>e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<[^>]*>/g,"").trim();function Mde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Tde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ade;return g.jsx(Ne,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Nde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},jde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Rde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Nde(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ide=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Fde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:jde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=P.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(Ne,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(_t,{width:"100%",height:"85%",children:g.jsxs(Oo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(or,{strokeDasharray:"0",vertical:!1}),g.jsx(Bn,{dataKey:"level"}),g.jsx(An,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(Pt,{content:g.jsx(Rde,{}),cursor:!1}),g.jsx(Kt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx(Ide,{})]})},Lde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function $de({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Lde;return g.jsx(Ne,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Bde(e){return at({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Wde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],zde={open_complaints:{title:"Open Complaints",Icon:qk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:C3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:E3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Vde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Hde={primary:{size:28,lineHeight:32,weight:500}},Yde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ude({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(fP,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Wde.map(n=>g.jsx(fP,{id:n},n))})}function fP({id:e,data:t}){const n=zde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Yde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(Ne,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(Vde,{...Hde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(eh,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function wr({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-[16px]",children:[g.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),g.jsx("div",{className:"text-[16px] font-semibold text-gray-900 mb-[4px]",children:t}),g.jsx("div",{className:"text-[12px] text-gray-500 max-w-[260px]",children:n})]})}const Kde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Gde({data:e}){const t=Array.isArray(e)?e:Kde;return g.jsx(Ne,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(qde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(wr,{})})})})}const Xde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Qde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Xde;return g.jsx(Ne,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(Qde,{...n},`${n.label}-${r}`))})})}function Jde(e){return at({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function efe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(Ne,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(eh,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function tfe({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(efe,{...n},r))})}function nfe(e){return at({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function rfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(Ne,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const ife=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Jde,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:x3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Xie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:nfe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function ofe({data:e}){const t=Array.isArray(e)&&e.length>0?e:ife;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(rfe,{...n},r))})}const pP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},afe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(wb,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(pP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(pP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Wn.register(Po,ko,Tl,Yr);const sfe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(Ne,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Xue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Ml,{data:t,options:n})})]})},lfe="₹",hP=["bg-blue-500","bg-red-500","bg-purple-700"],va={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function Op(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mP(e){if(e==null||e==="")return"0";if(typeof e=="number")return e_(e);const t=Number(e);return Number.isNaN(t)?String(e):e_(t)}function cfe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||hP[p%hP.length]})),o=n?.totalOrders??n?.orders??va.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??va.summary.revenueGenerated,s=Op(n?.growthPercentage??n?.revenueGrowth,va.summary.growthPercentage),l=Op(n?.growthTotalPercentage??n?.orderGrowth,va.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||lfe,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||va.title,period:t?.period||va.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:va.outlets}}function ufe({data:e,title:t,period:n,icon:r}){const i=cfe(e),o=t||i.title,a=n||i.period,s=r||g.jsx(ude,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mP(i.summary.revenueGenerated),u=Op(i.summary.growthPercentage,0),d=Op(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(Ne,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Ga,{}):g.jsx(qa,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]! items-end mr-[10px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(Ga,{}):g.jsx(qa,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mP(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function dfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(Ne,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(fde,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(Ga,{}):g.jsx(qa,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"flex flex-col gap-[8px]! items-end mr-[10px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Ga,{}):g.jsx(qa,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Wn.register(Po,ko,Tl,Yr,ei);function ffe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(Ne,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(O3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Ml,{data:l,options:c})})})}const pfe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function hfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(Ne,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(Mv,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(Pt,{content:g.jsx(pfe,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function mfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function gfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function vfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>gfe(i?.hour)===n)||{};return{hour:n,time:mfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vP({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(Yj,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function yfe({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function bfe({data:e}){const t=e&&Object.keys(e).length?e:gP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return vfe(l.length?l:gP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(Ne,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(bb,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx(vP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx(vP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(_x,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(or,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx(Bn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(An,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(Pt,{content:g.jsx(yfe,{})}),g.jsx(Ho,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Ho,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const xfe=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),wfe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(xfe,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function _fe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(Ct,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(Pt,{content:g.jsx(wfe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(Ct,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function Sfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(Ct,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"8 8",vertical:!1}),g.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx(Bn,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(An,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Pt,{cursor:!1}),g.jsx(Kt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(pn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const Efe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Ofe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(Ct,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(An,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(Efe,{})}),g.jsx(Pt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(wr,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Cfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(Ga,{}):g.jsx(qa,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Pfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(Ct,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(Vk,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Pt,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(ls,{active:v,payload:b,label:x})})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},kfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Dfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?kfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(An,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Afe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(Ne,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[132px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
373
373
  ${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
374
- `,children:[i?g.jsx(Ga,{}):g.jsx(qa,{}),Math.abs(r),"%"]}),g.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Tfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Mfe=({x:e,y:t,payload:n})=>g.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:g.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Nfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,r=(e==null?Tfe:Array?.isArray(e)?e:[]).map(i=>({...i,name:i.facility_name,color:"#8B5CF6"}));return g.jsx(Ie,{title:"Bookings",icon:g.jsx(lde,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:g.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?g.jsx(wr,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:r||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[g.jsx(Bn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),g.jsx(An,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:g.jsx(Mfe,{})}),g.jsx(Pt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const jfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Rfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?jfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?g.jsx(wr,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),g.jsx(An,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ife=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Vd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Ffe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ife,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return g.jsx(Ct,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?g.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:g.jsx(wr,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>g.jsx(pn,{fill:Vd?.[c%Vd?.length]},`cell-${c}`))}),g.jsx(Pt,{cursor:!1,content:l=>g.jsx(ls,{...l,formatter:c=>s(c)})})]})})}),g.jsx("div",{className:"col-span-6",children:g.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Amenity"}),g.jsx("div",{className:"text-right",children:"Revenue"})]}),g.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>g.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[g.jsxs("div",{className:"flex items-center gap-[12px]",children:[g.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Vd?.[c%Vd?.length]}}),g.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),g.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Hd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Lfe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],$fe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})):Lfe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(wr,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>g.jsx(pn,{fill:i.fill},o))}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>g.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Bfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:g.jsx(wr,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:a,payload:s,label:l})=>!a||!s||!s.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:l}),s.map((c,u)=>{const d=c.color||c.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:d,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:c.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:c.value})]},u)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:a.map((s,l)=>g.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function Wfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||1110),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||20),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||30),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return g.jsx(Ct,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>g.jsx(pn,{fill:i.color},`cell-${o}`))}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function zfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:g.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):g.jsx(g.Fragment,{})})]})})}function Vfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,m=`repeat(${u.length}, 1fr)`;return g.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[g.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[g.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:m},children:u.map((v,b)=>g.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},b))}),g.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?g.jsx(wr,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,b)=>g.jsx("div",{className:"grid",style:{gridTemplateColumns:m},children:u.map((S,w)=>{const x=v[S.key],_=S.label==="Closed",O=S.label==="Open",k=typeof x=="string"&&x.includes("%"),D=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return g.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:_?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:x??"-"}):O?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:x??"-"}):k?g.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:x}):g.jsx("div",{children:x??"-"})},w)})},b))})]}),g.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[g.jsx("div",{children:"Rows per page:"}),g.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,b)=>g.jsx("option",{value:v,children:v},b))}),g.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),g.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[g.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(ide,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(LR,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx($R,{size:18})}),g.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(ade,{size:18})})]})]})]})}const WR=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),g.jsxs("div",{ref:o,className:"relative h-[32px]",children:[g.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[g.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),g.jsx(ede,{size:16,className:"text-[#64748B]"})]}),r&&g.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>g.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Hfe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:g.jsx(wr,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:g.jsx(WR,{options:o,value:r,onChange:c=>i(c)}),children:g.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[261px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>g.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},Yfe=({data:e=[]})=>{const[t,n]=P.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return g.jsx(Ct,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:g.jsx(WR,{options:r,value:t,onChange:a=>n(a)}),children:o?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Pt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return g.jsx(ls,{active:a,payload:s,label:u})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return g.jsxs("g",{children:[g.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ufe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return g.jsx(Ct,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:g.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[g.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Tenant"}),g.jsx("div",{className:"flex justify-end",children:"Total"}),g.jsx("div",{className:"flex justify-end",children:"Pending"}),g.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),g.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>g.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[g.jsx("div",{className:"text-[#475569]",children:r.name}),g.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),g.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),g.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},Yd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Kfe=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],qfe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})):Kfe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(wr,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsx(Ni,{children:g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>g.jsx(pn,{fill:i.color},o))})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),g.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=Sfe;exports.Accounting=Eue;exports.Amenities=dfe;exports.AmenitiesStatsCard=Afe;exports.AmenityWiseRevenue=Ffe;exports.AssetValueBreakdown=Iue;exports.AssetsByType=$fe;exports.BlockWiseOccupancy=vue;exports.BookingTrendChart=Rfe;exports.Bookings=Nfe;exports.Budgets=kue;exports.BuildingWiseApprovals=Ufe;exports.Card=Ie;exports.CardAccess=BR;exports.CashBankBalance=Aue;exports.CommercialAccessOverview=_fe;exports.CommercialGuardPatrols=Wfe;exports.CommercialIncidentReports=zfe;exports.CommercialOccupancy=afe;exports.CommercialReportTable=Vfe;exports.Community=Jie;exports.Complaints=Mde;exports.ComplaintsByLevel=Fde;exports.DuesAgeing=Mue;exports.EmployeeFootfall=sfe;exports.Engagement=eoe;exports.EngagementStatsGrid=ofe;exports.EscalationLevel=Hfe;exports.EventsUtilisation=Gde;exports.ExpenseCategories=jue;exports.Facilities=toe;exports.FinanceSummary=noe;exports.FoodBeverages=ufe;exports.GateAndSecurityStatsGrid=Dde;exports.GateUpdates=Voe;exports.GuardPatrols=hde;exports.Header=u3;exports.Helpdesk=Hoe;exports.HelpdeskStatsGrid=Ude;exports.HourlyTrafficFlow=bde;exports.IncidentReports=_de;exports.IncomeExpenditure=IR;exports.MainHeader=S3;exports.MaintenanceStatus=Bfe;exports.MetricCard=Cfe;exports.MobileAccess=BR;exports.MoveInOutTrends=bue;exports.NoticeBoardStatus=Zde;exports.OccupancyOverview=hue;exports.OrganisationWiseVisitors=Dfe;exports.PortfolioAssetsByType=qfe;exports.RequestBox=$de;exports.ResidentOverview=gue;exports.RevenuebyCategory=Lue;exports.SingleStats=tfe;exports.StaffAttendance=Ode;exports.StatsGrid=Vue;exports.TenantsByVisitors=Yfe;exports.TicketEscalation=ffe;exports.TicketStatus=hfe;exports.Tickets=RR;exports.TicketsperCategory=Ofe;exports.UnitStatus=RR;exports.VisitorUpdates=bfe;exports.WeeklyVisitorPattern=Pfe;
374
+ `,children:[i?g.jsx(Ga,{}):g.jsx(qa,{}),Math.abs(r),"%"]}),g.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Tfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Mfe=({x:e,y:t,payload:n})=>g.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:g.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Nfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,r=(e==null?Tfe:Array?.isArray(e)?e:[]).map(i=>({...i,name:i.facility_name,color:"#8B5CF6"}));return g.jsx(Ne,{title:"Bookings",icon:g.jsx(lde,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:g.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?g.jsx(wr,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:r||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[g.jsx(Bn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),g.jsx(An,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:g.jsx(Mfe,{})}),g.jsx(Pt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const jfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Rfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?jfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?g.jsx(wr,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),g.jsx(An,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ife=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Vd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Ffe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ife,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return g.jsx(Ct,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?g.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:g.jsx(wr,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>g.jsx(pn,{fill:Vd?.[c%Vd?.length]},`cell-${c}`))}),g.jsx(Pt,{cursor:!1,content:l=>g.jsx(ls,{...l,formatter:c=>s(c)})})]})})}),g.jsx("div",{className:"col-span-6",children:g.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Amenity"}),g.jsx("div",{className:"text-right",children:"Revenue"})]}),g.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>g.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[g.jsxs("div",{className:"flex items-center gap-[12px]",children:[g.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Vd?.[c%Vd?.length]}}),g.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),g.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Hd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Lfe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],$fe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})):Lfe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(wr,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>g.jsx(pn,{fill:i.fill},o))}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>g.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Bfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:g.jsx(wr,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:a,payload:s,label:l})=>!a||!s||!s.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:l}),s.map((c,u)=>{const d=c.color||c.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:d,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:c.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:c.value})]},u)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:a.map((s,l)=>g.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function Wfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||1110),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||20),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||30),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return g.jsx(Ct,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>g.jsx(pn,{fill:i.color},`cell-${o}`))}),g.jsx(Pt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function zfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:g.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):g.jsx(g.Fragment,{})})]})})}function Vfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,m=`repeat(${u.length}, 1fr)`;return g.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[g.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[g.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:m},children:u.map((v,b)=>g.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},b))}),g.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?g.jsx(wr,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,b)=>g.jsx("div",{className:"grid",style:{gridTemplateColumns:m},children:u.map((S,w)=>{const x=v[S.key],_=S.label==="Closed",O=S.label==="Open",k=typeof x=="string"&&x.includes("%"),D=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return g.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:_?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:x??"-"}):O?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:x??"-"}):k?g.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:x}):g.jsx("div",{children:x??"-"})},w)})},b))})]}),g.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[g.jsx("div",{children:"Rows per page:"}),g.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,b)=>g.jsx("option",{value:v,children:v},b))}),g.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),g.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[g.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(ide,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(LR,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx($R,{size:18})}),g.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(ade,{size:18})})]})]})]})}const WR=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),g.jsxs("div",{ref:o,className:"relative h-[32px]",children:[g.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[g.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),g.jsx(ede,{size:16,className:"text-[#64748B]"})]}),r&&g.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>g.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Hfe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:g.jsx(wr,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:g.jsx(WR,{options:o,value:r,onChange:c=>i(c)}),children:g.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[261px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Oo,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Pt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>g.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},Yfe=({data:e=[]})=>{const[t,n]=P.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return g.jsx(Ct,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:g.jsx(WR,{options:r,value:t,onChange:a=>n(a)}),children:o?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(wr,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Pt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return g.jsx(ls,{active:a,payload:s,label:u})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return g.jsxs("g",{children:[g.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ufe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return g.jsx(Ct,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:g.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[g.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Tenant"}),g.jsx("div",{className:"flex justify-end",children:"Total"}),g.jsx("div",{className:"flex justify-end",children:"Pending"}),g.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),g.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>g.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[g.jsx("div",{className:"text-[#475569]",children:r.name}),g.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),g.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),g.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},Yd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Kfe=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],qfe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})):Kfe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(wr,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsx(Ni,{children:g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>g.jsx(pn,{fill:i.color},o))})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),g.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=Sfe;exports.Accounting=Eue;exports.Amenities=dfe;exports.AmenitiesStatsCard=Afe;exports.AmenityWiseRevenue=Ffe;exports.AssetValueBreakdown=Iue;exports.AssetsByType=$fe;exports.BlockWiseOccupancy=vue;exports.BookingTrendChart=Rfe;exports.Bookings=Nfe;exports.Budgets=kue;exports.BuildingWiseApprovals=Ufe;exports.Card=Ne;exports.CardAccess=BR;exports.CashBankBalance=Aue;exports.CommercialAccessOverview=_fe;exports.CommercialGuardPatrols=Wfe;exports.CommercialIncidentReports=zfe;exports.CommercialOccupancy=afe;exports.CommercialReportTable=Vfe;exports.Community=Jie;exports.Complaints=Mde;exports.ComplaintsByLevel=Fde;exports.DuesAgeing=Mue;exports.EmployeeFootfall=sfe;exports.Engagement=eoe;exports.EngagementStatsGrid=ofe;exports.EscalationLevel=Hfe;exports.EventsUtilisation=Gde;exports.ExpenseCategories=jue;exports.Facilities=toe;exports.FinanceSummary=noe;exports.FoodBeverages=ufe;exports.GateAndSecurityStatsGrid=Dde;exports.GateUpdates=Voe;exports.GuardPatrols=hde;exports.Header=u3;exports.Helpdesk=Hoe;exports.HelpdeskStatsGrid=Ude;exports.HourlyTrafficFlow=bde;exports.IncidentReports=_de;exports.IncomeExpenditure=IR;exports.MainHeader=S3;exports.MaintenanceStatus=Bfe;exports.MetricCard=Cfe;exports.MobileAccess=BR;exports.MoveInOutTrends=bue;exports.NoticeBoardStatus=Zde;exports.OccupancyOverview=hue;exports.OrganisationWiseVisitors=Dfe;exports.PortfolioAssetsByType=qfe;exports.RequestBox=$de;exports.ResidentOverview=gue;exports.RevenuebyCategory=Lue;exports.SingleStats=tfe;exports.StaffAttendance=Ode;exports.StatsGrid=Vue;exports.TenantsByVisitors=Yfe;exports.TicketEscalation=ffe;exports.TicketStatus=hfe;exports.Tickets=RR;exports.TicketsperCategory=Ofe;exports.UnitStatus=RR;exports.VisitorUpdates=bfe;exports.WeeklyVisitorPattern=Pfe;