pulsewatch-frontend 0.1.3 → 0.1.4
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.js +1 -1
- package/dist/index.mjs +4 -4
- package/dist/pulsewatch-frontend.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,4 +102,4 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
|
|
|
102
102
|
|
|
103
103
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},N$="DialogDescriptionWarning",D$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b0(N$).contentName}}.`;return v.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},I$=o0,j$=c0,L$=l0,F$=u0,z$=f0,$$=p0,V$=g0;function v0({...e}){return g.jsx(I$,{"data-slot":"dialog",...e})}function B$({...e}){return g.jsx(j$,{"data-slot":"dialog-portal",...e})}function U$({className:e,...t}){return g.jsx(L$,{"data-slot":"dialog-overlay",className:Se("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function x0({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(B$,{"data-slot":"dialog-portal",children:[g.jsx(U$,{}),g.jsxs(F$,{"data-slot":"dialog-content",className:Se("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&g.jsxs(V$,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(a1,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col gap-2 text-center sm:text-start",e),...t})}function w0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function S0({className:e,...t}){return g.jsx(z$,{"data-slot":"dialog-title",className:Se("text-lg leading-none font-semibold",e),...t})}function E0({className:e,...t}){return g.jsx($$,{"data-slot":"dialog-description",className:Se("text-muted-foreground text-sm",e),...t})}const W$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Nd({open:e,onOpenChange:t,monitor:n,onSubmit:r}){const s=!!n,[o,i]=v.useState(!1),a=Cf({resolver:vw(W$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}});v.useEffect(()=>{e&&(n?a.reset({name:n.name,type:n.type,intervalSeconds:n.intervalSeconds,timeoutMs:n.timeoutMs,url:n.url??"",host:n.host??"",port:n.port,method:n.method??"GET",keyword:n.keyword??"",jsonQuery:n.jsonQuery??"",expectedValue:n.expectedValue??"",dnsRecordType:n.dnsRecordType??""}):a.reset({name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}))},[e,n,a]);const c=a.watch("type"),l=async u=>{i(!0);try{await r(u),t(!1)}catch(d){console.error(d)}finally{i(!1)}};return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:s?"Edit Monitor":"New Monitor"}),g.jsx(E0,{children:s?"Update monitor configuration.":"Configure parameters for a new uptime monitor."})]}),g.jsx(t0,{...a,children:g.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"name",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"type",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(d=>g.jsx(Vs,{value:d,children:d.toUpperCase()},d))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"intervalSeconds",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"timeoutMs",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})})]}),(c==="http"||c==="keyword"||c==="json_query"||c==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"url",render:({field:u})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...u})}),g.jsx(Le,{})]})}),c!=="websocket"&&g.jsx(Ne,{control:a.control,name:"method",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),(c==="tcp"||c==="ping"||c==="dns"||c==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"host",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...u})}),g.jsx(Le,{})]})}),(c==="tcp"||c==="steam")&&g.jsx(Ne,{control:a.control,name:"port",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),c==="dns"&&g.jsx(Ne,{control:a.control,name:"dnsRecordType",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),c==="keyword"&&g.jsx(Ne,{control:a.control,name:"keyword",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...u})}),g.jsx(Le,{})]})}),c==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"jsonQuery",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"expectedValue",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...u})}),g.jsx(Le,{})]})})]}),c==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs(w0,{children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),g.jsxs(gt,{type:"submit",disabled:o,children:[o&&g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Update":"Create"]})]})]})})]})})}function k0({open:e,onOpenChange:t,monitor:n,onConfirm:r}){const[s,o]=T.useState(!1);async function i(){o(!0);try{await r(),t(!1)}catch(a){console.error(a)}finally{o(!1)}}return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"sm:max-w-md",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:"Delete Monitor"}),g.jsxs(E0,{children:["Are you sure you want to delete ",g.jsx("span",{className:"font-semibold text-foreground",children:n?.name}),"? This action cannot be undone and will delete all historical data for this monitor."]})]}),g.jsxs(w0,{children:[g.jsx(gt,{variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),g.jsxs(gt,{variant:"destructive",onClick:i,disabled:s,children:[s?g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}):g.jsx(jf,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})}function H$(){const e=Hv(),t=ls(),{data:n,loading:r}=qv(k=>k.monitors),[s,o]=v.useState(""),[i,a]=v.useState(!1),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(null);v.useEffect(()=>{e(Ur(60));const k=setInterval(()=>e(Ur(60)),3e4);return()=>clearInterval(k)},[e]);const p=v.useMemo(()=>{if(!s)return n;const k=s.toLowerCase();return n.filter(E=>E.monitor.name.toLowerCase().includes(k)||E.monitor.host?.toLowerCase().includes(k))},[n,s]),m=async k=>{try{await e(px(k)).unwrap(),Ee.success("Monitor created"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to create monitor"),E}},y=async k=>{if(f)try{await e(Df({id:f.id,data:k})).unwrap(),Ee.success("Monitor updated"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to update monitor"),E}},b=async()=>{if(f)try{await e(Nf(f.id)).unwrap(),Ee.success("Monitor deleted")}catch(k){throw Ee.error(k||"Failed to delete monitor"),k}},x=async k=>{try{await e(dc({id:k.id,paused:!k.isPaused})).unwrap(),Ee.success(k.isPaused?"Resumed":"Paused")}catch(E){Ee.error(E||"Failed to toggle pause")}},_=async k=>{Ee.info("Clone feature coming soon")},w=k=>{h(k),l(!0)},S=k=>{h(k),d(!0)},C=k=>{t({to:"/monitors/$id",params:{id:k.id}})};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Monitors"}),g.jsx("p",{className:"text-muted-foreground",children:"Manage your uptime monitors and status checks."})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"relative w-full md:w-auto",children:[g.jsx(Ex,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),g.jsx(nt,{placeholder:"Search monitors...",value:s,onChange:k=>o(k.target.value),className:"pl-8 w-full md:w-[250px]"})]}),g.jsxs(gt,{onClick:()=>{h(null),a(!0)},children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]})]}),r&&n.length===0?g.jsx("div",{className:"flex h-64 items-center justify-center",children:g.jsx(If,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center animate-in fade-in-50",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:g.jsx(KM,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No monitors found"}),g.jsx("p",{className:"mb-4 mt-2 text-sm text-muted-foreground",children:s?"Try adjusting your search terms.":"Get started by adding your first monitor."}),!s&&g.jsxs(gt,{onClick:()=>a(!0),children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map(k=>g.jsx(HI,{summary:k,onEdit:w,onDelete:S,onPause:x,onClone:_,onDetails:C},k.monitor.id))}),g.jsx(Nd,{open:i,onOpenChange:a,onSubmit:m}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:f,onSubmit:y}),g.jsx(k0,{open:u,onOpenChange:d,monitor:f,onConfirm:b})]})}function Rs({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:Se("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function Ps({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:Se("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Os({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:Se("leading-none font-semibold",e),...t})}function C0({className:e,...t}){return g.jsx("div",{"data-slot":"card-description",className:Se("text-muted-foreground text-sm",e),...t})}function Ts({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:Se("px-6",e),...t})}const q$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Ng(){const e=ls(),n=pi({strict:!1})?.id,r=Cf({resolver:vw(q$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}}),{reset:s,watch:o,control:i}=r;v.useEffect(()=>{n&&(async()=>{try{const u=(await Te.get("/monitors")).data.monitors.find(d=>d.id===n);u&&s({...u,intervalSeconds:u.intervalSeconds,timeoutMs:u.timeoutMs})}catch{Ee.error("Failed to load monitor")}})()},[n,s]);const a=o("type"),c=async l=>{try{const u={...l};n?(await Te.put(`/monitors/${n}`,u),Ee.success("Monitor updated")):(await Te.post("/monitors",u),Ee.success("Monitor created")),e({to:"/"})}catch(u){Ee.error(u?.response?.data?.detail??"Save failed")}};return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",onClick:()=>e({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsx("h2",{className:"text-xl font-semibold",children:n?"Edit Monitor":"New Monitor"})]}),g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Monitor Configuration"}),g.jsx(C0,{children:"Configure the settings for your uptime monitor."})]}),g.jsx(Ts,{children:g.jsx(t0,{...r,children:g.jsxs("form",{onSubmit:r.handleSubmit(c),className:"space-y-6",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"name",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"type",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>g.jsx(Vs,{value:u,children:u.toUpperCase()},u))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"intervalSeconds",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"timeoutMs",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})})]}),(a==="http"||a==="keyword"||a==="json_query"||a==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"url",render:({field:l})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...l})}),g.jsx(Le,{})]})}),a!=="websocket"&&g.jsx(Ne,{control:i,name:"method",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),(a==="tcp"||a==="ping"||a==="dns"||a==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"host",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...l})}),g.jsx(Le,{})]})}),(a==="tcp"||a==="steam")&&g.jsx(Ne,{control:i,name:"port",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),a==="dns"&&g.jsx(Ne,{control:i,name:"dnsRecordType",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),a==="keyword"&&g.jsx(Ne,{control:i,name:"keyword",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...l})}),g.jsx(Le,{})]})}),a==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"jsonQuery",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"expectedValue",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...l})}),g.jsx(Le,{})]})})]}),a==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>e({to:"/"}),children:"Cancel"}),g.jsx(gt,{type:"submit",disabled:r.formState.isSubmitting,children:r.formState.isSubmitting?"Saving...":"Save Monitor"})]})]})})})]})]})}const Mn=Object.create(null);Mn.open="0";Mn.close="1";Mn.ping="2";Mn.pong="3";Mn.message="4";Mn.upgrade="5";Mn.noop="6";const La=Object.create(null);Object.keys(Mn).forEach(e=>{La[Mn[e]]=e});const Dd={type:"error",data:"parser error"},R0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",P0=typeof ArrayBuffer=="function",O0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,mh=({type:e,data:t},n,r)=>R0&&t instanceof Blob?n?r(t):Dg(t,r):P0&&(t instanceof ArrayBuffer||O0(t))?n?r(t):Dg(new Blob([t]),r):r(Mn[e]+(t||"")),Dg=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ig(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function K$(e,t){if(R0&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ig).then(t);if(P0&&(e.data instanceof ArrayBuffer||O0(e.data)))return t(Ig(e.data));mh(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jg.length;e++)Mo[jg.charCodeAt(e)]=e;const Z$=e=>{let t=e.length*.75,n=e.length,r,s=0,o,i,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=Mo[e.charCodeAt(r)],i=Mo[e.charCodeAt(r+1)],a=Mo[e.charCodeAt(r+2)],c=Mo[e.charCodeAt(r+3)],u[s++]=o<<2|i>>4,u[s++]=(i&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return l},G$=typeof ArrayBuffer=="function",gh=(e,t)=>{if(typeof e!="string")return{type:"message",data:T0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Y$(e.substring(1),t)}:La[n]?e.length>1?{type:La[n],data:e.substring(1)}:{type:La[n]}:Dd},Y$=(e,t)=>{if(G$){const n=Z$(e);return T0(n,t)}else return{base64:!0,data:e}},T0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,M0="",X$=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,i)=>{mh(o,!1,a=>{r[i]=a,++s===n&&t(r.join(M0))})})},J$=(e,t)=>{const n=e.split(M0),r=[];for(let s=0;s<n.length;s++){const o=gh(n[s],t);if(r.push(o),o.type==="error")break}return r};function Q$(){return new TransformStream({transform(e,t){K$(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function ca(e){return e.reduce((t,n)=>t+n.length,0)}function la(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function eV(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(ca(n)<1)break;const c=la(n,1);o=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(ca(n)<2)break;const c=la(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ca(n)<8)break;const c=la(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Dd);break}s=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ca(n)<s)break;const c=la(n,s);a.enqueue(gh(o?c:wu.decode(c),t)),r=0}if(s===0||s>e){a.enqueue(Dd);break}}}})}const A0=4;function Xe(e){if(e)return tV(e)}function tV(e){for(var t in Xe.prototype)e[t]=Xe.prototype[t];return e}Xe.prototype.on=Xe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Xe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Xe.prototype.emitReserved=Xe.prototype.emit;Xe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Xe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nV="arraybuffer";function N0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const rV=Xt.setTimeout,sV=Xt.clearTimeout;function El(e,t){t.useNativeTimers?(e.setTimeoutFn=rV.bind(Xt),e.clearTimeoutFn=sV.bind(Xt)):(e.setTimeoutFn=Xt.setTimeout.bind(Xt),e.clearTimeoutFn=Xt.clearTimeout.bind(Xt))}const oV=1.33;function iV(e){return typeof e=="string"?aV(e):Math.ceil((e.byteLength||e.size)*oV)}function aV(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function D0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function lV(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class uV extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yh extends Xe{constructor(t){super(),this.writable=!1,El(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new uV(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=cV(t);return n.length?"?"+n:""}}class dV extends yh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};J$(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,X$(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=D0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let I0=!1;try{I0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const fV=I0;function hV(){}class pV extends dV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Cn extends Xe{constructor(t,n,r){super(),this.createRequest=t,El(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=N0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Cn.requestsCount++,Cn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Cn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Cn.requestsCount=0;Cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lg);else if(typeof addEventListener=="function"){const e="onpagehide"in Xt?"pagehide":"unload";addEventListener(e,Lg,!1)}}function Lg(){for(let e in Cn.requests)Cn.requests.hasOwnProperty(e)&&Cn.requests[e].abort()}const mV=(function(){const e=j0({xdomain:!1});return e&&e.responseType!==null})();class gV extends pV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=mV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Cn(j0,this.uri(),t)}}function j0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||fV))return new XMLHttpRequest}catch{}if(!t)try{return new Xt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const L0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yV extends yh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=L0?{}:N0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;mh(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=D0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Su=Xt.WebSocket||Xt.MozWebSocket;class bV extends yV{createSocket(t,n,r){return L0?new Su(t,n,r):n?new Su(t,n):new Su(t)}doWrite(t,n){this.ws.send(n)}}class vV extends yh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=eV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Q$();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xV={websocket:bV,webtransport:vV,polling:gV},_V=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Id(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=_V.exec(e||""),o={},i=14;for(;i--;)o[wV[i]]=s[i]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=SV(o,o.path),o.queryKey=EV(o,o.query),o}function SV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function EV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const jd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fa=[];jd&&addEventListener("offline",()=>{Fa.forEach(e=>e())},!1);class fr extends Xe{constructor(t,n){if(super(),this.binaryType=nV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Id(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Id(n.host).host);El(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=lV(this.opts.query)),jd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=A0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&fr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",fr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=iV(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(fr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fa.indexOf(this._offlineEventListener);r!==-1&&Fa.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}fr.protocol=A0;class kV extends fr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;fr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;fr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const i=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){i("transport closed")}function c(){i("socket closed")}function l(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",i),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",s),n.once("error",i),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let CV=class extends kV{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>xV[s]).filter(s=>!!s)),super(t,r)}};function RV(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Id(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const PV=typeof ArrayBuffer=="function",OV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,F0=Object.prototype.toString,TV=typeof Blob=="function"||typeof Blob<"u"&&F0.call(Blob)==="[object BlobConstructor]",MV=typeof File=="function"||typeof File<"u"&&F0.call(File)==="[object FileConstructor]";function bh(e){return PV&&(e instanceof ArrayBuffer||OV(e))||TV&&e instanceof Blob||MV&&e instanceof File}function za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(za(e[n]))return!0;return!1}if(bh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&za(e[n]))return!0;return!1}function AV(e){const t=[],n=e.data,r=e;return r.data=Ld(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ld(e,t){if(!e)return e;if(bh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ld(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ld(e[r],t));return n}return e}function NV(e,t){return e.data=Fd(e.data,t),delete e.attachments,e}function Fd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fd(e[n],t));return e}const DV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class IV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&za(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=AV(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class vh extends Xe{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new jV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(o,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(vh.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return Fg(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||Fg(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&DV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class jV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=NV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Fg(e){return Object.prototype.toString.call(e)==="[object Object]"}const LV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vh,Encoder:IV,get PacketType(){return _e}},Symbol.toStringTag,{value:"Module"}));function ln(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const FV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class z0 extends Xe{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ln(t,"open",this.onopen.bind(this)),ln(t,"packet",this.onpacket.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(FV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:_e.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),i.id=u}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),i=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(i,a)=>i?s(i):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:_e.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};io.prototype.reset=function(){this.attempts=0};io.prototype.setMin=function(e){this.ms=e};io.prototype.setMax=function(e){this.max=e};io.prototype.setJitter=function(e){this.jitter=e};class zd extends Xe{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,El(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new io({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||LV;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new CV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=ln(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=ln(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ln(t,"ping",this.onping.bind(this)),ln(t,"data",this.ondata.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this)),ln(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new z0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const xo={};function $a(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=RV(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=xo[s]&&o in xo[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let c;return a?c=new zd(r,t):(xo[s]||(xo[s]=new zd(r,t)),c=xo[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($a,{Manager:zd,Socket:z0,io:$a,connect:$a});function Pi(e){return e+.5|0}const ir=(e,t,n)=>Math.max(Math.min(e,n),t);function Ao(e){return ir(Pi(e*2.55),0,255)}function hr(e){return ir(Pi(e*255),0,255)}function $n(e){return ir(Pi(e/2.55)/100,0,1)}function zg(e){return ir(Pi(e*100),0,100)}const Zt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$d=[..."0123456789ABCDEF"],zV=e=>$d[e&15],$V=e=>$d[(e&240)>>4]+$d[e&15],ua=e=>(e&240)>>4===(e&15),VV=e=>ua(e.r)&&ua(e.g)&&ua(e.b)&&ua(e.a);function BV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Zt[e[1]]*17,g:255&Zt[e[2]]*17,b:255&Zt[e[3]]*17,a:t===5?Zt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Zt[e[1]]<<4|Zt[e[2]],g:Zt[e[3]]<<4|Zt[e[4]],b:Zt[e[5]]<<4|Zt[e[6]],a:t===9?Zt[e[7]]<<4|Zt[e[8]]:255})),n}const UV=(e,t)=>e<255?t(e):"";function WV(e){var t=VV(e)?zV:$V;return e?"#"+t(e.r)+t(e.g)+t(e.b)+UV(e.a,t):void 0}const HV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $0(e,t,n){const r=t*Math.min(n,1-n),s=(o,i=(o+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function qV(e,t,n){const r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function KV(e,t,n){const r=$0(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function ZV(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function xh(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let c,l,u;return o!==i&&(u=o-i,l=a>.5?u/(2-o-i):u/(o+i),c=ZV(n,r,s,u,o),c=c*60+.5),[c|0,l||0,a]}function _h(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(hr)}function wh(e,t,n){return _h($0,e,t,n)}function GV(e,t,n){return _h(KV,e,t,n)}function YV(e,t,n){return _h(qV,e,t,n)}function V0(e){return(e%360+360)%360}function XV(e){const t=HV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ao(+t[5]):hr(+t[5]));const s=V0(+t[2]),o=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?r=GV(s,o,i):t[1]==="hsv"?r=YV(s,o,i):r=wh(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function JV(e,t){var n=xh(e);n[0]=V0(n[0]+t),n=wh(n),e.r=n[0],e.g=n[1],e.b=n[2]}function QV(e){if(!e)return;const t=xh(e),n=t[0],r=zg(t[1]),s=zg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${$n(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const $g={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function eB(){const e={},t=Object.keys(Vg),n=Object.keys($g);let r,s,o,i,a;for(r=0;r<t.length;r++){for(i=a=t[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,$g[o]);o=parseInt(Vg[i],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let da;function tB(e){da||(da=eB(),da.transparent=[0,0,0,0]);const t=da[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const nB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rB(e){const t=nB.exec(e);let n=255,r,s,o;if(t){if(t[7]!==r){const i=+t[7];n=t[8]?Ao(i):ir(i*255,0,255)}return r=+t[1],s=+t[3],o=+t[5],r=255&(t[2]?Ao(r):ir(r,0,255)),s=255&(t[4]?Ao(s):ir(s,0,255)),o=255&(t[6]?Ao(o):ir(o,0,255)),{r,g:s,b:o,a:n}}}function sB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_s=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function oB(e,t,n){const r=_s($n(e.r)),s=_s($n(e.g)),o=_s($n(e.b));return{r:hr(Eu(r+n*(_s($n(t.r))-r))),g:hr(Eu(s+n*(_s($n(t.g))-s))),b:hr(Eu(o+n*(_s($n(t.b))-o))),a:e.a+n*(t.a-e.a)}}function fa(e,t,n){if(e){let r=xh(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=wh(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function B0(e,t){return e&&Object.assign(t||{},e)}function Bg(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=hr(e[3]))):(t=B0(e,{r:0,g:0,b:0,a:1}),t.a=hr(t.a)),t}function iB(e){return e.charAt(0)==="r"?rB(e):XV(e)}class ai{constructor(t){if(t instanceof ai)return t;const n=typeof t;let r;n==="object"?r=Bg(t):n==="string"&&(r=BV(t)||tB(t)||iB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=B0(this._rgb);return t&&(t.a=$n(t.a)),t}set rgb(t){this._rgb=Bg(t)}rgbString(){return this._valid?sB(this._rgb):void 0}hexString(){return this._valid?WV(this._rgb):void 0}hslString(){return this._valid?QV(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let o;const i=n===o?.5:n,a=2*i-1,c=r.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,r.r=255&l*r.r+o*s.r+.5,r.g=255&l*r.g+o*s.g+.5,r.b=255&l*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=oB(this._rgb,t._rgb,n)),this}clone(){return new ai(this.rgb)}alpha(t){return this._rgb.a=hr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Pi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fa(this._rgb,2,t),this}darken(t){return fa(this._rgb,2,-t),this}saturate(t){return fa(this._rgb,1,t),this}desaturate(t){return fa(this._rgb,1,-t),this}rotate(t){return JV(this._rgb,t),this}}function In(){}const aB=(()=>{let e=0;return()=>e++})();function ye(e){return e==null}function ze(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function xe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function We(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ft(e,t){return We(e)?e:t}function de(e,t){return typeof e>"u"?t:e}const cB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,U0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Me(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ce(e,t,n,r){let s,o,i;if(ze(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(xe(e))for(i=Object.keys(e),o=i.length,s=0;s<o;s++)t.call(n,e[i[s]],i[s])}function kc(e,t){let n,r,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Cc(e){if(ze(e))return e.map(Cc);if(xe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=Cc(e[n[s]]);return t}return e}function W0(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function lB(e,t,n,r){if(!W0(e))return;const s=t[e],o=n[e];xe(s)&&xe(o)?ci(s,o,r):t[e]=Cc(o)}function ci(e,t,n){const r=ze(t)?t:[t],s=r.length;if(!xe(e))return e;n=n||{};const o=n.merger||lB;let i;for(let a=0;a<s;++a){if(i=r[a],!xe(i))continue;const c=Object.keys(i);for(let l=0,u=c.length;l<u;++l)o(c[l],e,i,n)}return e}function Vo(e,t){return ci(e,t,{merger:uB})}function uB(e,t,n){if(!W0(e))return;const r=t[e],s=n[e];xe(r)&&xe(s)?Vo(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Cc(s))}const Ug={"":e=>e,x:e=>e.x,y:e=>e.y};function dB(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function fB(e){const t=dB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function br(e,t){return(Ug[t]||(Ug[t]=fB(t)))(e)}function Sh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const li=e=>typeof e<"u",vr=e=>typeof e=="function",Wg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const we=Math.PI,Ae=2*we,pB=Ae+we,Rc=Number.POSITIVE_INFINITY,mB=we/180,He=we/2,Mr=we/4,Hg=we*2/3,ar=Math.log10,Rn=Math.sign;function Bo(e,t,n){return Math.abs(e-t)<n}function qg(e){const t=Math.round(e);e=Bo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ar(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function gB(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function yB(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ys(e){return!yB(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function bB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function H0(e,t,n){let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function fn(e){return e*(we/180)}function Eh(e){return e*(180/we)}function Kg(e){if(!We(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function q0(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*we&&(o+=Ae),{angle:o,distance:s}}function Vd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function vB(e,t){return(e-t+pB)%Ae-we}function mt(e){return(e%Ae+Ae)%Ae}function ui(e,t,n,r){const s=mt(e),o=mt(t),i=mt(n),a=mt(o-s),c=mt(i-s),l=mt(s-o),u=mt(s-i);return s===o||s===i||r&&o===i||a>c&&l<u}function at(e,t,n){return Math.max(t,Math.min(n,e))}function xB(e){return at(e,-32768,32767)}function Bn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function kh(e,t,n){n=n||(i=>e[i]<t);let r=e.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Un=(e,t,n,r)=>kh(e,n,r?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),_B=(e,t,n)=>kh(e,n,r=>e[r][t]>=n);function wB(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const K0=["push","pop","shift","splice","unshift"];function SB(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K0.forEach(n=>{const r="_onData"+Sh(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Zg(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(K0.forEach(o=>{delete e[o]}),delete e._chartjs)}function Z0(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const G0=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Y0(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,G0.call(window,()=>{r=!1,e.apply(t,n)}))}}function EB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ch=e=>e==="start"?"left":e==="end"?"right":"center",ht=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,kB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function X0(e,t,n){const r=t.length;let s=0,o=r;if(e._sorted){const{iScale:i,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:d,max:f,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(s=Math.min(Un(c,u,d).lo,n?r:Un(t,u,i.getPixelForValue(d)).lo),l){const m=c.slice(0,s+1).reverse().findIndex(y=>!ye(y[a.axis]));s-=Math.max(0,m)}s=at(s,0,r-1)}if(p){let m=Math.max(Un(c,i.axis,f,!0).hi+1,n?0:Un(t,u,i.getPixelForValue(f),!0).hi+1);if(l){const y=c.slice(m-1).findIndex(b=>!ye(b[a.axis]));m+=Math.max(0,y)}o=at(m,s,r)-s}else o=r-s}return{start:s,count:o}}function J0(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=s,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,s),o}const ha=e=>e===0||e===1,Gg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ae/n)),Yg=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ae/n)+1,Uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*He)+1,easeOutSine:e=>Math.sin(e*He),easeInOutSine:e=>-.5*(Math.cos(we*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ha(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ha(e)?e:Gg(e,.075,.3),easeOutElastic:e=>ha(e)?e:Yg(e,.075,.3),easeInOutElastic(e){return ha(e)?e:e<.5?.5*Gg(e*2,.1125,.45):.5+.5*Yg(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Uo.easeInBounce(e*2)*.5:Uo.easeOutBounce(e*2-1)*.5+.5};function Rh(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Xg(e){return Rh(e)?e:new ai(e)}function ku(e){return Rh(e)?e:new ai(e).saturate(.5).darken(.1).hexString()}const CB=["x","y","borderWidth","radius","tension"],RB=["color","borderColor","backgroundColor"];function PB(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:RB},numbers:{type:"number",properties:CB}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function OB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jg=new Map;function TB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Jg.get(n);return r||(r=new Intl.NumberFormat(e,t),Jg.set(n,r)),r}function Oi(e,t,n){return TB(t,n).format(e)}const Q0={values(e){return ze(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,o=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=MB(e,n)}const i=ar(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Oi(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ar(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Q0.numeric.call(this,e,t,n):""}};function MB(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var kl={formatters:Q0};function AB(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:kl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const as=Object.create(null),Bd=Object.create(null);function Wo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Cu(e,t,n){return typeof t=="string"?ci(Wo(e,t),n):ci(Wo(e,""),t)}class NB{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>ku(s.backgroundColor),this.hoverBorderColor=(r,s)=>ku(s.borderColor),this.hoverColor=(r,s)=>ku(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Cu(this,t,n)}get(t){return Wo(this,t)}describe(t,n){return Cu(Bd,t,n)}override(t,n){return Cu(as,t,n)}route(t,n,r,s){const o=Wo(this,t),i=Wo(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],l=i[s];return xe(c)?Object.assign({},l,c):de(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var $e=new NB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[PB,OB,AB]);function DB(e){return!e||ye(e.size)||ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Pc(e,t,n,r,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>r&&(r=o),r}function IB(e,t,n,r){r=r||{};let s=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(s=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const a=n.length;let c,l,u,d,f;for(c=0;c<a;c++)if(d=n[c],d!=null&&!ze(d))i=Pc(e,s,o,i,d);else if(ze(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!ze(f)&&(i=Pc(e,s,o,i,f));e.restore();const h=o.length/2;if(h>n.length){for(c=0;c<h;c++)delete s[o[c]];o.splice(0,h)}return i}function Ar(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function Qg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ud(e,t,n,r){eS(e,t,n,r,null)}function eS(e,t,n,r,s){let o,i,a,c,l,u,d,f;const h=t.pointStyle,p=t.rotation,m=t.radius;let y=(p||0)*mB;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,r,s/2,m,0,0,Ae):e.arc(n,r,m,0,Ae),e.closePath();break;case"triangle":u=s?s/2:m,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),e.closePath();break;case"rectRounded":l=m*.516,c=m-l,i=Math.cos(y+Mr)*c,d=Math.cos(y+Mr)*(s?s/2-l:c),a=Math.sin(y+Mr)*c,f=Math.sin(y+Mr)*(s?s/2-l:c),e.arc(n-d,r-a,l,y-we,y-He),e.arc(n+f,r-i,l,y-He,y),e.arc(n+d,r+a,l,y,y+He),e.arc(n-f,r+i,l,y+He,y+we),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*m,u=s?s/2:c,e.rect(n-u,r-c,2*u,2*c);break}y+=Mr;case"rectRot":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-i),e.lineTo(n+d,r+a),e.lineTo(n-f,r+i),e.closePath();break;case"crossRot":y+=Mr;case"cross":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"star":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i),y+=Mr,d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*m,a=Math.sin(y)*m,e.moveTo(n-i,r-a),e.lineTo(n+i,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(s?s/2:m),r+Math.sin(y)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Cl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Rl(e){e.restore()}function jB(e,t,n,r,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function LB(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function FB(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ye(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function zB(e,t,n,r,s){if(s.strikethrough||s.underline){const o=e.measureText(r),i=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(i,u),e.lineTo(a,u),e.stroke()}}function $B(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function cs(e,t,n,r,s,o={}){const i=ze(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(e.save(),e.font=s.string,FB(e,o),c=0;c<i.length;++c)l=i[c],o.backdrop&&$B(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),ye(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(l,n,r,o.maxWidth)),e.fillText(l,n,r,o.maxWidth),zB(e,n,r,l,o),r+=Number(s.lineHeight);e.restore()}function di(e,t){const{x:n,y:r,w:s,h:o,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*we,we,!0),e.lineTo(n,r+o-i.bottomLeft),e.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,we,He,!0),e.lineTo(n+s-i.bottomRight,r+o),e.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,He,0,!0),e.lineTo(n+s,r+i.topRight),e.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-He,!0),e.lineTo(n+i.topLeft,r)}const VB=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,BB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UB(e,t){const n=(""+e).match(VB);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const WB=e=>+e||0;function Ph(e,t){const n={},r=xe(t),s=r?Object.keys(t):t,o=xe(e)?r?i=>de(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of s)n[i]=WB(o(i));return n}function tS(e){return Ph(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Zr(e){return Ph(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(e){const t=tS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function rt(e,t){e=e||{},t=t||$e.font;let n=de(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=de(e.style,t.style);r&&!(""+r).match(BB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:de(e.family,t.family),lineHeight:UB(de(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:de(e.weight,t.weight),string:""};return s.string=DB(s),s}function No(e,t,n,r){let s,o,i;for(s=0,o=e.length;s<o;++s)if(i=e[s],i!==void 0&&i!==void 0)return i}function HB(e,t,n){const{min:r,max:s}=e,o=U0(t,(s-r)/2),i=(a,c)=>n&&a===0?0:a+c;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function Rr(e,t){return Object.assign(Object.create(e),t)}function Oh(e,t=[""],n,r,s=()=>e[0]){const o=n||e;typeof r>"u"&&(r=oS("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>Oh([a,...e],t,o,r)};return new Proxy(i,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return rS(a,c,()=>QB(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return ty(a).includes(c)},ownKeys(a){return ty(a)},set(a,c,l){const u=a._storage||(a._storage=s());return a[c]=u[c]=l,delete a._keys,!0}})}function Xs(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:nS(e,r),setContext:o=>Xs(e,o,n,r),override:o=>Xs(e.override(o),t,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete e[i],!0},get(o,i,a){return rS(o,i,()=>KB(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(o,i,a){return e[i]=a,delete o[i],!0}})}function nS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:vr(n)?n:()=>n,isIndexable:vr(r)?r:()=>r}}const qB=(e,t)=>e?e+Sh(t):t,Th=(e,t)=>xe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function rS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function KB(e,t,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=e;let a=r[t];return vr(a)&&i.isScriptable(t)&&(a=ZB(t,a,e,n)),ze(a)&&a.length&&(a=GB(t,a,e,i.isIndexable)),Th(t,a)&&(a=Xs(a,s,o&&o[t],i)),a}function ZB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,i||r);return a.delete(e),Th(e,c)&&(c=Mh(s._scopes,s,e,c)),c}function GB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(xe(t[0])){const c=t,l=s._scopes.filter(u=>u!==c);t=[];for(const u of c){const d=Mh(l,s,e,u);t.push(Xs(d,o,i&&i[e],a))}}return t}function sS(e,t,n){return vr(e)?e(t,n):e}const YB=(e,t)=>e===!0?t:typeof e=="string"?br(t,e):void 0;function XB(e,t,n,r,s){for(const o of t){const i=YB(n,o);if(i){e.add(i);const a=sS(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function Mh(e,t,n,r){const s=t._rootScopes,o=sS(t._fallback,n,r),i=[...e,...s],a=new Set;a.add(r);let c=ey(a,i,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=ey(a,i,o,c,r),c===null)?!1:Oh(Array.from(a),[""],s,o,()=>JB(t,n,r))}function ey(e,t,n,r,s){for(;n;)n=XB(e,t,n,r,s);return n}function JB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return ze(s)&&xe(n)?n:s||{}}function QB(e,t,n,r){let s;for(const o of t)if(s=oS(qB(o,e),n),typeof s<"u")return Th(e,s)?Mh(n,r,e,s):s}function oS(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function ty(e){let t=e._keys;return t||(t=e._keys=eU(e._scopes)),t}function eU(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function iS(e,t,n,r){const{iScale:s}=e,{key:o="r"}=this._parsing,i=new Array(r);let a,c,l,u;for(a=0,c=r;a<c;++a)l=a+n,u=t[l],i[a]={r:s.parse(br(u,o),l)};return i}const tU=Number.EPSILON||1e-14,Js=(e,t)=>t<e.length&&!e[t].skip&&e[t],aS=e=>e==="x"?"y":"x";function nU(e,t,n,r){const s=e.skip?t:e,o=t,i=n.skip?t:n,a=Vd(o,s),c=Vd(i,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const d=r*l,f=r*u;return{previous:{x:o.x-d*(i.x-s.x),y:o.y-d*(i.y-s.y)},next:{x:o.x+f*(i.x-s.x),y:o.y+f*(i.y-s.y)}}}function rU(e,t,n){const r=e.length;let s,o,i,a,c,l=Js(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Js(e,u+1),!(!c||!l)){if(Bo(t[u],0,tU)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(i=3/Math.sqrt(a),n[u]=s*i*t[u],n[u+1]=o*i*t[u])}}function sU(e,t,n="x"){const r=aS(n),s=e.length;let o,i,a,c=Js(e,0);for(let l=0;l<s;++l){if(i=a,a=c,c=Js(e,l+1),!a)continue;const u=a[n],d=a[r];i&&(o=(u-i[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[l]),c&&(o=(c[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[l])}}function oU(e,t="x"){const n=aS(t),r=e.length,s=Array(r).fill(0),o=Array(r);let i,a,c,l=Js(e,0);for(i=0;i<r;++i)if(a=c,c=l,l=Js(e,i+1),!!c){if(l){const u=l[t]-c[t];s[i]=u!==0?(l[n]-c[n])/u:0}o[i]=a?l?Rn(s[i-1])!==Rn(s[i])?0:(s[i-1]+s[i])/2:s[i-1]:s[i]}rU(e,s,o),sU(e,o,t)}function pa(e,t,n){return Math.max(Math.min(e,n),t)}function iU(e,t){let n,r,s,o,i,a=Wn(e[0],t);for(n=0,r=e.length;n<r;++n)i=o,o=a,a=n<r-1&&Wn(e[n+1],t),o&&(s=e[n],i&&(s.cp1x=pa(s.cp1x,t.left,t.right),s.cp1y=pa(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=pa(s.cp2x,t.left,t.right),s.cp2y=pa(s.cp2y,t.top,t.bottom)))}function aU(e,t,n,r,s){let o,i,a,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")oU(e,s);else{let l=r?e[e.length-1]:e[0];for(o=0,i=e.length;o<i;++o)a=e[o],c=nU(l,a,e[Math.min(o+1,i-(r?0:1))%i],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&iU(e,n)}function Ah(){return typeof window<"u"&&typeof document<"u"}function Nh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Oc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Pl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function cU(e,t){return Pl(e).getPropertyValue(t)}const lU=["top","right","bottom","left"];function Gr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=lU[s];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const uU=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function dU(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=r;let i=!1,a,c;if(uU(s,o,e.target))a=s,c=o;else{const l=t.getBoundingClientRect();a=r.clientX-l.left,c=r.clientY-l.top,i=!0}return{x:a,y:c,box:i}}function Ir(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Pl(n),o=s.boxSizing==="border-box",i=Gr(s,"padding"),a=Gr(s,"border","width"),{x:c,y:l,box:u}=dU(e,n),d=i.left+(u&&a.left),f=i.top+(u&&a.top);let{width:h,height:p}=t;return o&&(h-=i.width+a.width,p-=i.height+a.height),{x:Math.round((c-d)/h*n.width/r),y:Math.round((l-f)/p*n.height/r)}}function fU(e,t,n){let r,s;if(t===void 0||n===void 0){const o=e&&Nh(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const i=o.getBoundingClientRect(),a=Pl(o),c=Gr(a,"border","width"),l=Gr(a,"padding");t=i.width-l.width-c.width,n=i.height-l.height-c.height,r=Oc(a.maxWidth,o,"clientWidth"),s=Oc(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Rc,maxHeight:s||Rc}}const cr=e=>Math.round(e*10)/10;function hU(e,t,n,r){const s=Pl(e),o=Gr(s,"margin"),i=Oc(s.maxWidth,e,"clientWidth")||Rc,a=Oc(s.maxHeight,e,"clientHeight")||Rc,c=fU(e,t,n);let{width:l,height:u}=c;if(s.boxSizing==="content-box"){const f=Gr(s,"border","width"),h=Gr(s,"padding");l-=h.width+f.width,u-=h.height+f.height}return l=Math.max(0,l-o.width),u=Math.max(0,r?l/r:u-o.height),l=cr(Math.min(l,i,c.maxWidth)),u=cr(Math.min(u,a,c.maxHeight)),l&&!u&&(u=cr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=cr(Math.floor(u*r))),{width:l,height:u}}function ny(e,t,n){const r=t||1,s=cr(e.height*r),o=cr(e.width*r);e.height=cr(e.height),e.width=cr(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(e.currentDevicePixelRatio=r,i.height=s,i.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const pU=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Ah()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function ry(e,t){const n=cU(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function mU(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function gU(e,t,n,r){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},i=jr(e,s,n),a=jr(s,o,n),c=jr(o,t,n),l=jr(i,a,n),u=jr(a,c,n);return jr(l,u,n)}const yU=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},bU=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Bs(e,t,n){return e?yU(t,n):bU()}function cS(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function lS(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function uS(e){return e==="angle"?{between:ui,compare:vB,normalize:mt}:{between:Bn,compare:(t,n)=>t-n,normalize:t=>t}}function sy({start:e,end:t,count:n,loop:r,style:s}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:s}}function vU(e,t,n){const{property:r,start:s,end:o}=n,{between:i,normalize:a}=uS(r),c=t.length;let{start:l,end:u,loop:d}=e,f,h;if(d){for(l+=c,u+=c,f=0,h=c;f<h&&i(a(t[l%c][r]),s,o);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function dS(e,t,n){if(!n)return[e];const{property:r,start:s,end:o}=n,i=t.length,{compare:a,between:c,normalize:l}=uS(r),{start:u,end:d,loop:f,style:h}=vU(e,t,n),p=[];let m=!1,y=null,b,x,_;const w=()=>c(s,_,b)&&a(s,_)!==0,S=()=>a(o,b)===0||c(o,_,b),C=()=>m||w(),k=()=>!m||S();for(let E=u,P=u;E<=d;++E)x=t[E%i],!x.skip&&(b=l(x[r]),b!==_&&(m=c(b,s,o),y===null&&C()&&(y=a(b,s)===0?E:P),y!==null&&k()&&(p.push(sy({start:y,end:E,loop:f,count:i,style:h})),y=null),P=E,_=b));return y!==null&&p.push(sy({start:y,end:d,loop:f,count:i,style:h})),p}function fS(e,t){const n=[],r=e.segments;for(let s=0;s<r.length;s++){const o=dS(r[s],e.points,t);o.length&&n.push(...o)}return n}function xU(e,t,n,r){let s=0,o=t-1;if(n&&!r)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function _U(e,t,n,r){const s=e.length,o=[];let i=t,a=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%s];l.skip||l.stop?a.skip||(r=!1,o.push({start:t%s,end:(c-1)%s,loop:r}),t=i=l.stop?c:null):(i=c,a.skip&&(t=c)),a=l}return i!==null&&o.push({start:t%s,end:i%s,loop:r}),o}function wU(e,t){const n=e.points,r=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:i,end:a}=xU(n,s,o,r);if(r===!0)return oy(e,[{start:i,end:a,loop:o}],n,t);const c=a<i?a+s:a,l=!!e._fullLoop&&i===0&&a===s-1;return oy(e,_U(n,i,c,l),n,t)}function oy(e,t,n,r){return!r||!r.setContext||!n?t:SU(e,t,n,r)}function SU(e,t,n,r){const s=e._chart.getContext(),o=iy(e.options),{_datasetIndex:i,options:{spanGaps:a}}=e,c=n.length,l=[];let u=o,d=t[0].start,f=d;function h(p,m,y,b){const x=a?-1:1;if(p!==m){for(p+=c;n[p%c].skip;)p-=x;for(;n[m%c].skip;)m+=x;p%c!==m%c&&(l.push({start:p%c,end:m%c,loop:y,style:b}),u=b,d=m%c)}}for(const p of t){d=a?d:p.start;let m=n[d%c],y;for(f=d+1;f<=p.end;f++){const b=n[f%c];y=iy(r.setContext(Rr(s,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:i}))),EU(y,u)&&h(d,f-1,p.loop,u),m=b,u=y}d<f-1&&h(d,f-1,p.loop,u)}return l}function iy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function EU(e,t){if(!t)return!1;const n=[],r=function(s,o){return Rh(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ma(e,t,n){return e.options.clip?e[n]:t[n]}function kU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ma(n,t,"left"),right:ma(n,t,"right"),top:ma(r,t,"top"),bottom:ma(r,t,"bottom")}:t}function hS(e,t){const n=t._clip;if(n.disabled)return!1;const r=kU(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class CU{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=G0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,c;for(;i>=0;--i)c=o[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,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,s)=>Math.max(r,s._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 s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ln=new CU;const ay="transparent",RU={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Xg(e||ay),s=r.valid&&Xg(t||ay);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class PU{constructor(t,n,r,s){const o=n[r];s=No([t.to,s,o,t.from]);const i=No([t.from,o,s]);this._active=!0,this._fn=t.fn||RU[t.type||typeof i],this._easing=Uo[t.easing]||Uo.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=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=No([t.to,n,s,t.from]),this._from=No([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let c;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}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 s=0;s<r.length;s++)r[s][n]()}}class pS{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!xe(t))return;const n=Object.keys($e.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!xe(o))return;const i={};for(const a of n)i[a]=o[a];(ze(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=TU(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&OU(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let c;for(c=i.length-1;c>=0;--c){const l=i[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[l];let d=o[l];const f=r.get(l);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[l]=u;continue}o[l]=d=new PU(f,t,l,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ln.add(this._chart,r),!0}}function OU(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function TU(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 cy(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function MU(e,t,n){if(n===!1)return!1;const r=cy(e,n),s=cy(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function AU(e){let t,n,r,s;return xe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function mS(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function ly(e,t,n,r={}){const s=e.keys,o=r.mode==="single";let i,a,c,l;if(t===null)return;let u=!1;for(i=0,a=s.length;i<a;++i){if(c=+s[i],c===n){if(u=!0,r.all)continue;break}l=e.values[c],We(l)&&(o||t===0||Rn(t)===Rn(l))&&(t+=l)}return!u&&!r.all?0:t}function NU(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(e),a=new Array(i.length);let c,l,u;for(c=0,l=i.length;c<l;++c)u=i[c],a[c]={[s]:u,[o]:e[u]};return a}function Ru(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function DU(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function IU(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function jU(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function uy(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function dy(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,c=o.axis,l=i.axis,u=DU(o,i,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[c]:m,[l]:y}=p,b=p._stacks||(p._stacks={});f=b[l]=jU(s,u,m),f[a]=y,f._top=uy(f,i,!0,r.type),f._bottom=uy(f,i,!1,r.type);const x=f._visualValues||(f._visualValues={});x[a]=y}}function Pu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function LU(e,t){return Rr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function FU(e,t,n){return Rr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _o(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const o=s._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 Ou=e=>e==="reset"||e==="none",fy=(e,t)=>t?e:Object.assign({},e),zU=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:mS(n,!0),values:null};class Pr{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=Ru(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&&_o(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,o=n.xAxisID=de(r.xAxisID,Pu(t,"x")),i=n.yAxisID=de(r.yAxisID,Pu(t,"y")),a=n.rAxisID=de(r.rAxisID,Pu(t,"r")),c=n.indexAxis,l=n.iAxisID=s(c,o,i,a),u=n.vAxisID=s(c,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(l),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&&Zg(this._data,this),t._stacked&&_o(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(xe(n)){const s=this._cachedMeta;this._data=NU(n,s)}else if(r!==n){if(r){Zg(r,this);const s=this._cachedMeta;_o(s),s._parsed=[]}n&&Object.isExtensible(n)&&SB(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 s=!1;this._dataCheck();const o=n._stacked;n._stacked=Ru(n.vScale,n),n.stack!==r.stack&&(s=!0,_o(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(dy(this,n._parsed),n._stacked=Ru(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:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let c=t===0&&n===s.length?!0:r._sorted,l=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{ze(s[t])?f=this.parseArrayData(r,s,t,n):xe(s[t])?f=this.parseObjectData(r,s,t,n):f=this.parsePrimitiveData(r,s,t,n);const h=()=>d[a]===null||l&&d[a]<l[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],c&&(h()&&(c=!1),l=d);r._sorted=c}i&&dy(this,f)}parsePrimitiveData(t,n,r,s){const{iScale:o,vScale:i}=t,a=o.axis,c=i.axis,l=o.getLabels(),u=o===i,d=new Array(s);let f,h,p;for(f=0,h=s;f<h;++f)p=f+r,d[f]={[a]:u||o.parse(l[p],p),[c]:i.parse(n[p],p)};return d}parseArrayData(t,n,r,s){const{xScale:o,yScale:i}=t,a=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+r,d=n[u],a[c]={x:o.parse(d[0],u),y:i.parse(d[1],u)};return a}parseObjectData(t,n,r,s){const{xScale:o,yScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s);let u,d,f,h;for(u=0,d=s;u<d;++u)f=u+r,h=n[f],l[u]={x:o.parse(br(h,a),f),y:i.parse(br(h,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,o=this._cachedMeta,i=n[t.axis],a={keys:mS(s,!0),values:n._stacks[t.axis]._visualValues};return ly(a,i,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=ly(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,i=s.length,a=this._getOtherScale(t),c=zU(n,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=IU(a);let f,h;function p(){h=s[f];const m=h[a.axis];return!We(h[t.axis])||u>m||d<m}for(f=0;f<i&&!(!p()&&(this.updateRangeFromParsed(l,t,h,c),o));++f);if(o){for(f=i-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,h,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][t.axis],We(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=AU(de(this.options.clip,MU(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,c),u=a;u<a+c;++u){const d=s[u];d.hidden||(d.active&&l?i.push(d):d.draw(t,o))}for(u=0;u<i.length;++u)i[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 s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];o=i.$context||(i.$context=FU(this.getContext(),t,i)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=LU(this.chart.getContext(),this.index)),o.dataset=s,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 s=n==="active",o=this._cachedDataOpts,i=t+"-"+n,a=o[i],c=this.enableOptionSharing&&li(r);if(a)return fy(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),h=Object.keys($e.elements[t]),p=()=>this.getContext(r,s,n),m=l.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=c,o[i]=Object.freeze(fy(m,c))),m}_resolveAnimations(t,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let c;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);c=u.createResolver(f,this.getContext(t,r,n))}const l=new pS(s,c&&c.animations);return c&&c._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ou(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(t,n,r,s){Ou(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Ou(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&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[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){const s=this._cachedMeta,o=s.data,i=t+n;let a;const c=l=>{for(l.length+=n,a=l.length-1;a>=i;a--)l[a]=l[a-n]};for(c(o),a=t;a<i;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&_o(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}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 $U(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=Z0(r.sort((s,o)=>s-o))}return e._cache.$bar}function VU(e){const t=e.iScale,n=$U(t,e.type);let r=t._length,s,o,i,a;const c=()=>{i===32767||i===-32768||(li(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=t.getPixelForValue(n[s]),c();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)i=t.getPixelForTick(s),c();return r}function BU(e,t,n,r){const s=n.barThickness;let o,i;return ye(s)?(o=t.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:t.pixels[e]-o/2}}function UU(e,t,n,r){const s=t.pixels,o=s[e];let i=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const c=n.categoryPercentage;i===null&&(i=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-i);const l=o-(o-Math.min(i,a))/2*c;return{chunk:Math.abs(a-i)/2*c/r,ratio:n.barPercentage,start:l}}function WU(e,t,n,r){const s=n.parse(e[0],r),o=n.parse(e[1],r),i=Math.min(s,o),a=Math.max(s,o);let c=i,l=a;Math.abs(i)>Math.abs(a)&&(c=a,l=i),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:s,end:o,min:i,max:a}}function gS(e,t,n,r){return ze(e)?WU(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hy(e,t,n,r){const s=e.iScale,o=e.vScale,i=s.getLabels(),a=s===o,c=[];let l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[s.axis]=a||s.parse(i[l],l),c.push(gS(f,d,o,l));return c}function Tu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function HU(e,t,n){return e!==0?Rn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function qU(e){let t,n,r,s,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:t,top:s,bottom:o}}function KU(e,t,n,r){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:c,top:l,bottom:u}=qU(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=l:(n._bottom||0)===r?s=u:(o[py(u,i,a,c)]=!0,s=l)),o[py(s,i,a,c)]=!0,e.borderSkipped=o}function py(e,t,n,r){return r?(e=ZU(e,t,n),e=my(e,n,t)):e=my(e,t,n),e}function ZU(e,t,n){return e===t?n:e===n?t:e}function my(e,t,n){return e==="start"?t:e==="end"?n:e}function GU(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class YU extends Pr{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,s){return hy(t,n,r,s)}parseArrayData(t,n,r,s){return hy(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:o,vScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=i.axis==="x"?a:c,d=[];let f,h,p,m;for(f=r,h=r+s;f<h;++f)m=n[f],p={},p[o.axis]=o.parse(br(m,l),f),d.push(gS(br(m,u),p,i,f));return d}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);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:s}=n,o=this.getParsed(t),i=o._custom,a=Tu(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}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,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,s);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=o||ye(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),b=(p._stacks||{})[a.axis],x={horizontal:l,base:m.base,enableBorderRadius:!b||Tu(p._custom)||i===b._top||i===b._bottom,x:l?m.head:y.center,y:l?y.center:m.head,height:l?y.size:Math.abs(m.size),width:l?Math.abs(m.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(h,t[h].active?"active":s));const _=x.options||t[h].options;KU(x,_,b,i),GU(x,_,u.ratio),this.updateElement(t[h],h,x,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),c=a&&a[r.axis],l=u=>{const d=u._parsed.find(h=>h[r.axis]===c),f=d&&d[u.vScale.axis];if(ye(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&l(u))&&((o===!1||i.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===t))break;return i.length||i.push(void 0),i}_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[de(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||VU(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,c=this.getParsed(t),l=c._custom,u=Tu(l);let d=c[n.axis],f=0,h=r?this.applyStack(n,c,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=l.barStart,h=l.barEnd-l.barStart,d!==0&&Rn(d)!==Rn(l.barEnd)&&(f=0),f+=d);const y=!ye(o)&&!u?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=b,m=p-b,Math.abs(m)<i){m=HU(m,n,a)*i,d===a&&(b-=m/2);const x=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),w=Math.min(x,_),S=Math.max(x,_);b=Math.max(Math.min(b,S),w),p=b+m,r&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=Rn(m)*n.getLineWidthForValue(a)/2;b+=x,m-=x}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,o=s.skipNull,i=de(s.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=s.barThickness==="flex"?UU(t,n,s,u*l):BU(t,n,s,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(de(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;a=d.start+d.chunk*p+d.chunk/2,c=Math.min(i,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),c=Math.min(i,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}class XU extends Pr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,s){const o=super.parsePrimitiveData(t,n,r,s);for(let i=0;i<o.length;i++)o[i]._custom=this.resolveDataElementOptions(i+r).radius;return o}parseArrayData(t,n,r,s){const o=super.parseArrayData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a[2],this.resolveDataElementOptions(i+r).radius)}return o}parseObjectData(t,n,r,s){const o=super.parseObjectData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a&&a.r&&+a.r,this.resolveDataElementOptions(i+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y),l=i._custom;return{label:r[t]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,s),u=i.axis,d=a.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!o&&this.getParsed(f),m={},y=m[u]=o?i.getPixelForDecimal(.5):i.getPixelForValue(p[u]),b=m[d]=o?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(b),l&&(m.options=c||this.resolveDataElementOptions(f,h.active?"active":s),o&&(m.options.radius=0)),this.updateElement(h,f,m,s)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=de(r&&r._custom,o),s}}function JU(e,t,n){let r=1,s=1,o=0,i=0;if(t<Ae){const a=e,c=a+t,l=Math.cos(a),u=Math.sin(a),d=Math.cos(c),f=Math.sin(c),h=(_,w,S)=>ui(_,a,c,!0)?1:Math.max(w,w*n,S,S*n),p=(_,w,S)=>ui(_,a,c,!0)?-1:Math.min(w,w*n,S,S*n),m=h(0,l,d),y=h(He,u,f),b=p(we,l,d),x=p(we+He,u,f);r=(m-b)/2,s=(y-x)/2,o=-(m+b)/2,i=-(y+x)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class Dh extends Pr{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,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,l)=>{const d=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||d.borderRadius),index:l}}):[]}},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,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(xe(r[t])){const{key:c="value"}=this._parsing;o=l=>+br(r[l],c)}let i,a;for(i=t,a=t+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return fn(this.options.rotation-90)}_getCircumference(){return fn(this.options.circumference)}_getRotationExtents(){let t=Ae,n=-Ae;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+i)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(cB(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=JU(d,u,c),y=(r.width-i)/f,b=(r.height-i)/h,x=Math.max(Math.min(y,b)/2,0),_=U0(this.options.radius,x),w=Math.max(_*c,0),S=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Ae)}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,l=i.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&l.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+r;++x){const _=this._circumference(x,o),w=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:h};y&&(S.options=m||this.resolveDataElementOptions(x,w.active?"active":s)),b+=_,this.updateElement(w,x,S,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ae*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,o,i,a,c;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),t=i.data,a=i.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++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(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yS extends Pr{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:s=[],_dataset:o}=n,i=this.chart._animationsDisabled;let{start:a,count:c}=X0(n,s,i);this._drawStart=a,this._drawCount=c,J0(n)&&(a=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=i.axis,h=a.axis,{spanGaps:p,segment:m}=this.options,y=Ys(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+r,_=t.length;let w=n>0&&this.getParsed(n-1);for(let S=0;S<_;++S){const C=t[S],k=b?C:{};if(S<n||S>=x){k.skip=!0;continue}const E=this.getParsed(S),P=ye(E[h]),O=k[f]=i.getPixelForValue(E[f],S),N=k[h]=o||P?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,E,c):E[h],S);k.skip=isNaN(O)||isNaN(N)||P,k.stop=S>0&&Math.abs(E[f]-w[f])>y,m&&(k.parsed=E,k.raw=l.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":s)),b||this.updateElement(C,S,k,s),w=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return r;const o=s[0].size(this.resolveDataElementOptions(0)),i=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class bS extends Pr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};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:s}}=t.legend.options;return n.labels.map((o,i)=>{const c=t.getDatasetMeta(0).controller.getStyle(i);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t].r,r.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),i=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-i)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,c=i.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,d=l.yCenter,f=l.getIndexAngle(0)-.5*we;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,s,m);for(p=n;p<n+r;p++){const y=t[p];let b=h,x=h+this._computeAngle(p,s,m),_=i.getDataVisibility(p)?l.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=x,o&&(c.animateScale&&(_=0),c.animateRotate&&(b=x=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,w,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?fn(this.resolveDataElementOptions(t,n).angle||r):0}}class QU extends Dh{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class e5 extends Pr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,t!=="resize"){const i=this.resolveDatasetElementOptions(t);this.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:i};this.updateElement(r,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,r,s){const o=this._cachedMeta.rScale,i=s==="reset";for(let a=n;a<n+r;a++){const c=t[a],l=this.resolveDataElementOptions(a,c.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=i?o.xCenter:u.x,f=i?o.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:l};this.updateElement(c,a,h,s)}}}class t5 extends Pr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y);return{label:r[t]||"",value:"("+a+", "+c+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:i}=X0(n,r,s);if(this._drawStart=o,this._drawCount=i,J0(n)&&(o=0,i=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=r;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,i,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),h=i.axis,p=a.axis,{spanGaps:m,segment:y}=this.options,b=Ys(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let _=n>0&&this.getParsed(n-1);for(let w=n;w<n+r;++w){const S=t[w],C=this.getParsed(w),k=x?S:{},E=ye(C[p]),P=k[h]=i.getPixelForValue(C[h],w),O=k[p]=o||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[p],w);k.skip=isNaN(P)||isNaN(O)||E,k.stop=w>0&&Math.abs(C[h]-_[h])>b,y&&(k.parsed=C,k.raw=l.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,S.active?"active":s)),x||this.updateElement(S,w,k,s),_=C}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const r=t.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),i=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,i)/2}}var n5=Object.freeze({__proto__:null,BarController:YU,BubbleController:XU,DoughnutController:Dh,LineController:yS,PieController:QU,PolarAreaController:bS,RadarController:e5,ScatterController:t5});function Nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ih{static override(t){Object.assign(Ih.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Nr()}parse(){return Nr()}format(){return Nr()}add(){return Nr()}diff(){return Nr()}startOf(){return Nr()}endOf(){return Nr()}}var r5={_date:Ih};function s5(e,t,n,r){const{controller:s,data:o,_sorted:i}=e,a=s._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&i&&o.length){const l=a._reversePixels?_B:Un;if(r){if(s._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=l(o,t,n-d),h=l(o,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=l(o,t,n);if(c){const{vScale:d}=s._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!ye(m[d.axis]));u.lo-=Math.max(0,h);const p=f.slice(u.hi).findIndex(m=>!ye(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Ol(e,t,n,r,s){const o=e.getSortedVisibleDatasetMetas(),i=n[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:d,hi:f}=s5(o[a],t,i,s);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,l,h)}}}function o5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const o=t?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function Mu(e,t,n,r,s){const o=[];return!s&&!e.isPointInArea(t)||Ol(e,n,t,function(a,c,l){!s&&!Wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function i5(e,t,n,r){let s=[];function o(i,a,c){const{startAngle:l,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:d}=q0(i,{x:t.x,y:t.y});ui(d,l,u)&&s.push({element:i,datasetIndex:a,index:c})}return Ol(e,n,t,o),s}function a5(e,t,n,r,s,o){let i=[];const a=o5(n);let c=Number.POSITIVE_INFINITY;function l(u,d,f){const h=u.inRange(t.x,t.y,s);if(r&&!h)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!h)return;const y=a(t,p);y<c?(i=[{element:u,datasetIndex:d,index:f}],c=y):y===c&&i.push({element:u,datasetIndex:d,index:f})}return Ol(e,n,t,l),i}function Au(e,t,n,r,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?i5(e,t,n,s):a5(e,t,n,r,s,o)}function gy(e,t,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return Ol(e,n,t,(c,l,u)=>{c[i]&&c[i](t[n],s)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(t.x,t.y,s))}),r&&!a?[]:o}var c5={modes:{index(e,t,n,r){const s=Ir(t,e),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i);if(a.length>0){const c=a[0].datasetIndex,l=e.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Mu(e,s,o,r,i)},nearest(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Au(e,s,o,n.intersect,r,i)},x(e,t,n,r){const s=Ir(t,e);return gy(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=Ir(t,e);return gy(e,s,"y",n.intersect,r)}}};const vS=["left","top","right","bottom"];function wo(e,t){return e.filter(n=>n.pos===t)}function yy(e,t){return e.filter(n=>vS.indexOf(n.pos)===-1&&n.box.axis===t)}function So(e,t){return e.sort((n,r)=>{const s=t?r:n,o=t?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function l5(e){const t=[];let n,r,s,o,i,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return t}function u5(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!vS.includes(s))continue;const i=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function d5(e,t){const n=u5(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let o,i,a;for(o=0,i=e.length;o<i;++o){a=e[o];const{fullSize:c}=a.box,l=n[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*r:c&&t.availableWidth,a.height=s):(a.width=r,a.height=u?u*s:c&&t.availableHeight)}return n}function f5(e){const t=l5(e),n=So(t.filter(l=>l.box.fullSize),!0),r=So(wo(t,"left"),!0),s=So(wo(t,"right")),o=So(wo(t,"top"),!0),i=So(wo(t,"bottom")),a=yy(t,"x"),c=yy(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(c).concat(i).concat(a),chartArea:wo(t,"chartArea"),vertical:r.concat(s).concat(c),horizontal:o.concat(i).concat(a)}}function by(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function xS(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 h5(e,t,n,r){const{pos:s,box:o}=n,i=e.maxPadding;if(!xe(s)){n.size&&(e[s]-=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[s]+=n.size}o.getPadding&&xS(i,o.getPadding());const a=Math.max(0,t.outerWidth-by(i,e,"left","right")),c=Math.max(0,t.outerHeight-by(i,e,"top","bottom")),l=a!==e.w,u=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function p5(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function m5(e,t){const n=t.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(t[i],n[i])}),o}return r(e?["left","right"]:["top","bottom"])}function Do(e,t,n,r){const s=[];let o,i,a,c,l,u;for(o=0,i=e.length,l=0;o<i;++o){a=e[o],c=a.box,c.update(a.width||t.w,a.height||t.h,m5(a.horizontal,t));const{same:d,other:f}=h5(t,n,a,r);l|=d&&s.length,u=u||f,c.fullSize||s.push(a)}return l&&Do(s,t,n,r)||u}function ga(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function vy(e,t,n,r){const s=n.padding;let{x:o,y:i}=t;for(const a of e){const c=a.box,l=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const d=t.w*u,f=l.size||c.height;li(l.start)&&(i=l.start),c.fullSize?ga(c,s.left,i,n.outerWidth-s.right-s.left,f):ga(c,t.left+l.placed,i,d,f),l.start=i,l.placed+=d,i=c.bottom}else{const d=t.h*u,f=l.size||c.width;li(l.start)&&(o=l.start),c.fullSize?ga(c,o,s.top,f,n.outerHeight-s.bottom-s.top):ga(c,o,t.top+l.placed,f,d),l.start=o,l.placed+=d,o=c.right}}t.x=o,t.y=i}var bt={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 s=xt(e.options.layout.padding),o=Math.max(t-s.width,0),i=Math.max(n-s.height,0),a=f5(e.boxes),c=a.vertical,l=a.horizontal;Ce(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/u,hBoxMaxHeight:i/2}),f=Object.assign({},s);xS(f,xt(r));const h=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),p=d5(c.concat(l),d);Do(a.fullSize,h,d,p),Do(c,h,d,p),Do(l,h,d,p)&&Do(c,h,d,p),p5(h),vy(a.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,vy(a.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ce(a.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class _S{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class g5 extends _S{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Va="$chartjs",y5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xy=e=>e===null||e==="";function b5(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Va]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",xy(s)){const o=ry(e,"width");o!==void 0&&(e.width=o)}if(xy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ry(e,"height");o!==void 0&&(e.height=o)}return e}const wS=pU?{passive:!0}:!1;function v5(e,t,n){e&&e.addEventListener(t,n,wS)}function x5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,wS)}function _5(e,t){const n=y5[e.type]||e.type,{x:r,y:s}=Ir(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Tc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function w5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.addedNodes,r),i=i&&!Tc(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function S5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.removedNodes,r),i=i&&!Tc(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fi=new Map;let _y=0;function SS(){const e=window.devicePixelRatio;e!==_y&&(_y=e,fi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function E5(e,t){fi.size||window.addEventListener("resize",SS),fi.set(e,t)}function k5(e){fi.delete(e),fi.size||window.removeEventListener("resize",SS)}function C5(e,t,n){const r=e.canvas,s=r&&Nh(r);if(!s)return;const o=Y0((a,c)=>{const l=s.clientWidth;n(a,c),l<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return i.observe(s),E5(e,o),i}function Nu(e,t,n){n&&n.disconnect(),t==="resize"&&k5(e)}function R5(e,t,n){const r=e.canvas,s=Y0(o=>{e.ctx!==null&&n(_5(o,e))},e);return v5(r,t,s),s}class P5 extends _S{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(b5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Va])return!1;const r=n[Va].initial;["height","width"].forEach(o=>{const i=r[o];ye(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Va],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),i={attach:w5,detach:S5,resize:C5}[n]||R5;s[n]=i(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Nu,detach:Nu,resize:Nu}[n]||x5)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return hU(t,n,r,s)}isAttached(t){const n=t&&Nh(t);return!!(n&&n.isConnected)}}function O5(e){return!Ah()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?g5:P5}let Jn=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 Ys(this.x)&&Ys(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}};function T5(e,t){const n=e.options.ticks,r=M5(e),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?N5(t):[],i=o.length,a=o[0],c=o[i-1],l=[];if(i>s)return D5(t,l,o,i/s),l;const u=A5(o,t,s);if(i>0){let d,f;const h=i>1?Math.round((c-a)/(i-1)):null;for(ya(t,l,u,ye(h)?0:a-h,a),d=0,f=i-1;d<f;d++)ya(t,l,u,o[d],o[d+1]);return ya(t,l,u,c,ye(h)?t.length:c+h),l}return ya(t,l,u),l}function M5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function A5(e,t,n){const r=I5(e),s=t.length/n;if(!r)return Math.max(s,1);const o=gB(r);for(let i=0,a=o.length-1;i<a;i++){const c=o[i];if(c>s)return c}return Math.max(s,1)}function N5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function D5(e,t,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<e.length;i++)i===o&&(t.push(e[i]),s++,o=n[s*r])}function ya(e,t,n,r,s){const o=de(r,0),i=Math.min(de(s,e.length),e.length);let a=0,c,l,u;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(l=Math.max(o,0);l<i;l++)l===u&&(t.push(e[l]),a++,u=Math.round(o+a*n))}function I5(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 j5=e=>e==="left"?"right":e==="right"?"left":e,wy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Sy=(e,t)=>Math.min(t||e,e);function Ey(e,t){const n=[],r=e.length/t,s=e.length;let o=0;for(;o<s;o+=r)n.push(e[Math.floor(o)]);return n}function L5(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),o=e._startPixel,i=e._endPixel,a=1e-6;let c=e.getPixelForTick(s),l;if(!(n&&(r===1?l=Math.max(c-o,i-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>i+a)))return c}function F5(e,t){Ce(e,n=>{const r=n.gc,s=r.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Eo(e){return e.drawTicks?e.tickLength:0}function ky(e,t){if(!e.display)return 0;const n=rt(e.font,t),r=xt(e.padding);return(ze(e.text)?e.text.length:1)*n.lineHeight+r.height}function z5(e,t){return Rr(e,{scale:t,type:"scale"})}function $5(e,t,n){return Rr(e,{tick:n,index:t,type:"tick"})}function V5(e,t,n){let r=Ch(e);return(n&&t!=="right"||!n&&t==="right")&&(r=j5(r)),r}function B5(e,t,n,r){const{top:s,left:o,bottom:i,right:a,chart:c}=e,{chartArea:l,scales:u}=c;let d=0,f,h,p;const m=i-s,y=a-o;if(e.isHorizontal()){if(h=ht(r,o,a),xe(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+m-t}else n==="center"?p=(l.bottom+l.top)/2+m-t:p=wy(e,n,t);f=a-o}else{if(xe(n)){const b=Object.keys(n)[0],x=n[b];h=u[b].getPixelForValue(x)-y+t}else n==="center"?h=(l.left+l.right)/2-y+t:h=wy(e,n,t);p=ht(r,i,s),d=n==="left"?-He:He}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class hs extends Jn{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:s}=this;return t=Ft(t,Number.POSITIVE_INFINITY),n=Ft(n,Number.NEGATIVE_INFINITY),r=Ft(r,Number.POSITIVE_INFINITY),s=Ft(s,Number.NEGATIVE_INFINITY),{min:Ft(t,r),max:Ft(n,s),minDefined:We(t),maxDefined:We(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)i=a[c].controller.getMinMax(this,t),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Ft(n,Ft(r,n)),max:Ft(r,Ft(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(){Me(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.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=HB(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Ey(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=T5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&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(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(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(){Me(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Me(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r],o.label=Me(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Sy(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,c,l;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=at(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),c=this.maxHeight-Eo(t.grid)-n.padding-ky(t.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),i=Eh(Math.min(Math.asin(at((u.highest.height+6)/a,-1,1)),Math.asin(at(c/l,-1,1))-Math.asin(at(f/l,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const c=ky(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Eo(o)+c):(t.height=this.maxHeight,t.width=Eo(o)+c),r.display&&this.ticks.length){const{first:l,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=fn(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const b=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(l,u,y,m)}}this._handleMargins(),a?(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,s){const{ticks:{align:o,padding:i},position:a}=this.options,c=this.labelRotation!==0,l=a!=="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,h=0;c?l?(f=s*t.width,h=r*n.height):(f=r*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+i)*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+i,this.paddingBottom=d+i}}_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(){Me(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++)ye(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=Ey(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],c=Math.floor(n/Sy(n,r));let l=0,u=0,d,f,h,p,m,y,b,x,_,w,S;for(d=0;d<n;d+=c){if(p=t[d].label,m=this._resolveTickFontOptions(d),s.font=y=m.string,b=o[y]=o[y]||{data:{},gc:[]},x=m.lineHeight,_=w=0,!ye(p)&&!ze(p))_=Pc(s,b.data,b.gc,_,p),w=x;else if(ze(p))for(f=0,h=p.length;f<h;++f)S=p[f],!ye(S)&&!ze(S)&&(_=Pc(s,b.data,b.gc,_,S),w+=x);i.push(_),a.push(w),l=Math.max(_,l),u=Math.max(w,u)}F5(o,n);const C=i.indexOf(l),k=a.indexOf(u),E=P=>({width:i[P]||0,height:a[P]||0});return{first:E(0),last:E(n-1),widest:E(C),highest:E(k),widths:i,heights:a}}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 xB(this._alignToPixels?Ar(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=$5(this.getContext(),t,r))}return this.$context||(this.$context=z5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=fn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=t.autoSkipPadding||0,a=o?o.widest.width+i:0,c=o?o.highest.height+i:0;return this.isHorizontal()?c*r>a*s?a/r:c/s:c*s<a*r?c/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=Eo(o),h=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,b=function(D){return Ar(r,D,m)};let x,_,w,S,C,k,E,P,O,N,A,j;if(i==="top")x=b(this.bottom),k=this.bottom-f,P=x-y,N=b(t.top)+y,j=t.bottom;else if(i==="bottom")x=b(this.top),N=t.top,j=b(t.bottom)-y,k=x+y,P=this.top+f;else if(i==="left")x=b(this.right),C=this.right-f,E=x-y,O=b(t.left)+y,A=t.right;else if(i==="right")x=b(this.left),O=t.left,A=b(t.right)-y,C=x+y,E=this.left+f;else if(n==="x"){if(i==="center")x=b((t.top+t.bottom)/2+.5);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}N=t.top,j=t.bottom,k=x+y,P=k+f}else if(n==="y"){if(i==="center")x=b((t.left+t.right)/2);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}C=x-y,E=C-f,O=t.left,A=t.right}const $=de(s.ticks.maxTicksLimit,d),q=Math.max(1,Math.ceil(d/$));for(_=0;_<d;_+=q){const D=this.getContext(_),H=o.setContext(D),F=a.setContext(D),W=H.lineWidth,se=H.color,I=F.dash||[],Y=F.dashOffset,K=H.tickWidth,Z=H.tickColor,oe=H.tickBorderDash||[],ce=H.tickBorderDashOffset;w=L5(this,_,c),w!==void 0&&(S=Ar(r,w,W),l?C=E=O=A=S:k=P=N=j=S,h.push({tx1:C,ty1:k,tx2:E,ty2:P,x1:O,y1:N,x2:A,y2:j,width:W,color:se,borderDash:I,borderDashOffset:Y,tickWidth:K,tickColor:Z,tickBorderDash:oe,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:d}=o,f=Eo(r.grid),h=f+u,p=d?-u:h,m=-fn(this.labelRotation),y=[];let b,x,_,w,S,C,k,E,P,O,N,A,j="middle";if(s==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(n==="x"){if(s==="center")C=(t.top+t.bottom)/2+h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];C=this.chart.scales[q].getPixelForValue(D)+h}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(t.left+t.right)/2-h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];S=this.chart.scales[q].getPixelForValue(D)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?j="top":c==="end"&&(j="bottom"));const $=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){_=a[b],w=_.label;const q=o.setContext(this.getContext(b));E=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,N=ze(w)?w.length:1;const D=N/2,H=q.color,F=q.textStrokeColor,W=q.textStrokeWidth;let se=k;i?(S=E,k==="inner"&&(b===x-1?se=this.options.reverse?"left":"right":b===0?se=this.options.reverse?"right":"left":se="center"),s==="top"?l==="near"||m!==0?A=-N*O+O/2:l==="center"?A=-$.highest.height/2-D*O+O:A=-$.highest.height+O/2:l==="near"||m!==0?A=O/2:l==="center"?A=$.highest.height/2-D*O:A=$.highest.height-N*O,d&&(A*=-1),m!==0&&!q.showLabelBackdrop&&(S+=O/2*Math.sin(m))):(C=E,A=(1-N)*O/2);let I;if(q.showLabelBackdrop){const Y=xt(q.backdropPadding),K=$.heights[b],Z=$.widths[b];let oe=A-Y.top,ce=0-Y.left;switch(j){case"middle":oe-=K/2;break;case"bottom":oe-=K;break}switch(k){case"center":ce-=Z/2;break;case"right":ce-=Z;break;case"inner":b===x-1?ce-=Z:b>0&&(ce-=Z/2);break}I={left:ce,top:oe,width:Z+Y.width,height:K+Y.height,color:q.backdropColor}}y.push({label:w,font:P,textOffset:A,options:{rotation:m,color:H,strokeColor:F,strokeWidth:W,textAlign:se,textBaseline:j,translation:[S,C],backdrop:I}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-fn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=t+o,c=i.widest.width;let l,u;return n==="left"?s?(u=this.right+o,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?s?(u=this.left+o,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,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:s,width:o,height:i}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,o,i),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,i;const a=(c,l,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(c.x,c.y),r.lineTo(l.x,l.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const c=s[o];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,d,f;this.isHorizontal()?(l=Ar(t,this.left,i)-i/2,u=Ar(t,this.right,a)+a/2,d=f=c):(d=Ar(t,this.top,i)-i/2,f=Ar(t,this.bottom,a)+a/2,l=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(l,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Cl(r,s);const o=this.getLabelItems(t);for(const i of o){const a=i.options,c=i.font,l=i.label,u=i.textOffset;cs(r,l,0,u,c,a)}s&&Rl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=rt(r.font),i=xt(r.padding),a=r.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||xe(n)?(c+=i.bottom,ze(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:l,titleY:u,maxWidth:d,rotation:f}=B5(this,c,n,a);cs(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:V5(a,n,s),textBaseline:"middle",translation:[l,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=de(t.grid&&t.grid.z,-1),s=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return rt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ba{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;H5(n)&&(r=this.register(n));const s=this.items,o=t.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,U5(t,i,r),this.override&&$e.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in $e[s]&&(delete $e[s][r],this.override&&delete as[r])}}function U5(e,t,n){const r=ci(Object.create(null),[n?$e.get(n):{},$e.get(t),e.defaults]);$e.set(t,r),e.defaultRoutes&&W5(t,e.defaultRoutes),e.descriptors&&$e.describe(t,e.descriptors)}function W5(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),o=[e].concat(r).join("."),i=t[n].split("."),a=i.pop(),c=i.join(".");$e.route(o,s,c,a)})}function H5(e){return"id"in e&&"defaults"in e}class q5{constructor(){this.controllers=new ba(Pr,"datasets",!0),this.elements=new ba(Jn,"elements"),this.plugins=new ba(Object,"plugins"),this.scales=new ba(hs,"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(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Ce(s,i=>{const a=r||this._getRegistryForType(i);this._exec(t,a,i)})})}_exec(t,n,r){const s=Sh(t);Me(r["before"+s],[],r),n[t](r),Me(r["after"+s],[],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 s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var wn=new q5;class K5{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,n,r,s){s=s||{};for(const o of t){const i=o.plugin,a=i[r],c=[n,s,o.options];if(Me(a,c,i)===!1&&s.cancelable)return!1}return!0}invalidate(){ye(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,s=de(r.options&&r.options.plugins,{}),o=Z5(r);return s===!1&&!n?[]:Y5(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(c=>a.plugin.id===c.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function Z5(e){const t={},n=[],r=Object.keys(wn.plugins.items);for(let o=0;o<r.length;o++)n.push(wn.getPlugin(r[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}function G5(e,t){return!t&&e===!1?null:e===!0?{}:e}function Y5(e,{plugins:t,localIds:n},r,s){const o=[],i=e.getContext();for(const a of t){const c=a.id,l=G5(r[c],s);l!==null&&o.push({plugin:a,options:X5(e.config,{plugin:a,local:n[c]},l,i)})}return o}function X5(e,{plugin:t,local:n},r,s){const o=e.pluginScopeKeys(t),i=e.getOptionScopes(r,o);return n&&t.defaults&&i.push(t.defaults),e.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wd(e,t){const n=$e.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function J5(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Q5(e,t){return e===t?"_index_":"_value_"}function Cy(e){if(e==="x"||e==="y"||e==="r")return e}function eW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hd(e,...t){if(Cy(e))return e;for(const n of t){const r=n.axis||eW(n.position)||e.length>1&&Cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ry(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function tW(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 Ry(e,"x",n[0])||Ry(e,"y",n[0])}return{}}function nW(e,t){const n=as[e.type]||{scales:{}},r=t.scales||{},s=Wd(e.type,t),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Hd(i,a,tW(i,e),$e.scales[a.type]),l=Q5(c,s),u=n.scales||{};o[i]=Vo(Object.create(null),[{axis:c},a,u[c],u[l]])}),e.data.datasets.forEach(i=>{const a=i.type||e.type,c=i.indexAxis||Wd(a,t),u=(as[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=J5(d,c),h=i[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),Vo(o[h],[{axis:f},r[h],u[d]])})}),Object.keys(o).forEach(i=>{const a=o[i];Vo(a,[$e.scales[a.type],$e.scale])}),o}function ES(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=nW(e,t)}function kS(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function rW(e){return e=e||{},e.data=kS(e.data),ES(e),e}const Py=new Map,CS=new Set;function va(e,t){let n=Py.get(e);return n||(n=t(),Py.set(e,n),CS.add(n)),n}const ko=(e,t,n)=>{const r=br(t,n);r!==void 0&&e.add(r)};class sW{constructor(t){this._config=rW(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=kS(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(),ES(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return va(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return va(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return va(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return va(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:o}=this,i=this._cachedScopes(t,r),a=i.get(n);if(a)return a;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(d=>ko(c,t,d))),u.forEach(d=>ko(c,s,d)),u.forEach(d=>ko(c,as[o]||{},d)),u.forEach(d=>ko(c,$e,d)),u.forEach(d=>ko(c,Bd,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),CS.has(n)&&i.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,as[n]||{},$e.datasets[n]||{},{type:n},$e,Bd]}resolveNamedOptions(t,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=Oy(this._resolverCache,t,s);let c=i;if(iW(i,n)){o.$shared=!1,r=vr(r)?r():r;const l=this.createResolver(t,r,a);c=Xs(i,r,l)}for(const l of n)o[l]=c[l];return o}createResolver(t,n,r=[""],s){const{resolver:o}=Oy(this._resolverCache,t,r);return xe(n)?Xs(o,n,void 0,s):o}}function Oy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let o=r.get(s);return o||(o={resolver:Oh(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const oW=e=>xe(e)&&Object.getOwnPropertyNames(e).some(t=>vr(e[t]));function iW(e,t){const{isScriptable:n,isIndexable:r}=nS(e);for(const s of t){const o=n(s),i=r(s),a=(i||o)&&e[s];if(o&&(vr(a)||oW(a))||i&&ze(a))return!0}return!1}var aW="4.5.1";const cW=["top","bottom","left","right","chartArea"];function Ty(e,t){return e==="top"||e==="bottom"||cW.indexOf(e)===-1&&t==="x"}function My(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ay(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Me(n&&n.onComplete,[e],t)}function lW(e){const t=e.chart,n=t.options.animation;Me(n&&n.onProgress,[e],t)}function RS(e){return Ah()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ba={},Ny=e=>{const t=RS(e);return Object.values(Ba).filter(n=>n.canvas===t).pop()};function uW(e,t,n){const r=Object.keys(e);for(const s of r){const o=+s;if(o>=t){const i=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=i)}}}function dW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Ti=class{static defaults=$e;static instances=Ba;static overrides=as;static registry=wn;static version=aW;static getChart=Ny;static register(...t){wn.add(...t),Dy()}static unregister(...t){wn.remove(...t),Dy()}constructor(t,n){const r=this.config=new sW(n),s=RS(t),o=Ny(s);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 i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||O5(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=aB(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=i,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 K5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=EB(d=>this.update(d),i.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ln.listen(this,"complete",Ay),Ln.listen(this,"progress",lW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return ye(t)?n&&o?o:s?r/s: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 wn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ny(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qg(this.canvas,this.ctx),this}stop(){return Ln.stop(this),this}resize(t,n){Ln.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,ny(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),Me(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ce(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],c=Hd(i,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Ce(o,i=>{const a=i.options,c=a.id,l=Hd(c,a),u=de(a.type,i.dtype);(a.position===void 0||Ty(a.position,l)!==Ty(i.dposition))&&(a.position=i.dposition),s[c]=!0;let d=null;if(c in r&&r[c].type===u)d=r[c];else{const f=wn.getScale(u);d=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ce(s,(i,a)=>{i||delete r[a]}),Ce(r,i=>{bt.configure(this,i,i.options),bt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(My("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||Wd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=wn.getController(a),{datasetElementType:l,dataElementType:u}=$e.datasets[a];Object.assign(c,{dataElementType:wn.getElement(u),datasetElementType:l&&wn.getElement(l)}),i.controller=new c(this,r),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Ce(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()),s=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 i=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:d}=this.getDatasetMeta(l),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),i=Math.max(+d.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||Ce(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(My("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ce(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;uW(t,s,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Wg(s,r(o)))return;return Array.from(s).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;bt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ce(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._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,vr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ln.has(this)?this.attached&&!Ln.running(this)&&Ln.start(this):(this.draw(),Ay({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}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 s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!t||i.visible)&&r.push(i)}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},s=hS(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Cl(n,s),t.controller.draw(),s&&Rl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const o=c5.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=Rr(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 s=r?"show":"hide",o=this.getDatasetMeta(t),i=o.controller._resolveAnimations(void 0,s);li(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?s: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(),Ln.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(),Qg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ba[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,i)=>{n.addEventListener(this,o,i),t[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};Ce(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){Ce(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ce(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let o,i,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){i=t[a];const l=i&&this.getDatasetMeta(i.datasetIndex).controller;l&&l[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!kc(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 s=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),i=o(n,t),a=r?t:o(t,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(t,s,r,i),c=hB(t),l=dW(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Me(o.onHover,[t,a,this],this),c&&Me(o.onClick,[t,a,this],this));const u=!kc(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=l,u}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Dy(){return Ce(Ti.instances,e=>e._plugins.invalidate())}function fW(e,t,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/i,mt(r-n));if(e.beginPath(),e.arc(s,o,i-l/2,r+d/2,n-d/2),a>0){const f=Math.min(l/a,mt(r-n));e.arc(s,o,a+l/2,n-f/2,r+f/2,!0)}else{const f=Math.min(l/2,i*mt(r-n));if(u==="round")e.arc(s,o,f,n-we/2,r+we/2,!0);else if(u==="bevel"){const h=2*f*f,p=-h*Math.cos(n+we/2)+s,m=-h*Math.sin(n+we/2)+o,y=h*Math.cos(r+we/2)+s,b=h*Math.sin(r+we/2)+o;e.lineTo(p,m),e.lineTo(y,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function hW(e,t,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:c}=t;let l=s/a;e.beginPath(),e.arc(o,i,a,r-l,n+l),c>s?(l=s/c,e.arc(o,i,c,n+l,r-l,!0)):e.arc(o,i,s,n+He,r-He),e.closePath(),e.clip()}function pW(e){return Ph(e,["outerStart","outerEnd","innerStart","innerEnd"])}function mW(e,t,n,r){const s=pW(e.options.borderRadius),o=(n-t)/2,i=Math.min(o,r*t/2),a=c=>{const l=(n-Math.min(o,c))*r/2;return at(c,0,Math.min(o,l))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:at(s.innerStart,0,i),innerEnd:at(s.innerEnd,0,i)}}function ws(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Mc(e,t,n,r,s,o){const{x:i,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0;let h=0;const p=s-c;if(r){const q=u>0?u-r:0,D=d>0?d-r:0,H=(q+D)/2,F=H!==0?p*H/(H+r):p;h=(p-F)/2}const m=Math.max(.001,p*d-n/we)/d,y=(p-m)/2,b=c+y+h,x=s-y-h,{outerStart:_,outerEnd:w,innerStart:S,innerEnd:C}=mW(t,f,d,x-b),k=d-_,E=d-w,P=b+_/k,O=x-w/E,N=f+S,A=f+C,j=b+S/N,$=x-C/A;if(e.beginPath(),o){const q=(P+O)/2;if(e.arc(i,a,d,P,q),e.arc(i,a,d,q,O),w>0){const W=ws(E,O,i,a);e.arc(W.x,W.y,w,O,x+He)}const D=ws(A,x,i,a);if(e.lineTo(D.x,D.y),C>0){const W=ws(A,$,i,a);e.arc(W.x,W.y,C,x+He,$+Math.PI)}const H=(x-C/f+(b+S/f))/2;if(e.arc(i,a,f,x-C/f,H,!0),e.arc(i,a,f,H,b+S/f,!0),S>0){const W=ws(N,j,i,a);e.arc(W.x,W.y,S,j+Math.PI,b-He)}const F=ws(k,b,i,a);if(e.lineTo(F.x,F.y),_>0){const W=ws(k,P,i,a);e.arc(W.x,W.y,_,b-He,P)}}else{e.moveTo(i,a);const q=Math.cos(P)*d+i,D=Math.sin(P)*d+a;e.lineTo(q,D);const H=Math.cos(O)*d+i,F=Math.sin(O)*d+a;e.lineTo(H,F)}e.closePath()}function gW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=t;let c=t.endAngle;if(o){Mc(e,t,n,r,c,s);for(let l=0;l<o;++l)e.fill();isNaN(a)||(c=i+(a%Ae||Ae))}return Mc(e,t,n,r,c,s),e.fill(),c}function yW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:h}=c,p=c.borderAlign==="inner";if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,p?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Mc(e,t,n,r,m,s);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(m=i+(a%Ae||Ae))}p&&hW(e,t,m),c.selfJoin&&m-i>=we&&h===0&&u!=="miter"&&fW(e,t,m),o||(Mc(e,t,n,r,m,s),e.stroke())}class bW extends Jn{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 s=this.getProps(["x","y"],r),{angle:o,distance:i}=q0(s,{x:t,y:n}),{startAngle:a,endAngle:c,innerRadius:l,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,h=de(d,c-a),p=ui(o,a,c)&&a!==c,m=h>=Ae||p,y=Bn(i,l+f,u+f);return m&&y}getCenterPoint(t){const{x:n,y:r,startAngle:s,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:l}=this.options,u=(s+o)/2,d=(i+a+l+c)/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,s=(n.offset||0)/4,o=(n.spacing||0)/2,i=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Ae?Math.floor(r/Ae):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const c=1-Math.sin(Math.min(we,r||0)),l=s*c;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,gW(t,this,l,o,i),yW(t,this,l,o,i),t.restore()}}function PS(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function vW(e,t,n){e.lineTo(n.x,n.y)}function xW(e){return e.stepped?jB:e.tension||e.cubicInterpolationMode==="monotone"?LB:vW}function OS(e,t,n={}){const r=e.length,{start:s=0,end:o=r-1}=n,{start:i,end:a}=t,c=Math.max(s,i),l=Math.min(o,a),u=s<i&&o<i||s>a&&o>a;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function _W(e,t,n,r){const{points:s,options:o}=t,{count:i,start:a,loop:c,ilen:l}=OS(s,n,r),u=xW(o);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=l;++h)p=s[(a+(f?l-h:h))%i],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,o.stepped),m=p);return c&&(p=s[(a+(f?l:0))%i],u(e,m,p,f,o.stepped)),!!c}function wW(e,t,n,r){const s=t.points,{count:o,start:i,ilen:a}=OS(s,n,r),{move:c=!0,reverse:l}=r||{};let u=0,d=0,f,h,p,m,y,b;const x=w=>(i+(l?a-w:w))%o,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,b))};for(c&&(h=s[x(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=s[x(f)],h.skip)continue;const w=h.x,S=h.y,C=w|0;C===p?(S<m?m=S:S>y&&(y=S),u=(d*u+w)/++d):(_(),e.lineTo(w,S),p=C,d=0,m=y=S),b=S}_()}function qd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?wW:_W}function SW(e){return e.stepped?mU:e.tension||e.cubicInterpolationMode==="monotone"?gU:jr}function EW(e,t,n,r){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,r)&&s.closePath()),PS(e,t.options),e.stroke(s)}function kW(e,t,n,r){const{segments:s,options:o}=t,i=qd(t);for(const a of s)PS(e,o,a.style),e.beginPath(),i(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const CW=typeof Path2D=="function";function RW(e,t,n,r){CW&&!t.options.segment?EW(e,t,n,r):kW(e,t,n,r)}class Mi extends Jn{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 s=r.spanGaps?this._loop:this._fullLoop;aU(this._points,r,t,s,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=wU(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,s=t[n],o=this.points,i=fS(this,{property:n,start:s,end:s});if(!i.length)return;const a=[],c=SW(r);let l,u;for(l=0,u=i.length;l<u;++l){const{start:d,end:f}=i[l],h=o[d],p=o[f];if(h===p){a.push(h);continue}const m=Math.abs((s-h[n])/(p[n]-h[n])),y=c(h,p,m,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return qd(this)(t,this,n,r)}path(t,n,r){const s=this.segments,o=qd(this);let i=this._loop;n=n||0,r=r||this.points.length-n;for(const a of s)i&=o(t,this,a,{start:n,end:n+r-1});return!!i}draw(t,n,r,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),RW(t,this,r,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Iy(e,t,n,r){const s=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<s.radius+s.hitRadius}class TS extends Jn{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 s=this.options,{x:o,y:i}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-i,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Iy(this,t,"x",n)}inYRange(t,n){return Iy(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||!Wn(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,Ud(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function MS(e,t){const{x:n,y:r,base:s,width:o,height:i}=e.getProps(["x","y","base","width","height"],t);let a,c,l,u,d;return e.horizontal?(d=i/2,a=Math.min(n,s),c=Math.max(n,s),l=r-d,u=r+d):(d=o/2,a=n-d,c=n+d,l=Math.min(r,s),u=Math.max(r,s)),{left:a,top:l,right:c,bottom:u}}function lr(e,t,n,r){return e?0:at(t,n,r)}function PW(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,o=tS(r);return{t:lr(s.top,o.top,0,n),r:lr(s.right,o.right,0,t),b:lr(s.bottom,o.bottom,0,n),l:lr(s.left,o.left,0,t)}}function OW(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Zr(s),i=Math.min(t,n),a=e.borderSkipped,c=r||xe(s);return{topLeft:lr(!c||a.top||a.left,o.topLeft,0,i),topRight:lr(!c||a.top||a.right,o.topRight,0,i),bottomLeft:lr(!c||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:lr(!c||a.bottom||a.right,o.bottomRight,0,i)}}function TW(e){const t=MS(e),n=t.right-t.left,r=t.bottom-t.top,s=PW(e,n/2,r/2),o=OW(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Du(e,t,n,r){const s=t===null,o=n===null,a=e&&!(s&&o)&&MS(e,r);return a&&(s||Bn(t,a.left,a.right))&&(o||Bn(n,a.top,a.bottom))}function MW(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function AW(e,t){e.rect(t.x,t.y,t.w,t.h)}function Iu(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+o,h:e.h+i,radius:e.radius}}class NW extends Jn{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:s}}=this,{inner:o,outer:i}=TW(this),a=MW(i.radius)?di:AW;t.save(),(i.w!==o.w||i.h!==o.h)&&(t.beginPath(),a(t,Iu(i,n,o)),t.clip(),a(t,Iu(o,-n,i)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Iu(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Du(this,t,n,r)}inXRange(t,n){return Du(this,t,null,n)}inYRange(t,n){return Du(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var DW=Object.freeze({__proto__:null,ArcElement:bW,BarElement:NW,LineElement:Mi,PointElement:TS});const Kd=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],jy=Kd.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function AS(e){return Kd[e%Kd.length]}function NS(e){return jy[e%jy.length]}function IW(e,t){return e.borderColor=AS(t),e.backgroundColor=NS(t),++t}function jW(e,t){return e.backgroundColor=e.data.map(()=>AS(t++)),t}function LW(e,t){return e.backgroundColor=e.data.map(()=>NS(t++)),t}function FW(e){let t=0;return(n,r)=>{const s=e.getDatasetMeta(r).controller;s instanceof Dh?t=jW(n,t):s instanceof bS?t=LW(n,t):s&&(t=IW(n,t))}}function Ly(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function zW(e){return e&&(e.borderColor||e.backgroundColor)}function $W(){return $e.borderColor!=="rgba(0,0,0,0.1)"||$e.backgroundColor!=="rgba(0,0,0,0.1)"}var VW={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:s}=e.config,{elements:o}=s,i=Ly(r)||zW(s)||o&&Ly(o)||$W();if(!n.forceOverride&&i)return;const a=FW(e);r.forEach(a)}};function BW(e,t,n,r,s){const o=s.samples||r;if(o>=n)return e.slice(t,t+n);const i=[],a=(n-2)/(o-2);let c=0;const l=t+n-1;let u=t,d,f,h,p,m;for(i[c++]=e[u],d=0;d<o-2;d++){let y=0,b=0,x;const _=Math.floor((d+1)*a)+1+t,w=Math.min(Math.floor((d+2)*a)+1,n)+t,S=w-_;for(x=_;x<w;x++)y+=e[x].x,b+=e[x].y;y/=S,b/=S;const C=Math.floor(d*a)+1+t,k=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:E,y:P}=e[u];for(h=p=-1,x=C;x<k;x++)p=.5*Math.abs((E-y)*(e[x].y-P)-(E-e[x].x)*(b-P)),p>h&&(h=p,f=e[x],m=x);i[c++]=f,u=m}return i[c++]=e[l],i}function UW(e,t,n,r){let s=0,o=0,i,a,c,l,u,d,f,h,p,m;const y=[],b=t+n-1,x=e[t].x,w=e[b].x-x;for(i=t;i<t+n;++i){a=e[i],c=(a.x-x)/w*r,l=a.y;const S=c|0;if(S===u)l<p?(p=l,d=i):l>m&&(m=l,f=i),s=(o*s+a.x)/++o;else{const C=i-1;if(!ye(d)&&!ye(f)){const k=Math.min(d,f),E=Math.max(d,f);k!==h&&k!==C&&y.push({...e[k],x:s}),E!==h&&E!==C&&y.push({...e[E],x:s})}i>0&&C!==h&&y.push(e[C]),y.push(a),u=S,o=0,p=m=l,d=f=h=i}}return y}function DS(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Fy(e){e.data.datasets.forEach(t=>{DS(t)})}function WW(e,t){const n=t.length;let r=0,s;const{iScale:o}=e,{min:i,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(r=at(Un(t,o.axis,i).lo,0,n-1)),l?s=at(Un(t,o.axis,a).hi+1,r,n)-r:s=n-r,{start:r,count:s}}var HW={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Fy(e);return}const r=e.width;e.data.datasets.forEach((s,o)=>{const{_data:i,indexAxis:a}=s,c=e.getDatasetMeta(o),l=i||s.data;if(No([a,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=WW(c,l);const h=n.threshold||4*r;if(f<=h){DS(s);return}ye(i)&&(s._data=l,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=BW(l,d,f,r,n);break;case"min-max":p=UW(l,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Fy(e)}};function qW(e,t,n){const r=e.segments,s=e.points,o=t.points,i=[];for(const a of r){let{start:c,end:l}=a;l=Tl(c,l,s);const u=Zd(n,s[c],s[l],a.loop);if(!t.segments){i.push({source:a,target:u,start:s[c],end:s[l]});continue}const d=fS(t,u);for(const f of d){const h=Zd(n,o[f.start],o[f.end],f.loop),p=dS(a,s,h);for(const m of p)i.push({source:m,target:f,start:{[n]:zy(u,h,"start",Math.max)},end:{[n]:zy(u,h,"end",Math.min)}})}}return i}function Zd(e,t,n,r){if(r)return;let s=t[e],o=n[e];return e==="angle"&&(s=mt(s),o=mt(o)),{property:e,start:s,end:o}}function KW(e,t){const{x:n=null,y:r=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:i,end:a})=>{a=Tl(i,a,s);const c=s[i],l=s[a];r!==null?(o.push({x:c.x,y:r}),o.push({x:l.x,y:r})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:l.y}))}),o}function Tl(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function IS(e,t){let n=[],r=!1;return ze(e)?(r=!0,n=e):n=KW(e,t),n.length?new Mi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function $y(e){return e&&e.fill!==!1}function ZW(e,t,n){let s=e[t].fill;const o=[t];let i;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!We(s))return s;if(i=e[s],!i)return!1;if(i.visible)return s;o.push(s),s=i.fill}return!1}function GW(e,t,n){const r=QW(e);if(xe(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return We(s)&&Math.floor(s)===s?YW(r[0],t,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function YW(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function XW(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:xe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function JW(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:xe(e)?r=e.value:r=t.getBaseValue(),r}function QW(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function e4(e){const{scale:t,index:n,line:r}=e,s=[],o=r.segments,i=r.points,a=t4(t,n);a.push(IS({x:null,y:t.bottom},r));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)n4(s,i[u],a)}return new Mi({points:s,options:{}})}function t4(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const o=r[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function n4(e,t,n){const r=[];for(let s=0;s<n.length;s++){const o=n[s],{first:i,last:a,point:c}=r4(o,t,"x");if(!(!c||i&&a)){if(i)r.unshift(c);else if(e.push(c),!a)break}}e.push(...r)}function r4(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const s=r[n],o=e.segments,i=e.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],d=i[u.start][n],f=i[u.end][n];if(Bn(s,d,f)){a=s===d,c=s===f;break}}return{first:a,last:c,point:r}}class jS{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:s,y:o,radius:i}=this;return n=n||{start:0,end:Ae},t.arc(s,o,i,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:r+Math.sin(o)*s,angle:o}}}function s4(e){const{chart:t,fill:n,line:r}=e;if(We(n))return o4(t,n);if(n==="stack")return e4(e);if(n==="shape")return!0;const s=i4(e);return s instanceof jS?s:IS(s,r)}function o4(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function i4(e){return(e.scale||{}).getPointPositionForValue?c4(e):a4(e)}function a4(e){const{scale:t={},fill:n}=e,r=XW(n,t);if(We(r)){const s=t.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function c4(e){const{scale:t,fill:n}=e,r=t.options,s=t.getLabels().length,o=r.reverse?t.max:t.min,i=JW(n,t,o),a=[];if(r.grid.circular){const c=t.getPointPositionForValue(0,o);return new jS({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<s;++c)a.push(t.getPointPositionForValue(c,i));return a}function ju(e,t,n){const r=s4(t),{chart:s,index:o,line:i,scale:a,axis:c}=t,l=i.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:h=d}=u||{},p=s.getDatasetMeta(o),m=hS(s,p);r&&i.points.length&&(Cl(e,n),l4(e,{line:i,target:r,above:f,below:h,area:n,scale:a,axis:c,clip:m}),Rl(e))}function l4(e,t){const{line:n,target:r,above:s,below:o,area:i,scale:a,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(l==="x"?(Vy(e,r,i.top),Lu(e,{line:n,target:r,color:s,scale:a,property:l,clip:c}),e.restore(),e.save(),Vy(e,r,i.bottom)):l==="y"&&(By(e,r,i.left),Lu(e,{line:n,target:r,color:o,scale:a,property:l,clip:c}),e.restore(),e.save(),By(e,r,i.right),u=s)),Lu(e,{line:n,target:r,color:u,scale:a,property:l,clip:c}),e.restore()}function Vy(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function By(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Lu(e,t){const{line:n,target:r,property:s,color:o,scale:i,clip:a}=t,c=qW(n,r,s);for(const{source:l,target:u,start:d,end:f}of c){const{style:{backgroundColor:h=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,u4(e,i,a,p&&Zd(s,d,f)),e.beginPath();const m=!!n.pathSegment(e,l);let y;if(p){m?e.closePath():Uy(e,r,f,s);const b=!!r.pathSegment(e,u,{move:m,reverse:!0});y=m&&b,y||Uy(e,r,d,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function u4(e,t,n,r){const s=t.chart.chartArea,{property:o,start:i,end:a}=r||{};if(o==="x"||o==="y"){let c,l,u,d;o==="x"?(c=i,l=s.top,u=a,d=s.bottom):(c=s.left,l=i,u=s.right,d=a),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),d=Math.min(d,n.bottom)),e.rect(c,l,u-c,d-l),e.clip()}}function Uy(e,t,n,r){const s=t.interpolate(n,r);s&&e.lineTo(s.x,s.y)}var LS={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,s=[];let o,i,a,c;for(i=0;i<r;++i)o=e.getDatasetMeta(i),a=o.dataset,c=null,a&&a.options&&a instanceof Mi&&(c={visible:e.isDatasetVisible(i),index:i,fill:GW(a,i,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,s.push(c);for(i=0;i<r;++i)c=s[i],!(!c||c.fill===!1)&&(c.fill=ZW(s,i,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let i=s.length-1;i>=0;--i){const a=s[i].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&ju(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;$y(o)&&ju(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!$y(r)||n.drawTime!=="beforeDatasetDraw"||ju(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wy=(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)}},d4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Hy extends Jn{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=Me(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,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,s=rt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Wy(r,o);let l,u;n.font=s.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(i,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(i,s,a,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+o.measureText(p.text).width;(m===0||l[l.length-1]+y+2*a>i)&&(d+=u,l[l.length-(m>0?0:1)]=0,h+=u,f++),c[m]={left:0,top:h,row:f,width:y,height:s},l[l.length-1]+=y+a}),d}_fitCols(t,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=i-t;let d=a,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:_}=f4(r,n,o,y,s);b>0&&h+_+2*a>u&&(d+=f+a,l.push({width:f,height:h}),p+=f+a,m++,f=h=0),c[b]={left:p,top:h,col:m,width:x,height:_},f=Math.max(f,x),h+=_+a}),d+=f,l.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=Bs(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=ht(r,this.left+s,this.right-this.lineWidths[a]);for(const l of n)a!==l.row&&(a=l.row,c=ht(r,this.left+s,this.right-this.lineWidths[a])),l.top+=this.top+t+s,l.left=i.leftForLtr(i.x(c),l.width),c+=l.width+s}else{let a=0,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const l of n)l.col!==a&&(a=l.col,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+s,l.left=i.leftForLtr(i.x(l.left),l.width),c+=l.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Cl(t,this),this._draw(),Rl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=t,a=$e.color,c=Bs(t.rtl,this.left,this.width),l=rt(i.font),{padding:u}=i,d=l.size,f=d/2;let h;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=Wy(i,d),b=function(C,k,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=de(E.lineWidth,1);if(s.fillStyle=de(E.fillStyle,a),s.lineCap=de(E.lineCap,"butt"),s.lineDashOffset=de(E.lineDashOffset,0),s.lineJoin=de(E.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=de(E.strokeStyle,a),s.setLineDash(de(E.lineDash,[])),i.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:P},N=c.xPlus(C,p/2),A=k+f;eS(s,O,N,A,i.pointStyleWidth&&p)}else{const O=k+Math.max((d-m)/2,0),N=c.leftForLtr(C,p),A=Zr(E.borderRadius);s.beginPath(),Object.values(A).some(j=>j!==0)?di(s,{x:N,y:O,w:p,h:m,radius:A}):s.rect(N,O,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},x=function(C,k,E){cs(s,E.text,C,k+y/2,l,{strikethrough:E.hidden,textAlign:c.textAlign(E.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?h={x:ht(o,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:ht(o,this.top+w+u,this.bottom-n[0].height),line:0},cS(this.ctx,t.textDirection);const S=y+u;this.legendItems.forEach((C,k)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const E=s.measureText(C.text).width,P=c.textAlign(C.textAlign||(C.textAlign=i.textAlign)),O=p+f+E;let N=h.x,A=h.y;c.setWidth(this.width),_?k>0&&N+O+u>this.right&&(A=h.y+=S,h.line++,N=h.x=ht(o,this.left+u,this.right-r[h.line])):k>0&&A+S>this.bottom&&(N=h.x=N+n[h.line].width+u,h.line++,A=h.y=ht(o,this.top+w+u,this.bottom-n[h.line].height));const j=c.x(N);if(b(j,A,C),N=kB(P,N+p+f,_?N+O:this.right,t.rtl),x(c.x(N),A,C),_)h.x+=O+u;else if(typeof C.text!="string"){const $=l.lineHeight;h.y+=FS(C,$)+u}else h.y+=S}),lS(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=rt(n.font),s=xt(n.padding);if(!n.display)return;const o=Bs(t.rtl,this.left,this.width),i=this.ctx,a=n.position,c=r.size/2,l=s.top+c;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,d=ht(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=l+ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=ht(a,d,d+f);i.textAlign=o.textAlign(Ch(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,cs(i,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=rt(t.font),r=xt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,o;if(Bn(t,this.left,this.right)&&Bn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Bn(t,s.left,s.left+s.width)&&Bn(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!m4(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=d4(s,r);s&&!o&&Me(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!o&&Me(n.onHover,[t,r,this],this)}else r&&Me(n.onClick,[t,r,this],this)}}function f4(e,t,n,r,s){const o=h4(r,e,t,n),i=p4(s,r,t.lineHeight);return{itemWidth:o,itemHeight:i}}function h4(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),t+n.size/2+r.measureText(s).width}function p4(e,t,n){let r=e;return typeof t.text!="string"&&(r=FS(t,n)),r}function FS(e,t){const n=e.text?e.text.length:0;return t*n}function m4(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var zS={id:"legend",_element:Hy,start(e,t,n){const r=e.legend=new Hy({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r)},stop(e){bt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bt.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,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.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:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=xt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:i&&(a||l.borderRadius),datasetIndex:c.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)}}};class jh extends Jn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,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.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ze(r.text)?r.text.length:1;this._padding=xt(r.padding);const o=s*rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let c=0,l,u,d;return this.isHorizontal()?(u=ht(a,r,o),d=n+t,l=o-r):(i.position==="left"?(u=r+t,d=ht(a,s,n),c=we*-.5):(u=o-t,d=ht(a,n,s),c=we*.5),l=s-n),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=rt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);cs(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:l,textAlign:Ch(n.align),textBaseline:"middle",translation:[i,a]})}}function g4(e,t){const n=new jh({ctx:e.ctx,options:t,chart:e});bt.configure(e,n,t),bt.addBox(e,n),e.titleBlock=n}var y4={id:"title",_element:jh,start(e,t,n){g4(e,n)},stop(e){const t=e.titleBlock;bt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const xa=new WeakMap;var b4={id:"subtitle",start(e,t,n){const r=new jh({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r),xa.set(e,r)},stop(e){bt.removeBox(e,xa.get(e)),xa.delete(e)},beforeUpdate(e,t,n){const r=xa.get(e);bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Io={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),s+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,c)=>a+c)/r.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=e.length;o<i;++o){const c=e[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=Vd(t,l);u<s&&(s=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function _n(e,t){return t&&(ze(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Fn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
104
104
|
`)>-1?e.split(`
|
|
105
|
-
`):e}function v4(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function qy(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,c=rt(t.bodyFont),l=rt(t.titleFont),u=rt(t.footerFont),d=o.length,f=s.length,h=r.length,p=xt(t.padding);let m=p.height,y=0,b=r.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*w+(b-h)*c.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){y=Math.max(y,n.measureText(w).width+x)};return n.save(),n.font=l.string,Ce(e.title,_),n.font=c.string,Ce(e.beforeBody.concat(e.afterBody),_),x=t.displayColors?i+2+t.boxPadding:0,Ce(r,w=>{Ce(w.before,_),Ce(w.lines,_),Ce(w.after,_)}),x=0,n.font=u.string,Ce(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function x4(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function _4(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function w4(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:c}}=e;let l="center";return r==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=i-o/2&&(l="right"),_4(l,e,t,n)&&(l="center"),l}function Ky(e,t,n){const r=n.yAlign||t.yAlign||x4(e,n);return{xAlign:n.xAlign||t.xAlign||w4(e,t,n,r),yAlign:r}}function S4(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function E4(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function Zy(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:c}=n,l=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Zr(i);let p=S4(t,a);const m=E4(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,h)+s),{x:at(p,0,r.width-t.width),y:at(m,0,r.height-t.height)}}function _a(e,t,n){const r=xt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Gy(e){return _n([],Fn(e))}function k4(e,t,n){return Rr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $S={beforeTitle:In,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:In,beforeBody:In,beforeLabel:In,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 ye(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:In,afterBody:In,beforeFooter:In,footer:In,afterFooter:In};function Pt(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?$S[t].call(n,r):s}class Xy extends Jn{static positioners=Io;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()),s=r.enabled&&n.options.animation&&r.animations,o=new pS(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=k4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Pt(r,"beforeTitle",this,t),o=Pt(r,"title",this,t),i=Pt(r,"afterTitle",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}getBeforeBody(t,n){return Gy(Pt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Ce(t,o=>{const i={before:[],lines:[],after:[]},a=Yy(r,o);_n(i.before,Fn(Pt(a,"beforeLabel",this,o))),_n(i.lines,Pt(a,"label",this,o)),_n(i.after,Fn(Pt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return Gy(Pt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Pt(r,"beforeFooter",this,t),o=Pt(r,"footer",this,t),i=Pt(r,"afterFooter",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(v4(this.chart,n[c]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ce(a,u=>{const d=Yy(t.callbacks,u);s.push(Pt(d,"labelColor",this,u)),o.push(Pt(d,"labelPointStyle",this,u)),i.push(Pt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Io[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=qy(this,r),l=Object.assign({},a,c),u=Ky(this.chart,r,l),d=Zy(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,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,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Zr(a),{x:f,y:h}=t,{width:p,height:m}=n;let y,b,x,_,w,S;return o==="center"?(w=h+m/2,s==="left"?(y=f,b=y-i,_=w+i,S=w-i):(y=f+p,b=y+i,_=w-i,S=w+i),x=y):(s==="left"?b=f+Math.max(c,u)+i:s==="right"?b=f+p-Math.max(l,d)-i:b=this.caretX,o==="top"?(_=h,w=_-i,y=b-i,x=b+i):(_=h+m,w=_+i,y=b+i,x=b-i),S=_),{x1:y,x2:b,x3:x,y1:_,y2:w,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,c;if(o){const l=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.titleAlign,r),n.textAlign=l.textAlign(r.titleAlign),n.textBaseline="middle",i=rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<o;++c)n.fillText(s[c],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,c+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=rt(o.bodyFont),d=_a(this,"left",o),f=s.x(d),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ud(t,m,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Ud(t,m,y,b)}else{t.lineWidth=xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const m=s.leftForLtr(f,l),y=s.leftForLtr(s.xPlus(f,1),l-2),b=Zr(i.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:m,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),di(t,{x:y,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,l,c),t.strokeRect(m,p,l,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=rt(r.bodyFont);let f=d.lineHeight,h=0;const p=Bs(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+o},y=p.textAlign(i);let b,x,_,w,S,C,k;for(n.textAlign=i,n.textBaseline="middle",n.font=d.string,t.x=_a(this,y,r),n.fillStyle=r.bodyColor,Ce(this.beforeBody,m),h=a&&y!=="right"?i==="center"?l/2+u:l+2+u:0,w=0,C=s.length;w<C;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,Ce(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,w,p,r),f=Math.max(d.lineHeight,c)),S=0,k=_.length;S<k;++S)m(_[S]),f=d.lineHeight;Ce(b.after,m)}h=0,f=d.lineHeight,Ce(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const c=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:c}=t,{width:l,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Zr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,c),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+l-f,c),n.quadraticCurveTo(a+l,c,a+l,c+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,c+d),n.quadraticCurveTo(a,c,a+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Io[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=qy(this,t),c=Object.assign({},i,this._size),l=Ky(n,t,c),u=Zy(t,c,l,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.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 s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),cS(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),lS(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!kc(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),c=n||!kc(i,o)||a;return c&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Io[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}var VS={id:"tooltip",_element:Xy,positioners:Io,afterInit(e,t,n){n&&(e.tooltip=new Xy({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:$S},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"]},C4=Object.freeze({__proto__:null,Colors:VW,Decimation:HW,Filler:LS,Legend:zS,SubTitle:b4,Title:y4,Tooltip:VS});const R4=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function P4(e,t,n,r){const s=e.indexOf(t);if(s===-1)return R4(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const O4=(e,t)=>e===null?null:at(Math.round(e),0,t);function Jy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class BS extends hs{static id="category";static defaults={ticks:{callback:Jy}};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:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:P4(r,t,de(n,t),this._addedLabels),O4(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];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 i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return Jy.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 T4(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=o||1,p=u-1,{min:m,max:y}=t,b=!ye(i),x=!ye(a),_=!ye(l),w=(y-m)/(d+1);let S=qg((y-m)/p/h)*h,C,k,E,P;if(S<1e-14&&!b&&!x)return[{value:m},{value:y}];P=Math.ceil(y/S)-Math.floor(m/S),P>p&&(S=qg(P*S/p/h)*h),ye(c)||(C=Math.pow(10,c),S=Math.ceil(S*C)/C),s==="ticks"?(k=Math.floor(m/S)*S,E=Math.ceil(y/S)*S):(k=m,E=y),b&&x&&o&&bB((a-i)/o,S/1e3)?(P=Math.round(Math.min((a-i)/S,u)),S=(a-i)/P,k=i,E=a):_?(k=b?i:k,E=x?a:E,P=l-1,S=(E-k)/P):(P=(E-k)/S,Bo(P,Math.round(P),S/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Kg(S),Kg(k));C=Math.pow(10,ye(c)?O:c),k=Math.round(k*C)/C,E=Math.round(E*C)/C;let N=0;for(b&&(f&&k!==i?(n.push({value:i}),k<i&&N++,Bo(Math.round((k+N*S)*C)/C,i,Qy(i,w,e))&&N++):k<i&&N++);N<P;++N){const A=Math.round((k+N*S)*C)/C;if(x&&A>a)break;n.push({value:A})}return x&&f&&E!==a?n.length&&Bo(n[n.length-1].value,a,Qy(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||E===a)&&n.push({value:E}),n}function Qy(e,t,{horizontal:n,minRotation:r}){const s=fn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class Ac extends hs{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 ye(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:s,max:o}=this;const i=c=>s=n?s:c,a=c=>o=r?o:c;if(t){const c=Rn(s),l=Rn(o);c<0&&l<0?a(0):c>0&&l>0&&i(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||i(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={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,i=T4(s,o);return t.bounds==="ticks"&&H0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class US extends Ac{static id="linear";static defaults={ticks:{callback:kl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?t:0,this.max=We(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=fn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hi=e=>Math.floor(ar(e)),Dr=(e,t)=>Math.pow(10,hi(e)+t);function eb(e){return e/Math.pow(10,hi(e))===1}function tb(e,t,n){const r=Math.pow(10,n),s=Math.floor(e/r);return Math.ceil(t/r)-s}function M4(e,t){const n=t-e;let r=hi(n);for(;tb(e,t,r)>10;)r++;for(;tb(e,t,r)<10;)r--;return Math.min(r,hi(e))}function A4(e,{min:t,max:n}){t=Ft(e.min,t);const r=[],s=hi(t);let o=M4(t,n),i=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*i)/i,u=Math.floor((t-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),f=Ft(e.min,Math.round((c+u+d*Math.pow(10,o))*i)/i);for(;f<n;)r.push({value:f,major:eb(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,i=o>=0?1:i),f=Math.round((c+u+d*Math.pow(10,o))*i)/i;const h=Ft(e.max,f);return r.push({value:h,major:eb(h),significand:d}),r}class N4 extends hs{static id="logarithmic";static defaults={ticks:{callback:kl.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ac.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return We(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?Math.max(0,t):null,this.max=We(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!We(this._userMin)&&(this.min=t===Dr(this.min,0)?Dr(this.min,-1):Dr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=a=>r=t?r:a,i=a=>s=n?s:a;r===s&&(r<=0?(o(1),i(10)):(o(Dr(r,-1)),i(Dr(s,1)))),r<=0&&o(Dr(s,-1)),s<=0&&i(Dr(r,1)),this.min=r,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=A4(n,this);return t.bounds==="ticks"&&H0(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Oi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ar(t),this._valueRange=ar(this.max)-ar(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ar(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Gd(e){const t=e.ticks;if(t.display&&e.display){const n=xt(t.backdropPadding);return de(t.font&&t.font.size,$e.font.size)+n.height}return 0}function D4(e,t,n){return n=ze(n)?n:[n],{w:IB(e,t.string,n),h:n.length*t.lineHeight}}function nb(e,t,n,r,s){return e===r||e===s?{start:t-n/2,end:t+n/2}:e<r||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function I4(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],s=[],o=e._pointLabels.length,i=e.options.pointLabels,a=i.centerPointLabels?we/o:0;for(let c=0;c<o;c++){const l=i.setContext(e.getPointLabelContext(c));s[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+s[c],a),d=rt(l.font),f=D4(e.ctx,d,e._pointLabels[c]);r[c]=f;const h=mt(e.getIndexAngle(c)+a),p=Math.round(Eh(h)),m=nb(p,u.x,f.w,0,180),y=nb(p,u.y,f.h,90,270);j4(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=z4(e,r,s)}function j4(e,t,n,r,s){const o=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let a=0,c=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(c=(t.t-s.start)/i,e.t=Math.min(e.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/i,e.b=Math.max(e.b,t.b+c))}function L4(e,t,n){const r=e.drawingArea,{extra:s,additionalAngle:o,padding:i,size:a}=n,c=e.getPointPosition(t,r+s+i,o),l=Math.round(Eh(mt(c.angle+He))),u=B4(c.y,a.h,l),d=$4(l),f=V4(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function F4(e,t){if(!t)return!0;const{left:n,top:r,right:s,bottom:o}=e;return!(Wn({x:n,y:r},t)||Wn({x:n,y:o},t)||Wn({x:s,y:r},t)||Wn({x:s,y:o},t))}function z4(e,t,n){const r=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:i,display:a}=o.pointLabels,c={extra:Gd(o)/2,additionalAngle:i?we/s:0};let l;for(let u=0;u<s;u++){c.padding=n[u],c.size=t[u];const d=L4(e,u,c);r.push(d),a==="auto"&&(d.visible=F4(d,l),d.visible&&(l=d))}return r}function $4(e){return e===0||e===180?"center":e<180?"left":"right"}function V4(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function B4(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function U4(e,t,n){const{left:r,top:s,right:o,bottom:i}=n,{backdropColor:a}=t;if(!ye(a)){const c=Zr(t.borderRadius),l=xt(t.backdropPadding);e.fillStyle=a;const u=r-l.left,d=s-l.top,f=o-r+l.width,h=i-s+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:d,w:f,h,radius:c}),e.fill()):e.fillRect(u,d,f,h)}}function W4(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const i=r.setContext(e.getPointLabelContext(s));U4(n,i,o);const a=rt(i.font),{x:c,y:l,textAlign:u}=o;cs(n,e._pointLabels[s],c,l+a.lineHeight/2,a,{color:i.color,textAlign:u,textBaseline:"middle"})}}function WS(e,t,n,r){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ae);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let i=1;i<r;i++)o=e.getPointPosition(i,t),s.lineTo(o.x,o.y)}}function H4(e,t,n,r,s){const o=e.ctx,i=t.circular,{color:a,lineWidth:c}=t;!i&&!r||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),WS(e,n,i,r),o.closePath(),o.stroke(),o.restore())}function q4(e,t,n){return Rr(e,{label:n,index:t,type:"pointLabel"})}class K4 extends Ac{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xt(Gd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=We(t)&&!isNaN(t)?t:0,this.max=We(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gd(this.options))}generateTickLabels(t){Ac.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const s=Me(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?I4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,s))}getIndexAngle(t){const n=Ae/(this._pointLabels.length||1),r=this.options.startAngle||0;return mt(t*n+fn(r))}getDistanceFromCenterForValue(t){if(ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return q4(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const s=this.getIndexAngle(t)-He+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),WS(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,i=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&W4(this,i),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=s.setContext(f),p=o.setContext(f);H4(this,h,c,i,p)}}),r.display){for(t.save(),a=i-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,i;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=r.setContext(this.getContext(c)),u=rt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,i=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const d=xt(l.backdropPadding);t.fillRect(-i/2-d.left,-o-u.size/2-d.top,i+d.width,u.size+d.height)}cs(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ml={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}},Nt=Object.keys(Ml);function rb(e,t){return e-t}function sb(e,t){if(ye(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),We(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(Ys(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ob(e,t,n,r){const s=Nt.length;for(let o=Nt.indexOf(e);o<s-1;++o){const i=Ml[Nt[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return Nt[o]}return Nt[s-1]}function Z4(e,t,n,r,s){for(let o=Nt.length-1;o>=Nt.indexOf(n);o--){const i=Nt[o];if(Ml[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return Nt[n?Nt.indexOf(n):0]}function G4(e){for(let t=Nt.indexOf(e)+1,n=Nt.length;t<n;++t)if(Ml[Nt[t]].common)return Nt[t]}function ib(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=kh(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function Y4(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,c;for(a=o;a<=i;a=+s.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function ab(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:Y4(e,r,s,n)}class Nc extends hs{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={}),s=this._adapter=new r5._date(t.adapters.date);s.init(n),Vo(r.displayFormats,s.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:sb(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:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function c(l){!i&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!i||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=We(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=We(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+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,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=wB(s,o,i);return this._unit=n.unit||(r.autoSkip?ob(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Z4(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:G4(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ab(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=at(n,0,i),r=at(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ob(o.minUnit,n,r,this._getLabelCapacity(n)),a=de(s.ticks.stepSize,1),c=i==="week"?o.isoWeekday:!1,l=Ys(c)||c===!0,u={};let d=n,f,h;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,i),h++)ib(u,f,p);return(f===r||s.bounds==="ticks"||h===1)&&ib(u,f,p),Object.keys(u).sort(rb).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 s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return Me(i,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],f=r[n],h=l&&d&&f&&f.major;return this._adapter.format(t,s||(h?d:u))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.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,s=fn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,ab(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[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 s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(sb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Z0(t.sort(rb))}}function wa(e,t,n){let r=0,s=e.length-1,o,i,a,c;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Un(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:c}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Un(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:c}=e[s]);const l=i-o;return l?a+(c-a)*(t-o)/l:a}class X4 extends Nc{static id="timeseries";static defaults=Nc.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=wa(n,this.min),this._tableRange=wa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,c,l,u;for(i=0,a=t.length;i<a;++i)l=t[i],l>=n&&l<=r&&s.push(l);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)u=s[i+1],c=s[i-1],l=s[i],Math.round((u+c)/2)!==l&&o.push({time:l,pos:i/(a-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((s,o)=>s-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(wa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wa(this._table,r*this._tableRange+this._minPos,!0)}}var J4=Object.freeze({__proto__:null,CategoryScale:BS,LinearScale:US,LogarithmicScale:N4,RadialLinearScale:K4,TimeScale:Nc,TimeSeriesScale:X4});const Q4=[n5,DW,C4,J4],HS="label";function cb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function eH(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function qS(e,t){e.labels=t}function KS(e,t,n=HS){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function tH(e,t=HS){const n={labels:[],datasets:[]};return qS(n,e.labels),KS(n,e.datasets,t),n}function nH(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,h=T.useRef(null),p=T.useRef(null),m=()=>{h.current&&(p.current=new Ti(h.current,{type:i,data:tH(a,o),options:c&&{...c},plugins:l}),cb(t,p.current))},y=()=>{cb(t,null),p.current&&(p.current.destroy(),p.current=null)};return T.useEffect(()=>{!s&&p.current&&c&&eH(p.current,c)},[s,c]),T.useEffect(()=>{!s&&p.current&&qS(p.current.config.data,a.labels)},[s,a.labels]),T.useEffect(()=>{!s&&p.current&&a.datasets&&KS(p.current.config.data,a.datasets,o)},[s,a.datasets]),T.useEffect(()=>{p.current&&(s?(y(),setTimeout(m)):p.current.update(d))},[s,c,a.labels,a.datasets,d]),T.useEffect(()=>{p.current&&(y(),setTimeout(m))},[i]),T.useEffect(()=>(m(),()=>y()),[]),g.jsx("canvas",{ref:h,role:"img",height:n,width:r,...f,children:u})}const rH=T.forwardRef(nH);function sH(e,t){return Ti.register(t),T.forwardRef((n,r)=>g.jsx(rH,{...n,ref:r,type:e}))}const oH=sH("line",yS);Ti.register(...Q4);Ti.register(BS,US,TS,Mi,LS,VS,zS,Nc);const iH={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:n,data:r}=e;if(!n)return;r?.datasets?.[0]?.meta?.raw;const s=r?.datasets?.[0]?.status??[];if(!Array.isArray(s)||s.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const o=e.scales.x;for(let i=0;i<s.length;i++){if(s[i]!=="down")continue;const a=o.getPixelForValue(i-.5),c=o.getPixelForValue(i+.5);t.fillRect(a,n.top,c-a,n.bottom-n.top)}t.restore()}};function aH({points:e}){const t=e.map(i=>new Date(i.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),n=e.map(i=>i.status==="down"?null:i.ping),r=e.map(i=>i.status),s={labels:t,datasets:[{label:"Ping (ms)",data:n,tension:.25,pointRadius:0,fill:!0,status:r}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>{const a=i.dataIndex;if(r[a]==="down")return"Down";const l=i.parsed.y;return l!=null?`${l} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return g.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[g.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),g.jsx("div",{className:"h-[220px]",children:g.jsx(oH,{data:s,options:o,plugins:[iH]})})]})}const cH=Rx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{success:"bg-green-500 text-white",default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function lH({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lf:"span";return g.jsx(s,{"data-slot":"badge",className:Se(cH({variant:t}),e),...r})}var Al="Checkbox",[uH]=wr(Al),[dH,Lh]=uH(Al);function fH(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Zs({prop:n,defaultProp:s??!1,onChange:c,caller:Al}),[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),_=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:o,setChecked:h,control:p,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:pr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:b};return g.jsx(dH,{scope:t,...w,children:hH(d)?d(w):r})}var ZS="CheckboxTrigger",GS=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:p}=Lh(ZS,e),m=Pe(s,u),y=v.useRef(c);return v.useEffect(()=>{const b=o?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[o,d]),g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":pr(c)?"mixed":c,"aria-required":l,"data-state":tE(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:re(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:re(n,b=>{d(x=>pr(x)?!0:!x),p&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});GS.displayName=ZS;var YS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(fH,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(GS,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(eE,{__scopeCheckbox:n})]})})});YS.displayName=Al;var XS="CheckboxIndicator",JS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=Lh(XS,n);return g.jsx(Xn,{present:r||pr(o.checked)||o.checked===!0,children:g.jsx(be.span,{"data-state":tE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});JS.displayName=XS;var QS="CheckboxBubbleInput",eE=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Lh(QS,e),p=Pe(n,h),m=kw(o),y=Wx(r);v.useEffect(()=>{const x=f;if(!x)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(m!==o&&S){const k=new Event("click",{bubbles:C});x.indeterminate=pr(o),S.call(x,pr(o)?!1:o),x.dispatchEvent(k)}},[f,m,o,s]);const b=v.useRef(pr(o)?!1:o);return g.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});eE.displayName=QS;function hH(e){return typeof e=="function"}function pr(e){return e==="indeterminate"}function tE(e){return pr(e)?"indeterminate":e?"checked":"unchecked"}function pH({className:e,...t}){return g.jsx(YS,{"data-slot":"checkbox",className:Se("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(JS,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(bx,{className:"size-3.5"})})})}function mH(){const{id:e}=pi({strict:!1}),t=ls(),n=Hv(),{current:r,currentResults:s,loading:o}=qv(O=>O.monitors),[i,a]=v.useState(!1),[c,l]=v.useState(!1);v.useEffect(()=>{if(!e)return;n(ks(e)),n(Aa(e));const O=setInterval(()=>{n(Aa(e)),n(ks(e))},3e4);return()=>clearInterval(O)},[e,n]);const[u,d]=v.useState(null);if(v.useEffect(()=>{if(!e)return;let O=null;return O=$a(td.apiBase,{path:td.wsPath,transports:["websocket"]}),O.on("monitor:update",N=>{N.monitorId===e&&(d(N),n(Aa(e)),n(ks(e)))}),()=>{O?.disconnect()}},[e,n]),!r)return g.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[g.jsx("div",{children:o?"Loading...":"Monitor not found."}),g.jsx(gt,{variant:"link",onClick:()=>t({to:"/"}),children:"Back to Monitors"})]});const f=(s??[]).slice().reverse(),h=f.slice(-40).map(O=>O.status),p=u??s?.[0]??null,m=p?.status??"unknown",y=m==="up"?"text-emerald-500":m==="down"?"text-red-500":"text-muted-foreground",b=m==="up"?"bg-emerald-500":m==="down"?"bg-red-500":"bg-neutral-400",x=f.map(O=>({t:new Date(O.checkedAt).getTime(),ping:O.pingMs??null,status:O.status??"unknown"})),_=f.filter(O=>O.status==="up"||O.status==="down"),w=_.length?_.filter(O=>O.status==="up").length/_.length*100:0,S=(()=>{const O=f.map(N=>N.pingMs).filter(N=>typeof N=="number");return O.length?Math.round(O.reduce((N,A)=>N+A,0)/O.length):null})();async function C(){if(r)try{await n(dc({id:e,paused:!r.isPaused})).unwrap(),Ee.success(r.isPaused?"Resumed":"Paused")}catch(O){Ee.error(O??"Failed")}}async function k(){try{const N=(await Te.post(`/monitors/${e}/clone`)).data.monitor.id;Ee.success("Cloned (paused)"),n(Na()),t({to:"/monitors/$id",params:{id:N}})}catch(O){Ee.error(O?.response?.data?.detail??"Clone failed")}}async function E(){try{await n(Nf(e)).unwrap(),Ee.success("Deleted"),t({to:"/"})}catch(O){Ee.error(O??"Delete failed")}}const P=async O=>{try{await n(Df({id:r.id,data:O})).unwrap(),Ee.success("Monitor updated"),n(ks(e))}catch(N){throw Ee.error(N||"Failed to update monitor"),N}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",className:"-ml-2 h-8 w-8 text-muted-foreground",onClick:()=>t({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:Se("h-3 w-3 rounded-full",b)}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r.name}),r.isPaused&&g.jsx(lH,{variant:"secondary",children:"Paused"})]})]}),g.jsxs("div",{className:"text-sm text-muted-foreground ml-10",children:[r.type.toUpperCase()," • Interval: ",r.intervalSeconds,"s • ",r.url||r.host||"No target"]}),g.jsx("div",{className:"ml-10 pt-1",children:g.jsxs("div",{className:"flex gap-[2px] items-end h-6",children:[h.map((O,N)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-90 transition-all hover:scale-110 hover:opacity-100",O==="up"?"bg-emerald-500 h-4":O==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-800 h-4"),title:O},N)),h.length===0&&g.jsx("div",{className:"text-xs text-muted-foreground",children:"No data yet"})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs(gt,{variant:"outline",size:"sm",onClick:C,children:[r.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),r.isPaused?"Resume":"Pause"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:()=>l(!0),children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:k,children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(gt,{variant:"destructive",size:"sm",onClick:()=>a(!0),children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Status"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:`text-2xl font-bold ${y}`,children:m.toUpperCase()}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p?.message??"—"})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Uptime (24h)"})}),g.jsxs(Ts,{children:[g.jsxs("div",{className:"text-2xl font-bold",children:[w.toFixed(1),"%"]}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last ",s.length," checks"]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Avg Response"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:"text-2xl font-bold",children:S!=null?`${S} ms`:"—"}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Latest: ",p?.pingMs!=null?`${p.pingMs} ms`:"—"]})]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{children:g.jsx(Os,{children:"Response Time History"})}),g.jsx(Ts,{children:g.jsx(aH,{points:x.slice(-120)})})]}),g.jsx(gH,{monitorId:e}),g.jsx(k0,{open:i,onOpenChange:a,monitor:r,onConfirm:E}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:r,onSubmit:P})]})}function gH({monitorId:e}){const{data:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),{data:n,refetch:r}=Go({queryKey:["monitor-notifications",e],queryFn:async()=>(await Te.get(`/notifications/monitor/${e}`)).data.links}),s=new Set((n??[]).map(i=>i.notificationId));async function o(i){await Te.post(`/notifications/monitor/${e}`,{notificationIds:i}),Ee.success("Notifications updated"),await r()}return g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Notifications"}),g.jsx(C0,{children:"Select which notification channels to alert when this monitor goes down."})]}),g.jsx(Ts,{children:!t||t.length===0?g.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications configured. Go to Settings → Notifications to add channels."}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(i=>g.jsxs("div",{className:"flex items-start space-x-2 rounded-md border p-3",children:[g.jsx(pH,{id:i.id,checked:s.has(i.id),onCheckedChange:a=>{const c=new Set(s);a?c.add(i.id):c.delete(i.id),o(Array.from(c))}}),g.jsxs("div",{className:"grid gap-1.5 leading-none",children:[g.jsx(e0,{htmlFor:i.id,className:"font-medium cursor-pointer",children:i.name}),g.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[200px]",title:i.webhookUrl,children:i.webhookUrl})]})]},i.id))})})]})}function yH(){const e=Go({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Go({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=v.useState(!1),[r,s]=v.useState("My Status Page"),[o,i]=v.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:o,domains:[]}),Ee.success("Created"),e.refetch()}catch(c){Ee.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{className:"font-semibold",children:"Create"}),g.jsxs(Jo,{className:"grid gap-3 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>s(c.target.value)})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Slug"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:o,onChange:c=>i(c.target.value)})]}),g.jsx("div",{className:"flex items-end",children:g.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),g.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>g.jsxs(Yo,{children:[g.jsxs(Xo,{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),g.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),g.jsxs(Jo,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",g.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function bH(){const{data:e,refetch:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=v.useState(""),[s,o]=v.useState("");async function i(){if(!n.trim()||!s.trim()){Ee.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:s}),r(""),o(""),Ee.success("Notification created"),await t()}catch(c){Ee.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),Ee.success("Deleted"),await t()}catch(l){Ee.error(l?.response?.data?.detail??"Delete failed")}}return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),g.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),g.jsxs(Jo,{children:[g.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:"text-sm",children:"Webhook URL"}),g.jsx("input",{value:s,onChange:c=>o(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{children:g.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),g.jsx(Jo,{children:(e??[]).length===0?g.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):g.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),g.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function vH(){return Wc(),vv(),g.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[g.jsx("main",{className:"min-h-screen",children:g.jsx(of,{})}),g.jsx(ER,{richColors:!0})]})}const Sa=Fk({component:vH}),xH=()=>{const{token:e}=Wc.getState();if(!e)throw yb({to:"/login"})};function Nl(e=!0){const t=jn({getParentRoute:()=>Sa,id:"workspace",beforeLoad:e?xH:void 0,component:yT}),n=t.addChildren([jn({getParentRoute:()=>t,path:"/",component:H$}),jn({getParentRoute:()=>t,path:"/monitors/new",component:Ng}),jn({getParentRoute:()=>t,path:"/monitors/$id",component:mH}),jn({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Ng}),jn({getParentRoute:()=>t,path:"/status-pages",component:yH}),jn({getParentRoute:()=>t,path:"/settings/notifications",component:bH})]);if(e){const r=jn({getParentRoute:()=>Sa,path:"/login",component:gT});return Sa.addChildren([n,r])}else return Sa.addChildren([n])}af({routeTree:Nl(!0)});const nE=sM({reducer:{monitors:CM}}),_H=new Vb;function wH({apiBase:e,token:t,basePath:n}){T.useEffect(()=>{iO(e,t)},[e,t]);const r=T.useMemo(()=>af({routeTree:Nl(!1),basepath:n||"/"}),[n]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:_H,children:g.jsx(Nb,{router:r})})})}const SH=new Vb;function EH({apiBase:e}){T.useEffect(()=>{e&&(Te.defaults.baseURL=e),aO()},[e]);const t=T.useMemo(()=>af({routeTree:Nl(!1)}),[]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:SH,children:g.jsx(Nb,{router:t})})})}const kH=[{title:"Monitors",url:"/monitors",icon:"Activity"},{title:"Status Pages",url:"/status-pages",icon:"Globe"},{title:"Notifications",url:"/settings/notifications",icon:"Bell"}];exports.PulsePage=wH;exports.PulseWatch=EH;exports.api=Te;exports.createRouteTree=Nl;exports.pulseNavItems=kH;
|
|
105
|
+
`):e}function v4(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function qy(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,c=rt(t.bodyFont),l=rt(t.titleFont),u=rt(t.footerFont),d=o.length,f=s.length,h=r.length,p=xt(t.padding);let m=p.height,y=0,b=r.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*w+(b-h)*c.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){y=Math.max(y,n.measureText(w).width+x)};return n.save(),n.font=l.string,Ce(e.title,_),n.font=c.string,Ce(e.beforeBody.concat(e.afterBody),_),x=t.displayColors?i+2+t.boxPadding:0,Ce(r,w=>{Ce(w.before,_),Ce(w.lines,_),Ce(w.after,_)}),x=0,n.font=u.string,Ce(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function x4(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function _4(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function w4(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:c}}=e;let l="center";return r==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=i-o/2&&(l="right"),_4(l,e,t,n)&&(l="center"),l}function Ky(e,t,n){const r=n.yAlign||t.yAlign||x4(e,n);return{xAlign:n.xAlign||t.xAlign||w4(e,t,n,r),yAlign:r}}function S4(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function E4(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function Zy(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:c}=n,l=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Zr(i);let p=S4(t,a);const m=E4(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,h)+s),{x:at(p,0,r.width-t.width),y:at(m,0,r.height-t.height)}}function _a(e,t,n){const r=xt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Gy(e){return _n([],Fn(e))}function k4(e,t,n){return Rr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $S={beforeTitle:In,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:In,beforeBody:In,beforeLabel:In,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 ye(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:In,afterBody:In,beforeFooter:In,footer:In,afterFooter:In};function Pt(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?$S[t].call(n,r):s}class Xy extends Jn{static positioners=Io;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()),s=r.enabled&&n.options.animation&&r.animations,o=new pS(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=k4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Pt(r,"beforeTitle",this,t),o=Pt(r,"title",this,t),i=Pt(r,"afterTitle",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}getBeforeBody(t,n){return Gy(Pt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Ce(t,o=>{const i={before:[],lines:[],after:[]},a=Yy(r,o);_n(i.before,Fn(Pt(a,"beforeLabel",this,o))),_n(i.lines,Pt(a,"label",this,o)),_n(i.after,Fn(Pt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return Gy(Pt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Pt(r,"beforeFooter",this,t),o=Pt(r,"footer",this,t),i=Pt(r,"afterFooter",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(v4(this.chart,n[c]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ce(a,u=>{const d=Yy(t.callbacks,u);s.push(Pt(d,"labelColor",this,u)),o.push(Pt(d,"labelPointStyle",this,u)),i.push(Pt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Io[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=qy(this,r),l=Object.assign({},a,c),u=Ky(this.chart,r,l),d=Zy(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,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,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Zr(a),{x:f,y:h}=t,{width:p,height:m}=n;let y,b,x,_,w,S;return o==="center"?(w=h+m/2,s==="left"?(y=f,b=y-i,_=w+i,S=w-i):(y=f+p,b=y+i,_=w-i,S=w+i),x=y):(s==="left"?b=f+Math.max(c,u)+i:s==="right"?b=f+p-Math.max(l,d)-i:b=this.caretX,o==="top"?(_=h,w=_-i,y=b-i,x=b+i):(_=h+m,w=_+i,y=b+i,x=b-i),S=_),{x1:y,x2:b,x3:x,y1:_,y2:w,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,c;if(o){const l=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.titleAlign,r),n.textAlign=l.textAlign(r.titleAlign),n.textBaseline="middle",i=rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<o;++c)n.fillText(s[c],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,c+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=rt(o.bodyFont),d=_a(this,"left",o),f=s.x(d),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ud(t,m,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Ud(t,m,y,b)}else{t.lineWidth=xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const m=s.leftForLtr(f,l),y=s.leftForLtr(s.xPlus(f,1),l-2),b=Zr(i.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:m,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),di(t,{x:y,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,l,c),t.strokeRect(m,p,l,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=rt(r.bodyFont);let f=d.lineHeight,h=0;const p=Bs(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+o},y=p.textAlign(i);let b,x,_,w,S,C,k;for(n.textAlign=i,n.textBaseline="middle",n.font=d.string,t.x=_a(this,y,r),n.fillStyle=r.bodyColor,Ce(this.beforeBody,m),h=a&&y!=="right"?i==="center"?l/2+u:l+2+u:0,w=0,C=s.length;w<C;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,Ce(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,w,p,r),f=Math.max(d.lineHeight,c)),S=0,k=_.length;S<k;++S)m(_[S]),f=d.lineHeight;Ce(b.after,m)}h=0,f=d.lineHeight,Ce(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const c=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:c}=t,{width:l,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Zr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,c),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+l-f,c),n.quadraticCurveTo(a+l,c,a+l,c+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,c+d),n.quadraticCurveTo(a,c,a+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Io[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=qy(this,t),c=Object.assign({},i,this._size),l=Ky(n,t,c),u=Zy(t,c,l,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.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 s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),cS(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),lS(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!kc(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),c=n||!kc(i,o)||a;return c&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Io[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}var VS={id:"tooltip",_element:Xy,positioners:Io,afterInit(e,t,n){n&&(e.tooltip=new Xy({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:$S},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"]},C4=Object.freeze({__proto__:null,Colors:VW,Decimation:HW,Filler:LS,Legend:zS,SubTitle:b4,Title:y4,Tooltip:VS});const R4=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function P4(e,t,n,r){const s=e.indexOf(t);if(s===-1)return R4(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const O4=(e,t)=>e===null?null:at(Math.round(e),0,t);function Jy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class BS extends hs{static id="category";static defaults={ticks:{callback:Jy}};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:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:P4(r,t,de(n,t),this._addedLabels),O4(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];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 i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return Jy.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 T4(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=o||1,p=u-1,{min:m,max:y}=t,b=!ye(i),x=!ye(a),_=!ye(l),w=(y-m)/(d+1);let S=qg((y-m)/p/h)*h,C,k,E,P;if(S<1e-14&&!b&&!x)return[{value:m},{value:y}];P=Math.ceil(y/S)-Math.floor(m/S),P>p&&(S=qg(P*S/p/h)*h),ye(c)||(C=Math.pow(10,c),S=Math.ceil(S*C)/C),s==="ticks"?(k=Math.floor(m/S)*S,E=Math.ceil(y/S)*S):(k=m,E=y),b&&x&&o&&bB((a-i)/o,S/1e3)?(P=Math.round(Math.min((a-i)/S,u)),S=(a-i)/P,k=i,E=a):_?(k=b?i:k,E=x?a:E,P=l-1,S=(E-k)/P):(P=(E-k)/S,Bo(P,Math.round(P),S/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Kg(S),Kg(k));C=Math.pow(10,ye(c)?O:c),k=Math.round(k*C)/C,E=Math.round(E*C)/C;let N=0;for(b&&(f&&k!==i?(n.push({value:i}),k<i&&N++,Bo(Math.round((k+N*S)*C)/C,i,Qy(i,w,e))&&N++):k<i&&N++);N<P;++N){const A=Math.round((k+N*S)*C)/C;if(x&&A>a)break;n.push({value:A})}return x&&f&&E!==a?n.length&&Bo(n[n.length-1].value,a,Qy(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||E===a)&&n.push({value:E}),n}function Qy(e,t,{horizontal:n,minRotation:r}){const s=fn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class Ac extends hs{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 ye(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:s,max:o}=this;const i=c=>s=n?s:c,a=c=>o=r?o:c;if(t){const c=Rn(s),l=Rn(o);c<0&&l<0?a(0):c>0&&l>0&&i(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||i(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={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,i=T4(s,o);return t.bounds==="ticks"&&H0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class US extends Ac{static id="linear";static defaults={ticks:{callback:kl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?t:0,this.max=We(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=fn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hi=e=>Math.floor(ar(e)),Dr=(e,t)=>Math.pow(10,hi(e)+t);function eb(e){return e/Math.pow(10,hi(e))===1}function tb(e,t,n){const r=Math.pow(10,n),s=Math.floor(e/r);return Math.ceil(t/r)-s}function M4(e,t){const n=t-e;let r=hi(n);for(;tb(e,t,r)>10;)r++;for(;tb(e,t,r)<10;)r--;return Math.min(r,hi(e))}function A4(e,{min:t,max:n}){t=Ft(e.min,t);const r=[],s=hi(t);let o=M4(t,n),i=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*i)/i,u=Math.floor((t-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),f=Ft(e.min,Math.round((c+u+d*Math.pow(10,o))*i)/i);for(;f<n;)r.push({value:f,major:eb(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,i=o>=0?1:i),f=Math.round((c+u+d*Math.pow(10,o))*i)/i;const h=Ft(e.max,f);return r.push({value:h,major:eb(h),significand:d}),r}class N4 extends hs{static id="logarithmic";static defaults={ticks:{callback:kl.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ac.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return We(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?Math.max(0,t):null,this.max=We(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!We(this._userMin)&&(this.min=t===Dr(this.min,0)?Dr(this.min,-1):Dr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=a=>r=t?r:a,i=a=>s=n?s:a;r===s&&(r<=0?(o(1),i(10)):(o(Dr(r,-1)),i(Dr(s,1)))),r<=0&&o(Dr(s,-1)),s<=0&&i(Dr(r,1)),this.min=r,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=A4(n,this);return t.bounds==="ticks"&&H0(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Oi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ar(t),this._valueRange=ar(this.max)-ar(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ar(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Gd(e){const t=e.ticks;if(t.display&&e.display){const n=xt(t.backdropPadding);return de(t.font&&t.font.size,$e.font.size)+n.height}return 0}function D4(e,t,n){return n=ze(n)?n:[n],{w:IB(e,t.string,n),h:n.length*t.lineHeight}}function nb(e,t,n,r,s){return e===r||e===s?{start:t-n/2,end:t+n/2}:e<r||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function I4(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],s=[],o=e._pointLabels.length,i=e.options.pointLabels,a=i.centerPointLabels?we/o:0;for(let c=0;c<o;c++){const l=i.setContext(e.getPointLabelContext(c));s[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+s[c],a),d=rt(l.font),f=D4(e.ctx,d,e._pointLabels[c]);r[c]=f;const h=mt(e.getIndexAngle(c)+a),p=Math.round(Eh(h)),m=nb(p,u.x,f.w,0,180),y=nb(p,u.y,f.h,90,270);j4(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=z4(e,r,s)}function j4(e,t,n,r,s){const o=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let a=0,c=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(c=(t.t-s.start)/i,e.t=Math.min(e.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/i,e.b=Math.max(e.b,t.b+c))}function L4(e,t,n){const r=e.drawingArea,{extra:s,additionalAngle:o,padding:i,size:a}=n,c=e.getPointPosition(t,r+s+i,o),l=Math.round(Eh(mt(c.angle+He))),u=B4(c.y,a.h,l),d=$4(l),f=V4(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function F4(e,t){if(!t)return!0;const{left:n,top:r,right:s,bottom:o}=e;return!(Wn({x:n,y:r},t)||Wn({x:n,y:o},t)||Wn({x:s,y:r},t)||Wn({x:s,y:o},t))}function z4(e,t,n){const r=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:i,display:a}=o.pointLabels,c={extra:Gd(o)/2,additionalAngle:i?we/s:0};let l;for(let u=0;u<s;u++){c.padding=n[u],c.size=t[u];const d=L4(e,u,c);r.push(d),a==="auto"&&(d.visible=F4(d,l),d.visible&&(l=d))}return r}function $4(e){return e===0||e===180?"center":e<180?"left":"right"}function V4(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function B4(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function U4(e,t,n){const{left:r,top:s,right:o,bottom:i}=n,{backdropColor:a}=t;if(!ye(a)){const c=Zr(t.borderRadius),l=xt(t.backdropPadding);e.fillStyle=a;const u=r-l.left,d=s-l.top,f=o-r+l.width,h=i-s+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:d,w:f,h,radius:c}),e.fill()):e.fillRect(u,d,f,h)}}function W4(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const i=r.setContext(e.getPointLabelContext(s));U4(n,i,o);const a=rt(i.font),{x:c,y:l,textAlign:u}=o;cs(n,e._pointLabels[s],c,l+a.lineHeight/2,a,{color:i.color,textAlign:u,textBaseline:"middle"})}}function WS(e,t,n,r){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ae);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let i=1;i<r;i++)o=e.getPointPosition(i,t),s.lineTo(o.x,o.y)}}function H4(e,t,n,r,s){const o=e.ctx,i=t.circular,{color:a,lineWidth:c}=t;!i&&!r||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),WS(e,n,i,r),o.closePath(),o.stroke(),o.restore())}function q4(e,t,n){return Rr(e,{label:n,index:t,type:"pointLabel"})}class K4 extends Ac{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xt(Gd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=We(t)&&!isNaN(t)?t:0,this.max=We(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gd(this.options))}generateTickLabels(t){Ac.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const s=Me(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?I4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,s))}getIndexAngle(t){const n=Ae/(this._pointLabels.length||1),r=this.options.startAngle||0;return mt(t*n+fn(r))}getDistanceFromCenterForValue(t){if(ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return q4(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const s=this.getIndexAngle(t)-He+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),WS(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,i=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&W4(this,i),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=s.setContext(f),p=o.setContext(f);H4(this,h,c,i,p)}}),r.display){for(t.save(),a=i-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,i;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=r.setContext(this.getContext(c)),u=rt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,i=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const d=xt(l.backdropPadding);t.fillRect(-i/2-d.left,-o-u.size/2-d.top,i+d.width,u.size+d.height)}cs(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ml={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}},Nt=Object.keys(Ml);function rb(e,t){return e-t}function sb(e,t){if(ye(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),We(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(Ys(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ob(e,t,n,r){const s=Nt.length;for(let o=Nt.indexOf(e);o<s-1;++o){const i=Ml[Nt[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return Nt[o]}return Nt[s-1]}function Z4(e,t,n,r,s){for(let o=Nt.length-1;o>=Nt.indexOf(n);o--){const i=Nt[o];if(Ml[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return Nt[n?Nt.indexOf(n):0]}function G4(e){for(let t=Nt.indexOf(e)+1,n=Nt.length;t<n;++t)if(Ml[Nt[t]].common)return Nt[t]}function ib(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=kh(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function Y4(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,c;for(a=o;a<=i;a=+s.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function ab(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:Y4(e,r,s,n)}class Nc extends hs{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={}),s=this._adapter=new r5._date(t.adapters.date);s.init(n),Vo(r.displayFormats,s.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:sb(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:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function c(l){!i&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!i||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=We(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=We(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+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,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=wB(s,o,i);return this._unit=n.unit||(r.autoSkip?ob(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Z4(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:G4(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ab(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=at(n,0,i),r=at(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ob(o.minUnit,n,r,this._getLabelCapacity(n)),a=de(s.ticks.stepSize,1),c=i==="week"?o.isoWeekday:!1,l=Ys(c)||c===!0,u={};let d=n,f,h;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,i),h++)ib(u,f,p);return(f===r||s.bounds==="ticks"||h===1)&&ib(u,f,p),Object.keys(u).sort(rb).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 s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return Me(i,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],f=r[n],h=l&&d&&f&&f.major;return this._adapter.format(t,s||(h?d:u))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.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,s=fn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,ab(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[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 s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(sb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Z0(t.sort(rb))}}function wa(e,t,n){let r=0,s=e.length-1,o,i,a,c;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Un(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:c}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Un(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:c}=e[s]);const l=i-o;return l?a+(c-a)*(t-o)/l:a}class X4 extends Nc{static id="timeseries";static defaults=Nc.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=wa(n,this.min),this._tableRange=wa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,c,l,u;for(i=0,a=t.length;i<a;++i)l=t[i],l>=n&&l<=r&&s.push(l);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)u=s[i+1],c=s[i-1],l=s[i],Math.round((u+c)/2)!==l&&o.push({time:l,pos:i/(a-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((s,o)=>s-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(wa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wa(this._table,r*this._tableRange+this._minPos,!0)}}var J4=Object.freeze({__proto__:null,CategoryScale:BS,LinearScale:US,LogarithmicScale:N4,RadialLinearScale:K4,TimeScale:Nc,TimeSeriesScale:X4});const Q4=[n5,DW,C4,J4],HS="label";function cb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function eH(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function qS(e,t){e.labels=t}function KS(e,t,n=HS){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function tH(e,t=HS){const n={labels:[],datasets:[]};return qS(n,e.labels),KS(n,e.datasets,t),n}function nH(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,h=T.useRef(null),p=T.useRef(null),m=()=>{h.current&&(p.current=new Ti(h.current,{type:i,data:tH(a,o),options:c&&{...c},plugins:l}),cb(t,p.current))},y=()=>{cb(t,null),p.current&&(p.current.destroy(),p.current=null)};return T.useEffect(()=>{!s&&p.current&&c&&eH(p.current,c)},[s,c]),T.useEffect(()=>{!s&&p.current&&qS(p.current.config.data,a.labels)},[s,a.labels]),T.useEffect(()=>{!s&&p.current&&a.datasets&&KS(p.current.config.data,a.datasets,o)},[s,a.datasets]),T.useEffect(()=>{p.current&&(s?(y(),setTimeout(m)):p.current.update(d))},[s,c,a.labels,a.datasets,d]),T.useEffect(()=>{p.current&&(y(),setTimeout(m))},[i]),T.useEffect(()=>(m(),()=>y()),[]),g.jsx("canvas",{ref:h,role:"img",height:n,width:r,...f,children:u})}const rH=T.forwardRef(nH);function sH(e,t){return Ti.register(t),T.forwardRef((n,r)=>g.jsx(rH,{...n,ref:r,type:e}))}const oH=sH("line",yS);Ti.register(...Q4);Ti.register(BS,US,TS,Mi,LS,VS,zS,Nc);const iH={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:n,data:r}=e;if(!n)return;r?.datasets?.[0]?.meta?.raw;const s=r?.datasets?.[0]?.status??[];if(!Array.isArray(s)||s.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const o=e.scales.x;for(let i=0;i<s.length;i++){if(s[i]!=="down")continue;const a=o.getPixelForValue(i-.5),c=o.getPixelForValue(i+.5);t.fillRect(a,n.top,c-a,n.bottom-n.top)}t.restore()}};function aH({points:e}){const t=e.map(i=>new Date(i.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),n=e.map(i=>i.status==="down"?null:i.ping),r=e.map(i=>i.status),s={labels:t,datasets:[{label:"Ping (ms)",data:n,tension:.25,pointRadius:0,fill:!0,status:r}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>{const a=i.dataIndex;if(r[a]==="down")return"Down";const l=i.parsed.y;return l!=null?`${l} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return g.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[g.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),g.jsx("div",{className:"h-[220px]",children:g.jsx(oH,{data:s,options:o,plugins:[iH]})})]})}const cH=Rx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{success:"bg-green-500 text-white",default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function lH({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lf:"span";return g.jsx(s,{"data-slot":"badge",className:Se(cH({variant:t}),e),...r})}var Al="Checkbox",[uH]=wr(Al),[dH,Lh]=uH(Al);function fH(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Zs({prop:n,defaultProp:s??!1,onChange:c,caller:Al}),[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),_=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:o,setChecked:h,control:p,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:pr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:b};return g.jsx(dH,{scope:t,...w,children:hH(d)?d(w):r})}var ZS="CheckboxTrigger",GS=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:p}=Lh(ZS,e),m=Pe(s,u),y=v.useRef(c);return v.useEffect(()=>{const b=o?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[o,d]),g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":pr(c)?"mixed":c,"aria-required":l,"data-state":tE(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:re(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:re(n,b=>{d(x=>pr(x)?!0:!x),p&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});GS.displayName=ZS;var YS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(fH,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(GS,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(eE,{__scopeCheckbox:n})]})})});YS.displayName=Al;var XS="CheckboxIndicator",JS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=Lh(XS,n);return g.jsx(Xn,{present:r||pr(o.checked)||o.checked===!0,children:g.jsx(be.span,{"data-state":tE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});JS.displayName=XS;var QS="CheckboxBubbleInput",eE=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Lh(QS,e),p=Pe(n,h),m=kw(o),y=Wx(r);v.useEffect(()=>{const x=f;if(!x)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(m!==o&&S){const k=new Event("click",{bubbles:C});x.indeterminate=pr(o),S.call(x,pr(o)?!1:o),x.dispatchEvent(k)}},[f,m,o,s]);const b=v.useRef(pr(o)?!1:o);return g.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});eE.displayName=QS;function hH(e){return typeof e=="function"}function pr(e){return e==="indeterminate"}function tE(e){return pr(e)?"indeterminate":e?"checked":"unchecked"}function pH({className:e,...t}){return g.jsx(YS,{"data-slot":"checkbox",className:Se("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(JS,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(bx,{className:"size-3.5"})})})}function mH(){const{id:e}=pi({strict:!1}),t=ls(),n=Hv(),{current:r,currentResults:s,loading:o}=qv(O=>O.monitors),[i,a]=v.useState(!1),[c,l]=v.useState(!1);v.useEffect(()=>{if(!e)return;n(ks(e)),n(Aa(e));const O=setInterval(()=>{n(Aa(e)),n(ks(e))},3e4);return()=>clearInterval(O)},[e,n]);const[u,d]=v.useState(null);if(v.useEffect(()=>{if(!e)return;let O=null;return O=$a(td.apiBase,{path:td.wsPath,transports:["websocket"]}),O.on("monitor:update",N=>{N.monitorId===e&&(d(N),n(Aa(e)),n(ks(e)))}),()=>{O?.disconnect()}},[e,n]),!r)return g.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[g.jsx("div",{children:o?"Loading...":"Monitor not found."}),g.jsx(gt,{variant:"link",onClick:()=>t({to:"/"}),children:"Back to Monitors"})]});const f=(s??[]).slice().reverse(),h=f.slice(-40).map(O=>O.status),p=u??s?.[0]??null,m=p?.status??"unknown",y=m==="up"?"text-emerald-500":m==="down"?"text-red-500":"text-muted-foreground",b=m==="up"?"bg-emerald-500":m==="down"?"bg-red-500":"bg-neutral-400",x=f.map(O=>({t:new Date(O.checkedAt).getTime(),ping:O.pingMs??null,status:O.status??"unknown"})),_=f.filter(O=>O.status==="up"||O.status==="down"),w=_.length?_.filter(O=>O.status==="up").length/_.length*100:0,S=(()=>{const O=f.map(N=>N.pingMs).filter(N=>typeof N=="number");return O.length?Math.round(O.reduce((N,A)=>N+A,0)/O.length):null})();async function C(){if(r)try{await n(dc({id:e,paused:!r.isPaused})).unwrap(),Ee.success(r.isPaused?"Resumed":"Paused")}catch(O){Ee.error(O??"Failed")}}async function k(){try{const N=(await Te.post(`/monitors/${e}/clone`)).data.monitor.id;Ee.success("Cloned (paused)"),n(Na()),t({to:"/monitors/$id",params:{id:N}})}catch(O){Ee.error(O?.response?.data?.detail??"Clone failed")}}async function E(){try{await n(Nf(e)).unwrap(),Ee.success("Deleted"),t({to:"/"})}catch(O){Ee.error(O??"Delete failed")}}const P=async O=>{try{await n(Df({id:r.id,data:O})).unwrap(),Ee.success("Monitor updated"),n(ks(e))}catch(N){throw Ee.error(N||"Failed to update monitor"),N}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",className:"-ml-2 h-8 w-8 text-muted-foreground",onClick:()=>t({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:Se("h-3 w-3 rounded-full",b)}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r.name}),r.isPaused&&g.jsx(lH,{variant:"secondary",children:"Paused"})]})]}),g.jsxs("div",{className:"text-sm text-muted-foreground ml-10",children:[r.type.toUpperCase()," • Interval: ",r.intervalSeconds,"s • ",r.url||r.host||"No target"]}),g.jsx("div",{className:"ml-10 pt-1",children:g.jsxs("div",{className:"flex gap-[2px] items-end h-6",children:[h.map((O,N)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-90 transition-all hover:scale-110 hover:opacity-100",O==="up"?"bg-emerald-500 h-4":O==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-800 h-4"),title:O},N)),h.length===0&&g.jsx("div",{className:"text-xs text-muted-foreground",children:"No data yet"})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs(gt,{variant:"outline",size:"sm",onClick:C,children:[r.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),r.isPaused?"Resume":"Pause"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:()=>l(!0),children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:k,children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(gt,{variant:"destructive",size:"sm",onClick:()=>a(!0),children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Status"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:`text-2xl font-bold ${y}`,children:m.toUpperCase()}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p?.message??"—"})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Uptime (24h)"})}),g.jsxs(Ts,{children:[g.jsxs("div",{className:"text-2xl font-bold",children:[w.toFixed(1),"%"]}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last ",s.length," checks"]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Avg Response"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:"text-2xl font-bold",children:S!=null?`${S} ms`:"—"}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Latest: ",p?.pingMs!=null?`${p.pingMs} ms`:"—"]})]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{children:g.jsx(Os,{children:"Response Time History"})}),g.jsx(Ts,{children:g.jsx(aH,{points:x.slice(-120)})})]}),g.jsx(gH,{monitorId:e}),g.jsx(k0,{open:i,onOpenChange:a,monitor:r,onConfirm:E}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:r,onSubmit:P})]})}function gH({monitorId:e}){const{data:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),{data:n,refetch:r}=Go({queryKey:["monitor-notifications",e],queryFn:async()=>(await Te.get(`/notifications/monitor/${e}`)).data.links}),s=new Set((n??[]).map(i=>i.notificationId));async function o(i){await Te.post(`/notifications/monitor/${e}`,{notificationIds:i}),Ee.success("Notifications updated"),await r()}return g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Notifications"}),g.jsx(C0,{children:"Select which notification channels to alert when this monitor goes down."})]}),g.jsx(Ts,{children:!t||t.length===0?g.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications configured. Go to Settings → Notifications to add channels."}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(i=>g.jsxs("div",{className:"flex items-start space-x-2 rounded-md border p-3",children:[g.jsx(pH,{id:i.id,checked:s.has(i.id),onCheckedChange:a=>{const c=new Set(s);a?c.add(i.id):c.delete(i.id),o(Array.from(c))}}),g.jsxs("div",{className:"grid gap-1.5 leading-none",children:[g.jsx(e0,{htmlFor:i.id,className:"font-medium cursor-pointer",children:i.name}),g.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[200px]",title:i.webhookUrl,children:i.webhookUrl})]})]},i.id))})})]})}function yH(){const e=Go({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Go({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=v.useState(!1),[r,s]=v.useState("My Status Page"),[o,i]=v.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:o,domains:[]}),Ee.success("Created"),e.refetch()}catch(c){Ee.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{className:"font-semibold",children:"Create"}),g.jsxs(Jo,{className:"grid gap-3 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>s(c.target.value)})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Slug"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:o,onChange:c=>i(c.target.value)})]}),g.jsx("div",{className:"flex items-end",children:g.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),g.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>g.jsxs(Yo,{children:[g.jsxs(Xo,{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),g.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),g.jsxs(Jo,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",g.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function bH(){const{data:e,refetch:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=v.useState(""),[s,o]=v.useState("");async function i(){if(!n.trim()||!s.trim()){Ee.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:s}),r(""),o(""),Ee.success("Notification created"),await t()}catch(c){Ee.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),Ee.success("Deleted"),await t()}catch(l){Ee.error(l?.response?.data?.detail??"Delete failed")}}return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),g.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),g.jsxs(Jo,{children:[g.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:"text-sm",children:"Webhook URL"}),g.jsx("input",{value:s,onChange:c=>o(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{children:g.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),g.jsx(Jo,{children:(e??[]).length===0?g.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):g.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),g.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function vH(){return Wc(),vv(),g.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[g.jsx("main",{className:"min-h-screen",children:g.jsx(of,{})}),g.jsx(ER,{richColors:!0})]})}const Sa=Fk({component:vH}),xH=()=>{const{token:e}=Wc.getState();if(!e)throw yb({to:"/login"})};function Nl(e=!0){const t=jn({getParentRoute:()=>Sa,id:"workspace",beforeLoad:e?xH:void 0,component:yT}),n=t.addChildren([jn({getParentRoute:()=>t,path:"/",component:H$}),jn({getParentRoute:()=>t,path:"/monitors/new",component:Ng}),jn({getParentRoute:()=>t,path:"/monitors/$id",component:mH}),jn({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Ng}),jn({getParentRoute:()=>t,path:"/status-pages",component:yH}),jn({getParentRoute:()=>t,path:"/settings/notifications",component:bH})]);if(e){const r=jn({getParentRoute:()=>Sa,path:"/login",component:gT});return Sa.addChildren([n,r])}else return Sa.addChildren([n])}af({routeTree:Nl(!0)});const nE=sM({reducer:{monitors:CM}}),_H=new Vb;function wH({apiBase:e,token:t,basePath:n}){T.useEffect(()=>{iO(e,t)},[e,t]);const r=T.useMemo(()=>af({routeTree:Nl(!1),basepath:"/pulse"}),[n]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:_H,children:g.jsx(Nb,{router:r})})})}const SH=new Vb;function EH({apiBase:e}){T.useEffect(()=>{e&&(Te.defaults.baseURL=e),aO()},[e]);const t=T.useMemo(()=>af({routeTree:Nl(!1)}),[]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:SH,children:g.jsx(Nb,{router:t})})})}const kH=[{title:"Monitors",url:"/pulse/monitors",icon:"Activity"},{title:"Status Pages",url:"/pulse/status-pages",icon:"Globe"},{title:"Notifications",url:"/pulse/notifications",icon:"Bell"}];exports.PulsePage=wH;exports.PulseWatch=EH;exports.api=Te;exports.createRouteTree=Nl;exports.pulseNavItems=kH;
|
package/dist/index.mjs
CHANGED
|
@@ -36612,7 +36612,7 @@ function s3({ apiBase: e, token: t, basePath: n }) {
|
|
|
36612
36612
|
const r = A.useMemo(() => lf({
|
|
36613
36613
|
routeTree: $h(!1),
|
|
36614
36614
|
// Disable internal auth guard, handled by host
|
|
36615
|
-
basepath:
|
|
36615
|
+
basepath: "/pulse"
|
|
36616
36616
|
}), [n]);
|
|
36617
36617
|
return /* @__PURE__ */ g.jsx(Gb, { store: iE, children: /* @__PURE__ */ g.jsx(Kb, { client: RH, children: /* @__PURE__ */ g.jsx(Lb, { router: r }) }) });
|
|
36618
36618
|
}
|
|
@@ -36630,7 +36630,7 @@ function o3({ apiBase: e }) {
|
|
|
36630
36630
|
const i3 = [
|
|
36631
36631
|
{
|
|
36632
36632
|
title: "Monitors",
|
|
36633
|
-
url: "/monitors",
|
|
36633
|
+
url: "/pulse/monitors",
|
|
36634
36634
|
// This assumes the plugin is mounted at root or handles its own routing with this prefix?
|
|
36635
36635
|
// Actually usually plugins are mounted at a prefix e.g. /pulse.
|
|
36636
36636
|
// If routeTree is added to root, then /monitors is correct.
|
|
@@ -36640,12 +36640,12 @@ const i3 = [
|
|
|
36640
36640
|
},
|
|
36641
36641
|
{
|
|
36642
36642
|
title: "Status Pages",
|
|
36643
|
-
url: "/status-pages",
|
|
36643
|
+
url: "/pulse/status-pages",
|
|
36644
36644
|
icon: "Globe"
|
|
36645
36645
|
},
|
|
36646
36646
|
{
|
|
36647
36647
|
title: "Notifications",
|
|
36648
|
-
url: "/
|
|
36648
|
+
url: "/pulse/notifications",
|
|
36649
36649
|
icon: "Bell"
|
|
36650
36650
|
}
|
|
36651
36651
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-orange-500:oklch(70.5% .213 47.604);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-100:oklch(96.2% .044 156.743);--color-green-500:oklch(72.3% .219 149.579);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-500:oklch(58.5% .233 277.117);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-950:oklch(12.9% .042 264.695);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}*{scrollbar-width:thin;scrollbar-color:var(--border)transparent}html{overflow-x:hidden}body{background-color:var(--background);width:100%;min-height:100svh;color:var(--foreground)}body:has(:is(div[data-variant=inset])){background-color:var(--sidebar)}body[data-scroll-locked]{overflow:unset!important}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}@media screen and (max-width:767px){input,select,textarea{font-size:16px!important}}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.start-0{inset-inline-start:calc(var(--spacing)*0)}.start-2{inset-inline-start:calc(var(--spacing)*2)}.end-0{inset-inline-end:calc(var(--spacing)*0)}.end-1{inset-inline-end:calc(var(--spacing)*1)}.end-2{inset-inline-end:calc(var(--spacing)*2)}.end-3{inset-inline-end:calc(var(--spacing)*3)}.end-4{inset-inline-end:calc(var(--spacing)*4)}.top-0{top:calc(var(--spacing)*0)}.top-1\.5{top:calc(var(--spacing)*1.5)}.top-1\/2{top:50%}.top-2\.5{top:calc(var(--spacing)*2.5)}.top-3\.5{top:calc(var(--spacing)*3.5)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.ms-auto{margin-inline-start:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.-ml-2{margin-left:calc(var(--spacing)*-2)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-10{margin-left:calc(var(--spacing)*10)}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.size-\(--cell-size\){width:var(--cell-size);height:var(--cell-size)}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-auto{width:auto;height:auto}.size-full{width:100%;height:100%}.h-\(--cell-size\){height:var(--cell-size)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-64{height:calc(var(--spacing)*64)}.h-\[1\.15rem\]{height:1.15rem}.h-\[220px\]{height:220px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[90vh\]{max-height:90vh}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--cell-size\){width:var(--cell-size)}.w-\(--sidebar-width\){width:var(--sidebar-width)}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-72{width:calc(var(--spacing)*72)}.w-\[340px\]{width:340px}.w-\[360px\]{width:360px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-md{max-width:var(--container-md)}.min-w-\(--cell-size\){min-width:var(--cell-size)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[300px\]{min-width:300px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-popover-content-transform-origin\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-caret-blink{animation:1.25s ease-out infinite caret-blink}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-start{justify-items:start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-\[2px\]{gap:2px}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*-2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*-2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-auto\!{overflow-x:auto!important}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-emerald-400{border-color:var(--color-emerald-400)}.border-input{border-color:var(--input)}.border-neutral-200{border-color:var(--color-neutral-200)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-foreground{background-color:var(--foreground)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-neutral-50{background-color:var(--color-neutral-50)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-300{background-color:var(--color-neutral-300)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-pink-500{background-color:var(--color-pink-500)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-current{fill:currentColor}.fill-primary{fill:var(--primary)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-10{padding:calc(var(--spacing)*10)}.p-12{padding:calc(var(--spacing)*12)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-\(--cell-size\){padding-inline:var(--cell-size)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-6{padding-block:calc(var(--spacing)*6)}.ps-2{padding-inline-start:calc(var(--spacing)*2)}.ps-8{padding-inline-start:calc(var(--spacing)*8)}.pe-1{padding-inline-end:calc(var(--spacing)*1)}.pe-2{padding-inline-end:calc(var(--spacing)*2)}.pe-8{padding-inline-end:calc(var(--spacing)*8)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-emerald-500{color:var(--color-emerald-500)}.text-foreground{color:var(--foreground)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-800{color:var(--color-neutral-800)}.text-neutral-900{color:var(--color-neutral-900)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground)70%,transparent)}}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-background{--tw-ring-color:var(--background)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[inset-inline\,width\]{transition-property:inset-inline,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.fade-in-50{--tw-enter-opacity:.5}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.\[--cell-size\:--spacing\(8\)\]{--cell-size:calc(var(--spacing)*8)}.paused{animation-play-state:paused}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:1}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pe-8:is(:where(.group\/menu-item):has([data-sidebar=menu-action]) *){padding-inline-end:calc(var(--spacing)*8)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing)*-8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing)*8)!important;height:calc(var(--spacing)*8)!important}.group-data-\[collapsible\=icon\]\:w-\(--sidebar-width-icon\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)))}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+\(--spacing\(4\)\)\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing)*4)) + 2px)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing)*2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\[collapsible\=offcanvas\]\:-start-\[calc\(var\(--sidebar-width\)\)\]:is(:where(.group)[data-collapsible=offcanvas] *){inset-inline-start:calc(calc(var(--sidebar-width))*-1)}.group-data-\[collapsible\=offcanvas\]\:-end-\[calc\(var\(--sidebar-width\)\)\]:is(:where(.group)[data-collapsible=offcanvas] *){inset-inline-end:calc(calc(var(--sidebar-width))*-1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing)*0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[focused\=true\]\/day\:relative:is(:where(.group\/day)[data-focused=true] *){position:relative}.group-data-\[focused\=true\]\/day\:z-10:is(:where(.group\/day)[data-focused=true] *){z-index:10}.group-data-\[focused\=true\]\/day\:border-ring:is(:where(.group\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\[focused\=true\]\/day\:ring-\[3px\]:is(:where(.group\/day)[data-focused=true] *){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.group-data-\[side\=left\]\:-end-4:is(:where(.group)[data-side=left] *){inset-inline-end:calc(var(--spacing)*-4)}.group-data-\[side\=left\]\:border-e:is(:where(.group)[data-side=left] *){border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.group-data-\[side\=right\]\:start-0:is(:where(.group)[data-side=right] *){inset-inline-start:calc(var(--spacing)*0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-s:is(:where(.group)[data-side=right] *){border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing)*1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing)*2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing)*1)}.selection\:bg-primary ::-moz-selection{background-color:var(--primary)}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::-moz-selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::-moz-selection{color:var(--primary-foreground)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::-moz-selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::-moz-placeholder{color:var(--muted-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-neutral-400::-moz-placeholder{color:var(--color-neutral-400)}.placeholder\:text-neutral-400::placeholder{color:var(--color-neutral-400)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing)*-2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:start-1\/2:after{content:var(--tw-content);inset-inline-start:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.group-data-\[collapsible\=offcanvas\]\:after\:start-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);inset-inline-start:100%}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:border-emerald-500\/50:hover{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.hover\:border-emerald-500\/50:hover{border-color:color-mix(in oklab,var(--color-emerald-500)50%,transparent)}}.hover\:border-neutral-500\/50:hover{border-color:#73737380}@supports (color:color-mix(in lab,red,red)){.hover\:border-neutral-500\/50:hover{border-color:color-mix(in oklab,var(--color-neutral-500)50%,transparent)}}.hover\:border-red-500\/50:hover{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.hover\:border-red-500\/50:hover{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-emerald-600:hover{background-color:var(--color-emerald-600)}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-neutral-50:hover{background-color:var(--color-neutral-50)}.hover\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[1px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}:where([data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-focus\:border-ring:has(:focus){border-color:var(--ring)}.has-focus\:ring-\[3px\]:has(:focus){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\:ring-ring\/50:has(:focus){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.has-focus\:ring-ring\/50:has(:focus){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.has-disabled\:opacity-50:has(:disabled){opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing)*4)1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){-moz-column-gap:calc(var(--spacing)*3);column-gap:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[inset\]\:ps-8[data-inset]{padding-inline-start:calc(var(--spacing)*8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive)90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-end[data-state=closed]:dir(ltr){--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-end[data-state=closed]:dir(rtl){--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-start[data-state=closed]:dir(ltr){--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-start[data-state=closed]:dir(rtl){--tw-exit-translate-x:100%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-end[data-state=open]:dir(ltr){--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-end[data-state=open]:dir(rtl){--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-start[data-state=open]:dir(ltr){--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-start[data-state=open]:dir(rtl){--tw-enter-translate-x:100%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media(hover:hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:flex{display:flex}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-start{text-align:start}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:block{display:block}.md\:flex{display:flex}.md\:w-\[250px\]{width:250px}.md\:w-auto{width:auto}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:opacity-0{opacity:0}.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing)*2)}.md\:peer-data-\[variant\=inset\]\:ms-0:is(:where(.peer)[data-variant=inset]~*){margin-inline-start:calc(var(--spacing)*0)}.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ms-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-inline-start:calc(var(--spacing)*2)}.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.rtl\:translate-x-1\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}:where([data-side=left]) .rtl\:in-data-\[side\=left\]\:cursor-e-resize:where(:dir(rtl),[dir=rtl],[dir=rtl] *){cursor:e-resize}:where([data-side=right]) .rtl\:in-data-\[side\=right\]\:cursor-w-resize:where(:dir(rtl),[dir=rtl],[dir=rtl] *){cursor:w-resize}.rtl\:data-\[state\=checked\]\:-translate-x-\[calc\(100\%-2px\)\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *)[data-state=checked]{--tw-translate-x: calc((100% - 2px)*-1) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.dark\:border-emerald-700\/60:is(.dark *){border-color:#00795699}@supports (color:color-mix(in lab,red,red)){.dark\:border-emerald-700\/60:is(.dark *){border-color:color-mix(in oklab,var(--color-emerald-700)60%,transparent)}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:border-neutral-800:is(.dark *){border-color:var(--color-neutral-800)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-emerald-900\/10:is(.dark *){background-color:#004e3b1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-emerald-900)10%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:bg-neutral-100:is(.dark *){background-color:var(--color-neutral-100)}.dark\:bg-neutral-700:is(.dark *){background-color:var(--color-neutral-700)}.dark\:bg-neutral-800:is(.dark *){background-color:var(--color-neutral-800)}.dark\:bg-neutral-900:is(.dark *){background-color:var(--color-neutral-900)}.dark\:bg-neutral-900\/40:is(.dark *){background-color:#17171766}@supports (color:color-mix(in lab,red,red)){.dark\:bg-neutral-900\/40:is(.dark *){background-color:color-mix(in oklab,var(--color-neutral-900)40%,transparent)}}.dark\:bg-neutral-950:is(.dark *){background-color:var(--color-neutral-950)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}.dark\:text-neutral-100:is(.dark *){color:var(--color-neutral-100)}.dark\:text-neutral-400:is(.dark *){color:var(--color-neutral-400)}.dark\:text-neutral-900:is(.dark *){color:var(--color-neutral-900)}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\:hover\:bg-neutral-200:is(.dark *):hover{background-color:var(--color-neutral-200)}.dark\:hover\:bg-neutral-800:is(.dark *):hover{background-color:var(--color-neutral-800)}.dark\:hover\:bg-neutral-900:is(.dark *):hover{background-color:var(--color-neutral-900)}.dark\:hover\:bg-neutral-900\/60:is(.dark *):hover{background-color:#17171799}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-neutral-900\/60:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-neutral-900)60%,transparent)}}.dark\:hover\:text-accent-foreground:is(.dark *):hover{color:var(--accent-foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_div\[data-content\]\]\:w-full div[data-content]{width:100%}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.rtl\:\*\*\:\[\.rdp-button\\_next\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg),:is(.rtl\:\*\*\:\[\.rdp-button\\_previous\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\]\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>span\:last-child\]\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-inherit>svg{color:inherit}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-end-2{inset-inline-end:calc(var(--spacing)*-2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left][data-state=collapsed] .rtl\:\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize:where(:dir(rtl),[dir=rtl],[dir=rtl] *){cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-start-2{inset-inline-start:calc(var(--spacing)*-2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-state=collapsed] .rtl\:\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize:where(:dir(rtl),[dir=rtl],[dir=rtl] *){cursor:e-resize}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:#0000}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(12.9% .042 264.695);--card:oklch(100% 0 0);--card-foreground:oklch(12.9% .042 264.695);--popover:oklch(100% 0 0);--popover-foreground:oklch(12.9% .042 264.695);--primary:oklch(20.8% .042 265.755);--primary-foreground:oklch(98.4% .003 247.858);--secondary:oklch(96.8% .007 247.896);--secondary-foreground:oklch(20.8% .042 265.755);--muted:oklch(96.8% .007 247.896);--muted-foreground:oklch(55.4% .046 257.417);--accent:oklch(96.8% .007 247.896);--accent-foreground:oklch(20.8% .042 265.755);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.9% .013 255.508);--input:oklch(92.9% .013 255.508);--ring:oklch(70.4% .04 256.788);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:var(--background);--sidebar-foreground:var(--foreground);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--accent);--sidebar-accent-foreground:var(--accent-foreground);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}.dark{--background:oklch(12% 0 0);--foreground:oklch(98% 0 0);--card:oklch(22% 0 0);--card-foreground:oklch(98% 0 0);--popover:oklch(28% 0 0);--popover-foreground:oklch(98% 0 0);--primary:oklch(90% 0 0);--primary-foreground:oklch(18% 0 0);--secondary:oklch(35% 0 0);--secondary-foreground:oklch(98% 0 0);--muted:oklch(35% 0 0);--muted-foreground:oklch(75% 0 0);--accent:oklch(35% 0 0);--accent-foreground:oklch(98% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(65% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439)}.CollapsibleContent{overflow:hidden}.CollapsibleContent[data-state=open]{animation:.3s ease-out slideDown}.CollapsibleContent[data-state=closed]{animation:.3s ease-out slideUp}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}
|
|
1
|
+
@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}*{scrollbar-width:thin;scrollbar-color:var(--border)transparent}html{overflow-x:hidden}body{background-color:var(--background);width:100%;min-height:100svh;color:var(--foreground)}body:has(:is(div[data-variant=inset])){background-color:var(--sidebar)}body[data-scroll-locked]{overflow:unset!important}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}@media screen and (max-width:767px){input,select,textarea{font-size:16px!important}}}@layer components,utilities;@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(12.9% .042 264.695);--card:oklch(100% 0 0);--card-foreground:oklch(12.9% .042 264.695);--popover:oklch(100% 0 0);--popover-foreground:oklch(12.9% .042 264.695);--primary:oklch(20.8% .042 265.755);--primary-foreground:oklch(98.4% .003 247.858);--secondary:oklch(96.8% .007 247.896);--secondary-foreground:oklch(20.8% .042 265.755);--muted:oklch(96.8% .007 247.896);--muted-foreground:oklch(55.4% .046 257.417);--accent:oklch(96.8% .007 247.896);--accent-foreground:oklch(20.8% .042 265.755);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.9% .013 255.508);--input:oklch(92.9% .013 255.508);--ring:oklch(70.4% .04 256.788);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:var(--background);--sidebar-foreground:var(--foreground);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--accent);--sidebar-accent-foreground:var(--accent-foreground);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}.dark{--background:oklch(12% 0 0);--foreground:oklch(98% 0 0);--card:oklch(22% 0 0);--card-foreground:oklch(98% 0 0);--popover:oklch(28% 0 0);--popover-foreground:oklch(98% 0 0);--primary:oklch(90% 0 0);--primary-foreground:oklch(18% 0 0);--secondary:oklch(35% 0 0);--secondary-foreground:oklch(98% 0 0);--muted:oklch(35% 0 0);--muted-foreground:oklch(75% 0 0);--accent:oklch(35% 0 0);--accent-foreground:oklch(98% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(65% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439)}.CollapsibleContent{overflow:hidden}.CollapsibleContent[data-state=open]{animation:.3s ease-out slideDown}.CollapsibleContent[data-state=closed]{animation:.3s ease-out slideUp}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}
|