okengine 0.17.2 → 0.18.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/AGENTS.md +5 -3
- package/README.md +14 -10
- package/manifest.v1.schema.json +61 -2
- package/package.json +19 -5
- package/site/content/docs/ai/index.mdx +1 -1
- package/site/content/docs/ai/mcp.mdx +10 -1
- package/site/content/docs/ai/skills.mdx +9 -9
- package/site/content/docs/elements/ai.mdx +1 -1
- package/site/content/docs/elements/clock.mdx +1 -1
- package/site/content/docs/elements/flow.mdx +25 -1
- package/site/content/docs/elements/gate.mdx +3 -2
- package/site/content/docs/elements/store.mdx +289 -341
- package/site/content/docs/elements/vault.mdx +5 -5
- package/site/content/docs/get-started/basic-usage.mdx +3 -10
- package/site/content/docs/get-started/index.mdx +1 -1
- package/site/content/docs/get-started/installation.mdx +2 -3
- package/site/content/docs/get-started/introduction.mdx +58 -121
- package/site/content/docs/get-started/meta.json +9 -1
- package/site/content/docs/get-started/project-structure.mdx +4 -11
- package/site/content/docs/get-started/testing.mdx +328 -0
- package/site/content/docs/get-started/why.mdx +93 -71
- package/site/content/docs/index.mdx +44 -11
- package/site/content/docs/meta.json +8 -5
- package/site/content/docs/plugins/apple.mdx +151 -0
- package/site/content/docs/plugins/discord.mdx +139 -0
- package/site/content/docs/plugins/facebook.mdx +134 -0
- package/site/content/docs/plugins/figma.mdx +138 -0
- package/site/content/docs/plugins/github.mdx +138 -0
- package/site/content/docs/plugins/google.mdx +153 -0
- package/site/content/docs/plugins/index.mdx +47 -1
- package/site/content/docs/plugins/meta.json +10 -0
- package/site/content/docs/plugins/microsoft.mdx +151 -0
- package/site/content/docs/plugins/oauth.mdx +188 -0
- package/site/content/docs/plugins/x.mdx +125 -0
- package/site/content/docs/providers/index.mdx +2 -0
- package/site/content/docs/recipes/index.mdx +2 -0
- package/site/content/docs/reference/cli.md +3 -2
- package/site/content/docs/reference/client.mdx +58 -1
- package/site/content/docs/reference/configuration.mdx +2 -4
- package/site/content/docs/reference/fx.mdx +3 -1
- package/site/content/docs/reference/index.mdx +0 -5
- package/site/content/docs/reference/meta.json +2 -2
- package/site/content/docs/reference/okid.mdx +137 -0
- package/src/auth/bindings.ts +1 -1
- package/src/auth/config.ts +9 -0
- package/src/auth/identity-sql.ts +314 -0
- package/src/auth/identity.ts +140 -2
- package/src/auth/index.ts +17 -1
- package/src/auth/method-context.ts +3 -0
- package/src/auth/oauth-as/cimd.ts +132 -0
- package/src/auth/oauth-as/crypto.test.ts +101 -0
- package/src/auth/oauth-as/crypto.ts +393 -0
- package/src/auth/oauth-as/errors.ts +68 -0
- package/src/auth/oauth-as/http.test.ts +419 -0
- package/src/auth/oauth-as/http.ts +842 -0
- package/src/auth/oauth-as/stores.ts +61 -0
- package/src/auth/oauth-as/tables.ts +142 -0
- package/src/auth/tables.ts +0 -11
- package/src/bench/README.md +83 -0
- package/src/bench/REPORT.md +176 -0
- package/src/bench/g01-rls-stamp.bench.ts +194 -0
- package/src/bench/g02-clock-per-tenant.bench.ts +158 -0
- package/src/bench/g03-signal-once.bench.ts +157 -0
- package/src/bench/g03-signal-reconnect.bench.ts +254 -0
- package/src/bench/g03-signal-sse-memory.bench.ts +191 -0
- package/src/bench/g04-auth-vault-hotpath.bench.ts +170 -0
- package/src/bench/g05-sustained-full.bench.ts +265 -0
- package/src/bench/g06-mixed-load.bench.ts +260 -0
- package/src/bench/g07-vault-crypto.bench.ts +100 -0
- package/src/bench/g07-vault-rotate-under-read.bench.ts +285 -0
- package/src/bench/g08-conn-oversubscribe.bench.ts +194 -0
- package/src/bench/g08-store-kv-durable.bench.ts +133 -0
- package/src/bench/g08-store-sql.bench.ts +178 -0
- package/src/bench/g09-journal-sustained.bench.ts +203 -0
- package/src/bench/g10-observability-contention.bench.ts +246 -0
- package/src/bench/g11-cold-start-cycle.bench.ts +164 -0
- package/src/bench/g13-elements.bench.ts +427 -0
- package/src/bench/g14-graceful-shutdown.bench.ts +244 -0
- package/src/bench/g15-postgres-degradation.bench.ts +264 -0
- package/src/bench/g16-live-query-fanout.bench.ts +206 -0
- package/src/bench/lib/event-loop-lag.ts +26 -0
- package/src/bench/lib/infra.ts +60 -0
- package/src/bench/lib/report.ts +52 -0
- package/src/bench/lib/rss-sampler.ts +61 -0
- package/src/bench/lib/signal-pg.ts +88 -0
- package/src/bench/load-app.ts +337 -0
- package/src/bench/load-child.ts +108 -0
- package/src/bench/smoke.bench.ts +43 -0
- package/src/cli/competitor-mention-removal.test.ts +28 -0
- package/src/cli/doctor-fd.ts +117 -0
- package/src/cli/doctor.test.ts +192 -0
- package/src/cli/doctor.ts +129 -1
- package/src/client/create.ts +95 -1
- package/src/client/index.ts +9 -2
- package/src/client/transport.ts +11 -4
- package/src/client/use-live-query.ts +154 -0
- package/src/client-react/index.ts +15 -1
- package/src/client-react/live-resource.ts +246 -0
- package/src/client-react/use-live-query.test.ts +475 -0
- package/src/client-react/use-live-query.ts +530 -0
- package/src/compiler/extract.test.ts +518 -0
- package/src/compiler/extract.ts +386 -19
- package/src/console/server/invoke-user-flow.ts +2 -1
- package/src/console/ui-next/dist/assets/{access-page-DnWbnGzq.js → access-page-De7Lc2JC.js} +1 -1
- package/src/console/ui-next/dist/assets/{flows-page-BiZ4-6yQ.js → flows-page-RGy7VEA_.js} +1 -1
- package/src/console/ui-next/dist/assets/{index-C8NRK2R-.js → index-_rgpdVzo.js} +3 -3
- package/src/console/ui-next/dist/assets/{observability-page-CrB6vd1T.js → observability-page-Ds6pcnh-.js} +1 -1
- package/src/console/ui-next/dist/assets/{store-page-CS5-aETQ.js → store-page-02xOiqIK.js} +3 -3
- package/src/console/ui-next/dist/assets/{units-page-CjtdlW8l.js → units-page-4rHOePuE.js} +1 -1
- package/src/console/ui-next/dist/assets/{vault-page-C6Xxm9SA.js → vault-page-DISPgxLM.js} +1 -1
- package/src/console/ui-next/dist/index.html +1 -1
- package/src/console/ui-next/src/features/store/lib/fields-from-table.ts +36 -2
- package/src/drivers/cdc-outbox.ts +389 -0
- package/src/drivers/memory.ts +20 -0
- package/src/drivers/oauth-apple.ts +156 -0
- package/src/drivers/oauth-discord.ts +79 -0
- package/src/drivers/oauth-facebook.ts +80 -0
- package/src/drivers/oauth-figma.ts +116 -0
- package/src/drivers/oauth-github.ts +92 -0
- package/src/drivers/oauth-google.ts +142 -0
- package/src/drivers/oauth-microsoft.ts +174 -0
- package/src/drivers/oauth-oidc.ts +293 -0
- package/src/drivers/oauth-shared.ts +326 -0
- package/src/drivers/oauth-types.ts +159 -0
- package/src/drivers/oauth-x.ts +77 -0
- package/src/drivers/oauth2-common.ts +95 -0
- package/src/drivers/oauth2-token.ts +61 -0
- package/src/drivers/pg-rls-row-passes.ts +251 -0
- package/src/drivers/pg-rls.ts +2 -0
- package/src/drivers/postgres.ts +45 -2
- package/src/drivers/signal-postgres.ts +2 -1
- package/src/elements/channel/runtime.ts +29 -2
- package/src/elements/channel.test.ts +52 -0
- package/src/elements/gate/boot.ts +29 -2
- package/src/elements/store/emit-drizzle.ts +147 -14
- package/src/elements/store/field-ddl.test.ts +118 -0
- package/src/elements/store/field-types.test.ts +455 -0
- package/src/elements/store/list-query.golden.json +777 -0
- package/src/elements/store/list-query.parity.test.ts +396 -0
- package/src/elements/store/list-query.ts +792 -0
- package/src/elements/store/live-default.test.ts +136 -0
- package/src/elements/store/live-http.test.ts +160 -0
- package/src/elements/store/live-isolation.test.ts +291 -0
- package/src/elements/store/live-query-runtime.test.ts +323 -0
- package/src/elements/store/live-query-runtime.ts +403 -0
- package/src/elements/store/live-query-server.test.ts +377 -0
- package/src/elements/store/live-query-server.ts +102 -0
- package/src/elements/store/live-query.ts +97 -0
- package/src/elements/store/resource.ts +189 -680
- package/src/elements/store/rls-row-passes-policies.parity.test.ts +665 -0
- package/src/elements/store/schema-decl.ts +539 -41
- package/src/elements/store/sql-rls-stamp.test.ts +27 -0
- package/src/elements/store/sql-session.ts +297 -35
- package/src/elements/store/table.ts +102 -21
- package/src/elements/store.test.ts +3 -1
- package/src/elements/store.ts +12 -1
- package/src/elements/vault/chaos-child.ts +74 -1
- package/src/elements/vault/chaos.test.ts +4 -2
- package/src/elements/vault/storage.ts +4 -2
- package/src/index.ts +5 -2
- package/src/kernel/app-auth.ts +1 -0
- package/src/kernel/app.ts +116 -2
- package/src/kernel/auth-sharing.test.ts +196 -0
- package/src/kernel/boot.test.ts +3 -3
- package/src/kernel/errors.ts +8 -0
- package/src/kernel/fx.test.ts +1 -0
- package/src/kernel/fx.ts +14 -2
- package/src/kernel/horizontal-child.ts +2 -1
- package/src/kernel/http-resource.ts +33 -7
- package/src/kernel/identity-host-persist.test.ts +119 -0
- package/src/kernel/instance-id.ts +4 -2
- package/src/kernel/journal.ts +2 -1
- package/src/kernel/mcp-tool.test.ts +95 -0
- package/src/kernel/on.ts +9 -0
- package/src/kernel/realtime-bind.ts +326 -0
- package/src/kernel/resource-live.ts +117 -0
- package/src/kernel/triggers.ts +86 -4
- package/src/manifest/diff.ts +37 -0
- package/src/manifest/types.ts +64 -2
- package/src/okid.bench.test.ts +64 -0
- package/src/okid.test.ts +338 -0
- package/src/okid.ts +245 -0
- package/src/plugins/anonymous.ts +19 -1
- package/src/plugins/auth/shared.ts +15 -0
- package/src/plugins/index.ts +2 -0
- package/src/plugins/magic-link.ts +10 -8
- package/src/plugins/mcp-oauth.ts +208 -0
- package/src/plugins/oauth/flow-store.ts +117 -0
- package/src/plugins/oauth/link.ts +69 -0
- package/src/plugins/oauth/shared.ts +108 -0
- package/src/plugins/oauth/token-vault.ts +100 -0
- package/src/plugins/oauth.security.test.ts +535 -0
- package/src/plugins/oauth.ts +532 -0
- package/src/plugins/otp.ts +48 -6
- package/src/plugins/passkey.ts +20 -1
- package/src/plugins/two-factor.ts +11 -0
- package/src/plugins/username.ts +40 -7
- package/src/release/build-lib.ts +7 -1
- package/src/release/measure.ts +1 -0
- package/src/release/official-plugins.ts +4 -1
- package/src/runs/collect.ts +2 -1
- package/src/runs/drivers/files.ts +2 -1
- package/src/test/create-test-app.ts +114 -5
- package/src/test/export-bundle.test.ts +33 -0
- package/src/test/live-signals.test.ts +83 -0
- package/src/test/tenant-isolation.test.ts +175 -0
- package/src/testing.ts +26 -0
- package/src/upgrade/codemods.ts +1 -1
- package/site/content/docs/reference/migrating-environments.mdx +0 -158
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{$n as n,Ca as r,Cr as i,Ea as a,Er as o,Ga as s,Ia as c,Ma as l,Mr as u,No as d,Qn as f,_r as p,br as m,cr as h,dr as g,er as _,gr as v,hr as y,i as b,kr as x,l as S,mr as C,nr as w,o as T,s as E,sr as D,tr as O,u as k,ur as A,vr as j,wr as M,xr as N,yr as P,zi as F}from"./shortcut-keys-DKxNTe_m.js";import{t as I}from"./useMutation-B8EO02Ej.js";import{n as L,r as R}from"./react-dom-Bph1y7z7.js";import{A as z,C as B,D as ee,E as V,S as H,T as U,_ as te,b as ne,g as re,h as ie,v as ae,w as oe,x as se,y as W}from"./xyflow-D7n4g6go.js";import{t as ce}from"./link-BX6Vqztd.js";import{g as le,i as ue,k as de,n as fe,t as G,x as pe}from"./react-D8E3mtu1.js";import{i as me,n as he,r as ge}from"./duration-tone-sC3lGABz.js";import{c as _e,s as ve,t as ye}from"./trace-detail-sheet-B09O8rA6.js";import{a as be,c as xe,i as Se,l as Ce,o as we,s as Te}from"./index-C8NRK2R-.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me}from"./element-icons-BVXtRyd3.js";import{t as Ne}from"./explorer-empty-2uIhBu0_.js";import{a as Pe,i as Fe,s as Ie}from"./highlighted-json-Awq7gYdu.js";import{C as Le}from"./request-meta-DV0ywz7t.js";import{n as Re,r as ze,t as Be}from"./collapsible-DGnOM2ph.js";import{H as Ve,M as He,n as Ue,t as We}from"./replica-lag-DKRrbvdo.js";import{n as Ge,r as Ke}from"./use-vault-list-uk4WVboC.js";import{t as qe}from"./call-pii-button-ChAUiLo9.js";function Je(e,t,n={}){let r=e.get(),i=null,a=r,o,s=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,c=()=>{i&&=(i.stop(),null),e.animation=void 0},l=()=>{let t=Xe(e.get()),r=Xe(a);if(t===r){c();return}let s=i?i.getGeneratorVelocity():e.getVelocity();c(),i=new pe({keyframes:[t,r],velocity:s,type:`spring`,restDelta:.001,restSpeed:.01,...n,onUpdate:o})},u=()=>{l(),e.animation=i??void 0,e.events.animationStart?.notify(),i?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((e,t)=>{a=e,o=e=>t(Ye(e,s)),de.postRender(u)},c),le(t)){let r=n.skipInitialAnimation===!0,i=t.on(`change`,t=>{r?(r=!1,e.jump(Ye(t,s),!1)):e.set(Ye(t,s))}),a=e.on(`destroy`,i);return()=>{i(),a()}}return c}function Ye(e,t){return t?e+t:e}function Xe(e){return typeof e==`number`?e:parseFloat(e)}var K=e(R(),1);function Ze(e,t={}){let{isStatic:n}=(0,K.useContext)(ue),r=()=>le(e)?e.get():e;if(n)return ve(r);let i=_e(r());return(0,K.useInsertionEffect)(()=>Je(i,e,t),[i,JSON.stringify(t)]),i}function Qe(e,t={}){return Ze(e,{type:`spring`,...t})}var $e=Math.PI/180,et=180/Math.PI,tt=18,nt=.96422,rt=1,it=.82521,at=4/29,ot=6/29,st=3*ot*ot,ct=ot*ot*ot;function lt(e){if(e instanceof dt)return new dt(e.l,e.a,e.b,e.opacity);if(e instanceof vt)return yt(e);e instanceof se||(e=U(e));var t=ht(e.r),n=ht(e.g),r=ht(e.b),i=ft((.2225045*t+.7168786*n+.0606169*r)/rt),a,o;return t===n&&n===r?a=o=i:(a=ft((.4360747*t+.3850649*n+.1430804*r)/nt),o=ft((.0139322*t+.0971045*n+.7141733*r)/it)),new dt(116*i-16,500*(a-i),200*(i-o),e.opacity)}function ut(e,t,n,r){return arguments.length===1?lt(e):new dt(e,t,n,r??1)}function dt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}V(dt,ut,ee(ne,{brighter(e){return new dt(this.l+tt*(e??1),this.a,this.b,this.opacity)},darker(e){return new dt(this.l-tt*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=nt*pt(t),e=rt*pt(e),n=it*pt(n),new se(mt(3.1338561*t-1.6168667*e-.4906146*n),mt(-.9787684*t+1.9161415*e+.033454*n),mt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function ft(e){return e>ct?e**(1/3):e/st+at}function pt(e){return e>ot?e*e*e:st*(e-at)}function mt(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function ht(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function gt(e){if(e instanceof vt)return new vt(e.h,e.c,e.l,e.opacity);if(e instanceof dt||(e=lt(e)),e.a===0&&e.b===0)return new vt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*et;return new vt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _t(e,t,n,r){return arguments.length===1?gt(e):new vt(e,t,n,r??1)}function vt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function yt(e){if(isNaN(e.h))return new dt(e.l,0,0,e.opacity);var t=e.h*$e;return new dt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}V(vt,_t,ee(ne,{brighter(e){return new vt(this.h,this.c,this.l+tt*(e??1),this.opacity)},darker(e){return new vt(this.h,this.c,this.l-tt*(e??1),this.opacity)},rgb(){return yt(this).rgb()}}));var bt=-.14861,xt=1.78277,St=-.29227,Ct=-.90649,wt=1.97294,Tt=wt*Ct,Et=wt*xt,Dt=xt*St-Ct*bt;function Ot(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);e instanceof se||(e=U(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Dt*r+Tt*t-Et*n)/(Dt+Tt-Et),a=r-i,o=(wt*(n-i)-St*a)/Ct,s=Math.sqrt(o*o+a*a)/(wt*i*(1-i)),c=s?Math.atan2(o,a)*et-120:NaN;return new At(c<0?c+360:c,s,i,e.opacity)}function kt(e,t,n,r){return arguments.length===1?Ot(e):new At(e,t,n,r??1)}function At(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}V(At,kt,ee(ne,{brighter(e){return e=e==null?H:H**+e,new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?B:B**+e,new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*$e,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new se(255*(t+n*(bt*r+xt*i)),255*(t+n*(St*r+Ct*i)),255*(t+wt*r*n),this.opacity)}}));function jt(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Mt(e){return function(t,n){var r=e((t=oe(t)).h,(n=oe(n)).h),i=W(t.s,n.s),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Nt=Mt(ae),Pt=Mt(W);function Ft(e,t){var n=W((e=ut(e)).l,(t=ut(t)).l),r=W(e.a,t.a),i=W(e.b,t.b),a=W(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function It(e){return function(t,n){var r=e((t=_t(t)).h,(n=_t(n)).h),i=W(t.c,n.c),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Lt=It(ae),Rt=It(W);function zt(e){return(function t(n){n=+n;function r(t,r){var i=e((t=kt(t)).h,(r=kt(r)).h),a=W(t.s,r.s),o=W(t.l,r.l),s=W(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var Bt=zt(ae),Vt=zt(W),Ht=[`console.ai.list`];function Ut(){return d({queryKey:Ht,queryFn:async()=>{let e=await r();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty AI list`);return e.data}})}var Wt=[`console.clock.list`];function Gt(){return d({queryKey:Wt,queryFn:async()=>{let e=await a();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty clock list`);return e.data},refetchInterval:15e3})}var Kt=[`console.instances.list`];function qt(){return d({queryKey:Kt,queryFn:async()=>{let e=await l();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty instances list`);return e.data},refetchInterval:15e3})}var Jt=[`console.signals.list`];function Yt(){return d({queryKey:Jt,queryFn:async()=>{let e=await s();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty signals list`);return e.data},refetchInterval:1e4})}function Xt(e,t,n){let r=xe(e,t,n),i=0,a=0;for(let e of r)e.inputTokens!==null&&e.inputTokens>0&&(i+=e.inputTokens),e.outputTokens!==null&&e.outputTokens>0&&(a+=e.outputTokens);return i===0&&a===0?{kind:`empty`}:{kind:`summary`,inputTokens:i,outputTokens:a,windowMs:n}}function Zt(e){return!Number.isFinite(e)||e<=0?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Qt(e){let t=[];return e.inputTokens>0&&t.push(`${Zt(e.inputTokens)} in`),e.outputTokens>0&&t.push(`${Zt(e.outputTokens)} out`),t.length===0?null:t.join(` · `)}var q=z();function $t({ai:e,asks:t,tokens:n}){let r=(e?.versions??[]).filter(e=>e.sampleCount>0),i=r.length===0?null:r.reduce((e,t)=>e+t.cost.mean,0)/r.length,a=n.kind===`summary`?Qt(n):null;return(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border/60 px-3 py-1.5`,"data-slot":`observability-ai-rail`,"aria-label":`AI usage`,children:[(0,q.jsx)(`span`,{className:`text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`AI`}),i==null?(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-slot":`observability-ai-empty`,children:`No cost samples in the Console AI journal.`}):(0,q.jsxs)(`p`,{className:`text-[11px] text-foreground/85`,"data-slot":`observability-ai-cost`,children:[(0,q.jsxs)(`span`,{className:`tabular-nums`,children:[`mean `,en(i)]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,q.jsxs)(`span`,{className:`tabular-nums`,children:[r.length,` version`]})]}),a?(0,q.jsx)(`p`,{className:`font-mono text-[10px] text-muted-foreground`,"data-slot":`observability-ai-tokens`,children:a}):null,t.kind===`summary`?(0,q.jsxs)(`span`,{className:`ml-auto font-mono text-[10px] text-muted-foreground`,"data-slot":`observability-ai-asks`,children:[t.asks,` ask`,t.asks===1?``:`s`,` in window`]}):(0,q.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:`No ask effects in window`})]})}function en(e){return Number.isFinite(e)?e===0?`0`:e<.01?e.toExponential(2):e.toFixed(4):`—`}function tn({fleet:e,open:t,onClose:n}){let r=e?.kind===`fleet`?e.instances:[],i=e?.kind===`fleet`?e.now:Date.now();return(0,q.jsx)(b,{open:t,onOpenChange:e=>!e&&n(),children:(0,q.jsxs)(T,{side:`right`,className:`flex w-full flex-col sm:max-w-md`,"data-slot":`instance-fleet-sheet`,children:[(0,q.jsxs)(S,{children:[(0,q.jsx)(k,{children:`Instances`}),(0,q.jsx)(E,{children:e?.kind===`fleet`?`${e.alive} alive — Clock and Journal leases this process holds`:`No shared fleet registry on this Console`})]}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:r.length===0?(0,q.jsx)(`p`,{className:D,children:e?.kind===`fleet`?`Every presence lease has expired.`:`The registry is unbound (test / no shared store).`}):(0,q.jsx)(`ul`,{className:`divide-y divide-border/60`,children:r.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(nn,{row:e,now:i})},e.id))})})]})})}function nn({row:e,now:t}){let n=Math.max(0,t-e.heartbeatAt),r=e.clock.map(e=>e.name).join(`, `),a=e.journal.map(e=>e.flow).join(`, `);return(0,q.jsxs)(`div`,{className:g,"data-slot":`instance-fleet-row`,"data-instance-id":e.id,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(`size-1.5 shrink-0 rounded-full`,n<3e4?`bg-emerald-500`:`bg-muted-foreground/50`)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`truncate font-medium text-foreground`,children:e.id}),(0,q.jsxs)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:[`heartbeat `,Fe(n),` ago`,e.pid===void 0?``:` · pid ${e.pid}`]}),(0,q.jsx)(`p`,{className:`${N} mt-1.5`,children:`Clock`}),(0,q.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:r.length>0?r:`holding nothing`}),(0,q.jsx)(`p`,{className:`${N} mt-1.5`,children:`Journal`}),(0,q.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:a.length>0?a:`holding nothing`})]})]})}function rn(e){return e.map(e=>({date:new Date(e.startAt),requests:e.n,errors:e.errors,p95:e.p95Ms}))}function an(e){return e<=36e5?6e4:e<=864e5?3e5:36e5}function on(e,t){return Math.floor(e/t)*t}function sn(e,t,n){let r=xe(e,t,n);if(r.length===0)return{kind:`empty`};let i=an(n),a=on(t-Math.max(0,n),i),o=on(t,i),s=new Map,c=new Map;for(let e=a;e<=o;e+=i)s.set(e,[]),c.set(e,{n:0,errors:0});for(let e of r){let t=on(e.startedAt,i),n=s.get(t),r=c.get(t);!n||!r||(n.push(e.durationMs),r.n+=1,Te(e)&&(r.errors+=1))}let l=[];for(let e=a;e<=o;e+=i){let t=s.get(e)??[],n=c.get(e)??{n:0,errors:0},r=[...t].sort((e,t)=>e-t);l.push({startAt:e,n:n.n,errors:n.errors,errorRate:n.n===0?0:n.errors/n.n,p95Ms:n.n===0?0:we(r,.95),requestPerSec:n.n/(i/1e3)})}return{kind:`series`,buckets:l,bucketMs:i,windowMs:n}}function J(e){return function(){return e}}var cn=Math.PI,ln=2*cn,un=1e-6,dn=ln-un;function fn(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function pn(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return fn;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var mn=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?fn:pn(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>un)if(!(Math.abs(u*s-c*l)>un)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((cn-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>un&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>un||Math.abs(this._y1-l)>un)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ln+ln),d>dn?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>un&&this._append`A${n},${n},0,${+(d>=cn)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};mn.prototype;function hn(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new mn(t)}Array.prototype.slice;function gn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _n(e){this._context=e}_n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function vn(e){return new _n(e)}function yn(e){return e[0]}function bn(e){return e[1]}function xn(e,t){var n=J(!0),r=null,i=vn,a=null,o=hn(s);e=typeof e==`function`?e:e===void 0?yn:J(e),t=typeof t==`function`?t:t===void 0?bn:J(t);function s(s){var c,l=(s=gn(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:J(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Sn(e,t,n){var r=null,i=J(!0),a=null,o=vn,s=null,c=hn(l);e=typeof e==`function`?e:e===void 0?yn:J(+e),t=typeof t==`function`?t:J(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?bn:J(+n);function l(l){var u,d,f,p=(l=gn(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return xn().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:J(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:J(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:J(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}function Cn(e){return e<0?-1:1}function wn(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Cn(a)+Cn(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Tn(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function En(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Dn(e){this._context=e}Dn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:En(this,this._t0,Tn(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,En(this,Tn(this,n=wn(this,e,t)),n);break;default:En(this,this._t0,n=wn(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},Object.create(Dn.prototype).point=function(e,t){Dn.prototype.point.call(this,t,e)};function On(e){return new Dn(e)}function kn(e){this._context=e}kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=An(e),i=An(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function An(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function jn(e){return new kn(e)}var Mn=t(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));function Nn(e,t){e(t)}function Pn(){let{x:e,x0:t,x1:n,y:r,y0:i,y1:a,defined:o,curve:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=Sn();return e&&Nn(c.x,e),t&&Nn(c.x0,t),n&&Nn(c.x1,n),r&&Nn(c.y,r),i&&Nn(c.y0,i),a&&Nn(c.y1,a),o&&c.defined(o),s&&c.curve(s),c}function Fn(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=xn();return e&&Nn(i.x,e),t&&Nn(i.y,t),n&&i.defined(n),r&&i.curve(r),i}var In=e(Mn());function Ln(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,q.jsx)(`g`,{ref:o,className:(0,In.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function Rn(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,q.jsx)(`line`,{ref:a,className:(0,In.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function zn(e){let{children:t,data:n=[],x:r,y:i,fill:a=`transparent`,className:o,curve:s,innerRef:c,defined:l=()=>!0,...u}=e,d=Fn({x:r,y:i,defined:l,curve:s});return t?(0,q.jsx)(q.Fragment,{children:t({path:d})}):(0,q.jsx)(`path`,{ref:c,className:(0,In.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}function Bn(e){let{x:t,x0:n,x1:r,y:i,y1:a,y0:o,yScale:s,data:c=[],defined:l=()=>!0,className:u,curve:d,innerRef:f,children:p,...m}=e,h=Pn({x:t,x0:n,x1:r,defined:l,curve:d});return o==null?h.y0(s.range()[0]):Nn(h.y0,o),i&&!a&&Nn(h.y1,i),a&&!i&&Nn(h.y1,a),p?(0,q.jsx)(q.Fragment,{children:p({path:h})}):(0,q.jsx)(`path`,{ref:f,className:(0,In.default)(`visx-area-closed`,u),d:h(c)||``,...m})}function Vn(e){return e===!1?{left:!1,right:!1,any:!1}:e===`left`?{left:!0,right:!1,any:!0}:e===`right`?{left:!1,right:!0,any:!0}:{left:!0,right:!0,any:!0}}function Hn(e){return[{offset:`0%`,opacity:+!e.left},{offset:`15%`,opacity:1},{offset:`85%`,opacity:1},{offset:`100%`,opacity:+!e.right}]}function Un(e){return{gradientUnits:`userSpaceOnUse`,x1:0,x2:e,y1:0,y2:0}}function Wn({gradientId:e,strokeGradientId:t,edgeMaskId:n,edgeGradientId:r,fill:i,fillOpacity:a,gradientToOpacity:o,gradientSpan:s=1,resolvedStroke:c,isPatternFill:l,fadeEdges:u,innerWidth:d,innerHeight:f}){let p=Vn(u),m=p.any?Hn(p):null,h=p.any&&!l?Hn(p):null,g=Math.min(1,Math.max(.01,s)),_=`${g*100}%`;return(0,q.jsxs)(`defs`,{children:[l?null:(0,q.jsxs)(`linearGradient`,{id:e,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:i,stopOpacity:a}}),(0,q.jsx)(`stop`,{offset:_,style:{stopColor:i,stopOpacity:o}}),g<1?(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:i,stopOpacity:o}}):null]}),m?(0,q.jsx)(`linearGradient`,{id:t,...Un(d),children:m.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:c,stopOpacity:e.opacity}},e.offset))}):null,h?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`linearGradient`,{id:r,...Un(d),children:h.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:`white`,stopOpacity:e.opacity}},e.offset))}),(0,q.jsx)(`mask`,{id:n,children:(0,q.jsx)(`rect`,{fill:`url(#${r})`,height:f,width:d,x:`0`,y:`0`})})]}):null]})}function Gn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Kn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qn(e){let t,n,r;e.length===2?(t=e===Gn||e===Kn?e:Jn,n=e,r=e):(t=Gn,n=(t,n)=>Gn(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Jn(){return 0}function Yn(e){return e===null?NaN:+e}var Xn=qn(Gn),Zn=Xn.right;Xn.left,qn(Yn).center;function Qn(e,t){let n,r;if(t===void 0)for(let t of e)t!=null&&(n===void 0?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var $n=Math.sqrt(50),er=Math.sqrt(10),tr=Math.sqrt(2);function nr(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=$n?10:a>=er?5:a>=tr?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?nr(e,t,n*2):[s,c,l]}function rr(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?nr(t,e,n):nr(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function ir(e,t,n){return t=+t,e=+e,n=+n,nr(e,t,n)[2]}function ar(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?ir(t,e,n):ir(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function sr(e){return function(){return e}}function cr(e){return+e}var lr=[0,1];function ur(e){return e}function dr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:sr(isNaN(t)?NaN:.5)}function fr(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function pr(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=dr(i,r),a=n(o,a)):(r=dr(r,i),a=n(a,o)),function(e){return a(r(e))}}function mr(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=dr(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=Zn(e,t,1,r)-1;return a[n](i[n](t))}}function hr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function gr(){var e=lr,t=lr,n=ie,r,i,a,o=ur,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==ur&&(o=fr(e[0],e[n-1])),s=n>2?mr:pr,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),re))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,cr),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=jt,u()},d.clamp=function(e){return arguments.length?(o=e?!0:ur,u()):o!==ur},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function _r(){return gr()(ur,ur)}function vr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function yr(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function br(e){return e=yr(Math.abs(e)),e?e[1]:NaN}function xr(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Sr(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Cr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wr(e){if(!(t=Cr.exec(e)))throw Error(`invalid format: `+e);var t;return new Tr({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}wr.prototype=Tr.prototype;function Tr(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Tr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Er(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var Dr;function Or(e,t){var n=yr(e,t);if(!n)return Dr=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Dr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+yr(e,Math.max(0,t+a-1))[0]}function kr(e,t){var n=yr(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ar={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:vr,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>kr(e*100,t),r:kr,s:Or,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jr(e){return e}var Mr=Array.prototype.map,Nr=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Pr(e){var t=e.grouping===void 0||e.thousands===void 0?jr:xr(Mr.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?jr:Sr(Mr.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=wr(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ar[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Ar[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Er(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Dr!==void 0?Nr[8+Dr/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(br(t)/3)))*3,r=10**-n,i=l((e=wr(e),e.type=`f`,e),{suffix:Nr[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Fr,Ir,Lr;Rr({thousands:`,`,grouping:[3],currency:[`$`,``]});function Rr(e){return Fr=Pr(e),Ir=Fr.format,Lr=Fr.formatPrefix,Fr}function zr(e){return Math.max(0,-br(Math.abs(e)))}function Br(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(br(t)/3)))*3-br(Math.abs(e)))}function Vr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,br(t)-br(e))+1}function Hr(e,t,n,r){var i=ar(e,t,n),a;switch(r=wr(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Br(i,o))&&(r.precision=a),Lr(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Vr(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=zr(i))&&(r.precision=a-(r.type===`%`)*2)}return Ir(r)}function Ur(e){var t=e.domain;return e.ticks=function(e){var n=t();return rr(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Hr(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=ir(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Wr(){var e=_r();return e.copy=function(){return hr(e,Wr())},or.apply(e,arguments),Ur(e)}function Gr(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}var Kr=new Date,qr=new Date;function Y(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>Y(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Kr.setTime(+t),qr.setTime(+r),e(Kr),e(qr),Math.floor(n(Kr,qr))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var Jr=Y(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jr.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Y(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jr),Jr.range;var Yr=1e3,Xr=Yr*60,Zr=Xr*60,Qr=Zr*24,$r=Qr*7,ei=Qr*30,ti=Qr*365,ni=Y(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getUTCSeconds());ni.range;var ri=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Yr)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getMinutes());ri.range;var ii=Y(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getUTCMinutes());ii.range;var ai=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Yr-e.getMinutes()*Xr)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getHours());ai.range;var oi=Y(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCHours());oi.range;var si=Y(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xr)/Qr,e=>e.getDate()-1);si.range;var ci=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>e.getUTCDate()-1);ci.range;var li=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>Math.floor(e/Qr));li.range;function ui(e){return Y(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xr)/$r)}var di=ui(0),fi=ui(1),pi=ui(2),mi=ui(3),hi=ui(4),gi=ui(5),_i=ui(6);di.range,fi.range,pi.range,mi.range,hi.range,gi.range,_i.range;function vi(e){return Y(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/$r)}var yi=vi(0),bi=vi(1),xi=vi(2),Si=vi(3),Ci=vi(4),wi=vi(5),Ti=vi(6);yi.range,bi.range,xi.range,Si.range,Ci.range,wi.range,Ti.range;var Ei=Y(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ei.range;var Di=Y(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Di.range;var Oi=Y(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Oi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Oi.range;var ki=Y(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ki.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),ki.range;function Ai(e,t,n,r,i,a){let o=[[ni,1,Yr],[ni,5,5*Yr],[ni,15,15*Yr],[ni,30,30*Yr],[a,1,Xr],[a,5,5*Xr],[a,15,15*Xr],[a,30,30*Xr],[i,1,Zr],[i,3,3*Zr],[i,6,6*Zr],[i,12,12*Zr],[r,1,Qr],[r,2,2*Qr],[n,1,$r],[t,1,ei],[t,3,3*ei],[e,1,ti]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=qn(([,,e])=>e).right(o,i);if(a===o.length)return e.every(ar(t/ti,n/ti,r));if(a===0)return Jr.every(Math.max(ar(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[ji,Mi]=Ai(ki,Di,yi,li,oi,ii),[Ni,Pi]=Ai(Oi,Ei,di,si,ai,ri);function Fi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ii(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Li(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ri(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Ui(i),u=Wi(i),d=Ui(a),f=Wi(a),p=Ui(o),m=Wi(o),h=Ui(s),g=Wi(s),_=Ui(c),v=Wi(c),y={a:N,A:P,b:F,B:I,c:null,d:da,e:da,f:ga,g:Da,G:ka,H:fa,I:pa,j:ma,L:ha,m:_a,M:va,p:L,q:R,Q:Qa,s:$a,S:ya,u:ba,U:xa,V:Ca,w:wa,W:Ta,x:null,X:null,y:Ea,Y:Oa,Z:Aa,"%":Za},b={a:z,A:B,b:ee,B:V,c:null,d:ja,e:ja,f:Ia,g:qa,G:Ya,H:Ma,I:Na,j:Pa,L:Fa,m:La,M:Ra,p:H,q:U,Q:Qa,s:$a,S:za,u:Ba,U:Va,V:Ua,w:Wa,W:Ga,x:null,X:null,y:Ka,Y:Ja,Z:Xa,"%":Za},x={a:E,A:D,b:O,B:k,c:A,d:ta,e:ta,f:sa,g:Zi,G:Xi,H:ra,I:ra,j:na,L:oa,m:ea,M:ia,p:T,q:$i,Q:la,s:ua,S:aa,u:Ki,U:qi,V:Ji,w:Gi,W:Yi,x:j,X:M,y:Zi,Y:Xi,Z:Qi,"%":ca};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=zi[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Li(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Ii(Li(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?bi.ceil(a):bi(a),a=ci.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Fi(Li(r.y,0,1)),o=a.getDay(),a=o>4||o===0?fi.ceil(a):fi(a),a=si.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Ii(Li(r.y,0,1)).getUTCDay():Fi(Li(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Ii(r)):Fi(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in zi?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function B(e){return a[e.getUTCDay()]}function ee(e){return c[e.getUTCMonth()]}function V(e){return s[e.getUTCMonth()]}function H(e){return i[+(e.getUTCHours()>=12)]}function U(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var zi={"-":``,_:` `,0:`0`},X=/^\s*\d+/,Bi=/^%/,Vi=/[\\^$*+?|[\]().{}]/g;function Z(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Hi(e){return e.replace(Vi,`\\$&`)}function Ui(e){return RegExp(`^(?:`+e.map(Hi).join(`|`)+`)`,`i`)}function Wi(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Gi(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ki(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ji(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Yi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Xi(e,t,n){var r=X.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Zi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Qi(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function $i(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ea(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ta(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function na(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ra(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ia(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function aa(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function oa(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function sa(e,t,n){var r=X.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ca(e,t,n){var r=Bi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function la(e,t,n){var r=X.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ua(e,t,n){var r=X.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function da(e,t){return Z(e.getDate(),t,2)}function fa(e,t){return Z(e.getHours(),t,2)}function pa(e,t){return Z(e.getHours()%12||12,t,2)}function ma(e,t){return Z(1+si.count(Oi(e),e),t,3)}function ha(e,t){return Z(e.getMilliseconds(),t,3)}function ga(e,t){return ha(e,t)+`000`}function _a(e,t){return Z(e.getMonth()+1,t,2)}function va(e,t){return Z(e.getMinutes(),t,2)}function ya(e,t){return Z(e.getSeconds(),t,2)}function ba(e){var t=e.getDay();return t===0?7:t}function xa(e,t){return Z(di.count(Oi(e)-1,e),t,2)}function Sa(e){var t=e.getDay();return t>=4||t===0?hi(e):hi.ceil(e)}function Ca(e,t){return e=Sa(e),Z(hi.count(Oi(e),e)+(Oi(e).getDay()===4),t,2)}function wa(e){return e.getDay()}function Ta(e,t){return Z(fi.count(Oi(e)-1,e),t,2)}function Ea(e,t){return Z(e.getFullYear()%100,t,2)}function Da(e,t){return e=Sa(e),Z(e.getFullYear()%100,t,2)}function Oa(e,t){return Z(e.getFullYear()%1e4,t,4)}function ka(e,t){var n=e.getDay();return e=n>=4||n===0?hi(e):hi.ceil(e),Z(e.getFullYear()%1e4,t,4)}function Aa(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Z(t/60|0,`0`,2)+Z(t%60,`0`,2)}function ja(e,t){return Z(e.getUTCDate(),t,2)}function Ma(e,t){return Z(e.getUTCHours(),t,2)}function Na(e,t){return Z(e.getUTCHours()%12||12,t,2)}function Pa(e,t){return Z(1+ci.count(ki(e),e),t,3)}function Fa(e,t){return Z(e.getUTCMilliseconds(),t,3)}function Ia(e,t){return Fa(e,t)+`000`}function La(e,t){return Z(e.getUTCMonth()+1,t,2)}function Ra(e,t){return Z(e.getUTCMinutes(),t,2)}function za(e,t){return Z(e.getUTCSeconds(),t,2)}function Ba(e){var t=e.getUTCDay();return t===0?7:t}function Va(e,t){return Z(yi.count(ki(e)-1,e),t,2)}function Ha(e){var t=e.getUTCDay();return t>=4||t===0?Ci(e):Ci.ceil(e)}function Ua(e,t){return e=Ha(e),Z(Ci.count(ki(e),e)+(ki(e).getUTCDay()===4),t,2)}function Wa(e){return e.getUTCDay()}function Ga(e,t){return Z(bi.count(ki(e)-1,e),t,2)}function Ka(e,t){return Z(e.getUTCFullYear()%100,t,2)}function qa(e,t){return e=Ha(e),Z(e.getUTCFullYear()%100,t,2)}function Ja(e,t){return Z(e.getUTCFullYear()%1e4,t,4)}function Ya(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ci(e):Ci.ceil(e),Z(e.getUTCFullYear()%1e4,t,4)}function Xa(){return`+0000`}function Za(){return`%`}function Qa(e){return+e}function $a(e){return Math.floor(e/1e3)}var eo,to;no({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function no(e){return eo=Ri(e),to=eo.format,eo.parse,eo.utcFormat,eo.utcParse,eo}function ro(e){return new Date(e)}function io(e){return e instanceof Date?+e:+new Date(+e)}function ao(e,t,n,r,i,a,o,s,c,l){var u=_r(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,io)):f().map(ro)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(Gr(n,e)):u},u.copy=function(){return hr(u,ao(e,t,n,r,i,a,o,s,c,l))},u}function oo(){return or.apply(ao(Ni,Pi,Oi,Ei,di,si,ai,ri,ni,to).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function so(e,t){t.domain&&(`nice`in e||`quantiles`in e||`padding`in e,e.domain(t.domain))}function co(e,t){t.range&&(`padding`in e,e.range(t.range))}function lo(e,t){`align`in e&&`align`in t&&t.align!==void 0&&e.align(t.align)}function uo(e,t){`base`in e&&`base`in t&&t.base!==void 0&&e.base(t.base)}function fo(e,t){`clamp`in e&&`clamp`in t&&t.clamp!==void 0&&e.clamp(t.clamp)}function po(e,t){`constant`in e&&`constant`in t&&t.constant!==void 0&&e.constant(t.constant)}function mo(e,t){`exponent`in e&&`exponent`in t&&t.exponent!==void 0&&e.exponent(t.exponent)}var ho={lab:Ft,hcl:Lt,"hcl-long":Rt,hsl:Nt,"hsl-long":Pt,cubehelix:Bt,"cubehelix-long":Vt,rgb:te};function go(e){switch(e){case`lab`:case`hcl`:case`hcl-long`:case`hsl`:case`hsl-long`:case`cubehelix`:case`cubehelix-long`:case`rgb`:return ho[e]}let{type:t,gamma:n}=e,r=ho[t];return n===void 0?r:r.gamma(n)}function _o(e,t){if(`interpolate`in t&&`interpolate`in e&&t.interpolate!==void 0){let n=go(t.interpolate);e.interpolate(n)}}var vo=new Date(Date.UTC(2020,1,2,3,4,5)),yo=`%Y-%m-%d %H:%M`;function bo(e){return e.tickFormat(1,yo)(vo)===`2020-02-02 03:04`}var xo={day:si,hour:ai,minute:ri,month:Ei,second:ni,week:di,year:Oi},So={day:ci,hour:oi,minute:ii,month:Di,second:ni,week:yi,year:ki};function Co(e,t){if(`nice`in t&&t.nice!==void 0&&`nice`in e){let{nice:n}=t;if(typeof n==`boolean`)n&&e.nice();else if(typeof n==`number`)e.nice(n);else{let t=e,r=bo(t);if(typeof n==`string`)t.nice(r?So[n]:xo[n]);else{let{interval:e,step:i}=n,a=(r?So[e]:xo[e]).every(i);a!=null&&t.nice(a)}}}}function wo(e,t){`padding`in e&&`padding`in t&&t.padding!==void 0&&e.padding(t.padding),`paddingInner`in e&&`paddingInner`in t&&t.paddingInner!==void 0&&e.paddingInner(t.paddingInner),`paddingOuter`in e&&`paddingOuter`in t&&t.paddingOuter!==void 0&&e.paddingOuter(t.paddingOuter)}function To(e,t){if(t.reverse){let t=e.range().slice().reverse();`padding`in e,e.range(t)}}function Eo(e,t){`round`in t&&t.round!==void 0&&(t.round&&`interpolate`in t&&t.interpolate!==void 0?console.warn(`[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:`,t):`round`in e?e.round(t.round):`interpolate`in e&&t.round&&e.interpolate(jt))}function Do(e,t){`unknown`in e&&`unknown`in t&&t.unknown!==void 0&&e.unknown(t.unknown)}function Oo(e,t){if(`zero`in t&&t.zero===!0){let[t,n]=e.domain(),r=n<t,[i,a]=r?[n,t]:[t,n],o=[Math.min(0,i),Math.max(0,a)];e.domain(r?o.reverse():o)}}var ko=[`domain`,`nice`,`zero`,`interpolate`,`round`,`range`,`reverse`,`align`,`base`,`clamp`,`constant`,`exponent`,`padding`,`unknown`],Ao={domain:so,nice:Co,zero:Oo,interpolate:_o,round:Eo,align:lo,base:uo,clamp:fo,constant:po,exponent:mo,padding:wo,range:co,reverse:To,unknown:Do};function jo(){let e=new Set([...arguments]),t=ko.filter(t=>e.has(t));return function(e,n){return n!==void 0&&t.forEach(t=>{Ao[t](e,n)}),e}}var Mo=jo(`domain`,`range`,`reverse`,`clamp`,`interpolate`,`nice`,`round`,`zero`);function No(e){return Mo(Wr(),e)}var Po=jo(`domain`,`range`,`reverse`,`clamp`,`interpolate`,`nice`,`round`);function Fo(e){return Po(oo(),e)}function Io(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function Lo(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}var Ro=`left`;function zo(e){return e==null||e===``?Ro:String(e)}function Bo(e){let t=new Map;for(let n of e){let e=zo(n.yAxisId),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}function Vo(e,t){return e[Ro]||(Object.values(e)[0]??t)}function Ho({lines:e,innerHeight:t,domainsByAxis:n}){let r=Bo(e),i={};for(let[e]of r){let r=n[e]??n.left??[0,100];i[e]=No({range:[t,0],domain:r})}return i.left||(i[Ro]=No({range:[t,0],domain:n.left??[0,100]})),i}var Q={background:`var(--chart-background)`,foreground:`var(--chart-foreground)`,foregroundMuted:`var(--chart-foreground-muted)`,label:`var(--chart-label)`,linePrimary:`var(--chart-line-primary)`,lineSecondary:`var(--chart-line-secondary)`,crosshair:`var(--chart-crosshair)`,grid:`var(--chart-grid)`,indicatorColor:`var(--chart-indicator-color)`,indicatorSecondaryColor:`var(--chart-indicator-secondary-color)`,markerBackground:`var(--chart-marker-background)`,markerBorder:`var(--chart-marker-border)`,markerForeground:`var(--chart-marker-foreground)`,badgeBackground:`var(--chart-marker-badge-background)`,badgeForeground:`var(--chart-marker-badge-foreground)`,segmentBackground:`var(--chart-segment-background)`,segmentLine:`var(--chart-segment-line)`,brushBorder:`var(--chart-brush-border)`,tooltipBackground:`var(--chart-tooltip-background)`},Uo=[`var(--chart-1)`,`var(--chart-2)`,`var(--chart-3)`,`var(--chart-4)`,`var(--chart-5)`],Wo=(0,K.createContext)(null),Go=(0,K.createContext)(null);function Ko({children:e,value:t}){let n=(0,K.useMemo)(()=>({data:t.data,renderData:t.renderData,xScale:t.xScale,yScale:t.yScale,yScales:t.yScales,width:t.width,height:t.height,innerWidth:t.innerWidth,innerHeight:t.innerHeight,margin:t.margin,columnWidth:t.columnWidth,containerRef:t.containerRef,lines:t.lines,referenceAreas:t.referenceAreas,chartPhase:t.chartPhase,chartStatus:t.chartStatus,loadingLabel:t.loadingLabel,yDomainTweenDuration:t.yDomainTweenDuration,yDomainSkeletonByAxis:t.yDomainSkeletonByAxis,yDomainTargetByAxis:t.yDomainTargetByAxis,isLoaded:t.isLoaded,animationDuration:t.animationDuration,animationEasing:t.animationEasing,enterTransition:t.enterTransition,revealEpoch:t.revealEpoch,notifyLoadingPulseComplete:t.notifyLoadingPulseComplete,xAccessor:t.xAccessor,dateLabels:t.dateLabels,xDomain:t.xDomain,xDomainSlotCount:t.xDomainSlotCount,barScale:t.barScale,bandWidth:t.bandWidth,barXAccessor:t.barXAccessor,orientation:t.orientation,stacked:t.stacked,stackOffsets:t.stackOffsets,composedBarDataKeys:t.composedBarDataKeys,composedBarSize:t.composedBarSize,composedMaxBarSize:t.composedMaxBarSize,composedBarGap:t.composedBarGap,composedStacked:t.composedStacked,composedStackOffsets:t.composedStackOffsets,composedStackGap:t.composedStackGap}),[t.data,t.renderData,t.xScale,t.yScale,t.yScales,t.width,t.height,t.innerWidth,t.innerHeight,t.margin,t.columnWidth,t.containerRef,t.lines,t.referenceAreas,t.chartPhase,t.chartStatus,t.loadingLabel,t.yDomainTweenDuration,t.yDomainSkeletonByAxis,t.yDomainTargetByAxis,t.isLoaded,t.animationDuration,t.animationEasing,t.enterTransition,t.revealEpoch,t.notifyLoadingPulseComplete,t.xAccessor,t.dateLabels,t.xDomain,t.xDomainSlotCount,t.barScale,t.bandWidth,t.barXAccessor,t.orientation,t.stacked,t.stackOffsets,t.composedBarDataKeys,t.composedBarSize,t.composedMaxBarSize,t.composedBarGap,t.composedStacked,t.composedStackOffsets,t.composedStackGap]),r=(0,K.useMemo)(()=>({tooltipData:t.tooltipData,setTooltipData:t.setTooltipData,selection:t.selection,clearSelection:t.clearSelection,hoveredBarIndex:t.hoveredBarIndex,setHoveredBarIndex:t.setHoveredBarIndex,hoveredCandleIndex:t.hoveredCandleIndex,setHoveredCandleIndex:t.setHoveredCandleIndex}),[t.tooltipData,t.setTooltipData,t.selection,t.clearSelection,t.hoveredBarIndex,t.setHoveredBarIndex,t.hoveredCandleIndex,t.setHoveredCandleIndex]);return(0,q.jsx)(Wo.Provider,{value:n,children:(0,q.jsx)(Go.Provider,{value:r,children:e})})}function qo(){let e=(0,K.useContext)(Wo);if(!e)throw Error(`useChartStable must be used within a ChartProvider. Make sure your component is wrapped in <LineChart>, <AreaChart>, <BarChart>, or <ComposedChart>.`);return e}function Jo(e){let{yScales:t,yScale:n}=qo();return t[e==null||e===``?`left`:String(e)]??n}function Yo(){let e=(0,K.useContext)(Go);if(!e)throw Error(`useChartHover must be used within a ChartProvider. Make sure your component is wrapped in <LineChart>, <AreaChart>, <BarChart>, or <ComposedChart>.`);return e}function Xo(){let e=qo(),t=Yo();return{...e,...t}}var Zo=2.2,Qo=.45,$o=[.85,0,.15,1],es=10;function ts(e){switch(e){case`loading`:return`loop`;case`exiting`:return`exit`;case`revealingLoading`:return`enter`;default:return null}}function ns(e,t,n,r){let i=_e(0),a=e+20,o=e+es,s=ve(i,e=>e<=.5?e/.5*a:(1-(e-.5)/.5)*a),c=ve(i,e=>{if(e<=.5)return-10;let t=(e-.5)/.5;return o-(1-t)*a});return(0,K.useEffect)(()=>{if(e<=0)return;let n=Zo/2,a=!1,o,s=()=>{a||r?.()},c=e=>{let t=n*((1-e)/.5);o=me(i,1,{duration:Math.max(t,.01),ease:[...$o],onComplete:s})};if(t===`loop`)return i.set(0),o=me(i,1,{duration:Zo,ease:[...$o],onComplete:s}),()=>{a=!0,o?.stop()};if(t===`exit`){let e=i.get();if(e<.5){let t=n*((.5-e)/.5);o=me(i,.5,{duration:Math.max(t,.01),ease:[...$o],onComplete:()=>{a||c(.5)}})}else c(e);return()=>{a=!0,o?.stop()}}if(t===`enter`)return i.set(0),o=me(i,.5,{duration:n,ease:[...$o],onComplete:s}),()=>{a=!0,o?.stop()}},[e,n,t,r,i]),{clipX:c,clipWidth:s}}function rs({pathD:e,mode:t=`loop`,loopEpoch:n=0,stroke:r=Q.foreground,strokeOpacity:i=.5,strokeWidth:a=2.5,onCycleComplete:o}){let{innerWidth:s,innerHeight:c}=qo(),l=(0,K.useId)(),u=`line-loading-clip-${l}`,d=`line-loading-gradient-${l}`,f=Hn(Vn(!0)),p=c+20,{clipX:m,clipWidth:h}=ns(s,t,n,o);return s<=0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`clipPath`,{id:u,children:(0,q.jsx)(G.rect,{height:p,style:{width:h,x:m},y:-10})}),(0,q.jsx)(`linearGradient`,{id:d,...Un(s),children:f.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,stopColor:r,stopOpacity:e.opacity},e.offset))})]}),(0,q.jsx)(`path`,{clipPath:`url(#${u})`,d:e,fill:`none`,opacity:i,stroke:`url(#${d})`,strokeLinecap:`round`,strokeWidth:a})]})}rs.displayName=`LineLoadingPulseStroke`;var is=2,as=-1,os=2,ss=25,cs=20,ls=80,us=14,ds=.55,fs=.18,ps=.02;function ms(e){let t=Math.sin(e)*43758.5453;return t-Math.floor(t)}function hs(e,t=0,n=cs,r=ls){let i=r-n;return Array.from({length:e},(e,r)=>n+Math.floor(ms((r+1)*12.9898+t)*i))}function gs(e=17,t=.05,n=.9){return Array.from({length:e},(r,i)=>{let a=i/(e-1),o=t+Math.sin(a*Math.PI)**2*(n-t);return{offset:`${(a*100).toFixed(0)}%`,opacity:Number(o.toFixed(3))}})}function _s({chartId:e,width:t,height:n,durationSeconds:r,onSweepComplete:i}){let a=(0,K.useMemo)(()=>gs(),[]),o=(0,K.useRef)(as),s=(0,K.useCallback)(e=>{let t=typeof e.x==`number`?e.x:as;t>=1&&o.current<1&&i(),o.current=t},[i]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`linearGradient`,{id:`${e}-grad`,x1:`0`,x2:`1`,y1:`0`,y2:`0`,children:a.map(({offset:e,opacity:t})=>(0,q.jsx)(`stop`,{offset:e,stopColor:`white`,stopOpacity:t},e))}),(0,q.jsx)(`pattern`,{height:`1`,id:`${e}-pattern`,patternContentUnits:`objectBoundingBox`,patternTransform:`rotate(${ss})`,patternUnits:`objectBoundingBox`,width:3,x:`0`,y:`0`,children:(0,q.jsx)(G.rect,{animate:{x:os},fill:`url(#${e}-grad)`,height:`1`,initial:{x:as},onUpdate:s,transition:{duration:r,ease:`linear`,repeat:1/0,repeatType:`loop`},width:`1`,y:`0`})}),(0,q.jsx)(`mask`,{id:`${e}-mask`,maskUnits:`userSpaceOnUse`,children:(0,q.jsx)(`rect`,{fill:`url(#${e}-pattern)`,height:n,width:t})})]})}function vs({curve:e,withArea:t=!1,mode:n=`loop`,onTransitionComplete:r,stroke:i=Q.foreground,strokeOpacity:a=ds,strokeWidth:o=2,pointCount:s=us,durationSeconds:c=is}){let{innerWidth:l,innerHeight:u}=qo(),d=fe(),f=`line-sweep-${(0,K.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,p=n===`loop`,[m,h]=(0,K.useState)(0),g=(0,K.useCallback)(()=>{p&&h(e=>e+1)},[p]),_=(0,K.useMemo)(()=>hs(s,m),[s,m]);if((0,K.useEffect)(()=>{d&&!p&&r?.()},[d,p,r]),l<=0||u<=0||_.length<2)return null;let v=No({domain:[0,_.length-1],range:[0,l]}),y=No({domain:[0,100],range:[u,0]}),b=_.map((e,t)=>({index:t,value:e})),x=e=>v(e.index),S=e=>y(e.value),C=(0,q.jsxs)(q.Fragment,{children:[t?(0,q.jsx)(Bn,{curve:e,data:b,fill:`url(#${f}-area)`,x,y:S,yScale:y}):null,(0,q.jsx)(zn,{curve:e,data:b,fill:`none`,stroke:i,strokeLinecap:`round`,strokeOpacity:a,strokeWidth:o,x,y:S})]}),w=t?(0,q.jsxs)(`linearGradient`,{id:`${f}-area`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:i,stopOpacity:fs}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:i,stopOpacity:ps})]}):null;if(d)return(0,q.jsxs)(q.Fragment,{children:[w?(0,q.jsx)(`defs`,{children:w}):null,C]});let T=`url(#${f}-mask)`,E=(0,q.jsxs)(`defs`,{children:[w,(0,q.jsx)(_s,{chartId:f,durationSeconds:c,height:u,onSweepComplete:g,width:l})]});return p?(0,q.jsxs)(q.Fragment,{children:[E,(0,q.jsx)(`g`,{mask:T,children:C})]}):(0,q.jsxs)(q.Fragment,{children:[E,(0,q.jsx)(G.g,{animate:{opacity:n===`exit`?0:1},initial:{opacity:+(n===`exit`)},mask:T,onAnimationComplete:r,transition:{duration:Qo,ease:[...$o]},children:C})]})}vs.displayName=`LineLoadingSweep`;var ys={pathD:null,pathLength:0};function bs(e,t){let[n,r]=(0,K.useState)(ys);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let n=t.getAttribute(`d`),i=n?t.getTotalLength():0;r(e=>e.pathD===n&&e.pathLength===i?e:{pathD:n,pathLength:i})},t),n}function xs(e,t){return e!=null&&e>=0&&e<t-1}function Ss(e,t,n,r){let i=e[t];return i?n(r(i))??0:0}function Cs({pathD:e,pathLength:t,dashStartLength:n,dashStartX:r,innerWidth:i,innerHeight:a,stroke:o,strokeWidth:s,dashArray:c}){let l=(0,K.useId)().replace(/:/g,``);if(!e||t<=0||n>=t)return null;let u=s*2,d=Math.max(0,i-r+u);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`clipPath`,{id:l,children:(0,q.jsx)(`rect`,{height:a+u,width:d,x:r-s,y:-s})})}),(0,q.jsx)(`path`,{d:e,fill:`none`,stroke:o,strokeDasharray:`${n} ${Math.max(1,t-n)}`,strokeLinecap:`round`,strokeWidth:s}),(0,q.jsx)(`path`,{clipPath:`url(#${l})`,d:e,fill:`none`,stroke:o,strokeDasharray:c,strokeLinecap:`round`,strokeWidth:s})]})}function ws({dashFromIndex:e,dashArray:t,data:n,pathD:r,pathLength:i,innerWidth:a,innerHeight:o,stroke:s,strokeWidth:c,xScale:l,xAccessor:u}){let d=xs(e,n.length),f=(0,K.useMemo)(()=>!d||e==null?0:Ss(n,e,l,u),[d,e,n,l,u]),p=(0,K.useMemo)(()=>!d||e==null||i<=0?0:e/Math.max(1,n.length-1)*i,[d,e,n.length,i]);return!d||e==null||i<=0?null:(0,q.jsx)(Cs,{dashArray:t,dashStartLength:p,dashStartX:f,innerHeight:o,innerWidth:a,pathD:r,pathLength:i,stroke:s,strokeWidth:c})}var Ts=(0,K.memo)(ws);function Es({pathRef:e,visible:t,stroke:n,strokeWidth:r,height:i,x:a,width:o}){let s=(0,K.useId)();return t&&e.current?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`clipPath`,{id:s,children:(0,q.jsx)(G.rect,{height:i,width:o,x:a,y:0})})}),(0,q.jsx)(G.path,{animate:{opacity:1},clipPath:`url(#${s})`,d:e.current.getAttribute(`d`)||``,exit:{opacity:0},fill:`none`,initial:{opacity:0},stroke:n,strokeLinecap:`round`,strokeWidth:r,transition:{duration:.4,ease:`easeInOut`}})]}):null}Es.displayName=`HighlightSegment`;var Ds={tooltipSpring:{stiffness:300,damping:30},tooltipBoxSpring:{stiffness:100,damping:20},highlightSpring:{stiffness:180,damping:28}},Os=(0,K.createContext)(null);function ks(){return(0,K.useContext)(Os)??Ds}var As=Ds.tooltipBoxSpring.damping;function js(e){if(e===0)return{animate:!1,springConfig:Ds.tooltipBoxSpring};let t=e??As,n=Ds.tooltipBoxSpring.stiffness;if(t<As){let e=(As-t)/As;n+=e*400}else if(t>As){let e=(t-As)/(100-As);n-=e*85}return{animate:!0,springConfig:{stiffness:Math.max(12,Math.round(n)),damping:t}}}var Ms={x:0,width:0,isActive:!1};function Ns(e,t,n,r,i){if(e.length===0)return Ms;if(i?.active)return{x:Math.min(i.startX,i.endX),width:Math.abs(i.endX-i.startX),isActive:!0};if(!r)return Ms;let a=r.index,o=Math.max(0,a-1),s=Math.min(e.length-1,a+1),c=e[o],l=e[s];if(!(c&&l))return Ms;let u=t(n(c))??0,d=t(n(l))??0;return{x:u,width:Math.max(0,d-u),isActive:!0}}function Ps({enabled:e=!0}={}){let{data:t,xScale:n,xAccessor:r}=qo(),{tooltipData:i,selection:a}=Yo(),{highlightSpring:o}=ks(),s=(0,K.useMemo)(()=>e?Ns(t,n,r,i,a):Ms,[e,t,n,r,i,a]),c=Qe(0,o),l=Qe(0,o),u=(0,K.useRef)(!1);return s.isActive&&!u.current?(c.jump(s.x),l.jump(s.width)):(c.set(s.x),l.set(s.width)),u.current=s.isActive,{xSpring:c,widthSpring:l,isActive:s.isActive}}function Fs({enabled:e,height:t,pathRef:n,stroke:r,strokeWidth:i}){let{isLoaded:a}=qo(),{xSpring:o,widthSpring:s,isActive:c}=Ps({enabled:e});return(0,q.jsx)(Es,{height:t,pathRef:n,stroke:r,strokeWidth:i,visible:e&&c&&a,width:s,x:o})}Fs.displayName=`SeriesHighlightLayer`;var Is=(0,K.createContext)(null);function Ls(){return(0,K.useContext)(Is)??{hoveredIndex:null,setHoveredIndex:()=>{}}}function Rs({enabled:e=!0,dimOpacity:t=.5,durationSec:n=.4,seriesIndex:r,children:i}){let{tooltipData:a,selection:o}=Yo(),{hoveredIndex:s}=Ls(),c=a!==null||o?.active===!0,l=e&&(c||s!==null&&r!==void 0&&s!==r)?t:1;return(0,q.jsx)(G.g,{animate:{opacity:l},initial:{opacity:1},transition:{duration:n,ease:`easeInOut`},children:i})}Rs.displayName=`SeriesHoverDim`;var zs=`cubic-bezier(0.85, 0, 0.15, 1)`,Bs=1100,Vs={type:`tween`,duration:Bs/1e3,ease:[.85,0,.15,1]};function Hs(e){return e?.type===`tween`?{...e,ease:e.ease??Vs.ease}:{type:`tween`,duration:typeof e?.duration==`number`?e.duration:Bs/1e3,ease:Vs.ease}}function Us({fill:e,stroke:t,strokeWidth:n,ringGap:r,outlineWidth:i,outlineColor:a,radius:o}){let s=t??e??`currentColor`,c=a??s,l=n>0?o+r+n:o,u=i>0?l+i/2:0;return(0,q.jsxs)(q.Fragment,{children:[i>0?(0,q.jsx)(`circle`,{cx:0,cy:0,fill:`none`,r:u,stroke:c,strokeWidth:i}):null,(0,q.jsx)(`circle`,{cx:0,cy:0,fill:e,r:o}),n>0?(0,q.jsx)(`circle`,{cx:0,cy:0,fill:`none`,r:o+r+n/2,stroke:s,strokeWidth:n}):null]})}var Ws=(0,K.memo)(function({cx:e,cy:t,scale:n=1,fill:r,stroke:i,strokeWidth:a=2,ringGap:o=2,outlineWidth:s=0,outlineColor:c,radius:l=5}){return(0,q.jsx)(`g`,{transform:`translate(${e}, ${t}) scale(${n})`,children:(0,q.jsx)(Us,{fill:r,outlineColor:c,outlineWidth:s,radius:l,ringGap:o,stroke:i,strokeWidth:a})})});function Gs({dataKey:e,index:t,cx:n,cy:r,enterBlur:i=2,revealDelay:a,revealEpoch:o,enterDuration:s,fill:c,stroke:l,strokeWidth:u=2,ringGap:d=2,outlineWidth:f=0,outlineColor:p,radius:m=5}){let h={hidden:{opacity:0,filter:`blur(${i}px)`,scale:1},visible:{opacity:1,filter:`blur(0px)`,scale:1,transition:{delay:a,duration:s,ease:Vs.ease}}};return(0,q.jsx)(`g`,{transform:`translate(${n}, ${r})`,children:(0,q.jsx)(G.g,{animate:`visible`,initial:`hidden`,variants:h,children:(0,q.jsx)(Us,{fill:c,outlineColor:p,outlineWidth:f,radius:m,ringGap:d,stroke:l,strokeWidth:u})},`${e}-${t}-${o}`)})}function Ks(e){let t=e.radius??5,n=e.strokeWidth??2,r=e.ringGap??2,i=e.outlineWidth??0,a=e.showActiveHighlight??!0,o=n>0?r+n:0,s=i>0?i:0,c=a?t*.35:0;return t+o+s+c+2}function qs({dataKey:e,fill:t,stroke:n,strokeWidth:r=2,ringGap:i=2,outlineWidth:a=0,outlineColor:o,radius:s=5,animate:c=!0,fadeOnHover:l=!0,inactiveOpacity:u=.5,inactiveBlur:d=2,enterBlur:f=2,showActiveHighlight:p=!0}){let{data:m,xScale:h,innerWidth:g,enterTransition:_,animationDuration:v,revealEpoch:y,isLoaded:b,xAccessor:x,lines:S}=qo(),C=(0,K.useMemo)(()=>{let t=S.findIndex(t=>t.dataKey===e);return t>=0?t:0},[S,e]),w=S[C],T=Jo(w?.yAxisId),E=Uo[C%Uo.length]??Uo[0],D=t??w?.stroke??E,O=n??D,k=(0,K.useMemo)(()=>Ks({radius:s,strokeWidth:r,ringGap:i,outlineWidth:a,showActiveHighlight:p}),[s,r,i,a,p]),A=Hs(_).duration??v/1e3,j=c&&!b,M=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?T(n)??0:null},[e,T]),N=(0,K.useMemo)(()=>m.flatMap((e,t)=>{let n=M(e);if(n===null)return[];let r=h(x(e))??0,i=Math.max(0,r-k);return[{index:t,cx:r,cy:n,revealDelay:g>0&&j?i/g*A:0}]}),[m,M,h,x,g,j,A,k]),P=(0,K.useMemo)(()=>({fill:D,stroke:O,strokeWidth:r,ringGap:i,outlineWidth:a,outlineColor:o,radius:s}),[D,O,r,i,a,o,s]);if(j)return(0,q.jsx)(`g`,{children:N.map(t=>(0,q.jsx)(Gs,{cx:t.cx,cy:t.cy,dataKey:e,enterBlur:f,enterDuration:.5,index:t.index,revealDelay:t.revealDelay,revealEpoch:y??0,...P},`${e}-${t.index}`))});let F=N.map(t=>(0,q.jsx)(Ws,{cx:t.cx,cy:t.cy,...P},`${e}-${t.index}`));return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(Js,{enabled:l,inactiveBlur:d,inactiveOpacity:u,seriesIndex:C,children:F}),(0,q.jsx)(Ys,{activeScale:p?1.35:1,enabled:l,markerStyle:P,points:N})]})}qs.displayName=`SeriesMarkers`;function Js({enabled:e,inactiveOpacity:t,inactiveBlur:n,seriesIndex:r,children:i}){let{tooltipData:a}=Yo(),{hoveredIndex:o}=Ls(),s=e&&(a!==null||o!==null&&o!==r);return(0,q.jsx)(`g`,{opacity:s?t:1,style:{transition:`opacity 0.15s ease-in-out, filter 0.15s ease-in-out`,filter:s&&n>0?`blur(${n}px)`:`none`},children:i})}function Ys({enabled:e,points:t,markerStyle:n,activeScale:r}){let{tooltipData:i}=Yo();if(!e||i===null)return null;let a=t.find(e=>e.index===i.index);return a?(0,q.jsx)(Ws,{cx:a.cx,cy:a.cy,scale:r,...n}):null}function Xs(e,t,n,r){let i=ts(e),a=t===!1?null:n??(t===!0?`loop`:i),o=a!=null,s=e===`revealing`||e===`ready`||e===`exitingReady`,[c,l]=(0,K.useState)(0);return{handleLoadingPulseComplete:(0,K.useCallback)(()=>{if(a===`loop`){window.setTimeout(()=>{l(e=>e+1)},280);return}r?.()},[r,a]),pulseMode:a,pulseEpoch:c,showLoadingPulse:o,showSeriesContent:s}}function Zs({dataKey:e,yAxisId:t,fill:n=Q.linePrimary,fillOpacity:r=.4,stroke:i,strokeWidth:a=2,curve:o=On,animate:s=!0,showLine:c=!0,showHighlight:l=!0,gradientToOpacity:u=0,gradientSpan:d=1,fadeEdges:f=!1,showMarkers:p=!1,markers:m,dashFromIndex:h,dashArray:g=`6,4`,loading:_,loadingStroke:v=Q.foreground,loadingStrokeOpacity:y=.5,loadingPulseMode:b,loadingStyle:x=`pulse`}){let{data:S,renderData:C,xScale:w,innerHeight:T,innerWidth:E,xAccessor:D,lines:O,chartPhase:k,notifyLoadingPulseComplete:A}=qo(),j=Jo(t),{handleLoadingPulseComplete:M,pulseMode:N,pulseEpoch:P,showLoadingPulse:F,showSeriesContent:I}=Xs(k,_,b,A),L=(0,K.useMemo)(()=>{let t=O.findIndex(t=>t.dataKey===e);return t>=0?t:0},[O,e]),R=(0,K.useRef)(null),{pathLength:z,pathD:B}=bs(R,[C,E,h,c,I,F]),ee=(0,K.useId)(),V=`area-gradient-${e}-${ee}`,H=`area-stroke-gradient-${e}-${ee}`,U=`area-edge-mask-${e}-${ee}`,te=`${U}-gradient`,ne=n.startsWith(`url(`),re=ne||r>0,ie=ne?n:`url(#${V})`,ae=i||(ne?Q.linePrimary:n),oe=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?j(n)??0:0},[e,j]),se=xs(h,S.length),W=Vn(f),ce=W.any&&!ne,le=ae;!ce&&W.any&&(le=`url(#${H})`);let ue=l&&c&&!F&&I,de=I&&c,fe=`transparent`;de&&!se&&(fe=le);let G=(0,q.jsxs)(q.Fragment,{children:[I&&re?(0,q.jsx)(Bn,{curve:o,data:C,fill:ie,x:e=>w(D(e))??0,y:oe,yScale:j}):null,c&&(I||F)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(zn,{curve:o,data:C,innerRef:R,stroke:fe,strokeLinecap:`round`,strokeWidth:a,x:e=>w(D(e))??0,y:oe}),de?(0,q.jsx)(Ts,{dashArray:g,dashFromIndex:h,data:S,innerHeight:T,innerWidth:E,pathD:B,pathLength:z,stroke:le,strokeWidth:a,xAccessor:D,xScale:w}):null]}):null]}),pe=F&&E>0&&x===`sweep`,me=F&&E>0&&!pe;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Wn,{edgeGradientId:te,edgeMaskId:U,fadeEdges:f,fill:n,fillOpacity:r,gradientId:V,gradientSpan:d,gradientToOpacity:u,innerHeight:T,innerWidth:E,isPatternFill:ne,resolvedStroke:ae,strokeGradientId:H}),(0,q.jsx)(Rs,{dimOpacity:.6,enabled:l,seriesIndex:L,children:ce?(0,q.jsx)(`g`,{mask:`url(#${U})`,children:G}):G}),(0,q.jsx)(Fs,{enabled:ue,height:T,pathRef:R,stroke:ae,strokeWidth:a}),p&&I?(0,q.jsx)(qs,{animate:s,dataKey:e,...m,fill:m?.fill??ae,stroke:m?.stroke??m?.fill??ae}):null,pe?(0,q.jsx)(vs,{curve:o,mode:N??`loop`,onTransitionComplete:M,stroke:v,strokeOpacity:y,strokeWidth:a,withArea:!0},`loading-sweep`):null,me&&B?(0,q.jsx)(rs,{loopEpoch:P,mode:N??void 0,onCycleComplete:M,pathD:B,stroke:v,strokeOpacity:y,strokeWidth:a},`loading-pulse`):null]})}Zs.displayName=`Area`;var Qs=t(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),$s=t(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),ec=t(((e,t)=>{var n=$s(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),tc=t(((e,t)=>{var n=ec();t.exports=function(){return n.Date.now()}})),nc=t(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),rc=t(((e,t)=>{var n=nc(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),ic=t(((e,t)=>{t.exports=ec().Symbol})),ac=t(((e,t)=>{var n=ic(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),oc=t(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),sc=t(((e,t)=>{var n=ic(),r=ac(),i=oc(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),cc=t(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),lc=t(((e,t)=>{var n=sc(),r=cc(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),uc=t(((e,t)=>{var n=rc(),r=Qs(),i=lc(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),dc=e(t(((e,t)=>{var n=Qs(),r=tc(),i=uc(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))()),fc=[],pc={width:0,height:0,top:0,left:0};function mc(){let{initialSize:e=pc,debounceTime:t=300,ignoreDimensions:n=fc,enableDebounceLeadingCall:r=!0,resizeObserverPolyfill:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=(0,K.useRef)(null),o=(0,K.useRef)(0),[s,c]=(0,K.useState)({...pc,...e}),l=(0,K.useMemo)(()=>{let e=Array.isArray(n)?n:[n];return(0,dc.default)(t=>{c(n=>Object.keys(n).filter(e=>n[e]!==t[e]).every(t=>e.includes(t))?n:t)},t,{leading:r})},[t,r,n]);return(0,K.useEffect)(()=>{let e=new(i||window.ResizeObserver)(e=>{e.forEach(e=>{let{left:t,top:n,width:r,height:i}=e?.contentRect??{};o.current=window.requestAnimationFrame(()=>{l({width:r,height:i,top:n,left:t})})})});return a.current&&e.observe(a.current),()=>{window.cancelAnimationFrame(o.current),e.disconnect(),l.cancel()}},[l,i]),{parentRef:a,resize:l,...s}}var hc={width:`100%`,height:`100%`};function gc(e){let{className:t,children:n,debounceTime:r,ignoreDimensions:i,initialSize:a,parentSizeStyles:o=hc,enableDebounceLeadingCall:s=!0,resizeObserverPolyfill:c,...l}=e,{parentRef:u,resize:d,...f}=mc({initialSize:a,debounceTime:r,ignoreDimensions:i,enableDebounceLeadingCall:s,resizeObserverPolyfill:c});return(0,q.jsx)(`div`,{style:o,ref:u,className:t,...l,children:n({...f,ref:u.current,resize:d})})}function _c(e,t,n,r,i){return e.map((e,a)=>{let o=t(e),s=e[i];return{x:n(o)??0,y:typeof s==`number`?r(s)??0:0,key:String(o.getTime?.()??a)}})}function vc(e,t,n){if(n>=1)return t;if(n<=0)return e.length>0?e:t;let r=new Map(e.map(e=>[e.key,e]));return t.map((i,a)=>{let o=r.get(i.key);if(o)return{key:i.key,x:o.x+(i.x-o.x)*n,y:o.y+(i.y-o.y)*n};let s=a>0?t[a-1]:void 0,c=s?r.get(s.key):void 0,l=a<t.length-1?t[a+1]:void 0,u=l?r.get(l.key):void 0,d=c??u??e[0]??i;return{key:i.key,x:d.x+(i.x-d.x)*n,y:d.y+(i.y-d.y)*n}})}function yc(e,t){return e.length===0?``:xn().x(e=>e.x).y(e=>e.y).curve(t)(e)??``}function bc({renderData:e,xAccessor:t,dataKey:n,innerWidth:r,xDomainMin:i,xDomainMax:a}){return`${r}|${i}|${a}|${e.map(e=>{let r=t(e),i=e[n];return`${r.getTime()}:${typeof i==`number`?i:``}`}).join(`,`)}`}function xc({renderData:e,xAccessor:t,xScale:n,yScale:r,dataKey:i,curve:a,chartPhase:o,durationMs:s,innerWidth:c,enabled:l}){let u=fe(),[d,f]=(0,K.useState)(null),p=(0,K.useRef)(null),m=(0,K.useRef)(!1),h=(0,K.useMemo)(()=>n.domain?.()??[new Date(0),new Date(0)],[n]),g=(0,K.useMemo)(()=>bc({renderData:e,xAccessor:t,dataKey:i,innerWidth:c,xDomainMin:h[0]?.getTime?.()??0,xDomainMax:h[1]?.getTime?.()??0}),[e,t,i,c,h]),_=(0,K.useMemo)(()=>_c(e,t,n,r,i),[e,t,n,r,i]),v=(0,K.useRef)(g);(0,K.useEffect)(()=>{m.current||(p.current=_)},[_]),(0,K.useEffect)(()=>{if(!(l&&!u&&o===`ready`&&s>0&&e.length>0)){m.current=!1,f(null),p.current=_,v.current=g;return}if(v.current===g)return;v.current=g;let a=p.current??_;if(a.length===0){p.current=_;return}m.current=!0;let c=a,d=me(0,1,{duration:s/1e3,ease:[...$o],onUpdate:a=>{let o=_c(e,t,n,r,i),s=vc(c,o,a);p.current=s,f(s)},onComplete:()=>{m.current=!1,p.current=_,f(null)}});return()=>{d.stop(),m.current=!1}},[g,o,s,l,u,e,t,n,r,i,_]);let y=d??_;return{pathD:(0,K.useMemo)(()=>yc(y,a),[y,a]),isPathAnimating:d!=null}}function Sc({animatedPathD:e,curve:t,getY:n,pathRef:r,renderData:i,strokeWidth:a,useDataTransitionPath:o,visibleStroke:s,xAccessor:c,xScale:l}){return o&&e?(0,q.jsx)(`path`,{d:e,fill:`none`,ref:r,stroke:s,strokeLinecap:`round`,strokeWidth:a}):(0,q.jsx)(zn,{curve:t,data:i,innerRef:r,stroke:s,strokeLinecap:`round`,strokeWidth:a,x:e=>l(c(e))??0,y:n})}function Cc({curve:e,handleLoadingPulseComplete:t,innerWidth:n,loadingStroke:r,loadingStrokeOpacity:i,loadingStyle:a,pathD:o,pulseEpoch:s,pulseMode:c,showLoadingPulse:l,strokeWidth:u}){let d=l&&n>0&&a===`sweep`;return(0,q.jsxs)(q.Fragment,{children:[d?(0,q.jsx)(vs,{curve:e,mode:c??`loop`,onTransitionComplete:t,stroke:r,strokeOpacity:i,strokeWidth:u},`loading-sweep`):null,l&&n>0&&!d&&o?(0,q.jsx)(rs,{loopEpoch:s,mode:c??void 0,onCycleComplete:t,pathD:o,stroke:r,strokeOpacity:i,strokeWidth:u},`loading-pulse`):null]})}function wc({dataKey:e,yAxisId:t,stroke:n=Q.linePrimary,strokeWidth:r=2.5,curve:i=jn,animate:a=!0,fadeEdges:o=!0,showHighlight:s=!0,showMarkers:c=!1,markers:l,dashFromIndex:u,dashArray:d=`6,4`,loading:f,loadingStroke:p=Q.foreground,loadingStrokeOpacity:m=.5,loadingPulseMode:h,onLoadingPulseCycleComplete:g,loadingStyle:_=`pulse`}){let{data:v,renderData:y,xScale:b,innerHeight:x,innerWidth:S,xAccessor:C,lines:w,chartPhase:T,notifyLoadingPulseComplete:E,yDomainTweenDuration:D}=qo(),O=Jo(t),k=a&&T===`ready`,{pathD:A}=xc({chartPhase:T,curve:i,dataKey:e,durationMs:D,enabled:k,innerWidth:S,renderData:y,xAccessor:C,xScale:b,yScale:O}),j=ts(T),M=f===!1?null:h??(f===!0?`loop`:j),N=M!=null,[P,F]=(0,K.useState)(0),I=s&&!N,L=(0,K.useCallback)(()=>{if(g?.(),M===`loop`){window.setTimeout(()=>{F(e=>e+1)},280);return}E?.()},[E,g,M]),R=(0,K.useMemo)(()=>{let t=w.findIndex(t=>t.dataKey===e);return t>=0?t:0},[w,e]),z=(0,K.useRef)(null),{pathLength:B,pathD:ee}=bs(z,[y,S,u,a,k?A:null]),V=`line-gradient-${e}-${(0,K.useId)()}`,H=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?O(n)??0:0},[e,O]),U=xs(u,v.length),te=Vn(o),ne=te.any?`url(#${V})`:n,re=te.any?Hn(te):null,ie=T===`revealing`||T===`ready`||T===`exitingReady`,ae=`transparent`;return ie&&!U&&(ae=ne),(0,q.jsxs)(q.Fragment,{children:[re?(0,q.jsx)(`defs`,{children:(0,q.jsx)(`linearGradient`,{id:V,...Un(S),children:re.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:n,stopOpacity:e.opacity}},e.offset))})}):null,(0,q.jsxs)(Rs,{dimOpacity:.3,enabled:I,seriesIndex:R,children:[(0,q.jsx)(Sc,{animatedPathD:A,curve:i,getY:H,pathRef:z,renderData:y,strokeWidth:r,useDataTransitionPath:k,visibleStroke:ae,xAccessor:C,xScale:b}),(0,q.jsx)(Ts,{dashArray:d,dashFromIndex:u,data:v,innerHeight:x,innerWidth:S,pathD:ee,pathLength:B,stroke:ne,strokeWidth:r,xAccessor:C,xScale:b})]}),c?(0,q.jsx)(qs,{animate:a,dataKey:e,...l,fill:l?.fill??n,stroke:l?.stroke??l?.fill??n}):null,(0,q.jsx)(Fs,{enabled:I,height:x,pathRef:z,stroke:n,strokeWidth:r}),(0,q.jsx)(Cc,{curve:i,handleLoadingPulseComplete:L,innerWidth:S,loadingStroke:p,loadingStrokeOpacity:m,loadingStyle:_,pathD:ee,pulseEpoch:P,pulseMode:M,showLoadingPulse:N,strokeWidth:r})]})}wc.displayName=`Line`;function Tc(e,t,n=Vs){return{...e??n,delay:t}}function Ec(e){let{innerWidth:t,dataLength:n,columnWidth:r,seriesCount:i,composedBarSize:a,composedMaxBarSize:o,composedBarGap:s=4,stacked:c=!1}=e,l=s,u=c?1:Math.max(1,i),d=r;d<=0&&(d=n<2?t:t/(n-1));let f=a??Math.min(d*.88,o??1/0);if(o!=null&&(f=Math.min(f,o)),u>1){let e=d*.92;u*f+(u-1)*l>e&&e>0&&(f=Math.max(4,(e-(u-1)*l)/u))}return Math.max(2,f)}function Dc(e){let{barWidth:t,seriesCount:n,gap:r=4,stacked:i=!1}=e;if(i||n<=1)return Math.ceil(t/2);let a=n*t+(n-1)*r;return Math.ceil(a/2)}function Oc(e){let{stacked:t,composedStackOffsets:n,rowIndex:r,dataKey:i,value:a,yScale:o,innerHeight:s,xCenter:c,barWidth:l,seriesCount:u,gap:d,seriesIndex:f,stackGap:p,isLastSeries:m,radius:h}=e;if(t&&n){let e=n.get(r)?.get(i)??0,t=s-(o(a)??0),u=o(e)??s,d=f*p,g=u-t-d;return!m&&p>0&&(t=Math.max(0,t-p)),{barLeft:c-l/2,barHeight:t,effectiveRadius:p>0||m?h:0,valueY:g}}let g=u*l+(u>1?(u-1)*d:0),_=o(a)??s;return{barLeft:c-g/2+f*(l+d),barHeight:s-_,effectiveRadius:h,valueY:_}}function kc({dataKey:e,fill:t=Q.linePrimary,radius:n=0,animate:r=!0,fadedOpacity:i=.3}){let{data:a,xScale:o,yScale:s,xAccessor:c,innerHeight:l,innerWidth:u,columnWidth:d,isLoaded:f,animationDuration:p,enterTransition:m,revealEpoch:h=0,barScale:g,composedBarDataKeys:_,composedBarSize:v,composedMaxBarSize:y,composedBarGap:b,composedStacked:x,composedStackOffsets:S,composedStackGap:C,tooltipData:w}=Xo(),T=(0,K.useMemo)(()=>_&&_.length>0?_:[e],[_,e]),E=(0,K.useMemo)(()=>{let t=T.indexOf(e);return t>=0?t:0},[T,e]),D=T.length,O=b??4,k=C??0,A=!!x&&S!=null&&_!=null&&_.length>0,j=E===D-1,M=(0,K.useMemo)(()=>Ec({innerWidth:u,dataLength:a.length,columnWidth:d,seriesCount:D,composedBarSize:v,composedMaxBarSize:y,composedBarGap:O,stacked:A}),[d,v,y,a.length,O,u,D,A]),N=(p||1100)*.4,P=a.length>1?N/1e3/a.length:0,{hoveredIndex:F}=Ls(),I=F!==null&&F!==E,L=w?.index??null;return g?(console.warn(`SeriesBar is for time-based ComposedChart / LineChart context. Use Bar inside BarChart for categorical x.`),null):(0,q.jsx)(`g`,{className:`series-bar`,children:a.map((a,u)=>{let d=a[e];if(typeof d!=`number`)return null;let p=o(c(a))??0,{barLeft:g,valueY:_,barHeight:v,effectiveRadius:y}=Oc({stacked:A,composedStackOffsets:S,rowIndex:u,dataKey:e,value:d,yScale:s,innerHeight:l,xCenter:p,barWidth:M,seriesCount:D,gap:O,seriesIndex:E,stackGap:k,isLastSeries:j,radius:n}),b=String(c(a).getTime()),x=L!==null&&L!==u||I;return r&&!f?(0,q.jsx)(Ac,{barHeight:v,barWidth:M,calculatedStaggerDelay:P,enterTransition:m,fadedOpacity:i,fill:t,index:u,innerHeight:l,isFaded:x,radius:y,revealEpoch:h,x:g,y:_},`${e}-${b}-${h}`):(0,q.jsx)(G.rect,{animate:{opacity:x?i:1},fill:t,height:v,rx:y,ry:y,transition:{opacity:{duration:.12}},width:M,x:g,y:_},`${e}-${b}`)})})}kc.displayName=`SeriesBar`;function Ac({x:e,y:t,barWidth:n,barHeight:r,fill:i,radius:a,index:o,innerHeight:s,calculatedStaggerDelay:c,enterTransition:l,revealEpoch:u,isFaded:d,fadedOpacity:f}){let p=Tc(l,o*c);return(0,q.jsx)(G.rect,{animate:{height:r,y:t,opacity:d?f:1},fill:i,initial:{height:0,y:s,opacity:1},rx:a,ry:a,transition:p,width:n,x:e},`series-bar-${o}-${u}`)}function jc(e){return typeof e==`function`&&e.__chartClipPassthrough===!0}function Mc(e){if(jc(e.type)){let t=e.props.children;if((0,K.isValidElement)(t))return Mc(t)}return e}var Nc=new Set([`Background`,`Grid`,`XAxis`,`YAxis`,`BarXAxis`,`BarYAxis`,`LiveXAxis`,`LiveYAxis`]),Pc=new Set([`ReferenceArea`,`BarColumnTrack`]);function Fc(e){let t=e.type;if(t.__isChartMarkers||t.__isPostOverlay)return!0;let n=typeof e.type==`function`&&(t.displayName||t.name)||``;return n===`ChartMarkers`||n===`MarkerGroup`||n===`ChartBrush`}function Ic(e){let t=e.type,n=typeof e.type==`function`&&(t.displayName||t.name)||``;return Pc.has(n)}function Lc(e){let t=e.type,n=typeof e.type==`function`&&(t.displayName||t.name)||``;return Nc.has(n)}function Rc(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}var zc=new Set([`Lines`,`Circles`,`Waves`,`Hexagons`,`Path`,`Pattern`]);function Bc(e){let t=Rc(e);return t.includes(`Pattern`)||zc.has(t)}function Vc(e){let t=Rc(e);return t.includes(`Gradient`)||t===`LinearGradient`||t===`RadialGradient`}var Hc=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),Uc=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}),Wc=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});var Gc=new Intl.NumberFormat(`en-US`).format,Kc=`ready`;function qc(e){return e===`loading`?`loading`:`ready`}function Jc(e){return e===`ready`}function Yc({clipPathId:e,height:t,targetWidth:n,enterTransition:r,revealEpoch:i,padding:a=0,animating:o=!0,mode:s=`reveal`,onComplete:c}){let l=Hs(r),u=Math.max(0,n+a*2),d=t+a*2;if(!o)return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(`rect`,{height:d,width:u,x:-a,y:-a})});if(s===`conceal`){let t=-a+u;return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(G.rect,{animate:{width:0,x:t},height:d,initial:{width:u,x:-a},onAnimationComplete:()=>c?.(),transition:l,y:-a},`conceal-${i}`)})}return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(G.rect,{animate:{width:u},height:d,initial:{width:0},transition:l,width:u,x:-a,y:-a},`reveal-${i}`)})}function Xc(e,t,n=[]){let r=e.length;if(t>=r||t<3)return e;let i=(e,t)=>{if(n.length===0){for(let t of Object.values(e))if(typeof t==`number`)return t;return t}let r=0,i=0;for(let t of n){let n=e[t];typeof n==`number`&&(r+=n,i++)}return i>0?r/i:t},a=[e[0]],o=(r-2)/(t-2),s=0;for(let n=0;n<t-2;n++){let t=Math.floor((n+1)*o)+1,c=Math.min(Math.floor((n+2)*o)+1,r-1),l=Math.floor((n+2)*o)+1,u=Math.min(Math.floor((n+3)*o)+1,r),d=Math.max(0,u-l),f=r-1,p=i(e[r-1],r-1);if(d>0){f=0,p=0;for(let t=l;t<u;t++)f+=t,p+=i(e[t],t);f/=d,p/=d}let m=e[s],h=s,g=i(m,s),_=-1,v=t;for(let n=t;n<c;n++){let t=Math.abs((h-f)*(i(e[n],n)-g)-(h-n)*(p-g))*.5;t>_&&(_=t,v=n)}a.push(e[v]),s=v}return a.push(e[r-1]),a}function Zc(e){return Math.max(64,Math.ceil(e*1.5))}function Qc(e,t,n){let r=t[0].getTime(),i=t[1].getTime(),a=Math.min(r,i),o=Math.max(r,i);return e.filter(e=>{let t=n(e).getTime();return t>=a&&t<=o})}function $c(e={}){let t=e.dataKey??`value`,n=e.pointCount??7,r=e.baseDate??new Date(`2025-01-01`);return Array.from({length:n},(e,n)=>{let i=new Date(r);return i.setDate(r.getDate()+n),{date:i,[t]:Math.round(110+Math.sin(n*1.15)*36+n*9)}})}function el(e,t){return e.map((e,n)=>({...e,[t]:Math.round(95+Math.sin(n*1.05)*28+n*7)}))}function tl(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r)e.value<t&&(t=e.value),e.value>n&&(n=e.value);return t===1/0?null:{minValue:t,maxValue:n}}function nl(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r){let r=e.date.getTime();r<t&&(t=r),r>n&&(n=r)}return t===1/0?null:{minTime:t,maxTime:n}}function rl(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function il(e){return rl(e)===`ProjectionLine`}function al(e){return e?.length?e.map(e=>({date:e.date instanceof Date?e.date:new Date(e.date),value:e.value})):[]}function ol(e){let t=[],n=e=>{K.Children.forEach(e,e=>{if(!(0,K.isValidElement)(e))return;if(e.type===K.Fragment){n(e.props.children);return}if(il(e)){let n=e.props,r=al(n?.data);r.length>=2&&t.push({yAxisId:zo(n?.yAxisId),data:r});return}if(jc(e.type)){n(e.props.children);return}let r=e.props;r?.children&&n(r.children)})};return n(e),t}function sl(e,t,n){let r=tl(t.filter(e=>e.yAxisId===n).map(e=>e.data));if(!r)return e;let[i,a]=e,o=Math.min(i,r.minValue),s=Math.max(a,r.maxValue);if(o>=0&&i>=0)return[0,s<=0?100:s*1.1];let c=(s-o)*.05||1;return[o-c,s+c]}function cl(e,t){let n=nl(t.map(e=>e.data));return n?Math.max(e,n.maxTime):e}function ll(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function ul(e){return ll(e)===`ReferenceArea`}function dl(e){let t=[],n=e=>{K.Children.forEach(e,e=>{if(!(0,K.isValidElement)(e))return;if(ul(e)){let n=e.props;n&&t.push({yAxisId:zo(n.yAxisId),y1:n.y1,y2:n.y2,axisLabelColor:n.axisLabelColor});return}let r=e.props;r?.children&&n(r.children)})};return n(e),t}var fl=(0,K.createContext)(null),pl=(0,K.createContext)(!1);function ml(){return(0,K.useContext)(pl)}function hl(e){let t=No({domain:e,range:[0,1],nice:!0}).domain();return[t[0]??e[0],t[1]??e[1]]}function gl(e,t){let n=Math.max(Math.abs(t[1]-t[0]),Math.abs(e[1]-e[0]),1),r=Math.abs(t[0]-e[0])/n,i=Math.abs(t[1]-e[1])/n;return r>=.02||i>=.02}function _l(e){return e===`loading`||e===`revealingLoading`}function vl(e){return e===`loading`||e===`exiting`||e===`gridTweenLoading`}function yl(e){return e===`gridTweenLoading`||e===`gridTweenReady`}function bl(e,t,n){switch(e){case`loading`:case`exiting`:case`gridTweenLoading`:return t;case`exitingReady`:case`gridTweenReady`:case`revealing`:case`ready`:return n;default:return n}}function xl({lines:e,resolveDomain:t}){let n=Bo(e),r={};for(let[e,i]of n){let n=i.map(e=>e.dataKey);r[zo(e)]=hl(t(n))}return r.left||=hl([0,100]),r}function Sl(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!(n&&i)||n[0]!==i[0]||n[1]!==i[1])return!1}return!0}function Cl(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function wl(e,t,n){Sl(n.current,e)||(t(e),n.current=e)}function Tl({destination:e,durationMs:t,enabled:n,reducedMotion:r,animatedRef:i,setAnimatedByAxis:a,onSettled:o}){if(Sl(i.current,e)){o?.();return}if(!n||r){wl(e,a,i),o?.();return}let s=Object.keys(e),c=i.current,l=!1;for(let t of s){let n=c[t]??e[t]??[0,100];if(gl(n,e[t]??n)){l=!0;break}}if(!l){wl(e,a,i),o?.();return}let u={};for(let t of s)u[t]=c[t]??e[t]??[0,100];return me(0,1,{duration:t/1e3,ease:[...$o],onUpdate:t=>{let n={};for(let r of s){let i=u[r]??e[r]??[0,100],a=e[r]??i;n[r]=gl(i,a)?Cl(i,a,t):a}i.current=n,a(n)},onComplete:()=>{wl(e,a,i),o?.()}})}function El({enabled:e,durationMs:t,chartPhase:n,skeletonByAxis:r,targetByAxis:i,onSettled:a,tweenOnTargetChange:o=!1}){let s=fe(),c=bl(n,r,i),l=(0,K.useRef)(c);l.current=c;let u=(0,K.useRef)(r);u.current=r;let d=(0,K.useRef)(i);d.current=i;let[f,p]=(0,K.useState)(c),m=(0,K.useRef)(f),h=(0,K.useRef)(n),g=(0,K.useRef)(a);g.current=a,(0,K.useEffect)(()=>{m.current=f},[f]),(0,K.useEffect)(()=>{if(h.current===n)return;h.current=n;let r=()=>{g.current?.()};if(n===`exiting`){wl(u.current,p,m);return}if(n===`exitingReady`){wl(d.current,p,m);return}if(n===`loading`){wl(u.current,p,m);return}if(n===`revealing`||n===`ready`){wl(d.current,p,m);return}if(!yl(n))return;let i=Tl({destination:l.current,durationMs:t,enabled:e,reducedMotion:s,animatedRef:m,setAnimatedByAxis:p,onSettled:r});return()=>i?.stop()},[n,t,e,s]);let _=JSON.stringify(i),v=(0,K.useRef)(_);return(0,K.useEffect)(()=>{if(n!==`ready`&&n!==`revealing`){v.current=_;return}if(v.current!==_){if(v.current=_,o&&n===`ready`){let n=Tl({destination:d.current,durationMs:t,enabled:e,reducedMotion:s,animatedRef:m,setAnimatedByAxis:p,onSettled:()=>g.current?.()});return()=>n?.stop()}wl(d.current,p,m)}},[n,t,e,s,_,o]),f}var Dl=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function Ol(e){return!!e&&e instanceof Element}function kl(e){return!!e&&(e instanceof SVGElement||`ownerSVGElement`in e)}function Al(e){return!!e&&`createSVGPoint`in e}function jl(e){return!!e&&`getScreenCTM`in e}function Ml(e){return!!e&&`changedTouches`in e}function Nl(e){return!!e&&`clientX`in e}function Pl(e){return!!e&&(e instanceof Event||`nativeEvent`in e&&e.nativeEvent instanceof Event)}var Fl={x:0,y:0};function Il(e){if(!e)return{...Fl};if(Ml(e))return e.changedTouches.length>0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:{...Fl};if(Nl(e))return{x:e.clientX,y:e.clientY};let t=e?.target,n=t&&`getBoundingClientRect`in t?t.getBoundingClientRect():null;return n?{x:n.x+n.width/2,y:n.y+n.height/2}:{...Fl}}function Ll(e,t){if(!e||!t)return null;let n=Il(t),r=kl(e)?e.ownerSVGElement:e,i=jl(r)?r.getScreenCTM():null;if(Al(r)&&i){let e=r.createSVGPoint();return e.x=n.x,e.y=n.y,e=e.matrixTransform(i.inverse()),new Dl({x:e.x,y:e.y})}let a=e.getBoundingClientRect();return new Dl({x:n.x-a.left-e.clientLeft,y:n.y-a.top-e.clientTop})}function Rl(e,t){if(Ol(e)&&t)return Ll(e,t);if(Pl(e)){let t=e,n=t.target;if(n)return Ll(n,t)}return null}function zl(e){if(typeof e==`object`&&e&&`index`in e&&typeof e.index==`number`){let{index:t,x:n}=e;return typeof n==`number`?`${t}:${Math.round(n)}`:String(t)}return JSON.stringify(e)}function Bl(){let[e,t]=(0,K.useState)(null),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>{i.current!==null&&cancelAnimationFrame(i.current)},[]);let o=(0,K.useCallback)((e,r)=>{r!==n.current&&(n.current=r,t(e))},[]);return{tooltipData:e,setTooltipData:t,scheduleTooltip:(0,K.useCallback)((e,t)=>{let s=t??zl(e);r.current=e,a.current=s,s!==n.current&&i.current===null&&(i.current=requestAnimationFrame(()=>{i.current=null;let e=r.current,t=a.current;e&&t&&o(e,t)}))},[o]),clearTooltip:(0,K.useCallback)(()=>{i.current!==null&&(cancelAnimationFrame(i.current),i.current=null),r.current=null,a.current=null,n.current=null,t(null)},[]),resetTooltipDedupe:(0,K.useCallback)(()=>{n.current=null},[])}}function Vl({xScale:e,yScale:t,yScales:n,data:r,lines:i,margin:a,xAccessor:o,bisectDate:s,canInteract:c}){let[l,u]=(0,K.useState)(null),{tooltipData:d,setTooltipData:f,scheduleTooltip:p,clearTooltip:m,resetTooltipDedupe:h}=Bl(),g=(0,K.useRef)(!1),_=(0,K.useRef)(0),v=(0,K.useRef)(null),y=(0,K.useCallback)(a=>{let c=e.invert(a),l=s(r,c,1),u=r[l-1],d=r[l];if(!u)return null;let f=u,p=l-1;if(d){let e=o(u).getTime(),t=o(d).getTime();c.getTime()-e>t-c.getTime()&&(f=d,p=l)}let m={};for(let e of i){let r=f[e.dataKey];if(typeof r==`number`){let i=n[zo(e.yAxisId)]??t;m[e.dataKey]=i(r)??0}}return{point:f,index:p,x:e(o(f))??0,yPositions:m}},[e,t,n,r,i,o,s]),b=(0,K.useCallback)(t=>{let n=e.invert(t),i=s(r,n,1),a=r[i-1],c=r[i];if(!a)return 0;if(c){let e=o(a).getTime(),t=o(c).getTime();if(n.getTime()-e>t-n.getTime())return i}return i-1},[e,r,o,s]),x=(0,K.useCallback)((e,t=0)=>{let n=null;if(`touches`in e){let r=e.touches[t];if(!r)return null;let i=e.currentTarget.ownerSVGElement;if(!i)return null;n=Rl(i,r)}else n=Rl(e);return n?n.x-a.left:null},[a.left]),S=(0,K.useCallback)(e=>{let t=x(e);if(t===null)return;if(g.current){let e=Math.min(_.current,t),n=Math.max(_.current,t);u({startX:e,endX:n,startIndex:b(e),endIndex:b(n),active:!0});return}v.current=t;let n=y(t);n&&p(n)},[x,y,b,p]),C=(0,K.useCallback)(()=>{v.current=null,m(),g.current&&=!1,u(null)},[m]),w=(0,K.useCallback)(e=>{let t=x(e);t!==null&&(g.current=!0,_.current=t,m(),u(null))},[x,m]),T=(0,K.useCallback)(()=>{g.current&&=!1,u(null)},[]),E=(0,K.useCallback)(e=>{if(e.touches.length===1){e.preventDefault();let t=x(e,0);if(t===null)return;v.current=t;let n=y(t);n&&p(n)}else if(e.touches.length===2){e.preventDefault(),h(),m();let t=x(e,0),n=x(e,1);if(t===null||n===null)return;let r=Math.min(t,n),i=Math.max(t,n);u({startX:r,endX:i,startIndex:b(r),endIndex:b(i),active:!0})}},[x,y,b,p,h,m]),D=(0,K.useCallback)(e=>{if(e.touches.length===1){e.preventDefault();let t=x(e,0);if(t===null)return;v.current=t;let n=y(t);n&&p(n)}else if(e.touches.length===2){e.preventDefault();let t=x(e,0),n=x(e,1);if(t===null||n===null)return;let r=Math.min(t,n),i=Math.max(t,n);u({startX:r,endX:i,startIndex:b(r),endIndex:b(i),active:!0})}},[x,y,b,p]),O=(0,K.useCallback)(()=>{m(),u(null)},[m]),k=(0,K.useCallback)(()=>{u(null)},[]);return(0,K.useEffect)(()=>{if(!c||v.current===null)return;let e=y(v.current);if(e){p(e,`${e.index}:${Math.round(e.x)}`);return}m()},[c,m,y,p]),{tooltipData:d,setTooltipData:f,selection:l,clearSelection:k,interactionHandlers:c?{onMouseMove:S,onMouseLeave:C,onMouseDown:w,onMouseUp:T,onTouchStart:E,onTouchMove:D,onTouchEnd:O}:{},interactionStyle:{cursor:c?`crosshair`:`default`,touchAction:`none`}}}function Hl({chartStatus:e,targetData:t,skeletonData:n,animationDuration:r,yDomainTweenDuration:i,revealSignature:a=``,skipEnterReveal:o=!1}){let[s,c]=(0,K.useState)(()=>qc(e)),[l,u]=(0,K.useState)(()=>e===`loading`?n:t),[d,f]=(0,K.useState)(0),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(()=>e===`ready`),_=(0,K.useRef)(e),v=(0,K.useRef)(s);v.current=s,(0,K.useEffect)(()=>{let a=_.current;if(a!==e){if(_.current=e,e===`ready`&&a===`loading`){g(!1),r<=0?i<=0?(u(t),c(`revealing`)):c(`gridTweenReady`):c(`exiting`);return}e===`loading`&&a===`ready`&&(g(!1),r<=0?i<=0?(u(n),c(`loading`)):c(`gridTweenLoading`):(m(e=>e+1),c(`exitingReady`)))}},[r,e,n,t,i]),(0,K.useEffect)(()=>{o||e===`ready`&&v.current===`ready`&&(c(`revealing`),g(!1))},[r,e,a,o]),(0,K.useEffect)(()=>{switch(s){case`loading`:e===`loading`&&u(n);break;case`exiting`:u(n);break;case`exitingReady`:case`gridTweenLoading`:case`gridTweenReady`:case`revealing`:case`ready`:u(t)}},[s,e,n,t]);let y=(0,K.useCallback)(()=>{v.current===`exiting`&&c(`gridTweenReady`)},[]),b=(0,K.useCallback)(()=>{v.current===`exitingReady`&&c(`gridTweenLoading`)},[]),x=(0,K.useCallback)(()=>{if(v.current===`gridTweenLoading`){c(`loading`);return}v.current===`gridTweenReady`&&c(`revealing`)},[]);return(0,K.useEffect)(()=>{if(s!==`revealing`)return;if(f(e=>e+1),r<=0){c(`ready`),g(!0);return}let e=window.setTimeout(()=>{c(`ready`),g(!0)},r);return()=>window.clearTimeout(e)},[r,s]),{chartPhase:s,plotData:l,revealEpoch:d,concealEpoch:p,isLoaded:h,notifyLoadingPulseComplete:y,notifyRevealConcealComplete:b,notifyYDomainTweenComplete:x}}function Ul(e,t){let n=1/0,r=-1/0;for(let i of e)for(let e of t){let t=i[e];typeof t==`number`&&(t<n&&(n=t),t>r&&(r=t))}return n===1/0?{minValue:0,maxValue:100}:{minValue:n,maxValue:r}}function Wl(e,t,n){if(n!=null&&n>0)return[0,n*1.1];let{minValue:r,maxValue:i}=Ul(e,t);if(r>=0)return[0,i<=0?100:i*1.1];let a=(i-r)*.05||1;return[r-a,i+a]}function Gl(e,t){return e.key==null?(0,K.cloneElement)(e,{key:`chart-child-${t}`}):e}function Kl(e){let{width:t,height:n}=e;return t<10||n<10?null:(0,q.jsx)(ql,{...e})}var ql=(0,K.memo)(function({width:e,height:t,data:n,xDataKey:r,margin:i,animationDuration:a,animationEasing:o=zs,enterTransition:s,revealSignature:c=``,children:l,containerRef:u,lines:d,clipPathId:f,composedBarDataKeys:p,composedBarSize:m,composedMaxBarSize:h,composedBarGap:g,composedStacked:_,composedStackOffsets:v,composedStackGap:y,yScaleDomainMax:b,chartStatus:x=Kc,loadingLabel:S,yDomainTween:C=!0,yDomainTweenDuration:w=500,xDomain:T,xDomainSlotCount:E,tweenYDomainOnXDomainChange:D=!1,onPhaseChange:O}){let k=ml(),A=e-i.left-i.right,j=t-i.top-i.bottom,M=(0,K.useCallback)((e,t)=>{let n=Bo(d);return Wl(e,t,n.size===1&&n.has(`left`)&&b!=null?b:void 0)},[d,b]),N=(0,K.useMemo)(()=>{let e=d[0]?.dataKey??`value`;return n.length===0?$c({dataKey:e}):el(n,e)},[n,d]),{chartPhase:P,plotData:F,revealEpoch:I,concealEpoch:L,isLoaded:R,notifyLoadingPulseComplete:z,notifyRevealConcealComplete:B,notifyYDomainTweenComplete:ee}=Hl({animationDuration:a,chartStatus:x,revealSignature:c,skeletonData:N,skipEnterReveal:k,targetData:n,yDomainTweenDuration:w});(0,K.useEffect)(()=>{O?.(P)},[P,O]);let V=(0,K.useCallback)(e=>{let t=e[r];return t instanceof Date?t:new Date(t)},[r]),H=(0,K.useMemo)(()=>qn(e=>V(e)).left,[V]),U=(0,K.useMemo)(()=>T?Qc(F,T,V):F,[F,T,V]),te=(0,K.useMemo)(()=>ol(l),[l]),ne=(0,K.useMemo)(()=>{let e=T?T[0].getTime():Qn(F,e=>V(e).getTime())[0]??0,t=T?T[1].getTime():Qn(F,e=>V(e).getTime())[1]??e;return T||(t=cl(t,te)),Fo({range:[0,A],domain:[e,t]})},[A,F,te,V,T]),re=T?F:U,ie=(0,K.useMemo)(()=>{let e=d.map(e=>e.dataKey);return Xc(re,Zc(A),e)},[re,A,d]),ae=(0,K.useMemo)(()=>{let e=T&&E!=null?E:U.length;return e<2?0:A/(e-1)},[A,U.length,T,E]),oe=(0,K.useMemo)(()=>xl({lines:d,resolveDomain:e=>M(N,e)}),[d,M,N]),se=(0,K.useMemo)(()=>{let e=xl({lines:d,resolveDomain:e=>M(T?U:n,e)});if(te.length===0)return e;let t={...e};for(let n of Object.keys(e))t[n]=sl(e[n]??[0,100],te,n);for(let e of te)t[e.yAxisId]||(t[e.yAxisId]=sl([0,100],te,e.yAxisId));return t},[n,d,te,M,U,T]),W=El({chartPhase:P,durationMs:w,enabled:C,onSettled:ee,skeletonByAxis:oe,targetByAxis:se,tweenOnTargetChange:C||D&&T!=null}),ce=(0,K.useMemo)(()=>Ho({domainsByAxis:W,innerHeight:j,lines:d}),[W,j,d]),le=Vo(ce,No({range:[j,0],domain:[0,100],nice:!0})),ue=(0,K.useMemo)(()=>{let e=U.map(e=>V(e)),t=e[0],n=e.at(-1),r=(t&&n?n.getTime()-t.getTime():0)<1296e5?Wc:Hc;return e.map(e=>r.format(e))},[U,V]),{tooltipData:de,setTooltipData:fe,selection:G,clearSelection:pe,interactionHandlers:me,interactionStyle:he}=Vl({bisectDate:H,canInteract:R&&Jc(P),data:U,lines:d,margin:i,xAccessor:V,xScale:ne,yScale:le,yScales:ce}),ge=[],_e=[],ve=[],ye=[],be=[];K.Children.forEach(l,(e,t)=>{if(!(0,K.isValidElement)(e))return;let n=Mc(Gl(e,t));Vc(n)?ge.push(n):Bc(n)?ye.push(n):Fc(n)?be.push(n):Lc(n)?_e.push(n):Ic(n)?ve.push(n):ye.push(n)});let[xe,Se]=(0,K.useState)(()=>new Map),Ce=(0,K.useCallback)((e,t)=>{Se(n=>{let r=n.get(e);if(r&&r.yAxisId===t.yAxisId&&r.y1===t.y1&&r.y2===t.y2&&r.axisLabelColor===t.axisLabelColor)return n;let i=new Map(n);return i.set(e,t),i})},[]),we=(0,K.useCallback)(e=>{Se(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),Te=(0,K.useMemo)(()=>({registerReferenceArea:Ce,unregisterReferenceArea:we}),[Ce,we]),Ee=(0,K.useMemo)(()=>{let e=dl(l),t=[...xe.values()];return t.length===0?e:e.length===0?t:[...e,...t]},[l,xe]),De=(0,K.useMemo)(()=>({data:U,renderData:ie,xScale:ne,yScale:le,yScales:ce,width:e,height:t,innerWidth:A,innerHeight:j,margin:i,columnWidth:ae,tooltipData:de,setTooltipData:fe,containerRef:u,lines:d,referenceAreas:Ee,chartPhase:P,chartStatus:x,loadingLabel:S,yDomainTweenDuration:w,yDomainSkeletonByAxis:oe,yDomainTargetByAxis:se,isLoaded:R,animationDuration:a,animationEasing:o,enterTransition:s,revealEpoch:I,notifyLoadingPulseComplete:z,xAccessor:V,dateLabels:ue,xDomain:T,xDomainSlotCount:E,selection:G,clearSelection:pe,composedBarDataKeys:p,composedBarSize:m,composedMaxBarSize:h,composedBarGap:g,composedStacked:_,composedStackOffsets:v,composedStackGap:y}),[U,ie,ne,le,ce,e,t,A,j,i,ae,de,fe,u,d,Ee,P,x,S,w,oe,se,R,a,o,s,I,z,V,ue,T,E,G,pe,p,m,h,g,_,v,y]),Oe=!k&&ie.length>1&&A>0&&a>0,ke=P===`revealing`,Ae=P===`exitingReady`&&a>0,je=s??{...Vs,duration:a/1e3},Me=(0,K.useMemo)(()=>p?.length?Dc({barWidth:Ec({columnWidth:ae,composedBarGap:g,composedBarSize:m,composedMaxBarSize:h,dataLength:F.length,innerWidth:A,seriesCount:p.length,stacked:_}),gap:g,seriesCount:p.length,stacked:_}):0,[ae,p,g,m,h,_,A,F.length]);return(0,q.jsx)(fl.Provider,{value:Te,children:(0,q.jsx)(Ko,{value:De,children:(0,q.jsxs)(`svg`,{"aria-hidden":`true`,height:t,width:e,children:[(0,q.jsxs)(`defs`,{children:[ge,Oe?(0,q.jsx)(Yc,{animating:ke||Ae,clipPathId:f,enterTransition:je,height:j+20,mode:Ae?`conceal`:`reveal`,onComplete:Ae?B:void 0,padding:Me,revealEpoch:Ae?L:I,targetWidth:A}):null]}),(0,q.jsx)(`rect`,{fill:`transparent`,height:t,width:e,x:0,y:0}),(0,q.jsxs)(`g`,{...me,style:he,transform:`translate(${i.left},${i.top})`,children:[(0,q.jsx)(`rect`,{fill:`transparent`,height:j,width:A,x:0,y:0}),_e,ve,Oe?(0,q.jsx)(`g`,{clipPath:`url(#${f})`,children:ye}):ye,be]})]})})})}),Jl={top:40,right:40,bottom:40,left:40};function Yl(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function Xl(e,t){let n=e.findIndex(e=>e.dataKey===t.dataKey);if(n===-1){e.push(t);return}e[n]=t}function Zl(e,t,n){let r=Yl(e);if(e.type!==kc&&r!==`SeriesBar`)return!1;let i=e.props;return!i.dataKey||(n.push(i.dataKey),Xl(t,{dataKey:i.dataKey,stroke:i.stroke||i.fill||`var(--chart-line-primary)`,strokeWidth:0}),!0)}function Ql(e,t){let n=Yl(e);if(e.type!==wc&&n!==`Line`)return!1;let r=e.props;return r.dataKey&&Xl(t,{dataKey:r.dataKey,stroke:r.stroke||`var(--chart-line-primary)`,strokeWidth:r.strokeWidth??2.5,yAxisId:r.yAxisId}),!0}function $l(e,t){let n=Yl(e);if(e.type!==Zs&&n!==`Area`)return!1;let r=e.props;return r.dataKey&&Xl(t,{dataKey:r.dataKey,stroke:r.stroke||r.fill||`var(--chart-line-primary)`,strokeWidth:r.strokeWidth??2,yAxisId:r.yAxisId}),!0}function eu(e){let t=[],n=[];return K.Children.forEach(e,e=>{(0,K.isValidElement)(e)&&(Zl(e,t,n)||Ql(e,t)||$l(e,t))}),{lines:t,barDataKeys:n}}function tu(e,t,n){let r=new Set(n),i=0;for(let a of e){let e=0;for(let t of n){let n=a[t];typeof n==`number`&&(e+=n)}let o=0;for(let e of t){if(r.has(e.dataKey))continue;let t=a[e.dataKey];typeof t==`number`&&(o=Math.max(o,t))}i=Math.max(i,e,o)}return i>0?i:void 0}function nu({width:e,height:t,data:n,xDataKey:r,margin:i,animationDuration:a,animationEasing:o,enterTransition:s,revealSignature:c,children:l,containerRef:u,barSize:d,maxBarSize:f,barGap:p,stacked:m=!1,stackGap:h=0,onPhaseChange:g}){let{lines:_,barDataKeys:v}=(0,K.useMemo)(()=>eu(l),[l]),y=(0,K.useMemo)(()=>{if(!(m&&v.length>0))return;let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];if(!r)continue;let i=new Map,a=0;for(let e of v){i.set(e,a);let t=r[e];typeof t==`number`&&(a+=t)}e.set(t,i)}return e},[n,v,m]),b=(0,K.useMemo)(()=>m&&v.length>0?tu(n,_,v):void 0,[n,_,v,m]);return(0,q.jsx)(Kl,{animationDuration:a,animationEasing:o,clipPathId:`composed-chart-grow-clip`,composedBarDataKeys:v.length>0?v:void 0,composedBarGap:p,composedBarSize:d,composedMaxBarSize:f,composedStacked:m,composedStackGap:h,composedStackOffsets:y,containerRef:u,data:n,enterTransition:s,height:t,lines:_,margin:i,onPhaseChange:g,revealSignature:c,width:e,xDataKey:r,yScaleDomainMax:b,children:l})}function ru({data:e,xDataKey:t=`date`,margin:n,animationDuration:r=1100,animationEasing:a,enterTransition:o,revealSignature:s,aspectRatio:c=`2 / 1`,className:l=``,children:u,barSize:d,maxBarSize:f,barGap:p=4,stacked:m=!1,stackGap:h=0,onPhaseChange:g}){let _=(0,K.useRef)(null),v={...Jl,...n};return(0,q.jsx)(`div`,{className:i(`relative w-full`,l),ref:_,style:{aspectRatio:c,touchAction:`none`},children:(0,q.jsx)(gc,{debounceTime:10,children:({width:n,height:i})=>(0,q.jsx)(nu,{animationDuration:r,animationEasing:a,barGap:p,barSize:d,containerRef:_,data:e,enterTransition:o,height:i,margin:v,maxBarSize:f,onPhaseChange:g,revealSignature:s,stacked:m,stackGap:h,width:n,xDataKey:t,children:u})})})}ru.displayName=`ComposedChart`;function iu(e){return`bandwidth`in e?e.bandwidth():0}function au(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??Lo(r,u),g=(f??0)+iu(r)/2,_=h.map((e,t)=>{let n=(Io(r(e))??0)+g;return{index:t,from:new Dl({x:0,y:n}),to:new Dl({x:i,y:n})}});return(0,q.jsx)(Ln,{className:(0,In.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,q.jsx)(Rn,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function ou(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??Lo(r,l),g=(d??0)+iu(r)/2,_=h.map((e,t)=>{let n=(Io(r(e))??0)+g;return{index:t,from:new Dl({x:n,y:0}),to:new Dl({x:n,y:i})}});return(0,q.jsx)(Ln,{className:(0,In.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,q.jsx)(Rn,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function su({innerWidth:e,shimmer:t,shimmerLength:n,shimmerSpeed:r,shimmerSync:i,active:a,oneShot:o=!1}){let s=_e(0),c=fe(),l=Zo/Math.max(r,.1),u=a&&t&&c!==!0&&e>0;(0,K.useEffect)(()=>{if(!u)return;let e=!1,t,n,r=()=>{e||(s.set(0),n=me(s,1,{duration:l,ease:[...$o],onComplete:()=>{e||(t=window.setTimeout(r,280))}}))};return i&&o?(s.set(0),n=me(s,1,{duration:l/2,ease:[...$o]}),()=>n?.stop()):i?(r(),()=>{e=!0,n?.stop(),t!==void 0&&window.clearTimeout(t)}):(s.set(0),n=me(s,1,{duration:l,repeat:1/0,ease:[...$o]}),()=>n?.stop())},[o,s,l,u,i]);let d=ve(s,t=>-n+t*(e+n*2));return{shimmerEnabled:u,shimmerTransform:ve(d,e=>`translate(${e}, 0)`)}}var cu=140,lu=1,uu=`color-mix(in oklch, var(--foreground) 68%, transparent)`;function du(e,t){return!t||e.length<=2?e:e.slice(1,-1)}function fu(e){let{hideHorizontalEdgeLines:t,numTicksRows:n,rowTickValues:r,yScale:i}=e,a=r??(i.ticks?i.ticks(n):[]),o=du(a,t);if(!(o===a&&!r&&!t))return o.length>0?o:void 0}function pu({horizontal:e=!0,vertical:t=!1,numTicksRows:n=5,numTicksColumns:r=10,rowTickValues:i,stroke:a=Q.grid,loadingStroke:o,strokeOpacity:s=1,strokeWidth:c=1,strokeDasharray:l=`4,4`,highlightRowValues:u,highlightRowStroke:d=Q.foregroundMuted,highlightRowStrokeOpacity:f=1,highlightRowStrokeWidth:p=1,highlightRowStrokeDasharray:m=`0`,fadeHorizontal:h=!0,fadeVertical:g=!1,hideHorizontalEdgeLines:_=!1,hideVerticalEdgeLines:v=!1,yAxisId:y,shimmer:b=!1,shimmerStroke:x=uu,shimmerLength:S=cu,shimmerSpeed:C=lu,shimmerSync:w=!1}){let{xScale:T,innerWidth:E,innerHeight:D,orientation:O,barScale:k,chartPhase:A}=qo(),j=Jo(y),M=b&&_l(A),N=vl(A)&&o!=null?o:a,{shimmerEnabled:P,shimmerTransform:F}=su({innerWidth:E,shimmer:b,shimmerLength:S,shimmerSpeed:C,shimmerSync:w,active:M}),I=O===`horizontal`&&k?j:T,L=fu({hideHorizontalEdgeLines:_,numTicksRows:n,rowTickValues:i,yScale:j}),R=t&&I&&typeof I==`function`&&v?(()=>{let e=du(I.ticks?.(r)??[],!0);return e.length>0?e:void 0})():void 0,z=(0,K.useId)(),B=`grid-rows-fade-${z}`,ee=`${B}-gradient`,V=`grid-shimmer-${z}`,H=`grid-cols-fade-${z}`,U=`${H}-gradient`,te=h?`url(#${B})`:void 0;return(0,q.jsxs)(`g`,{className:`chart-grid`,children:[e&&h&&(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:ee,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:`white`,stopOpacity:0}}),(0,q.jsx)(`stop`,{offset:`10%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`90%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:`white`,stopOpacity:0}})]}),(0,q.jsx)(`mask`,{id:B,children:(0,q.jsx)(`rect`,{fill:`url(#${ee})`,height:D,width:E,x:`0`,y:`0`})})]}),e&&P?(0,q.jsx)(`defs`,{children:(0,q.jsxs)(G.linearGradient,{gradientTransform:F,gradientUnits:`userSpaceOnUse`,id:V,x1:0,x2:S,y1:0,y2:0,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:x,stopOpacity:0}),(0,q.jsx)(`stop`,{offset:`35%`,stopColor:x,stopOpacity:.45}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:x,stopOpacity:1}),(0,q.jsx)(`stop`,{offset:`65%`,stopColor:x,stopOpacity:.45}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:x,stopOpacity:0})]})}):null,t&&g&&(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:U,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:`white`,stopOpacity:0}}),(0,q.jsx)(`stop`,{offset:`10%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`90%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:`white`,stopOpacity:0}})]}),(0,q.jsx)(`mask`,{id:H,children:(0,q.jsx)(`rect`,{fill:`url(#${U})`,height:D,width:E,x:`0`,y:`0`})})]}),e&&(0,q.jsxs)(`g`,{mask:te,children:[(0,q.jsx)(au,{numTicks:L?void 0:n,scale:j,stroke:N,strokeDasharray:l,strokeOpacity:s,strokeWidth:c,tickValues:L,width:E}),P?(0,q.jsx)(au,{numTicks:L?void 0:n,scale:j,stroke:`url(#${V})`,strokeDasharray:l,strokeOpacity:1,strokeWidth:c,tickValues:L,width:E}):null]}),e&&u&&u.length>0?(0,q.jsx)(`g`,{className:`chart-grid-highlight-rows`,children:u.map(e=>{let t=j(e);return t==null||!Number.isFinite(t)?null:(0,q.jsx)(`line`,{stroke:d,strokeDasharray:m,strokeOpacity:f,strokeWidth:p,x1:0,x2:E,y1:t,y2:t},e)})}):null,t&&I&&typeof I==`function`&&(0,q.jsx)(`g`,{mask:g?`url(#${H})`:void 0,children:(0,q.jsx)(ou,{height:D,numTicks:R?void 0:r,scale:I,stroke:a,strokeDasharray:l,strokeOpacity:s,strokeWidth:c,tickValues:R})})]})}pu.displayName=`Grid`;var mu=e(L(),1),hu=24,gu=60,_u=(0,K.memo)(function({currentIndex:e,labels:t}){let n=t[e]??t[0]??``;return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-full bg-zinc-900 px-4 py-1 text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:(0,q.jsx)(`div`,{className:`flex h-6 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:n})})})}),vu=(0,K.memo)(function({currentIndex:e,labels:t}){let n=(0,K.useMemo)(()=>t.map((e,t)=>{let n=e.split(` `);return{month:n[0]||``,day:n[1]||``,full:e,key:`${e}::${t}`}}),[t]),r=(0,K.useMemo)(()=>{let e=[];return n.forEach((t,n)=>{let r=e.at(-1);(!r||r.month!==t.month)&&e.push({month:t.month,key:`${t.month}-${n}`,startIndex:n})}),e},[n]),i=(0,K.useMemo)(()=>{if(e<0||e>=n.length)return 0;for(let t=r.length-1;t>=0;t--){let n=r[t];if(n&&n.startIndex<=e)return t}return 0},[e,n.length,r]),a=(0,K.useRef)(-1),o=Qe(0,{stiffness:400,damping:35}),s=Qe(0,{stiffness:400,damping:35});if(o.set(-e*hu),i>=0){let e=a.current===-1,t=a.current!==i;(e||t)&&(s.set(-i*hu),a.current=i)}return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-full bg-zinc-900 px-4 py-1 text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsxs)(`div`,{className:`flex items-center justify-center gap-1`,children:[(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsx)(G.div,{className:`flex flex-col`,style:{y:s},children:r.map(e=>(0,q.jsx)(`div`,{className:`flex h-6 shrink-0 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:e.month})},e.key))})}),(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsx)(G.div,{className:`flex flex-col`,style:{y:o},children:n.map(e=>(0,q.jsx)(`div`,{className:`flex h-6 shrink-0 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:e.day})},e.key))})})]})})})});function yu({currentIndex:e,labels:t,visible:n}){return!n||t.length===0?null:t.length>gu?(0,q.jsx)(_u,{currentIndex:e,labels:t}):(0,q.jsx)(vu,{currentIndex:e,labels:t})}yu.displayName=`DateTicker`;function bu(e){let[t,n]=(0,K.useState)(!1);(0,K.useEffect)(()=>{n(!0)},[]);let r=e.containerRef.current;return!(t&&r)||!e.visible?null:(0,q.jsx)(xu,{...e,container:r})}function xu({x:e,y:t,containerWidth:n,containerHeight:r,offset:a=16,className:o=``,children:s,left:c,top:l,flipped:u,springConfig:d,animate:f=!0,entrance:p=!0,panelStyle:m,backgroundColor:h=Q.tooltipBackground,container:g}){let{tooltipBoxSpring:_}=ks(),v=d??_,y=(0,K.useRef)(null),b=(0,K.useRef)(180),x=(0,K.useRef)(80),[S,C]=(0,K.useState)({left:e,top:t}),w=b.current,T=x.current,E=e+w+a>n,D=E?e-a-w:e+a,O=Math.max(a,Math.min(t-T/2,r-T-a)),k=Qe(D,v),A=Qe(O,v);f&&c===void 0&&k.set(D),f&&l===void 0&&A.set(O),(0,K.useLayoutEffect)(()=>{if(!y.current)return;let i=y.current,o=i.offsetWidth,s=i.offsetHeight;o>0&&(b.current=o),s>0&&(x.current=s);let u=b.current,d=x.current,p=e+u+a>n?e-a-u:e+a,m=Math.max(a,Math.min(t-d/2,r-d-a));if(!f){C({left:p,top:m});return}c===void 0&&k.set(p),l===void 0&&A.set(m)},[e,t,n,r,a,c,l,f,k,A]);let j=(0,K.useRef)(E),[M,N]=(0,K.useState)(0);(0,K.useEffect)(()=>{j.current!==E&&(N(e=>e+1),j.current=E)},[E]);let P=f?c??k:S.left,F=f?l??A:S.top,I=u??E,L=I?`right top`:`left top`,R=i(`min-w-[140px] overflow-hidden rounded-lg text-chart-tooltip-foreground shadow-lg`,m?.backgroundColor===void 0&&h===Q.tooltipBackground&&`bg-chart-tooltip-background`,m?.backdropFilter===void 0&&`backdrop-blur-md`),z={transformOrigin:L,...m?.backgroundColor===void 0&&{backgroundColor:h},...m};return p?(0,mu.createPortal)((0,q.jsx)(G.div,{animate:{opacity:1},className:i(`pointer-events-none absolute z-50`,o),exit:{opacity:0},initial:{opacity:0},ref:y,style:{left:P,top:F},transition:{duration:.1},children:(0,q.jsx)(G.div,{animate:{scale:1,opacity:1,x:0},className:R,initial:{scale:.85,opacity:0,x:I?20:-20},style:z,transition:{type:`spring`,stiffness:300,damping:25},children:s},M)}),g):(0,mu.createPortal)((0,q.jsx)(`div`,{className:i(`pointer-events-none absolute z-50`,o),ref:y,style:{left:S.left,top:S.top},children:(0,q.jsx)(`div`,{className:R,style:z,children:s})}),g)}bu.displayName=`TooltipBox`;function Su({title:e,rows:t,children:n}){return(0,q.jsx)(`div`,{className:`overflow-hidden`,children:(0,q.jsxs)(`div`,{className:`px-3 py-2.5`,children:[e&&(0,q.jsx)(`div`,{className:`mb-2 text-left font-medium text-chart-tooltip-foreground text-xs`,children:e}),(0,q.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,q.jsx)(`span`,{className:`text-chart-tooltip-muted text-sm`,children:e.label})]}),(0,q.jsx)(`span`,{className:`font-medium text-chart-tooltip-foreground text-sm tabular-nums`,children:typeof e.value==`number`?Gc(e.value):e.value})]},`${e.label}-${e.color}`))}),n&&(0,q.jsx)(`div`,{className:`mt-2 transition-opacity duration-200 ease-out`,children:n})]})})}Su.displayName=`TooltipContent`;function Cu(e,t){return e*2*Math.max(0,Math.min(.5,t))}function wu({x:e,y:t,halfExtent:n,cornerRadiusFraction:r,fill:i,stroke:a,strokeWidth:o,springConfig:s}){let{tooltipSpring:c}=ks(),l=s??c,u=Qe(e,l),d=Qe(t,l),f=n*2,p=Cu(n,r),m=ve(u,e=>e-n),h=ve(d,e=>e-n);return u.set(e),d.set(t),(0,q.jsx)(G.rect,{fill:i,height:f,rx:p,ry:p,stroke:a,strokeWidth:o,width:f,x:m,y:h})}function Tu({x:e,y:t,visible:n,color:r,size:i=5,strokeColor:a=Q.background,strokeWidth:o=2,variant:s=`dot`,cornerRadiusFraction:c=.25,springConfig:l,animate:u=!0}){let{tooltipSpring:d}=ks(),f=l??d,p=Qe(e,f),m=Qe(t,f),h=s===`ring`,g=h?`transparent`:r,_=h?r:a,v=h?o??1.5:o;if(u&&!h&&(p.set(e),m.set(t)),!n)return null;if(h){if(u)return(0,q.jsx)(wu,{cornerRadiusFraction:c,fill:g,halfExtent:i,springConfig:l,stroke:_,strokeWidth:v,x:e,y:t});let n=i*2,r=Cu(i,c);return(0,q.jsx)(`rect`,{fill:g,height:n,rx:r,ry:r,stroke:_,strokeWidth:v,width:n,x:e-i,y:t-i})}return u?(0,q.jsx)(G.circle,{cx:p,cy:m,fill:g,r:i,stroke:_,strokeWidth:v}):(0,q.jsx)(`circle`,{cx:e,cy:t,fill:g,r:i,stroke:_,strokeWidth:v})}Tu.displayName=`TooltipDot`;function Eu(e){return e===!1||e===`none`?{top:!1,bottom:!1,any:!1}:e===!0||e===`both`?{top:!0,bottom:!0,any:!0}:e===`top`?{top:!0,bottom:!1,any:!0}:{top:!1,bottom:!0,any:!0}}function Du(e,t=10){let n=Math.min(40,Math.max(2,t)),r=100-n;return e.any?e.top&&e.bottom?[{offset:`0%`,opacity:0},{offset:`${n}%`,opacity:1},{offset:`50%`,opacity:1},{offset:`${r}%`,opacity:1},{offset:`100%`,opacity:0}]:e.top?[{offset:`0%`,opacity:0},{offset:`${n}%`,opacity:1},{offset:`100%`,opacity:1}]:[{offset:`0%`,opacity:1},{offset:`${r}%`,opacity:1},{offset:`100%`,opacity:0}]:[{offset:`0%`,opacity:1}]}function Ou(e){if(typeof e==`number`)return e;switch(e){case`line`:return 1;case`thin`:return 2;case`medium`:return 4;case`thick`:return 8;default:return 1}}function ku(e){return e.visible?(0,q.jsx)(Au,{...e}):null}function Au({x:e,visible:t,height:n,width:r=`line`,span:i,columnWidth:a,colorEdge:o=Q.crosshair,colorMid:s=Q.crosshair,fadeEdges:c=`both`,fadeLength:l=10,animate:u=!0,gradientId:d=`tooltip-indicator-gradient`,springConfig:f,strokeDasharray:p}){let{tooltipSpring:m}=ks(),h=f??m,g=i!==void 0&&a!==void 0?i*a:Ou(r),_=e-g/2,v=e,y=Qe(_,h),b=Qe(v,h);u&&(y.set(_),b.set(v)),(0,K.useEffect)(()=>{y.set(_),b.set(v)},[b,y,v,_,t]);let x=s||o,S=Eu(c);if(p){let e=Math.max(1,g);return u?(0,q.jsx)(G.line,{stroke:x,strokeDasharray:p,strokeWidth:e,x1:b,x2:b,y1:0,y2:n}):(0,q.jsx)(`line`,{stroke:x,strokeDasharray:p,strokeWidth:e,x1:v,x2:v,y1:0,y2:n})}if(!S.any)return u?(0,q.jsx)(G.rect,{fill:x,height:n,width:g,x:y,y:0}):(0,q.jsx)(`rect`,{fill:x,height:n,width:g,x:_,y:0});let C=Du(S,l);return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`linearGradient`,{id:d,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:C.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:x,stopOpacity:e.opacity}},e.offset))})}),u?(0,q.jsx)(G.rect,{fill:`url(#${d})`,height:n,width:g,x:y,y:0}):(0,q.jsx)(`rect`,{fill:`url(#${d})`,height:n,width:g,x:_,y:0})]})}ku.displayName=`TooltipIndicator`;var ju=(0,K.memo)(function({showDatePill:e=!0,showCrosshair:t=!0,showDots:n=!0,dotVariant:r=`dot`,dotSize:i=5,dotRadiusFraction:a,dotScale:o=1,dotStrokeWidth:s,indicatorColor:c,content:l,rows:u,dotColor:d,children:f,className:p=``,container:m,springConfig:h,matchCrosshair:g=!1,damping:_,indicatorDasharray:v,indicatorFadeEdges:y,indicatorFadeLength:b,boxSpringConfig:x,panelStyle:S,backgroundColor:C}){let{tooltipData:w,width:T,height:E,innerHeight:D,margin:O,columnWidth:k,lines:A,xAccessor:j,dateLabels:M,containerRef:N,orientation:P,barXAccessor:F,bandWidth:I,squareSnap:L}=Xo(),{tooltipSpring:R}=ks(),z=P===`horizontal`,B=M.length>60,ee=(0,K.useMemo)(()=>{if(r!==`ring`||!I||A.length===0)return i*o;let e=A.length,t=L?.groupGap??(e>1?4:0);return(I-t*(e-1))/e/2*o},[I,o,i,r,A.length,L?.groupGap]),V=(0,K.useMemo)(()=>x?{animate:!B,springConfig:x}:g?{animate:!B,springConfig:h??R}:js(_),[x,_,B,g,h,R]),H=w!==null,U=w?.x??0,te=U+O.left,ne=A[0]?.dataKey,re=(ne?w?.yPositions[ne]??0:0)+O.top,ie=(0,K.useMemo)(()=>w?u?u(w.point):A.map(e=>({color:e.stroke,label:e.dataKey,value:w.point[e.dataKey]??0})):[],[w,A,u]),ae=(0,K.useMemo)(()=>(e,t)=>{if(u&&ie[t]?.color)return ie[t].color;if(d!=null){if(typeof d==`function`&&w)return d(w.point,e);if(typeof d==`string`)return d}return e.stroke},[d,u,w,ie]),oe=(0,K.useMemo)(()=>c==null?Q.crosshair:typeof c==`function`?w?c(w.point):Q.crosshair:c,[c,w]),se=(0,K.useMemo)(()=>{if(w)return F?F(w.point):Uc.format(j(w.point))},[w,F,j]),W=(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,height:`100%`,width:`100%`,children:(0,q.jsx)(`g`,{transform:`translate(${O.left},${O.top})`,children:(0,q.jsx)(ku,{animate:!B,colorEdge:oe,colorMid:oe,columnWidth:k,fadeEdges:v?`none`:y??`both`,fadeLength:b,height:D,springConfig:h,strokeDasharray:v,visible:H,width:`line`,x:U})})}),n&&H&&!z&&(0,q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,height:`100%`,width:`100%`,children:(0,q.jsx)(`g`,{transform:`translate(${O.left},${O.top})`,children:A.map((e,t)=>(0,q.jsx)(Tu,{color:ae(e,t),cornerRadiusFraction:r===`ring`?a:void 0,size:ee,springConfig:h,strokeColor:Q.background,strokeWidth:r===`ring`?s:void 0,variant:r,visible:H,x:w?.xPositions?.[e.dataKey]??U,y:w?.yPositions[e.dataKey]??0},e.dataKey))})}),(0,q.jsx)(bu,{animate:V.animate,backgroundColor:C,className:p,containerHeight:E,containerRef:N,containerWidth:T,panelStyle:S,springConfig:V.springConfig,top:z?void 0:O.top,visible:H,x:te,y:z?re:O.top,children:l&&w?l({point:w.point,index:w.index}):!l&&(0,q.jsx)(Su,{rows:ie,title:se,children:f})}),(0,q.jsx)(Nu,{currentIndex:w?.index??0,discreteInteraction:B,enabled:e&&!z,labels:M,springConfig:h,visible:H,xWithMargin:te})]});return(0,mu.createPortal)(W,m)});function Mu(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(ju,{...e,container:i}):null}Mu.displayName=`ChartTooltip`;function Nu(e){return e.enabled&&e.visible&&e.labels.length>0?(0,q.jsx)(Pu,{...e}):null}function Pu({labels:e,currentIndex:t,xWithMargin:n,discreteInteraction:r,springConfig:i,visible:a}){let{tooltipSpring:o}=ks(),s=Qe(n,i??o);return r||s.set(n),(0,K.useEffect)(()=>{s.set(n)},[s,a]),(0,q.jsx)(G.div,{className:`pointer-events-none absolute z-50`,style:{left:r?n:s,transform:`translateX(-50%)`,bottom:4},children:(0,q.jsx)(yu,{currentIndex:t,labels:e,visible:a})})}var Fu=500;function Iu({label:e,x:t,crosshairX:n,hoveredLabel:r,isHovering:a,tickerHalfWidth:o,animatePosition:s}){let c=o+20,l=1;if(a&&n!==null){let i=Math.abs(t-n);i<o||r&&e===r?l=0:i<c&&(l=(i-o)/20)}return(0,q.jsx)(`div`,{className:`absolute`,style:{left:t,bottom:12,width:0,display:`flex`,justifyContent:`center`,transition:s?`left ${Fu}ms cubic-bezier(${$o.join(`, `)})`:void 0},children:(0,q.jsx)(`span`,{className:i(`whitespace-nowrap text-chart-label text-xs`),style:{opacity:l,transition:`opacity 0.4s ease-in-out`},children:e})})}var Lu=400;function Ru(e,t){if(t<0||t>e)return 0;let n=1;for(let r=0;r<t;r++)n=n*(e-r)/(r+1);return n}function zu(e,t){if(t===1)return e>=1?[[e]]:[];let n=[];for(let r=1;r<=e-(t-1);r++)for(let i of zu(e-r,t-1))n.push([r,...i]);return n}function Bu(e){let t=[0],n=0;for(let r of e)n+=r,t.push(n);return t}function Vu(e,t){let n=e-1;if(n<=0)return[0];let r=Array.from({length:t},(e,r)=>Math.round(r/(t-1)*n)),i=[...new Set(r)].sort((e,t)=>e-t);return i[0]!==0&&i.unshift(0),i.at(-1)!==n&&i.push(n),[...new Set(i)].sort((e,t)=>e-t)}function Hu(e,t){let n=e-1;if(n<=0)return[[0]];let r=t-1;return r<=0?[[0]]:Ru(n-1,r-1)>Lu?[Vu(e,t)]:zu(n,r).map(Bu)}function Uu(e,t,n,r){let i=new Set,a=[];for(let o of e){let e=t[o];if(!e)continue;let s=n[o]??Hc.format(r(e));i.has(s)||(i.add(s),a.push(o))}return a}function Wu(e){let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];r!=null&&i!=null&&t.push(r-i)}return t}function Gu(e){let t=Wu(e),n=Math.min(...t),r=t.indexOf(n);return r===t.length-1?0:r===0?1:2}function Ku(e,t,n){if(e.length<2)return{score:1/0,symmetryPenalty:1/0,countDistance:1/0,edgePreference:1/0};let r=[];for(let n=1;n<e.length;n++){let i=e[n],a=e[n-1];i!=null&&a!=null&&r.push(t(i)-t(a))}let i=Math.min(...r),a=Math.max(...r),o=r.reduce((e,t)=>e+t,0)/r.length,s=o>0?(a-i)/o:a-i,c=Math.abs(e.length-n),l=Wu(e),u=Math.min(...l),d=l.indexOf(u),f=d>0&&d<l.length-1?.08:0,p=l.reduce((e,t,n)=>e+Math.abs(t-(l.at(-1-n)??t)),0)/l.length;return{score:s+.1*c+f+p*.02,symmetryPenalty:p,countDistance:c,edgePreference:Gu(e)}}function qu(e,t,n,r){return e.score<t.score-1e-6?!0:Math.abs(e.score-t.score)>1e-6?!1:n<r?!0:n>r?!1:e.symmetryPenalty<t.symmetryPenalty-1e-6?!0:e.symmetryPenalty>t.symmetryPenalty+1e-6?!1:e.edgePreference<t.edgePreference}function Ju(e,t,n){if(e<=0)return[];if(e===1)return[0];if(e<=t)return Array.from({length:e},(e,t)=>t);let r=n?.resolveXPx??(e=>e),i=Math.max(2,t-1),a=Math.min(e,t+1),o=Vu(e,t),s=Ku(o,r,t),c=s.countDistance;for(let l=i;l<=a;l++)for(let i of Hu(e,l)){let e=n?.data&&n.dateLabels&&n.xAccessor?Uu(i,n.data,n.dateLabels,n.xAccessor):i;if(e.length<2)continue;let a=Ku(e,r,t),l=Math.abs(e.length-t);qu(a,s,l,c)&&(o=e,s=a,c=l)}return o}function Yu({data:e,dateLabels:t,marginLeft:n,targetTickCount:r,xAccessor:i,xScale:a}){let o=new Set,s=[],c=t=>{let n=e[t];return n?a(i(n))??0:t};for(let l of Ju(e.length,r,{data:e,dateLabels:t,resolveXPx:c,xAccessor:i})){let r=e[l];if(!r)continue;let c=i(r),u=t[l]??Hc.format(c);o.has(u)||(o.add(u),s.push({date:c,label:u,x:(a(c)??0)+n}))}return s}function Xu({marginLeft:e,numTicks:t,xScale:n}){let r=n.domain(),i=r[0],a=r[1];if(!(i&&a))return[];let o=i.getTime(),s=a.getTime()-o,c=Math.max(2,t),l=new Set,u=[];for(let t=0;t<c;t++){let r=t/(c-1),i=new Date(o+r*s),a=Hc.format(i);l.has(a)||(l.add(a),u.push({date:i,label:a,x:(n(i)??0)+e}))}return u}function Zu(e,t,n){if(e.length===0)return!1;let r=n.domain()[1],i=e.at(-1);return r&&i?r.getTime()>t(i).getTime():!1}function Qu(e,t,n,r,i,a){if(t.length===0||a<=0)return e;let o=t.at(-1),s=r.domain()[1];if(!(o&&s))return e;let c=n(o).getTime(),l=s.getTime();if(l<=c)return e;let u=new Set(e.map(e=>e.label)),d=[],f=Math.min(a,3);for(let e=1;e<=f;e++){let t=new Date(c+e/(f+1)*(l-c)),n=Hc.format(t);u.has(n)||(u.add(n),d.push({date:t,label:n,x:(r(t)??0)+i}))}let p=Hc.format(s);return u.has(p)||d.push({date:s,label:p,x:(r(s)??0)+i}),d.length===0?e:[...e,...d].sort((e,t)=>e.x-t.x)}function $u(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(ed,{...e,container:i}):null}var ed=(0,K.memo)(function({numTicks:e=5,tickerHalfWidth:t=50,tickMode:n=`data`,container:r}){let{xScale:i,margin:a,tooltipData:o,data:s,xAccessor:c,dateLabels:l,xDomain:u}=Xo(),d=(0,K.useMemo)(()=>{let t=n===`data`&&Zu(s,c,i);if(n===`domain`||t&&u==null)return Xu({marginLeft:a.left,numTicks:e,xScale:i});let r=Yu({data:s,dateLabels:l,marginLeft:a.left,targetTickCount:e,xAccessor:c,xScale:i});return t&&u!=null?Qu(r,s,c,i,a.left,Math.max(1,e-r.length+1)):r},[n,u,s,l,c,i,a.left,e]),f=o!==null,p=o?o.x+a.left:null,m=f&&o?l[o.index]??Hc.format(c(o.point)):null;return(0,mu.createPortal)((0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,children:d.map(e=>(0,q.jsx)(Iu,{animatePosition:u==null,crosshairX:p,hoveredLabel:m,isHovering:f,label:e.label,tickerHalfWidth:t,x:e.x},`${e.date.getTime()}-${e.x}`))}),r)});$u.displayName=`XAxis`;function td(e,t,n){let r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=e??r,o=t??i;return[Math.min(a,o),Math.max(a,o)]}function nd(e){if(e==null||!Number.isFinite(e))return 5;let t=Math.round(e);return t<1?1:t>10?10:t}var rd=500;function id(e,t,n){return n?n(e):t&&e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function ad(e,t,n,r){for(let i of r){if(!i.axisLabelColor||zo(i.yAxisId)!==t)continue;let[r,a]=td(i.y1,i.y2,n.domain()),o=n(a)??0,s=n(r)??0;if(e>=Math.min(o,s)&&e<=Math.max(o,s))return i.axisLabelColor}}function od(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(sd,{...e,container:i}):null}var sd=(0,K.memo)(function({yAxisId:e,orientation:t=`left`,numTicks:n=5,formatLargeNumbers:r=!0,formatValue:i,container:a}){let{margin:o,referenceAreas:s}=qo(),c=Jo(e),l=t===`left`,u=zo(e),d=(0,K.useMemo)(()=>c.ticks(nd(n)).map(e=>{let t=(c(e)??0)+o.top;return{value:e,y:t,label:id(e,r,i),labelColor:ad(t-o.top,u,c,s)}}),[c,o.top,n,r,i,u,s]);return(0,mu.createPortal)((0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,children:(0,q.jsx)(`div`,{className:`absolute top-0 bottom-0`,style:l?{left:0,width:o.left}:{right:0,width:o.right},children:d.map(e=>(0,q.jsx)(`div`,{className:`absolute flex items-center`,style:{top:e.y,transform:`translateY(-50%)`,transition:`top ${rd}ms cubic-bezier(${$o.join(`, `)})`,...l?{right:0,justifyContent:`flex-end`,paddingRight:8}:{left:0,justifyContent:`flex-start`,paddingLeft:8}},children:(0,q.jsx)(`span`,{className:`text-chart-label text-xs`,style:e.labelColor?{color:e.labelColor}:void 0,children:e.label})},e.value))})}),a)});od.displayName=`YAxis`;var $={requests:{key:`requests`,label:`Requests`,color:`var(--chart-1)`},errors:{key:`errors`,label:`Errors`,color:`var(--destructive)`},p95:{key:`p95`,label:`P95`,color:`var(--chart-2)`}};function cd({data:e}){let t=e.map(e=>({date:e.date,requests:e.requests,errors:e.errors,p95:e.p95}));return(0,q.jsxs)(ru,{aspectRatio:`16 / 7`,barGap:0,className:`min-h-[240px]`,data:t,margin:{top:12,right:44,bottom:28,left:36},maxBarSize:16,xDataKey:`date`,children:[(0,q.jsx)(pu,{horizontal:!0,numTicksRows:4}),(0,q.jsx)(kc,{dataKey:$.requests.key,fill:$.requests.color,radius:2}),(0,q.jsx)(wc,{dataKey:$.errors.key,showMarkers:!1,stroke:$.errors.color,strokeWidth:2}),(0,q.jsx)(Zs,{dataKey:$.p95.key,fadeEdges:!0,fill:$.p95.color,fillOpacity:.28,showMarkers:!1,strokeWidth:2,yAxisId:`right`}),(0,q.jsx)(od,{formatLargeNumbers:!1,numTicks:4}),(0,q.jsx)(od,{formatValue:e=>Fe(e),numTicks:4,orientation:`right`,yAxisId:`right`}),(0,q.jsx)($u,{numTicks:6}),(0,q.jsx)(Mu,{rows:ld,showCrosshair:!0})]})}function ld(e){let t=ud(e.requests),n=ud(e.errors),r=ud(e.p95);return[{color:$.requests.color,label:$.requests.label,value:t},{color:$.errors.color,label:$.errors.label,value:n},{color:$.p95.color,label:$.p95.label,value:Fe(r)}]}function ud(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function dd({series:e,stats:t}){if(e.kind===`empty`||t.kind===`empty`)return(0,q.jsx)(Ne,{icon:o,title:`No runs in this window`,description:`The Console buffer has no traces for the selected lookback. Numbers stay empty — they are not zero.`});let n=rn(e.buckets),r=Math.round(t.errorRate*100);return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-slot":`observability-metrics`,children:[(0,q.jsxs)(`header`,{className:y,children:[(0,q.jsx)(`h2`,{className:i(N,`flex items-center px-2`),children:`Metrics`}),(0,q.jsxs)(`span`,{className:`ml-auto px-2 font-mono text-[10px] text-muted-foreground`,children:[e.buckets.length,` buckets`]})]}),(0,q.jsxs)(`div`,{className:`grid shrink-0 grid-cols-4 border-b border-border/60`,"data-slot":`observability-kpis`,children:[(0,q.jsx)(fd,{label:`Runs`,value:String(t.total)}),(0,q.jsx)(fd,{label:`Errors`,meta:`${r}%`,tone:t.errors>0?`warn`:`ok`,value:String(t.errors)}),(0,q.jsx)(fd,{label:`P95`,toneClassName:ge(he(t.p95Ms)),value:Fe(t.p95Ms)}),(0,q.jsx)(fd,{label:`P50`,toneClassName:ge(he(t.p50Ms)),value:Fe(t.p50Ms)})]}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 px-3 pt-3`,"data-slot":`observability-legend`,children:[(0,q.jsx)(pd,{color:$.requests.color,label:$.requests.label,shape:`bar`}),(0,q.jsx)(pd,{color:$.errors.color,label:$.errors.label,shape:`line`}),(0,q.jsx)(pd,{color:$.p95.color,label:`${$.p95.label} · right`,shape:`area`})]}),(0,q.jsx)(`div`,{className:`px-1 pb-2`,"data-slot":`observability-chart`,children:(0,q.jsx)(cd,{data:n})})]})]})}function fd({label:e,value:t,meta:n,tone:r,toneClassName:a}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-r border-border/60 px-3 py-2.5 last:border-r-0`,children:[(0,q.jsx)(`span`,{className:i(N,`text-muted-foreground`),children:e}),(0,q.jsxs)(`span`,{className:i(`font-mono text-lg leading-none font-semibold tabular-nums tracking-tight`,r===`warn`&&`text-destructive`,r===`ok`&&`text-foreground`,a),children:[t,n?(0,q.jsx)(`span`,{className:`ml-1.5 text-[10px] font-medium text-muted-foreground`,children:n}):null]})]})}function pd({color:e,label:t,shape:n}){return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(`shrink-0`,n===`bar`&&`h-2 w-2 rounded-[2px]`,n===`line`&&`h-0.5 w-3 rounded-full`,n===`area`&&`h-2 w-2.5 rounded-sm opacity-70`),style:{backgroundColor:e}}),t]})}function md(e){if(!e.error)return null;let t=e.error.data,n=t&&typeof t==`object`&&`reason`in t&&typeof t.reason==`string`?t.reason:null,r=Error(n??e.error.message??e.error.code);return r.code=e.error.code,r.data=e.error.data,r}function hd(){return I({mutationFn:async e=>{let t=await c(e),n=md(t);if(n)throw n;if(!t.data)throw Error(`Empty runs query`);return t.data}})}var gd=`SELECT flow, count(*) AS runs, round(avg(duration_ms), 1) AS avg_ms
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{$n as n,Ca as r,Cr as i,Ea as a,Er as o,Ga as s,Ia as c,Ma as l,Mr as u,No as d,Qn as f,_r as p,br as m,cr as h,dr as g,er as _,gr as v,hr as y,i as b,kr as x,l as S,mr as C,nr as w,o as T,s as E,sr as D,tr as O,u as k,ur as A,vr as j,wr as M,xr as N,yr as P,zi as F}from"./shortcut-keys-DKxNTe_m.js";import{t as I}from"./useMutation-B8EO02Ej.js";import{n as L,r as R}from"./react-dom-Bph1y7z7.js";import{A as z,C as B,D as ee,E as V,S as H,T as U,_ as te,b as ne,g as re,h as ie,v as ae,w as oe,x as se,y as W}from"./xyflow-D7n4g6go.js";import{t as ce}from"./link-BX6Vqztd.js";import{g as le,i as ue,k as de,n as fe,t as G,x as pe}from"./react-D8E3mtu1.js";import{i as me,n as he,r as ge}from"./duration-tone-sC3lGABz.js";import{c as _e,s as ve,t as ye}from"./trace-detail-sheet-B09O8rA6.js";import{a as be,c as xe,i as Se,l as Ce,o as we,s as Te}from"./index-_rgpdVzo.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me}from"./element-icons-BVXtRyd3.js";import{t as Ne}from"./explorer-empty-2uIhBu0_.js";import{a as Pe,i as Fe,s as Ie}from"./highlighted-json-Awq7gYdu.js";import{C as Le}from"./request-meta-DV0ywz7t.js";import{n as Re,r as ze,t as Be}from"./collapsible-DGnOM2ph.js";import{H as Ve,M as He,n as Ue,t as We}from"./replica-lag-DKRrbvdo.js";import{n as Ge,r as Ke}from"./use-vault-list-uk4WVboC.js";import{t as qe}from"./call-pii-button-ChAUiLo9.js";function Je(e,t,n={}){let r=e.get(),i=null,a=r,o,s=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,c=()=>{i&&=(i.stop(),null),e.animation=void 0},l=()=>{let t=Xe(e.get()),r=Xe(a);if(t===r){c();return}let s=i?i.getGeneratorVelocity():e.getVelocity();c(),i=new pe({keyframes:[t,r],velocity:s,type:`spring`,restDelta:.001,restSpeed:.01,...n,onUpdate:o})},u=()=>{l(),e.animation=i??void 0,e.events.animationStart?.notify(),i?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((e,t)=>{a=e,o=e=>t(Ye(e,s)),de.postRender(u)},c),le(t)){let r=n.skipInitialAnimation===!0,i=t.on(`change`,t=>{r?(r=!1,e.jump(Ye(t,s),!1)):e.set(Ye(t,s))}),a=e.on(`destroy`,i);return()=>{i(),a()}}return c}function Ye(e,t){return t?e+t:e}function Xe(e){return typeof e==`number`?e:parseFloat(e)}var K=e(R(),1);function Ze(e,t={}){let{isStatic:n}=(0,K.useContext)(ue),r=()=>le(e)?e.get():e;if(n)return ve(r);let i=_e(r());return(0,K.useInsertionEffect)(()=>Je(i,e,t),[i,JSON.stringify(t)]),i}function Qe(e,t={}){return Ze(e,{type:`spring`,...t})}var $e=Math.PI/180,et=180/Math.PI,tt=18,nt=.96422,rt=1,it=.82521,at=4/29,ot=6/29,st=3*ot*ot,ct=ot*ot*ot;function lt(e){if(e instanceof dt)return new dt(e.l,e.a,e.b,e.opacity);if(e instanceof vt)return yt(e);e instanceof se||(e=U(e));var t=ht(e.r),n=ht(e.g),r=ht(e.b),i=ft((.2225045*t+.7168786*n+.0606169*r)/rt),a,o;return t===n&&n===r?a=o=i:(a=ft((.4360747*t+.3850649*n+.1430804*r)/nt),o=ft((.0139322*t+.0971045*n+.7141733*r)/it)),new dt(116*i-16,500*(a-i),200*(i-o),e.opacity)}function ut(e,t,n,r){return arguments.length===1?lt(e):new dt(e,t,n,r??1)}function dt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}V(dt,ut,ee(ne,{brighter(e){return new dt(this.l+tt*(e??1),this.a,this.b,this.opacity)},darker(e){return new dt(this.l-tt*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=nt*pt(t),e=rt*pt(e),n=it*pt(n),new se(mt(3.1338561*t-1.6168667*e-.4906146*n),mt(-.9787684*t+1.9161415*e+.033454*n),mt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function ft(e){return e>ct?e**(1/3):e/st+at}function pt(e){return e>ot?e*e*e:st*(e-at)}function mt(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function ht(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function gt(e){if(e instanceof vt)return new vt(e.h,e.c,e.l,e.opacity);if(e instanceof dt||(e=lt(e)),e.a===0&&e.b===0)return new vt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*et;return new vt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _t(e,t,n,r){return arguments.length===1?gt(e):new vt(e,t,n,r??1)}function vt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function yt(e){if(isNaN(e.h))return new dt(e.l,0,0,e.opacity);var t=e.h*$e;return new dt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}V(vt,_t,ee(ne,{brighter(e){return new vt(this.h,this.c,this.l+tt*(e??1),this.opacity)},darker(e){return new vt(this.h,this.c,this.l-tt*(e??1),this.opacity)},rgb(){return yt(this).rgb()}}));var bt=-.14861,xt=1.78277,St=-.29227,Ct=-.90649,wt=1.97294,Tt=wt*Ct,Et=wt*xt,Dt=xt*St-Ct*bt;function Ot(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);e instanceof se||(e=U(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Dt*r+Tt*t-Et*n)/(Dt+Tt-Et),a=r-i,o=(wt*(n-i)-St*a)/Ct,s=Math.sqrt(o*o+a*a)/(wt*i*(1-i)),c=s?Math.atan2(o,a)*et-120:NaN;return new At(c<0?c+360:c,s,i,e.opacity)}function kt(e,t,n,r){return arguments.length===1?Ot(e):new At(e,t,n,r??1)}function At(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}V(At,kt,ee(ne,{brighter(e){return e=e==null?H:H**+e,new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?B:B**+e,new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*$e,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new se(255*(t+n*(bt*r+xt*i)),255*(t+n*(St*r+Ct*i)),255*(t+wt*r*n),this.opacity)}}));function jt(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Mt(e){return function(t,n){var r=e((t=oe(t)).h,(n=oe(n)).h),i=W(t.s,n.s),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Nt=Mt(ae),Pt=Mt(W);function Ft(e,t){var n=W((e=ut(e)).l,(t=ut(t)).l),r=W(e.a,t.a),i=W(e.b,t.b),a=W(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function It(e){return function(t,n){var r=e((t=_t(t)).h,(n=_t(n)).h),i=W(t.c,n.c),a=W(t.l,n.l),o=W(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Lt=It(ae),Rt=It(W);function zt(e){return(function t(n){n=+n;function r(t,r){var i=e((t=kt(t)).h,(r=kt(r)).h),a=W(t.s,r.s),o=W(t.l,r.l),s=W(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var Bt=zt(ae),Vt=zt(W),Ht=[`console.ai.list`];function Ut(){return d({queryKey:Ht,queryFn:async()=>{let e=await r();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty AI list`);return e.data}})}var Wt=[`console.clock.list`];function Gt(){return d({queryKey:Wt,queryFn:async()=>{let e=await a();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty clock list`);return e.data},refetchInterval:15e3})}var Kt=[`console.instances.list`];function qt(){return d({queryKey:Kt,queryFn:async()=>{let e=await l();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty instances list`);return e.data},refetchInterval:15e3})}var Jt=[`console.signals.list`];function Yt(){return d({queryKey:Jt,queryFn:async()=>{let e=await s();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty signals list`);return e.data},refetchInterval:1e4})}function Xt(e,t,n){let r=xe(e,t,n),i=0,a=0;for(let e of r)e.inputTokens!==null&&e.inputTokens>0&&(i+=e.inputTokens),e.outputTokens!==null&&e.outputTokens>0&&(a+=e.outputTokens);return i===0&&a===0?{kind:`empty`}:{kind:`summary`,inputTokens:i,outputTokens:a,windowMs:n}}function Zt(e){return!Number.isFinite(e)||e<=0?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Qt(e){let t=[];return e.inputTokens>0&&t.push(`${Zt(e.inputTokens)} in`),e.outputTokens>0&&t.push(`${Zt(e.outputTokens)} out`),t.length===0?null:t.join(` · `)}var q=z();function $t({ai:e,asks:t,tokens:n}){let r=(e?.versions??[]).filter(e=>e.sampleCount>0),i=r.length===0?null:r.reduce((e,t)=>e+t.cost.mean,0)/r.length,a=n.kind===`summary`?Qt(n):null;return(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border/60 px-3 py-1.5`,"data-slot":`observability-ai-rail`,"aria-label":`AI usage`,children:[(0,q.jsx)(`span`,{className:`text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`AI`}),i==null?(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-slot":`observability-ai-empty`,children:`No cost samples in the Console AI journal.`}):(0,q.jsxs)(`p`,{className:`text-[11px] text-foreground/85`,"data-slot":`observability-ai-cost`,children:[(0,q.jsxs)(`span`,{className:`tabular-nums`,children:[`mean `,en(i)]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,q.jsxs)(`span`,{className:`tabular-nums`,children:[r.length,` version`]})]}),a?(0,q.jsx)(`p`,{className:`font-mono text-[10px] text-muted-foreground`,"data-slot":`observability-ai-tokens`,children:a}):null,t.kind===`summary`?(0,q.jsxs)(`span`,{className:`ml-auto font-mono text-[10px] text-muted-foreground`,"data-slot":`observability-ai-asks`,children:[t.asks,` ask`,t.asks===1?``:`s`,` in window`]}):(0,q.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:`No ask effects in window`})]})}function en(e){return Number.isFinite(e)?e===0?`0`:e<.01?e.toExponential(2):e.toFixed(4):`—`}function tn({fleet:e,open:t,onClose:n}){let r=e?.kind===`fleet`?e.instances:[],i=e?.kind===`fleet`?e.now:Date.now();return(0,q.jsx)(b,{open:t,onOpenChange:e=>!e&&n(),children:(0,q.jsxs)(T,{side:`right`,className:`flex w-full flex-col sm:max-w-md`,"data-slot":`instance-fleet-sheet`,children:[(0,q.jsxs)(S,{children:[(0,q.jsx)(k,{children:`Instances`}),(0,q.jsx)(E,{children:e?.kind===`fleet`?`${e.alive} alive — Clock and Journal leases this process holds`:`No shared fleet registry on this Console`})]}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:r.length===0?(0,q.jsx)(`p`,{className:D,children:e?.kind===`fleet`?`Every presence lease has expired.`:`The registry is unbound (test / no shared store).`}):(0,q.jsx)(`ul`,{className:`divide-y divide-border/60`,children:r.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(nn,{row:e,now:i})},e.id))})})]})})}function nn({row:e,now:t}){let n=Math.max(0,t-e.heartbeatAt),r=e.clock.map(e=>e.name).join(`, `),a=e.journal.map(e=>e.flow).join(`, `);return(0,q.jsxs)(`div`,{className:g,"data-slot":`instance-fleet-row`,"data-instance-id":e.id,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(`size-1.5 shrink-0 rounded-full`,n<3e4?`bg-emerald-500`:`bg-muted-foreground/50`)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`truncate font-medium text-foreground`,children:e.id}),(0,q.jsxs)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:[`heartbeat `,Fe(n),` ago`,e.pid===void 0?``:` · pid ${e.pid}`]}),(0,q.jsx)(`p`,{className:`${N} mt-1.5`,children:`Clock`}),(0,q.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:r.length>0?r:`holding nothing`}),(0,q.jsx)(`p`,{className:`${N} mt-1.5`,children:`Journal`}),(0,q.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:a.length>0?a:`holding nothing`})]})]})}function rn(e){return e.map(e=>({date:new Date(e.startAt),requests:e.n,errors:e.errors,p95:e.p95Ms}))}function an(e){return e<=36e5?6e4:e<=864e5?3e5:36e5}function on(e,t){return Math.floor(e/t)*t}function sn(e,t,n){let r=xe(e,t,n);if(r.length===0)return{kind:`empty`};let i=an(n),a=on(t-Math.max(0,n),i),o=on(t,i),s=new Map,c=new Map;for(let e=a;e<=o;e+=i)s.set(e,[]),c.set(e,{n:0,errors:0});for(let e of r){let t=on(e.startedAt,i),n=s.get(t),r=c.get(t);!n||!r||(n.push(e.durationMs),r.n+=1,Te(e)&&(r.errors+=1))}let l=[];for(let e=a;e<=o;e+=i){let t=s.get(e)??[],n=c.get(e)??{n:0,errors:0},r=[...t].sort((e,t)=>e-t);l.push({startAt:e,n:n.n,errors:n.errors,errorRate:n.n===0?0:n.errors/n.n,p95Ms:n.n===0?0:we(r,.95),requestPerSec:n.n/(i/1e3)})}return{kind:`series`,buckets:l,bucketMs:i,windowMs:n}}function J(e){return function(){return e}}var cn=Math.PI,ln=2*cn,un=1e-6,dn=ln-un;function fn(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function pn(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return fn;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var mn=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?fn:pn(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>un)if(!(Math.abs(u*s-c*l)>un)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((cn-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>un&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>un||Math.abs(this._y1-l)>un)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ln+ln),d>dn?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>un&&this._append`A${n},${n},0,${+(d>=cn)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};mn.prototype;function hn(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new mn(t)}Array.prototype.slice;function gn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _n(e){this._context=e}_n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function vn(e){return new _n(e)}function yn(e){return e[0]}function bn(e){return e[1]}function xn(e,t){var n=J(!0),r=null,i=vn,a=null,o=hn(s);e=typeof e==`function`?e:e===void 0?yn:J(e),t=typeof t==`function`?t:t===void 0?bn:J(t);function s(s){var c,l=(s=gn(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:J(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Sn(e,t,n){var r=null,i=J(!0),a=null,o=vn,s=null,c=hn(l);e=typeof e==`function`?e:e===void 0?yn:J(+e),t=typeof t==`function`?t:J(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?bn:J(+n);function l(l){var u,d,f,p=(l=gn(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return xn().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:J(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:J(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:J(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:J(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:J(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}function Cn(e){return e<0?-1:1}function wn(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Cn(a)+Cn(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Tn(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function En(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Dn(e){this._context=e}Dn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:En(this,this._t0,Tn(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,En(this,Tn(this,n=wn(this,e,t)),n);break;default:En(this,this._t0,n=wn(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},Object.create(Dn.prototype).point=function(e,t){Dn.prototype.point.call(this,t,e)};function On(e){return new Dn(e)}function kn(e){this._context=e}kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=An(e),i=An(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function An(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function jn(e){return new kn(e)}var Mn=t(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));function Nn(e,t){e(t)}function Pn(){let{x:e,x0:t,x1:n,y:r,y0:i,y1:a,defined:o,curve:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=Sn();return e&&Nn(c.x,e),t&&Nn(c.x0,t),n&&Nn(c.x1,n),r&&Nn(c.y,r),i&&Nn(c.y0,i),a&&Nn(c.y1,a),o&&c.defined(o),s&&c.curve(s),c}function Fn(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=xn();return e&&Nn(i.x,e),t&&Nn(i.y,t),n&&i.defined(n),r&&i.curve(r),i}var In=e(Mn());function Ln(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,q.jsx)(`g`,{ref:o,className:(0,In.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function Rn(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,q.jsx)(`line`,{ref:a,className:(0,In.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function zn(e){let{children:t,data:n=[],x:r,y:i,fill:a=`transparent`,className:o,curve:s,innerRef:c,defined:l=()=>!0,...u}=e,d=Fn({x:r,y:i,defined:l,curve:s});return t?(0,q.jsx)(q.Fragment,{children:t({path:d})}):(0,q.jsx)(`path`,{ref:c,className:(0,In.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}function Bn(e){let{x:t,x0:n,x1:r,y:i,y1:a,y0:o,yScale:s,data:c=[],defined:l=()=>!0,className:u,curve:d,innerRef:f,children:p,...m}=e,h=Pn({x:t,x0:n,x1:r,defined:l,curve:d});return o==null?h.y0(s.range()[0]):Nn(h.y0,o),i&&!a&&Nn(h.y1,i),a&&!i&&Nn(h.y1,a),p?(0,q.jsx)(q.Fragment,{children:p({path:h})}):(0,q.jsx)(`path`,{ref:f,className:(0,In.default)(`visx-area-closed`,u),d:h(c)||``,...m})}function Vn(e){return e===!1?{left:!1,right:!1,any:!1}:e===`left`?{left:!0,right:!1,any:!0}:e===`right`?{left:!1,right:!0,any:!0}:{left:!0,right:!0,any:!0}}function Hn(e){return[{offset:`0%`,opacity:+!e.left},{offset:`15%`,opacity:1},{offset:`85%`,opacity:1},{offset:`100%`,opacity:+!e.right}]}function Un(e){return{gradientUnits:`userSpaceOnUse`,x1:0,x2:e,y1:0,y2:0}}function Wn({gradientId:e,strokeGradientId:t,edgeMaskId:n,edgeGradientId:r,fill:i,fillOpacity:a,gradientToOpacity:o,gradientSpan:s=1,resolvedStroke:c,isPatternFill:l,fadeEdges:u,innerWidth:d,innerHeight:f}){let p=Vn(u),m=p.any?Hn(p):null,h=p.any&&!l?Hn(p):null,g=Math.min(1,Math.max(.01,s)),_=`${g*100}%`;return(0,q.jsxs)(`defs`,{children:[l?null:(0,q.jsxs)(`linearGradient`,{id:e,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:i,stopOpacity:a}}),(0,q.jsx)(`stop`,{offset:_,style:{stopColor:i,stopOpacity:o}}),g<1?(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:i,stopOpacity:o}}):null]}),m?(0,q.jsx)(`linearGradient`,{id:t,...Un(d),children:m.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:c,stopOpacity:e.opacity}},e.offset))}):null,h?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`linearGradient`,{id:r,...Un(d),children:h.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:`white`,stopOpacity:e.opacity}},e.offset))}),(0,q.jsx)(`mask`,{id:n,children:(0,q.jsx)(`rect`,{fill:`url(#${r})`,height:f,width:d,x:`0`,y:`0`})})]}):null]})}function Gn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Kn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qn(e){let t,n,r;e.length===2?(t=e===Gn||e===Kn?e:Jn,n=e,r=e):(t=Gn,n=(t,n)=>Gn(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Jn(){return 0}function Yn(e){return e===null?NaN:+e}var Xn=qn(Gn),Zn=Xn.right;Xn.left,qn(Yn).center;function Qn(e,t){let n,r;if(t===void 0)for(let t of e)t!=null&&(n===void 0?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var $n=Math.sqrt(50),er=Math.sqrt(10),tr=Math.sqrt(2);function nr(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=$n?10:a>=er?5:a>=tr?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?nr(e,t,n*2):[s,c,l]}function rr(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?nr(t,e,n):nr(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function ir(e,t,n){return t=+t,e=+e,n=+n,nr(e,t,n)[2]}function ar(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?ir(t,e,n):ir(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function sr(e){return function(){return e}}function cr(e){return+e}var lr=[0,1];function ur(e){return e}function dr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:sr(isNaN(t)?NaN:.5)}function fr(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function pr(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=dr(i,r),a=n(o,a)):(r=dr(r,i),a=n(a,o)),function(e){return a(r(e))}}function mr(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=dr(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=Zn(e,t,1,r)-1;return a[n](i[n](t))}}function hr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function gr(){var e=lr,t=lr,n=ie,r,i,a,o=ur,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==ur&&(o=fr(e[0],e[n-1])),s=n>2?mr:pr,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),re))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,cr),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=jt,u()},d.clamp=function(e){return arguments.length?(o=e?!0:ur,u()):o!==ur},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function _r(){return gr()(ur,ur)}function vr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function yr(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function br(e){return e=yr(Math.abs(e)),e?e[1]:NaN}function xr(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Sr(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Cr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wr(e){if(!(t=Cr.exec(e)))throw Error(`invalid format: `+e);var t;return new Tr({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}wr.prototype=Tr.prototype;function Tr(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Tr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Er(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var Dr;function Or(e,t){var n=yr(e,t);if(!n)return Dr=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Dr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+yr(e,Math.max(0,t+a-1))[0]}function kr(e,t){var n=yr(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ar={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:vr,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>kr(e*100,t),r:kr,s:Or,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jr(e){return e}var Mr=Array.prototype.map,Nr=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Pr(e){var t=e.grouping===void 0||e.thousands===void 0?jr:xr(Mr.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?jr:Sr(Mr.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=wr(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ar[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Ar[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Er(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Dr!==void 0?Nr[8+Dr/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(br(t)/3)))*3,r=10**-n,i=l((e=wr(e),e.type=`f`,e),{suffix:Nr[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Fr,Ir,Lr;Rr({thousands:`,`,grouping:[3],currency:[`$`,``]});function Rr(e){return Fr=Pr(e),Ir=Fr.format,Lr=Fr.formatPrefix,Fr}function zr(e){return Math.max(0,-br(Math.abs(e)))}function Br(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(br(t)/3)))*3-br(Math.abs(e)))}function Vr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,br(t)-br(e))+1}function Hr(e,t,n,r){var i=ar(e,t,n),a;switch(r=wr(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Br(i,o))&&(r.precision=a),Lr(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Vr(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=zr(i))&&(r.precision=a-(r.type===`%`)*2)}return Ir(r)}function Ur(e){var t=e.domain;return e.ticks=function(e){var n=t();return rr(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Hr(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=ir(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Wr(){var e=_r();return e.copy=function(){return hr(e,Wr())},or.apply(e,arguments),Ur(e)}function Gr(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}var Kr=new Date,qr=new Date;function Y(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>Y(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Kr.setTime(+t),qr.setTime(+r),e(Kr),e(qr),Math.floor(n(Kr,qr))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var Jr=Y(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jr.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Y(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jr),Jr.range;var Yr=1e3,Xr=Yr*60,Zr=Xr*60,Qr=Zr*24,$r=Qr*7,ei=Qr*30,ti=Qr*365,ni=Y(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Yr)},(e,t)=>(t-e)/Yr,e=>e.getUTCSeconds());ni.range;var ri=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Yr)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getMinutes());ri.range;var ii=Y(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getUTCMinutes());ii.range;var ai=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Yr-e.getMinutes()*Xr)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getHours());ai.range;var oi=Y(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCHours());oi.range;var si=Y(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xr)/Qr,e=>e.getDate()-1);si.range;var ci=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>e.getUTCDate()-1);ci.range;var li=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Qr,e=>Math.floor(e/Qr));li.range;function ui(e){return Y(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xr)/$r)}var di=ui(0),fi=ui(1),pi=ui(2),mi=ui(3),hi=ui(4),gi=ui(5),_i=ui(6);di.range,fi.range,pi.range,mi.range,hi.range,gi.range,_i.range;function vi(e){return Y(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/$r)}var yi=vi(0),bi=vi(1),xi=vi(2),Si=vi(3),Ci=vi(4),wi=vi(5),Ti=vi(6);yi.range,bi.range,xi.range,Si.range,Ci.range,wi.range,Ti.range;var Ei=Y(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ei.range;var Di=Y(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Di.range;var Oi=Y(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Oi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Oi.range;var ki=Y(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ki.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),ki.range;function Ai(e,t,n,r,i,a){let o=[[ni,1,Yr],[ni,5,5*Yr],[ni,15,15*Yr],[ni,30,30*Yr],[a,1,Xr],[a,5,5*Xr],[a,15,15*Xr],[a,30,30*Xr],[i,1,Zr],[i,3,3*Zr],[i,6,6*Zr],[i,12,12*Zr],[r,1,Qr],[r,2,2*Qr],[n,1,$r],[t,1,ei],[t,3,3*ei],[e,1,ti]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=qn(([,,e])=>e).right(o,i);if(a===o.length)return e.every(ar(t/ti,n/ti,r));if(a===0)return Jr.every(Math.max(ar(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[ji,Mi]=Ai(ki,Di,yi,li,oi,ii),[Ni,Pi]=Ai(Oi,Ei,di,si,ai,ri);function Fi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ii(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Li(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ri(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Ui(i),u=Wi(i),d=Ui(a),f=Wi(a),p=Ui(o),m=Wi(o),h=Ui(s),g=Wi(s),_=Ui(c),v=Wi(c),y={a:N,A:P,b:F,B:I,c:null,d:da,e:da,f:ga,g:Da,G:ka,H:fa,I:pa,j:ma,L:ha,m:_a,M:va,p:L,q:R,Q:Qa,s:$a,S:ya,u:ba,U:xa,V:Ca,w:wa,W:Ta,x:null,X:null,y:Ea,Y:Oa,Z:Aa,"%":Za},b={a:z,A:B,b:ee,B:V,c:null,d:ja,e:ja,f:Ia,g:qa,G:Ya,H:Ma,I:Na,j:Pa,L:Fa,m:La,M:Ra,p:H,q:U,Q:Qa,s:$a,S:za,u:Ba,U:Va,V:Ua,w:Wa,W:Ga,x:null,X:null,y:Ka,Y:Ja,Z:Xa,"%":Za},x={a:E,A:D,b:O,B:k,c:A,d:ta,e:ta,f:sa,g:Zi,G:Xi,H:ra,I:ra,j:na,L:oa,m:ea,M:ia,p:T,q:$i,Q:la,s:ua,S:aa,u:Ki,U:qi,V:Ji,w:Gi,W:Yi,x:j,X:M,y:Zi,Y:Xi,Z:Qi,"%":ca};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=zi[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Li(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Ii(Li(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?bi.ceil(a):bi(a),a=ci.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Fi(Li(r.y,0,1)),o=a.getDay(),a=o>4||o===0?fi.ceil(a):fi(a),a=si.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Ii(Li(r.y,0,1)).getUTCDay():Fi(Li(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Ii(r)):Fi(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in zi?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function B(e){return a[e.getUTCDay()]}function ee(e){return c[e.getUTCMonth()]}function V(e){return s[e.getUTCMonth()]}function H(e){return i[+(e.getUTCHours()>=12)]}function U(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var zi={"-":``,_:` `,0:`0`},X=/^\s*\d+/,Bi=/^%/,Vi=/[\\^$*+?|[\]().{}]/g;function Z(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Hi(e){return e.replace(Vi,`\\$&`)}function Ui(e){return RegExp(`^(?:`+e.map(Hi).join(`|`)+`)`,`i`)}function Wi(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Gi(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ki(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ji(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Yi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Xi(e,t,n){var r=X.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Zi(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Qi(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function $i(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ea(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ta(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function na(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ra(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ia(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function aa(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function oa(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function sa(e,t,n){var r=X.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ca(e,t,n){var r=Bi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function la(e,t,n){var r=X.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ua(e,t,n){var r=X.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function da(e,t){return Z(e.getDate(),t,2)}function fa(e,t){return Z(e.getHours(),t,2)}function pa(e,t){return Z(e.getHours()%12||12,t,2)}function ma(e,t){return Z(1+si.count(Oi(e),e),t,3)}function ha(e,t){return Z(e.getMilliseconds(),t,3)}function ga(e,t){return ha(e,t)+`000`}function _a(e,t){return Z(e.getMonth()+1,t,2)}function va(e,t){return Z(e.getMinutes(),t,2)}function ya(e,t){return Z(e.getSeconds(),t,2)}function ba(e){var t=e.getDay();return t===0?7:t}function xa(e,t){return Z(di.count(Oi(e)-1,e),t,2)}function Sa(e){var t=e.getDay();return t>=4||t===0?hi(e):hi.ceil(e)}function Ca(e,t){return e=Sa(e),Z(hi.count(Oi(e),e)+(Oi(e).getDay()===4),t,2)}function wa(e){return e.getDay()}function Ta(e,t){return Z(fi.count(Oi(e)-1,e),t,2)}function Ea(e,t){return Z(e.getFullYear()%100,t,2)}function Da(e,t){return e=Sa(e),Z(e.getFullYear()%100,t,2)}function Oa(e,t){return Z(e.getFullYear()%1e4,t,4)}function ka(e,t){var n=e.getDay();return e=n>=4||n===0?hi(e):hi.ceil(e),Z(e.getFullYear()%1e4,t,4)}function Aa(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Z(t/60|0,`0`,2)+Z(t%60,`0`,2)}function ja(e,t){return Z(e.getUTCDate(),t,2)}function Ma(e,t){return Z(e.getUTCHours(),t,2)}function Na(e,t){return Z(e.getUTCHours()%12||12,t,2)}function Pa(e,t){return Z(1+ci.count(ki(e),e),t,3)}function Fa(e,t){return Z(e.getUTCMilliseconds(),t,3)}function Ia(e,t){return Fa(e,t)+`000`}function La(e,t){return Z(e.getUTCMonth()+1,t,2)}function Ra(e,t){return Z(e.getUTCMinutes(),t,2)}function za(e,t){return Z(e.getUTCSeconds(),t,2)}function Ba(e){var t=e.getUTCDay();return t===0?7:t}function Va(e,t){return Z(yi.count(ki(e)-1,e),t,2)}function Ha(e){var t=e.getUTCDay();return t>=4||t===0?Ci(e):Ci.ceil(e)}function Ua(e,t){return e=Ha(e),Z(Ci.count(ki(e),e)+(ki(e).getUTCDay()===4),t,2)}function Wa(e){return e.getUTCDay()}function Ga(e,t){return Z(bi.count(ki(e)-1,e),t,2)}function Ka(e,t){return Z(e.getUTCFullYear()%100,t,2)}function qa(e,t){return e=Ha(e),Z(e.getUTCFullYear()%100,t,2)}function Ja(e,t){return Z(e.getUTCFullYear()%1e4,t,4)}function Ya(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ci(e):Ci.ceil(e),Z(e.getUTCFullYear()%1e4,t,4)}function Xa(){return`+0000`}function Za(){return`%`}function Qa(e){return+e}function $a(e){return Math.floor(e/1e3)}var eo,to;no({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function no(e){return eo=Ri(e),to=eo.format,eo.parse,eo.utcFormat,eo.utcParse,eo}function ro(e){return new Date(e)}function io(e){return e instanceof Date?+e:+new Date(+e)}function ao(e,t,n,r,i,a,o,s,c,l){var u=_r(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,io)):f().map(ro)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(Gr(n,e)):u},u.copy=function(){return hr(u,ao(e,t,n,r,i,a,o,s,c,l))},u}function oo(){return or.apply(ao(Ni,Pi,Oi,Ei,di,si,ai,ri,ni,to).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function so(e,t){t.domain&&(`nice`in e||`quantiles`in e||`padding`in e,e.domain(t.domain))}function co(e,t){t.range&&(`padding`in e,e.range(t.range))}function lo(e,t){`align`in e&&`align`in t&&t.align!==void 0&&e.align(t.align)}function uo(e,t){`base`in e&&`base`in t&&t.base!==void 0&&e.base(t.base)}function fo(e,t){`clamp`in e&&`clamp`in t&&t.clamp!==void 0&&e.clamp(t.clamp)}function po(e,t){`constant`in e&&`constant`in t&&t.constant!==void 0&&e.constant(t.constant)}function mo(e,t){`exponent`in e&&`exponent`in t&&t.exponent!==void 0&&e.exponent(t.exponent)}var ho={lab:Ft,hcl:Lt,"hcl-long":Rt,hsl:Nt,"hsl-long":Pt,cubehelix:Bt,"cubehelix-long":Vt,rgb:te};function go(e){switch(e){case`lab`:case`hcl`:case`hcl-long`:case`hsl`:case`hsl-long`:case`cubehelix`:case`cubehelix-long`:case`rgb`:return ho[e]}let{type:t,gamma:n}=e,r=ho[t];return n===void 0?r:r.gamma(n)}function _o(e,t){if(`interpolate`in t&&`interpolate`in e&&t.interpolate!==void 0){let n=go(t.interpolate);e.interpolate(n)}}var vo=new Date(Date.UTC(2020,1,2,3,4,5)),yo=`%Y-%m-%d %H:%M`;function bo(e){return e.tickFormat(1,yo)(vo)===`2020-02-02 03:04`}var xo={day:si,hour:ai,minute:ri,month:Ei,second:ni,week:di,year:Oi},So={day:ci,hour:oi,minute:ii,month:Di,second:ni,week:yi,year:ki};function Co(e,t){if(`nice`in t&&t.nice!==void 0&&`nice`in e){let{nice:n}=t;if(typeof n==`boolean`)n&&e.nice();else if(typeof n==`number`)e.nice(n);else{let t=e,r=bo(t);if(typeof n==`string`)t.nice(r?So[n]:xo[n]);else{let{interval:e,step:i}=n,a=(r?So[e]:xo[e]).every(i);a!=null&&t.nice(a)}}}}function wo(e,t){`padding`in e&&`padding`in t&&t.padding!==void 0&&e.padding(t.padding),`paddingInner`in e&&`paddingInner`in t&&t.paddingInner!==void 0&&e.paddingInner(t.paddingInner),`paddingOuter`in e&&`paddingOuter`in t&&t.paddingOuter!==void 0&&e.paddingOuter(t.paddingOuter)}function To(e,t){if(t.reverse){let t=e.range().slice().reverse();`padding`in e,e.range(t)}}function Eo(e,t){`round`in t&&t.round!==void 0&&(t.round&&`interpolate`in t&&t.interpolate!==void 0?console.warn(`[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:`,t):`round`in e?e.round(t.round):`interpolate`in e&&t.round&&e.interpolate(jt))}function Do(e,t){`unknown`in e&&`unknown`in t&&t.unknown!==void 0&&e.unknown(t.unknown)}function Oo(e,t){if(`zero`in t&&t.zero===!0){let[t,n]=e.domain(),r=n<t,[i,a]=r?[n,t]:[t,n],o=[Math.min(0,i),Math.max(0,a)];e.domain(r?o.reverse():o)}}var ko=[`domain`,`nice`,`zero`,`interpolate`,`round`,`range`,`reverse`,`align`,`base`,`clamp`,`constant`,`exponent`,`padding`,`unknown`],Ao={domain:so,nice:Co,zero:Oo,interpolate:_o,round:Eo,align:lo,base:uo,clamp:fo,constant:po,exponent:mo,padding:wo,range:co,reverse:To,unknown:Do};function jo(){let e=new Set([...arguments]),t=ko.filter(t=>e.has(t));return function(e,n){return n!==void 0&&t.forEach(t=>{Ao[t](e,n)}),e}}var Mo=jo(`domain`,`range`,`reverse`,`clamp`,`interpolate`,`nice`,`round`,`zero`);function No(e){return Mo(Wr(),e)}var Po=jo(`domain`,`range`,`reverse`,`clamp`,`interpolate`,`nice`,`round`);function Fo(e){return Po(oo(),e)}function Io(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function Lo(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}var Ro=`left`;function zo(e){return e==null||e===``?Ro:String(e)}function Bo(e){let t=new Map;for(let n of e){let e=zo(n.yAxisId),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}function Vo(e,t){return e[Ro]||(Object.values(e)[0]??t)}function Ho({lines:e,innerHeight:t,domainsByAxis:n}){let r=Bo(e),i={};for(let[e]of r){let r=n[e]??n.left??[0,100];i[e]=No({range:[t,0],domain:r})}return i.left||(i[Ro]=No({range:[t,0],domain:n.left??[0,100]})),i}var Q={background:`var(--chart-background)`,foreground:`var(--chart-foreground)`,foregroundMuted:`var(--chart-foreground-muted)`,label:`var(--chart-label)`,linePrimary:`var(--chart-line-primary)`,lineSecondary:`var(--chart-line-secondary)`,crosshair:`var(--chart-crosshair)`,grid:`var(--chart-grid)`,indicatorColor:`var(--chart-indicator-color)`,indicatorSecondaryColor:`var(--chart-indicator-secondary-color)`,markerBackground:`var(--chart-marker-background)`,markerBorder:`var(--chart-marker-border)`,markerForeground:`var(--chart-marker-foreground)`,badgeBackground:`var(--chart-marker-badge-background)`,badgeForeground:`var(--chart-marker-badge-foreground)`,segmentBackground:`var(--chart-segment-background)`,segmentLine:`var(--chart-segment-line)`,brushBorder:`var(--chart-brush-border)`,tooltipBackground:`var(--chart-tooltip-background)`},Uo=[`var(--chart-1)`,`var(--chart-2)`,`var(--chart-3)`,`var(--chart-4)`,`var(--chart-5)`],Wo=(0,K.createContext)(null),Go=(0,K.createContext)(null);function Ko({children:e,value:t}){let n=(0,K.useMemo)(()=>({data:t.data,renderData:t.renderData,xScale:t.xScale,yScale:t.yScale,yScales:t.yScales,width:t.width,height:t.height,innerWidth:t.innerWidth,innerHeight:t.innerHeight,margin:t.margin,columnWidth:t.columnWidth,containerRef:t.containerRef,lines:t.lines,referenceAreas:t.referenceAreas,chartPhase:t.chartPhase,chartStatus:t.chartStatus,loadingLabel:t.loadingLabel,yDomainTweenDuration:t.yDomainTweenDuration,yDomainSkeletonByAxis:t.yDomainSkeletonByAxis,yDomainTargetByAxis:t.yDomainTargetByAxis,isLoaded:t.isLoaded,animationDuration:t.animationDuration,animationEasing:t.animationEasing,enterTransition:t.enterTransition,revealEpoch:t.revealEpoch,notifyLoadingPulseComplete:t.notifyLoadingPulseComplete,xAccessor:t.xAccessor,dateLabels:t.dateLabels,xDomain:t.xDomain,xDomainSlotCount:t.xDomainSlotCount,barScale:t.barScale,bandWidth:t.bandWidth,barXAccessor:t.barXAccessor,orientation:t.orientation,stacked:t.stacked,stackOffsets:t.stackOffsets,composedBarDataKeys:t.composedBarDataKeys,composedBarSize:t.composedBarSize,composedMaxBarSize:t.composedMaxBarSize,composedBarGap:t.composedBarGap,composedStacked:t.composedStacked,composedStackOffsets:t.composedStackOffsets,composedStackGap:t.composedStackGap}),[t.data,t.renderData,t.xScale,t.yScale,t.yScales,t.width,t.height,t.innerWidth,t.innerHeight,t.margin,t.columnWidth,t.containerRef,t.lines,t.referenceAreas,t.chartPhase,t.chartStatus,t.loadingLabel,t.yDomainTweenDuration,t.yDomainSkeletonByAxis,t.yDomainTargetByAxis,t.isLoaded,t.animationDuration,t.animationEasing,t.enterTransition,t.revealEpoch,t.notifyLoadingPulseComplete,t.xAccessor,t.dateLabels,t.xDomain,t.xDomainSlotCount,t.barScale,t.bandWidth,t.barXAccessor,t.orientation,t.stacked,t.stackOffsets,t.composedBarDataKeys,t.composedBarSize,t.composedMaxBarSize,t.composedBarGap,t.composedStacked,t.composedStackOffsets,t.composedStackGap]),r=(0,K.useMemo)(()=>({tooltipData:t.tooltipData,setTooltipData:t.setTooltipData,selection:t.selection,clearSelection:t.clearSelection,hoveredBarIndex:t.hoveredBarIndex,setHoveredBarIndex:t.setHoveredBarIndex,hoveredCandleIndex:t.hoveredCandleIndex,setHoveredCandleIndex:t.setHoveredCandleIndex}),[t.tooltipData,t.setTooltipData,t.selection,t.clearSelection,t.hoveredBarIndex,t.setHoveredBarIndex,t.hoveredCandleIndex,t.setHoveredCandleIndex]);return(0,q.jsx)(Wo.Provider,{value:n,children:(0,q.jsx)(Go.Provider,{value:r,children:e})})}function qo(){let e=(0,K.useContext)(Wo);if(!e)throw Error(`useChartStable must be used within a ChartProvider. Make sure your component is wrapped in <LineChart>, <AreaChart>, <BarChart>, or <ComposedChart>.`);return e}function Jo(e){let{yScales:t,yScale:n}=qo();return t[e==null||e===``?`left`:String(e)]??n}function Yo(){let e=(0,K.useContext)(Go);if(!e)throw Error(`useChartHover must be used within a ChartProvider. Make sure your component is wrapped in <LineChart>, <AreaChart>, <BarChart>, or <ComposedChart>.`);return e}function Xo(){let e=qo(),t=Yo();return{...e,...t}}var Zo=2.2,Qo=.45,$o=[.85,0,.15,1],es=10;function ts(e){switch(e){case`loading`:return`loop`;case`exiting`:return`exit`;case`revealingLoading`:return`enter`;default:return null}}function ns(e,t,n,r){let i=_e(0),a=e+20,o=e+es,s=ve(i,e=>e<=.5?e/.5*a:(1-(e-.5)/.5)*a),c=ve(i,e=>{if(e<=.5)return-10;let t=(e-.5)/.5;return o-(1-t)*a});return(0,K.useEffect)(()=>{if(e<=0)return;let n=Zo/2,a=!1,o,s=()=>{a||r?.()},c=e=>{let t=n*((1-e)/.5);o=me(i,1,{duration:Math.max(t,.01),ease:[...$o],onComplete:s})};if(t===`loop`)return i.set(0),o=me(i,1,{duration:Zo,ease:[...$o],onComplete:s}),()=>{a=!0,o?.stop()};if(t===`exit`){let e=i.get();if(e<.5){let t=n*((.5-e)/.5);o=me(i,.5,{duration:Math.max(t,.01),ease:[...$o],onComplete:()=>{a||c(.5)}})}else c(e);return()=>{a=!0,o?.stop()}}if(t===`enter`)return i.set(0),o=me(i,.5,{duration:n,ease:[...$o],onComplete:s}),()=>{a=!0,o?.stop()}},[e,n,t,r,i]),{clipX:c,clipWidth:s}}function rs({pathD:e,mode:t=`loop`,loopEpoch:n=0,stroke:r=Q.foreground,strokeOpacity:i=.5,strokeWidth:a=2.5,onCycleComplete:o}){let{innerWidth:s,innerHeight:c}=qo(),l=(0,K.useId)(),u=`line-loading-clip-${l}`,d=`line-loading-gradient-${l}`,f=Hn(Vn(!0)),p=c+20,{clipX:m,clipWidth:h}=ns(s,t,n,o);return s<=0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`clipPath`,{id:u,children:(0,q.jsx)(G.rect,{height:p,style:{width:h,x:m},y:-10})}),(0,q.jsx)(`linearGradient`,{id:d,...Un(s),children:f.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,stopColor:r,stopOpacity:e.opacity},e.offset))})]}),(0,q.jsx)(`path`,{clipPath:`url(#${u})`,d:e,fill:`none`,opacity:i,stroke:`url(#${d})`,strokeLinecap:`round`,strokeWidth:a})]})}rs.displayName=`LineLoadingPulseStroke`;var is=2,as=-1,os=2,ss=25,cs=20,ls=80,us=14,ds=.55,fs=.18,ps=.02;function ms(e){let t=Math.sin(e)*43758.5453;return t-Math.floor(t)}function hs(e,t=0,n=cs,r=ls){let i=r-n;return Array.from({length:e},(e,r)=>n+Math.floor(ms((r+1)*12.9898+t)*i))}function gs(e=17,t=.05,n=.9){return Array.from({length:e},(r,i)=>{let a=i/(e-1),o=t+Math.sin(a*Math.PI)**2*(n-t);return{offset:`${(a*100).toFixed(0)}%`,opacity:Number(o.toFixed(3))}})}function _s({chartId:e,width:t,height:n,durationSeconds:r,onSweepComplete:i}){let a=(0,K.useMemo)(()=>gs(),[]),o=(0,K.useRef)(as),s=(0,K.useCallback)(e=>{let t=typeof e.x==`number`?e.x:as;t>=1&&o.current<1&&i(),o.current=t},[i]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`linearGradient`,{id:`${e}-grad`,x1:`0`,x2:`1`,y1:`0`,y2:`0`,children:a.map(({offset:e,opacity:t})=>(0,q.jsx)(`stop`,{offset:e,stopColor:`white`,stopOpacity:t},e))}),(0,q.jsx)(`pattern`,{height:`1`,id:`${e}-pattern`,patternContentUnits:`objectBoundingBox`,patternTransform:`rotate(${ss})`,patternUnits:`objectBoundingBox`,width:3,x:`0`,y:`0`,children:(0,q.jsx)(G.rect,{animate:{x:os},fill:`url(#${e}-grad)`,height:`1`,initial:{x:as},onUpdate:s,transition:{duration:r,ease:`linear`,repeat:1/0,repeatType:`loop`},width:`1`,y:`0`})}),(0,q.jsx)(`mask`,{id:`${e}-mask`,maskUnits:`userSpaceOnUse`,children:(0,q.jsx)(`rect`,{fill:`url(#${e}-pattern)`,height:n,width:t})})]})}function vs({curve:e,withArea:t=!1,mode:n=`loop`,onTransitionComplete:r,stroke:i=Q.foreground,strokeOpacity:a=ds,strokeWidth:o=2,pointCount:s=us,durationSeconds:c=is}){let{innerWidth:l,innerHeight:u}=qo(),d=fe(),f=`line-sweep-${(0,K.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,p=n===`loop`,[m,h]=(0,K.useState)(0),g=(0,K.useCallback)(()=>{p&&h(e=>e+1)},[p]),_=(0,K.useMemo)(()=>hs(s,m),[s,m]);if((0,K.useEffect)(()=>{d&&!p&&r?.()},[d,p,r]),l<=0||u<=0||_.length<2)return null;let v=No({domain:[0,_.length-1],range:[0,l]}),y=No({domain:[0,100],range:[u,0]}),b=_.map((e,t)=>({index:t,value:e})),x=e=>v(e.index),S=e=>y(e.value),C=(0,q.jsxs)(q.Fragment,{children:[t?(0,q.jsx)(Bn,{curve:e,data:b,fill:`url(#${f}-area)`,x,y:S,yScale:y}):null,(0,q.jsx)(zn,{curve:e,data:b,fill:`none`,stroke:i,strokeLinecap:`round`,strokeOpacity:a,strokeWidth:o,x,y:S})]}),w=t?(0,q.jsxs)(`linearGradient`,{id:`${f}-area`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:i,stopOpacity:fs}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:i,stopOpacity:ps})]}):null;if(d)return(0,q.jsxs)(q.Fragment,{children:[w?(0,q.jsx)(`defs`,{children:w}):null,C]});let T=`url(#${f}-mask)`,E=(0,q.jsxs)(`defs`,{children:[w,(0,q.jsx)(_s,{chartId:f,durationSeconds:c,height:u,onSweepComplete:g,width:l})]});return p?(0,q.jsxs)(q.Fragment,{children:[E,(0,q.jsx)(`g`,{mask:T,children:C})]}):(0,q.jsxs)(q.Fragment,{children:[E,(0,q.jsx)(G.g,{animate:{opacity:n===`exit`?0:1},initial:{opacity:+(n===`exit`)},mask:T,onAnimationComplete:r,transition:{duration:Qo,ease:[...$o]},children:C})]})}vs.displayName=`LineLoadingSweep`;var ys={pathD:null,pathLength:0};function bs(e,t){let[n,r]=(0,K.useState)(ys);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let n=t.getAttribute(`d`),i=n?t.getTotalLength():0;r(e=>e.pathD===n&&e.pathLength===i?e:{pathD:n,pathLength:i})},t),n}function xs(e,t){return e!=null&&e>=0&&e<t-1}function Ss(e,t,n,r){let i=e[t];return i?n(r(i))??0:0}function Cs({pathD:e,pathLength:t,dashStartLength:n,dashStartX:r,innerWidth:i,innerHeight:a,stroke:o,strokeWidth:s,dashArray:c}){let l=(0,K.useId)().replace(/:/g,``);if(!e||t<=0||n>=t)return null;let u=s*2,d=Math.max(0,i-r+u);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`clipPath`,{id:l,children:(0,q.jsx)(`rect`,{height:a+u,width:d,x:r-s,y:-s})})}),(0,q.jsx)(`path`,{d:e,fill:`none`,stroke:o,strokeDasharray:`${n} ${Math.max(1,t-n)}`,strokeLinecap:`round`,strokeWidth:s}),(0,q.jsx)(`path`,{clipPath:`url(#${l})`,d:e,fill:`none`,stroke:o,strokeDasharray:c,strokeLinecap:`round`,strokeWidth:s})]})}function ws({dashFromIndex:e,dashArray:t,data:n,pathD:r,pathLength:i,innerWidth:a,innerHeight:o,stroke:s,strokeWidth:c,xScale:l,xAccessor:u}){let d=xs(e,n.length),f=(0,K.useMemo)(()=>!d||e==null?0:Ss(n,e,l,u),[d,e,n,l,u]),p=(0,K.useMemo)(()=>!d||e==null||i<=0?0:e/Math.max(1,n.length-1)*i,[d,e,n.length,i]);return!d||e==null||i<=0?null:(0,q.jsx)(Cs,{dashArray:t,dashStartLength:p,dashStartX:f,innerHeight:o,innerWidth:a,pathD:r,pathLength:i,stroke:s,strokeWidth:c})}var Ts=(0,K.memo)(ws);function Es({pathRef:e,visible:t,stroke:n,strokeWidth:r,height:i,x:a,width:o}){let s=(0,K.useId)();return t&&e.current?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`clipPath`,{id:s,children:(0,q.jsx)(G.rect,{height:i,width:o,x:a,y:0})})}),(0,q.jsx)(G.path,{animate:{opacity:1},clipPath:`url(#${s})`,d:e.current.getAttribute(`d`)||``,exit:{opacity:0},fill:`none`,initial:{opacity:0},stroke:n,strokeLinecap:`round`,strokeWidth:r,transition:{duration:.4,ease:`easeInOut`}})]}):null}Es.displayName=`HighlightSegment`;var Ds={tooltipSpring:{stiffness:300,damping:30},tooltipBoxSpring:{stiffness:100,damping:20},highlightSpring:{stiffness:180,damping:28}},Os=(0,K.createContext)(null);function ks(){return(0,K.useContext)(Os)??Ds}var As=Ds.tooltipBoxSpring.damping;function js(e){if(e===0)return{animate:!1,springConfig:Ds.tooltipBoxSpring};let t=e??As,n=Ds.tooltipBoxSpring.stiffness;if(t<As){let e=(As-t)/As;n+=e*400}else if(t>As){let e=(t-As)/(100-As);n-=e*85}return{animate:!0,springConfig:{stiffness:Math.max(12,Math.round(n)),damping:t}}}var Ms={x:0,width:0,isActive:!1};function Ns(e,t,n,r,i){if(e.length===0)return Ms;if(i?.active)return{x:Math.min(i.startX,i.endX),width:Math.abs(i.endX-i.startX),isActive:!0};if(!r)return Ms;let a=r.index,o=Math.max(0,a-1),s=Math.min(e.length-1,a+1),c=e[o],l=e[s];if(!(c&&l))return Ms;let u=t(n(c))??0,d=t(n(l))??0;return{x:u,width:Math.max(0,d-u),isActive:!0}}function Ps({enabled:e=!0}={}){let{data:t,xScale:n,xAccessor:r}=qo(),{tooltipData:i,selection:a}=Yo(),{highlightSpring:o}=ks(),s=(0,K.useMemo)(()=>e?Ns(t,n,r,i,a):Ms,[e,t,n,r,i,a]),c=Qe(0,o),l=Qe(0,o),u=(0,K.useRef)(!1);return s.isActive&&!u.current?(c.jump(s.x),l.jump(s.width)):(c.set(s.x),l.set(s.width)),u.current=s.isActive,{xSpring:c,widthSpring:l,isActive:s.isActive}}function Fs({enabled:e,height:t,pathRef:n,stroke:r,strokeWidth:i}){let{isLoaded:a}=qo(),{xSpring:o,widthSpring:s,isActive:c}=Ps({enabled:e});return(0,q.jsx)(Es,{height:t,pathRef:n,stroke:r,strokeWidth:i,visible:e&&c&&a,width:s,x:o})}Fs.displayName=`SeriesHighlightLayer`;var Is=(0,K.createContext)(null);function Ls(){return(0,K.useContext)(Is)??{hoveredIndex:null,setHoveredIndex:()=>{}}}function Rs({enabled:e=!0,dimOpacity:t=.5,durationSec:n=.4,seriesIndex:r,children:i}){let{tooltipData:a,selection:o}=Yo(),{hoveredIndex:s}=Ls(),c=a!==null||o?.active===!0,l=e&&(c||s!==null&&r!==void 0&&s!==r)?t:1;return(0,q.jsx)(G.g,{animate:{opacity:l},initial:{opacity:1},transition:{duration:n,ease:`easeInOut`},children:i})}Rs.displayName=`SeriesHoverDim`;var zs=`cubic-bezier(0.85, 0, 0.15, 1)`,Bs=1100,Vs={type:`tween`,duration:Bs/1e3,ease:[.85,0,.15,1]};function Hs(e){return e?.type===`tween`?{...e,ease:e.ease??Vs.ease}:{type:`tween`,duration:typeof e?.duration==`number`?e.duration:Bs/1e3,ease:Vs.ease}}function Us({fill:e,stroke:t,strokeWidth:n,ringGap:r,outlineWidth:i,outlineColor:a,radius:o}){let s=t??e??`currentColor`,c=a??s,l=n>0?o+r+n:o,u=i>0?l+i/2:0;return(0,q.jsxs)(q.Fragment,{children:[i>0?(0,q.jsx)(`circle`,{cx:0,cy:0,fill:`none`,r:u,stroke:c,strokeWidth:i}):null,(0,q.jsx)(`circle`,{cx:0,cy:0,fill:e,r:o}),n>0?(0,q.jsx)(`circle`,{cx:0,cy:0,fill:`none`,r:o+r+n/2,stroke:s,strokeWidth:n}):null]})}var Ws=(0,K.memo)(function({cx:e,cy:t,scale:n=1,fill:r,stroke:i,strokeWidth:a=2,ringGap:o=2,outlineWidth:s=0,outlineColor:c,radius:l=5}){return(0,q.jsx)(`g`,{transform:`translate(${e}, ${t}) scale(${n})`,children:(0,q.jsx)(Us,{fill:r,outlineColor:c,outlineWidth:s,radius:l,ringGap:o,stroke:i,strokeWidth:a})})});function Gs({dataKey:e,index:t,cx:n,cy:r,enterBlur:i=2,revealDelay:a,revealEpoch:o,enterDuration:s,fill:c,stroke:l,strokeWidth:u=2,ringGap:d=2,outlineWidth:f=0,outlineColor:p,radius:m=5}){let h={hidden:{opacity:0,filter:`blur(${i}px)`,scale:1},visible:{opacity:1,filter:`blur(0px)`,scale:1,transition:{delay:a,duration:s,ease:Vs.ease}}};return(0,q.jsx)(`g`,{transform:`translate(${n}, ${r})`,children:(0,q.jsx)(G.g,{animate:`visible`,initial:`hidden`,variants:h,children:(0,q.jsx)(Us,{fill:c,outlineColor:p,outlineWidth:f,radius:m,ringGap:d,stroke:l,strokeWidth:u})},`${e}-${t}-${o}`)})}function Ks(e){let t=e.radius??5,n=e.strokeWidth??2,r=e.ringGap??2,i=e.outlineWidth??0,a=e.showActiveHighlight??!0,o=n>0?r+n:0,s=i>0?i:0,c=a?t*.35:0;return t+o+s+c+2}function qs({dataKey:e,fill:t,stroke:n,strokeWidth:r=2,ringGap:i=2,outlineWidth:a=0,outlineColor:o,radius:s=5,animate:c=!0,fadeOnHover:l=!0,inactiveOpacity:u=.5,inactiveBlur:d=2,enterBlur:f=2,showActiveHighlight:p=!0}){let{data:m,xScale:h,innerWidth:g,enterTransition:_,animationDuration:v,revealEpoch:y,isLoaded:b,xAccessor:x,lines:S}=qo(),C=(0,K.useMemo)(()=>{let t=S.findIndex(t=>t.dataKey===e);return t>=0?t:0},[S,e]),w=S[C],T=Jo(w?.yAxisId),E=Uo[C%Uo.length]??Uo[0],D=t??w?.stroke??E,O=n??D,k=(0,K.useMemo)(()=>Ks({radius:s,strokeWidth:r,ringGap:i,outlineWidth:a,showActiveHighlight:p}),[s,r,i,a,p]),A=Hs(_).duration??v/1e3,j=c&&!b,M=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?T(n)??0:null},[e,T]),N=(0,K.useMemo)(()=>m.flatMap((e,t)=>{let n=M(e);if(n===null)return[];let r=h(x(e))??0,i=Math.max(0,r-k);return[{index:t,cx:r,cy:n,revealDelay:g>0&&j?i/g*A:0}]}),[m,M,h,x,g,j,A,k]),P=(0,K.useMemo)(()=>({fill:D,stroke:O,strokeWidth:r,ringGap:i,outlineWidth:a,outlineColor:o,radius:s}),[D,O,r,i,a,o,s]);if(j)return(0,q.jsx)(`g`,{children:N.map(t=>(0,q.jsx)(Gs,{cx:t.cx,cy:t.cy,dataKey:e,enterBlur:f,enterDuration:.5,index:t.index,revealDelay:t.revealDelay,revealEpoch:y??0,...P},`${e}-${t.index}`))});let F=N.map(t=>(0,q.jsx)(Ws,{cx:t.cx,cy:t.cy,...P},`${e}-${t.index}`));return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(Js,{enabled:l,inactiveBlur:d,inactiveOpacity:u,seriesIndex:C,children:F}),(0,q.jsx)(Ys,{activeScale:p?1.35:1,enabled:l,markerStyle:P,points:N})]})}qs.displayName=`SeriesMarkers`;function Js({enabled:e,inactiveOpacity:t,inactiveBlur:n,seriesIndex:r,children:i}){let{tooltipData:a}=Yo(),{hoveredIndex:o}=Ls(),s=e&&(a!==null||o!==null&&o!==r);return(0,q.jsx)(`g`,{opacity:s?t:1,style:{transition:`opacity 0.15s ease-in-out, filter 0.15s ease-in-out`,filter:s&&n>0?`blur(${n}px)`:`none`},children:i})}function Ys({enabled:e,points:t,markerStyle:n,activeScale:r}){let{tooltipData:i}=Yo();if(!e||i===null)return null;let a=t.find(e=>e.index===i.index);return a?(0,q.jsx)(Ws,{cx:a.cx,cy:a.cy,scale:r,...n}):null}function Xs(e,t,n,r){let i=ts(e),a=t===!1?null:n??(t===!0?`loop`:i),o=a!=null,s=e===`revealing`||e===`ready`||e===`exitingReady`,[c,l]=(0,K.useState)(0);return{handleLoadingPulseComplete:(0,K.useCallback)(()=>{if(a===`loop`){window.setTimeout(()=>{l(e=>e+1)},280);return}r?.()},[r,a]),pulseMode:a,pulseEpoch:c,showLoadingPulse:o,showSeriesContent:s}}function Zs({dataKey:e,yAxisId:t,fill:n=Q.linePrimary,fillOpacity:r=.4,stroke:i,strokeWidth:a=2,curve:o=On,animate:s=!0,showLine:c=!0,showHighlight:l=!0,gradientToOpacity:u=0,gradientSpan:d=1,fadeEdges:f=!1,showMarkers:p=!1,markers:m,dashFromIndex:h,dashArray:g=`6,4`,loading:_,loadingStroke:v=Q.foreground,loadingStrokeOpacity:y=.5,loadingPulseMode:b,loadingStyle:x=`pulse`}){let{data:S,renderData:C,xScale:w,innerHeight:T,innerWidth:E,xAccessor:D,lines:O,chartPhase:k,notifyLoadingPulseComplete:A}=qo(),j=Jo(t),{handleLoadingPulseComplete:M,pulseMode:N,pulseEpoch:P,showLoadingPulse:F,showSeriesContent:I}=Xs(k,_,b,A),L=(0,K.useMemo)(()=>{let t=O.findIndex(t=>t.dataKey===e);return t>=0?t:0},[O,e]),R=(0,K.useRef)(null),{pathLength:z,pathD:B}=bs(R,[C,E,h,c,I,F]),ee=(0,K.useId)(),V=`area-gradient-${e}-${ee}`,H=`area-stroke-gradient-${e}-${ee}`,U=`area-edge-mask-${e}-${ee}`,te=`${U}-gradient`,ne=n.startsWith(`url(`),re=ne||r>0,ie=ne?n:`url(#${V})`,ae=i||(ne?Q.linePrimary:n),oe=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?j(n)??0:0},[e,j]),se=xs(h,S.length),W=Vn(f),ce=W.any&&!ne,le=ae;!ce&&W.any&&(le=`url(#${H})`);let ue=l&&c&&!F&&I,de=I&&c,fe=`transparent`;de&&!se&&(fe=le);let G=(0,q.jsxs)(q.Fragment,{children:[I&&re?(0,q.jsx)(Bn,{curve:o,data:C,fill:ie,x:e=>w(D(e))??0,y:oe,yScale:j}):null,c&&(I||F)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(zn,{curve:o,data:C,innerRef:R,stroke:fe,strokeLinecap:`round`,strokeWidth:a,x:e=>w(D(e))??0,y:oe}),de?(0,q.jsx)(Ts,{dashArray:g,dashFromIndex:h,data:S,innerHeight:T,innerWidth:E,pathD:B,pathLength:z,stroke:le,strokeWidth:a,xAccessor:D,xScale:w}):null]}):null]}),pe=F&&E>0&&x===`sweep`,me=F&&E>0&&!pe;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Wn,{edgeGradientId:te,edgeMaskId:U,fadeEdges:f,fill:n,fillOpacity:r,gradientId:V,gradientSpan:d,gradientToOpacity:u,innerHeight:T,innerWidth:E,isPatternFill:ne,resolvedStroke:ae,strokeGradientId:H}),(0,q.jsx)(Rs,{dimOpacity:.6,enabled:l,seriesIndex:L,children:ce?(0,q.jsx)(`g`,{mask:`url(#${U})`,children:G}):G}),(0,q.jsx)(Fs,{enabled:ue,height:T,pathRef:R,stroke:ae,strokeWidth:a}),p&&I?(0,q.jsx)(qs,{animate:s,dataKey:e,...m,fill:m?.fill??ae,stroke:m?.stroke??m?.fill??ae}):null,pe?(0,q.jsx)(vs,{curve:o,mode:N??`loop`,onTransitionComplete:M,stroke:v,strokeOpacity:y,strokeWidth:a,withArea:!0},`loading-sweep`):null,me&&B?(0,q.jsx)(rs,{loopEpoch:P,mode:N??void 0,onCycleComplete:M,pathD:B,stroke:v,strokeOpacity:y,strokeWidth:a},`loading-pulse`):null]})}Zs.displayName=`Area`;var Qs=t(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),$s=t(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),ec=t(((e,t)=>{var n=$s(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),tc=t(((e,t)=>{var n=ec();t.exports=function(){return n.Date.now()}})),nc=t(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),rc=t(((e,t)=>{var n=nc(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),ic=t(((e,t)=>{t.exports=ec().Symbol})),ac=t(((e,t)=>{var n=ic(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),oc=t(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),sc=t(((e,t)=>{var n=ic(),r=ac(),i=oc(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),cc=t(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),lc=t(((e,t)=>{var n=sc(),r=cc(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),uc=t(((e,t)=>{var n=rc(),r=Qs(),i=lc(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),dc=e(t(((e,t)=>{var n=Qs(),r=tc(),i=uc(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))()),fc=[],pc={width:0,height:0,top:0,left:0};function mc(){let{initialSize:e=pc,debounceTime:t=300,ignoreDimensions:n=fc,enableDebounceLeadingCall:r=!0,resizeObserverPolyfill:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=(0,K.useRef)(null),o=(0,K.useRef)(0),[s,c]=(0,K.useState)({...pc,...e}),l=(0,K.useMemo)(()=>{let e=Array.isArray(n)?n:[n];return(0,dc.default)(t=>{c(n=>Object.keys(n).filter(e=>n[e]!==t[e]).every(t=>e.includes(t))?n:t)},t,{leading:r})},[t,r,n]);return(0,K.useEffect)(()=>{let e=new(i||window.ResizeObserver)(e=>{e.forEach(e=>{let{left:t,top:n,width:r,height:i}=e?.contentRect??{};o.current=window.requestAnimationFrame(()=>{l({width:r,height:i,top:n,left:t})})})});return a.current&&e.observe(a.current),()=>{window.cancelAnimationFrame(o.current),e.disconnect(),l.cancel()}},[l,i]),{parentRef:a,resize:l,...s}}var hc={width:`100%`,height:`100%`};function gc(e){let{className:t,children:n,debounceTime:r,ignoreDimensions:i,initialSize:a,parentSizeStyles:o=hc,enableDebounceLeadingCall:s=!0,resizeObserverPolyfill:c,...l}=e,{parentRef:u,resize:d,...f}=mc({initialSize:a,debounceTime:r,ignoreDimensions:i,enableDebounceLeadingCall:s,resizeObserverPolyfill:c});return(0,q.jsx)(`div`,{style:o,ref:u,className:t,...l,children:n({...f,ref:u.current,resize:d})})}function _c(e,t,n,r,i){return e.map((e,a)=>{let o=t(e),s=e[i];return{x:n(o)??0,y:typeof s==`number`?r(s)??0:0,key:String(o.getTime?.()??a)}})}function vc(e,t,n){if(n>=1)return t;if(n<=0)return e.length>0?e:t;let r=new Map(e.map(e=>[e.key,e]));return t.map((i,a)=>{let o=r.get(i.key);if(o)return{key:i.key,x:o.x+(i.x-o.x)*n,y:o.y+(i.y-o.y)*n};let s=a>0?t[a-1]:void 0,c=s?r.get(s.key):void 0,l=a<t.length-1?t[a+1]:void 0,u=l?r.get(l.key):void 0,d=c??u??e[0]??i;return{key:i.key,x:d.x+(i.x-d.x)*n,y:d.y+(i.y-d.y)*n}})}function yc(e,t){return e.length===0?``:xn().x(e=>e.x).y(e=>e.y).curve(t)(e)??``}function bc({renderData:e,xAccessor:t,dataKey:n,innerWidth:r,xDomainMin:i,xDomainMax:a}){return`${r}|${i}|${a}|${e.map(e=>{let r=t(e),i=e[n];return`${r.getTime()}:${typeof i==`number`?i:``}`}).join(`,`)}`}function xc({renderData:e,xAccessor:t,xScale:n,yScale:r,dataKey:i,curve:a,chartPhase:o,durationMs:s,innerWidth:c,enabled:l}){let u=fe(),[d,f]=(0,K.useState)(null),p=(0,K.useRef)(null),m=(0,K.useRef)(!1),h=(0,K.useMemo)(()=>n.domain?.()??[new Date(0),new Date(0)],[n]),g=(0,K.useMemo)(()=>bc({renderData:e,xAccessor:t,dataKey:i,innerWidth:c,xDomainMin:h[0]?.getTime?.()??0,xDomainMax:h[1]?.getTime?.()??0}),[e,t,i,c,h]),_=(0,K.useMemo)(()=>_c(e,t,n,r,i),[e,t,n,r,i]),v=(0,K.useRef)(g);(0,K.useEffect)(()=>{m.current||(p.current=_)},[_]),(0,K.useEffect)(()=>{if(!(l&&!u&&o===`ready`&&s>0&&e.length>0)){m.current=!1,f(null),p.current=_,v.current=g;return}if(v.current===g)return;v.current=g;let a=p.current??_;if(a.length===0){p.current=_;return}m.current=!0;let c=a,d=me(0,1,{duration:s/1e3,ease:[...$o],onUpdate:a=>{let o=_c(e,t,n,r,i),s=vc(c,o,a);p.current=s,f(s)},onComplete:()=>{m.current=!1,p.current=_,f(null)}});return()=>{d.stop(),m.current=!1}},[g,o,s,l,u,e,t,n,r,i,_]);let y=d??_;return{pathD:(0,K.useMemo)(()=>yc(y,a),[y,a]),isPathAnimating:d!=null}}function Sc({animatedPathD:e,curve:t,getY:n,pathRef:r,renderData:i,strokeWidth:a,useDataTransitionPath:o,visibleStroke:s,xAccessor:c,xScale:l}){return o&&e?(0,q.jsx)(`path`,{d:e,fill:`none`,ref:r,stroke:s,strokeLinecap:`round`,strokeWidth:a}):(0,q.jsx)(zn,{curve:t,data:i,innerRef:r,stroke:s,strokeLinecap:`round`,strokeWidth:a,x:e=>l(c(e))??0,y:n})}function Cc({curve:e,handleLoadingPulseComplete:t,innerWidth:n,loadingStroke:r,loadingStrokeOpacity:i,loadingStyle:a,pathD:o,pulseEpoch:s,pulseMode:c,showLoadingPulse:l,strokeWidth:u}){let d=l&&n>0&&a===`sweep`;return(0,q.jsxs)(q.Fragment,{children:[d?(0,q.jsx)(vs,{curve:e,mode:c??`loop`,onTransitionComplete:t,stroke:r,strokeOpacity:i,strokeWidth:u},`loading-sweep`):null,l&&n>0&&!d&&o?(0,q.jsx)(rs,{loopEpoch:s,mode:c??void 0,onCycleComplete:t,pathD:o,stroke:r,strokeOpacity:i,strokeWidth:u},`loading-pulse`):null]})}function wc({dataKey:e,yAxisId:t,stroke:n=Q.linePrimary,strokeWidth:r=2.5,curve:i=jn,animate:a=!0,fadeEdges:o=!0,showHighlight:s=!0,showMarkers:c=!1,markers:l,dashFromIndex:u,dashArray:d=`6,4`,loading:f,loadingStroke:p=Q.foreground,loadingStrokeOpacity:m=.5,loadingPulseMode:h,onLoadingPulseCycleComplete:g,loadingStyle:_=`pulse`}){let{data:v,renderData:y,xScale:b,innerHeight:x,innerWidth:S,xAccessor:C,lines:w,chartPhase:T,notifyLoadingPulseComplete:E,yDomainTweenDuration:D}=qo(),O=Jo(t),k=a&&T===`ready`,{pathD:A}=xc({chartPhase:T,curve:i,dataKey:e,durationMs:D,enabled:k,innerWidth:S,renderData:y,xAccessor:C,xScale:b,yScale:O}),j=ts(T),M=f===!1?null:h??(f===!0?`loop`:j),N=M!=null,[P,F]=(0,K.useState)(0),I=s&&!N,L=(0,K.useCallback)(()=>{if(g?.(),M===`loop`){window.setTimeout(()=>{F(e=>e+1)},280);return}E?.()},[E,g,M]),R=(0,K.useMemo)(()=>{let t=w.findIndex(t=>t.dataKey===e);return t>=0?t:0},[w,e]),z=(0,K.useRef)(null),{pathLength:B,pathD:ee}=bs(z,[y,S,u,a,k?A:null]),V=`line-gradient-${e}-${(0,K.useId)()}`,H=(0,K.useCallback)(t=>{let n=t[e];return typeof n==`number`?O(n)??0:0},[e,O]),U=xs(u,v.length),te=Vn(o),ne=te.any?`url(#${V})`:n,re=te.any?Hn(te):null,ie=T===`revealing`||T===`ready`||T===`exitingReady`,ae=`transparent`;return ie&&!U&&(ae=ne),(0,q.jsxs)(q.Fragment,{children:[re?(0,q.jsx)(`defs`,{children:(0,q.jsx)(`linearGradient`,{id:V,...Un(S),children:re.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:n,stopOpacity:e.opacity}},e.offset))})}):null,(0,q.jsxs)(Rs,{dimOpacity:.3,enabled:I,seriesIndex:R,children:[(0,q.jsx)(Sc,{animatedPathD:A,curve:i,getY:H,pathRef:z,renderData:y,strokeWidth:r,useDataTransitionPath:k,visibleStroke:ae,xAccessor:C,xScale:b}),(0,q.jsx)(Ts,{dashArray:d,dashFromIndex:u,data:v,innerHeight:x,innerWidth:S,pathD:ee,pathLength:B,stroke:ne,strokeWidth:r,xAccessor:C,xScale:b})]}),c?(0,q.jsx)(qs,{animate:a,dataKey:e,...l,fill:l?.fill??n,stroke:l?.stroke??l?.fill??n}):null,(0,q.jsx)(Fs,{enabled:I,height:x,pathRef:z,stroke:n,strokeWidth:r}),(0,q.jsx)(Cc,{curve:i,handleLoadingPulseComplete:L,innerWidth:S,loadingStroke:p,loadingStrokeOpacity:m,loadingStyle:_,pathD:ee,pulseEpoch:P,pulseMode:M,showLoadingPulse:N,strokeWidth:r})]})}wc.displayName=`Line`;function Tc(e,t,n=Vs){return{...e??n,delay:t}}function Ec(e){let{innerWidth:t,dataLength:n,columnWidth:r,seriesCount:i,composedBarSize:a,composedMaxBarSize:o,composedBarGap:s=4,stacked:c=!1}=e,l=s,u=c?1:Math.max(1,i),d=r;d<=0&&(d=n<2?t:t/(n-1));let f=a??Math.min(d*.88,o??1/0);if(o!=null&&(f=Math.min(f,o)),u>1){let e=d*.92;u*f+(u-1)*l>e&&e>0&&(f=Math.max(4,(e-(u-1)*l)/u))}return Math.max(2,f)}function Dc(e){let{barWidth:t,seriesCount:n,gap:r=4,stacked:i=!1}=e;if(i||n<=1)return Math.ceil(t/2);let a=n*t+(n-1)*r;return Math.ceil(a/2)}function Oc(e){let{stacked:t,composedStackOffsets:n,rowIndex:r,dataKey:i,value:a,yScale:o,innerHeight:s,xCenter:c,barWidth:l,seriesCount:u,gap:d,seriesIndex:f,stackGap:p,isLastSeries:m,radius:h}=e;if(t&&n){let e=n.get(r)?.get(i)??0,t=s-(o(a)??0),u=o(e)??s,d=f*p,g=u-t-d;return!m&&p>0&&(t=Math.max(0,t-p)),{barLeft:c-l/2,barHeight:t,effectiveRadius:p>0||m?h:0,valueY:g}}let g=u*l+(u>1?(u-1)*d:0),_=o(a)??s;return{barLeft:c-g/2+f*(l+d),barHeight:s-_,effectiveRadius:h,valueY:_}}function kc({dataKey:e,fill:t=Q.linePrimary,radius:n=0,animate:r=!0,fadedOpacity:i=.3}){let{data:a,xScale:o,yScale:s,xAccessor:c,innerHeight:l,innerWidth:u,columnWidth:d,isLoaded:f,animationDuration:p,enterTransition:m,revealEpoch:h=0,barScale:g,composedBarDataKeys:_,composedBarSize:v,composedMaxBarSize:y,composedBarGap:b,composedStacked:x,composedStackOffsets:S,composedStackGap:C,tooltipData:w}=Xo(),T=(0,K.useMemo)(()=>_&&_.length>0?_:[e],[_,e]),E=(0,K.useMemo)(()=>{let t=T.indexOf(e);return t>=0?t:0},[T,e]),D=T.length,O=b??4,k=C??0,A=!!x&&S!=null&&_!=null&&_.length>0,j=E===D-1,M=(0,K.useMemo)(()=>Ec({innerWidth:u,dataLength:a.length,columnWidth:d,seriesCount:D,composedBarSize:v,composedMaxBarSize:y,composedBarGap:O,stacked:A}),[d,v,y,a.length,O,u,D,A]),N=(p||1100)*.4,P=a.length>1?N/1e3/a.length:0,{hoveredIndex:F}=Ls(),I=F!==null&&F!==E,L=w?.index??null;return g?(console.warn(`SeriesBar is for time-based ComposedChart / LineChart context. Use Bar inside BarChart for categorical x.`),null):(0,q.jsx)(`g`,{className:`series-bar`,children:a.map((a,u)=>{let d=a[e];if(typeof d!=`number`)return null;let p=o(c(a))??0,{barLeft:g,valueY:_,barHeight:v,effectiveRadius:y}=Oc({stacked:A,composedStackOffsets:S,rowIndex:u,dataKey:e,value:d,yScale:s,innerHeight:l,xCenter:p,barWidth:M,seriesCount:D,gap:O,seriesIndex:E,stackGap:k,isLastSeries:j,radius:n}),b=String(c(a).getTime()),x=L!==null&&L!==u||I;return r&&!f?(0,q.jsx)(Ac,{barHeight:v,barWidth:M,calculatedStaggerDelay:P,enterTransition:m,fadedOpacity:i,fill:t,index:u,innerHeight:l,isFaded:x,radius:y,revealEpoch:h,x:g,y:_},`${e}-${b}-${h}`):(0,q.jsx)(G.rect,{animate:{opacity:x?i:1},fill:t,height:v,rx:y,ry:y,transition:{opacity:{duration:.12}},width:M,x:g,y:_},`${e}-${b}`)})})}kc.displayName=`SeriesBar`;function Ac({x:e,y:t,barWidth:n,barHeight:r,fill:i,radius:a,index:o,innerHeight:s,calculatedStaggerDelay:c,enterTransition:l,revealEpoch:u,isFaded:d,fadedOpacity:f}){let p=Tc(l,o*c);return(0,q.jsx)(G.rect,{animate:{height:r,y:t,opacity:d?f:1},fill:i,initial:{height:0,y:s,opacity:1},rx:a,ry:a,transition:p,width:n,x:e},`series-bar-${o}-${u}`)}function jc(e){return typeof e==`function`&&e.__chartClipPassthrough===!0}function Mc(e){if(jc(e.type)){let t=e.props.children;if((0,K.isValidElement)(t))return Mc(t)}return e}var Nc=new Set([`Background`,`Grid`,`XAxis`,`YAxis`,`BarXAxis`,`BarYAxis`,`LiveXAxis`,`LiveYAxis`]),Pc=new Set([`ReferenceArea`,`BarColumnTrack`]);function Fc(e){let t=e.type;if(t.__isChartMarkers||t.__isPostOverlay)return!0;let n=typeof e.type==`function`&&(t.displayName||t.name)||``;return n===`ChartMarkers`||n===`MarkerGroup`||n===`ChartBrush`}function Ic(e){let t=e.type,n=typeof e.type==`function`&&(t.displayName||t.name)||``;return Pc.has(n)}function Lc(e){let t=e.type,n=typeof e.type==`function`&&(t.displayName||t.name)||``;return Nc.has(n)}function Rc(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}var zc=new Set([`Lines`,`Circles`,`Waves`,`Hexagons`,`Path`,`Pattern`]);function Bc(e){let t=Rc(e);return t.includes(`Pattern`)||zc.has(t)}function Vc(e){let t=Rc(e);return t.includes(`Gradient`)||t===`LinearGradient`||t===`RadialGradient`}var Hc=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}),Uc=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}),Wc=new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});var Gc=new Intl.NumberFormat(`en-US`).format,Kc=`ready`;function qc(e){return e===`loading`?`loading`:`ready`}function Jc(e){return e===`ready`}function Yc({clipPathId:e,height:t,targetWidth:n,enterTransition:r,revealEpoch:i,padding:a=0,animating:o=!0,mode:s=`reveal`,onComplete:c}){let l=Hs(r),u=Math.max(0,n+a*2),d=t+a*2;if(!o)return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(`rect`,{height:d,width:u,x:-a,y:-a})});if(s===`conceal`){let t=-a+u;return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(G.rect,{animate:{width:0,x:t},height:d,initial:{width:u,x:-a},onAnimationComplete:()=>c?.(),transition:l,y:-a},`conceal-${i}`)})}return(0,q.jsx)(`clipPath`,{id:e,children:(0,q.jsx)(G.rect,{animate:{width:u},height:d,initial:{width:0},transition:l,width:u,x:-a,y:-a},`reveal-${i}`)})}function Xc(e,t,n=[]){let r=e.length;if(t>=r||t<3)return e;let i=(e,t)=>{if(n.length===0){for(let t of Object.values(e))if(typeof t==`number`)return t;return t}let r=0,i=0;for(let t of n){let n=e[t];typeof n==`number`&&(r+=n,i++)}return i>0?r/i:t},a=[e[0]],o=(r-2)/(t-2),s=0;for(let n=0;n<t-2;n++){let t=Math.floor((n+1)*o)+1,c=Math.min(Math.floor((n+2)*o)+1,r-1),l=Math.floor((n+2)*o)+1,u=Math.min(Math.floor((n+3)*o)+1,r),d=Math.max(0,u-l),f=r-1,p=i(e[r-1],r-1);if(d>0){f=0,p=0;for(let t=l;t<u;t++)f+=t,p+=i(e[t],t);f/=d,p/=d}let m=e[s],h=s,g=i(m,s),_=-1,v=t;for(let n=t;n<c;n++){let t=Math.abs((h-f)*(i(e[n],n)-g)-(h-n)*(p-g))*.5;t>_&&(_=t,v=n)}a.push(e[v]),s=v}return a.push(e[r-1]),a}function Zc(e){return Math.max(64,Math.ceil(e*1.5))}function Qc(e,t,n){let r=t[0].getTime(),i=t[1].getTime(),a=Math.min(r,i),o=Math.max(r,i);return e.filter(e=>{let t=n(e).getTime();return t>=a&&t<=o})}function $c(e={}){let t=e.dataKey??`value`,n=e.pointCount??7,r=e.baseDate??new Date(`2025-01-01`);return Array.from({length:n},(e,n)=>{let i=new Date(r);return i.setDate(r.getDate()+n),{date:i,[t]:Math.round(110+Math.sin(n*1.15)*36+n*9)}})}function el(e,t){return e.map((e,n)=>({...e,[t]:Math.round(95+Math.sin(n*1.05)*28+n*7)}))}function tl(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r)e.value<t&&(t=e.value),e.value>n&&(n=e.value);return t===1/0?null:{minValue:t,maxValue:n}}function nl(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r){let r=e.date.getTime();r<t&&(t=r),r>n&&(n=r)}return t===1/0?null:{minTime:t,maxTime:n}}function rl(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function il(e){return rl(e)===`ProjectionLine`}function al(e){return e?.length?e.map(e=>({date:e.date instanceof Date?e.date:new Date(e.date),value:e.value})):[]}function ol(e){let t=[],n=e=>{K.Children.forEach(e,e=>{if(!(0,K.isValidElement)(e))return;if(e.type===K.Fragment){n(e.props.children);return}if(il(e)){let n=e.props,r=al(n?.data);r.length>=2&&t.push({yAxisId:zo(n?.yAxisId),data:r});return}if(jc(e.type)){n(e.props.children);return}let r=e.props;r?.children&&n(r.children)})};return n(e),t}function sl(e,t,n){let r=tl(t.filter(e=>e.yAxisId===n).map(e=>e.data));if(!r)return e;let[i,a]=e,o=Math.min(i,r.minValue),s=Math.max(a,r.maxValue);if(o>=0&&i>=0)return[0,s<=0?100:s*1.1];let c=(s-o)*.05||1;return[o-c,s+c]}function cl(e,t){let n=nl(t.map(e=>e.data));return n?Math.max(e,n.maxTime):e}function ll(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function ul(e){return ll(e)===`ReferenceArea`}function dl(e){let t=[],n=e=>{K.Children.forEach(e,e=>{if(!(0,K.isValidElement)(e))return;if(ul(e)){let n=e.props;n&&t.push({yAxisId:zo(n.yAxisId),y1:n.y1,y2:n.y2,axisLabelColor:n.axisLabelColor});return}let r=e.props;r?.children&&n(r.children)})};return n(e),t}var fl=(0,K.createContext)(null),pl=(0,K.createContext)(!1);function ml(){return(0,K.useContext)(pl)}function hl(e){let t=No({domain:e,range:[0,1],nice:!0}).domain();return[t[0]??e[0],t[1]??e[1]]}function gl(e,t){let n=Math.max(Math.abs(t[1]-t[0]),Math.abs(e[1]-e[0]),1),r=Math.abs(t[0]-e[0])/n,i=Math.abs(t[1]-e[1])/n;return r>=.02||i>=.02}function _l(e){return e===`loading`||e===`revealingLoading`}function vl(e){return e===`loading`||e===`exiting`||e===`gridTweenLoading`}function yl(e){return e===`gridTweenLoading`||e===`gridTweenReady`}function bl(e,t,n){switch(e){case`loading`:case`exiting`:case`gridTweenLoading`:return t;case`exitingReady`:case`gridTweenReady`:case`revealing`:case`ready`:return n;default:return n}}function xl({lines:e,resolveDomain:t}){let n=Bo(e),r={};for(let[e,i]of n){let n=i.map(e=>e.dataKey);r[zo(e)]=hl(t(n))}return r.left||=hl([0,100]),r}function Sl(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!(n&&i)||n[0]!==i[0]||n[1]!==i[1])return!1}return!0}function Cl(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function wl(e,t,n){Sl(n.current,e)||(t(e),n.current=e)}function Tl({destination:e,durationMs:t,enabled:n,reducedMotion:r,animatedRef:i,setAnimatedByAxis:a,onSettled:o}){if(Sl(i.current,e)){o?.();return}if(!n||r){wl(e,a,i),o?.();return}let s=Object.keys(e),c=i.current,l=!1;for(let t of s){let n=c[t]??e[t]??[0,100];if(gl(n,e[t]??n)){l=!0;break}}if(!l){wl(e,a,i),o?.();return}let u={};for(let t of s)u[t]=c[t]??e[t]??[0,100];return me(0,1,{duration:t/1e3,ease:[...$o],onUpdate:t=>{let n={};for(let r of s){let i=u[r]??e[r]??[0,100],a=e[r]??i;n[r]=gl(i,a)?Cl(i,a,t):a}i.current=n,a(n)},onComplete:()=>{wl(e,a,i),o?.()}})}function El({enabled:e,durationMs:t,chartPhase:n,skeletonByAxis:r,targetByAxis:i,onSettled:a,tweenOnTargetChange:o=!1}){let s=fe(),c=bl(n,r,i),l=(0,K.useRef)(c);l.current=c;let u=(0,K.useRef)(r);u.current=r;let d=(0,K.useRef)(i);d.current=i;let[f,p]=(0,K.useState)(c),m=(0,K.useRef)(f),h=(0,K.useRef)(n),g=(0,K.useRef)(a);g.current=a,(0,K.useEffect)(()=>{m.current=f},[f]),(0,K.useEffect)(()=>{if(h.current===n)return;h.current=n;let r=()=>{g.current?.()};if(n===`exiting`){wl(u.current,p,m);return}if(n===`exitingReady`){wl(d.current,p,m);return}if(n===`loading`){wl(u.current,p,m);return}if(n===`revealing`||n===`ready`){wl(d.current,p,m);return}if(!yl(n))return;let i=Tl({destination:l.current,durationMs:t,enabled:e,reducedMotion:s,animatedRef:m,setAnimatedByAxis:p,onSettled:r});return()=>i?.stop()},[n,t,e,s]);let _=JSON.stringify(i),v=(0,K.useRef)(_);return(0,K.useEffect)(()=>{if(n!==`ready`&&n!==`revealing`){v.current=_;return}if(v.current!==_){if(v.current=_,o&&n===`ready`){let n=Tl({destination:d.current,durationMs:t,enabled:e,reducedMotion:s,animatedRef:m,setAnimatedByAxis:p,onSettled:()=>g.current?.()});return()=>n?.stop()}wl(d.current,p,m)}},[n,t,e,s,_,o]),f}var Dl=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function Ol(e){return!!e&&e instanceof Element}function kl(e){return!!e&&(e instanceof SVGElement||`ownerSVGElement`in e)}function Al(e){return!!e&&`createSVGPoint`in e}function jl(e){return!!e&&`getScreenCTM`in e}function Ml(e){return!!e&&`changedTouches`in e}function Nl(e){return!!e&&`clientX`in e}function Pl(e){return!!e&&(e instanceof Event||`nativeEvent`in e&&e.nativeEvent instanceof Event)}var Fl={x:0,y:0};function Il(e){if(!e)return{...Fl};if(Ml(e))return e.changedTouches.length>0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:{...Fl};if(Nl(e))return{x:e.clientX,y:e.clientY};let t=e?.target,n=t&&`getBoundingClientRect`in t?t.getBoundingClientRect():null;return n?{x:n.x+n.width/2,y:n.y+n.height/2}:{...Fl}}function Ll(e,t){if(!e||!t)return null;let n=Il(t),r=kl(e)?e.ownerSVGElement:e,i=jl(r)?r.getScreenCTM():null;if(Al(r)&&i){let e=r.createSVGPoint();return e.x=n.x,e.y=n.y,e=e.matrixTransform(i.inverse()),new Dl({x:e.x,y:e.y})}let a=e.getBoundingClientRect();return new Dl({x:n.x-a.left-e.clientLeft,y:n.y-a.top-e.clientTop})}function Rl(e,t){if(Ol(e)&&t)return Ll(e,t);if(Pl(e)){let t=e,n=t.target;if(n)return Ll(n,t)}return null}function zl(e){if(typeof e==`object`&&e&&`index`in e&&typeof e.index==`number`){let{index:t,x:n}=e;return typeof n==`number`?`${t}:${Math.round(n)}`:String(t)}return JSON.stringify(e)}function Bl(){let[e,t]=(0,K.useState)(null),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>{i.current!==null&&cancelAnimationFrame(i.current)},[]);let o=(0,K.useCallback)((e,r)=>{r!==n.current&&(n.current=r,t(e))},[]);return{tooltipData:e,setTooltipData:t,scheduleTooltip:(0,K.useCallback)((e,t)=>{let s=t??zl(e);r.current=e,a.current=s,s!==n.current&&i.current===null&&(i.current=requestAnimationFrame(()=>{i.current=null;let e=r.current,t=a.current;e&&t&&o(e,t)}))},[o]),clearTooltip:(0,K.useCallback)(()=>{i.current!==null&&(cancelAnimationFrame(i.current),i.current=null),r.current=null,a.current=null,n.current=null,t(null)},[]),resetTooltipDedupe:(0,K.useCallback)(()=>{n.current=null},[])}}function Vl({xScale:e,yScale:t,yScales:n,data:r,lines:i,margin:a,xAccessor:o,bisectDate:s,canInteract:c}){let[l,u]=(0,K.useState)(null),{tooltipData:d,setTooltipData:f,scheduleTooltip:p,clearTooltip:m,resetTooltipDedupe:h}=Bl(),g=(0,K.useRef)(!1),_=(0,K.useRef)(0),v=(0,K.useRef)(null),y=(0,K.useCallback)(a=>{let c=e.invert(a),l=s(r,c,1),u=r[l-1],d=r[l];if(!u)return null;let f=u,p=l-1;if(d){let e=o(u).getTime(),t=o(d).getTime();c.getTime()-e>t-c.getTime()&&(f=d,p=l)}let m={};for(let e of i){let r=f[e.dataKey];if(typeof r==`number`){let i=n[zo(e.yAxisId)]??t;m[e.dataKey]=i(r)??0}}return{point:f,index:p,x:e(o(f))??0,yPositions:m}},[e,t,n,r,i,o,s]),b=(0,K.useCallback)(t=>{let n=e.invert(t),i=s(r,n,1),a=r[i-1],c=r[i];if(!a)return 0;if(c){let e=o(a).getTime(),t=o(c).getTime();if(n.getTime()-e>t-n.getTime())return i}return i-1},[e,r,o,s]),x=(0,K.useCallback)((e,t=0)=>{let n=null;if(`touches`in e){let r=e.touches[t];if(!r)return null;let i=e.currentTarget.ownerSVGElement;if(!i)return null;n=Rl(i,r)}else n=Rl(e);return n?n.x-a.left:null},[a.left]),S=(0,K.useCallback)(e=>{let t=x(e);if(t===null)return;if(g.current){let e=Math.min(_.current,t),n=Math.max(_.current,t);u({startX:e,endX:n,startIndex:b(e),endIndex:b(n),active:!0});return}v.current=t;let n=y(t);n&&p(n)},[x,y,b,p]),C=(0,K.useCallback)(()=>{v.current=null,m(),g.current&&=!1,u(null)},[m]),w=(0,K.useCallback)(e=>{let t=x(e);t!==null&&(g.current=!0,_.current=t,m(),u(null))},[x,m]),T=(0,K.useCallback)(()=>{g.current&&=!1,u(null)},[]),E=(0,K.useCallback)(e=>{if(e.touches.length===1){e.preventDefault();let t=x(e,0);if(t===null)return;v.current=t;let n=y(t);n&&p(n)}else if(e.touches.length===2){e.preventDefault(),h(),m();let t=x(e,0),n=x(e,1);if(t===null||n===null)return;let r=Math.min(t,n),i=Math.max(t,n);u({startX:r,endX:i,startIndex:b(r),endIndex:b(i),active:!0})}},[x,y,b,p,h,m]),D=(0,K.useCallback)(e=>{if(e.touches.length===1){e.preventDefault();let t=x(e,0);if(t===null)return;v.current=t;let n=y(t);n&&p(n)}else if(e.touches.length===2){e.preventDefault();let t=x(e,0),n=x(e,1);if(t===null||n===null)return;let r=Math.min(t,n),i=Math.max(t,n);u({startX:r,endX:i,startIndex:b(r),endIndex:b(i),active:!0})}},[x,y,b,p]),O=(0,K.useCallback)(()=>{m(),u(null)},[m]),k=(0,K.useCallback)(()=>{u(null)},[]);return(0,K.useEffect)(()=>{if(!c||v.current===null)return;let e=y(v.current);if(e){p(e,`${e.index}:${Math.round(e.x)}`);return}m()},[c,m,y,p]),{tooltipData:d,setTooltipData:f,selection:l,clearSelection:k,interactionHandlers:c?{onMouseMove:S,onMouseLeave:C,onMouseDown:w,onMouseUp:T,onTouchStart:E,onTouchMove:D,onTouchEnd:O}:{},interactionStyle:{cursor:c?`crosshair`:`default`,touchAction:`none`}}}function Hl({chartStatus:e,targetData:t,skeletonData:n,animationDuration:r,yDomainTweenDuration:i,revealSignature:a=``,skipEnterReveal:o=!1}){let[s,c]=(0,K.useState)(()=>qc(e)),[l,u]=(0,K.useState)(()=>e===`loading`?n:t),[d,f]=(0,K.useState)(0),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(()=>e===`ready`),_=(0,K.useRef)(e),v=(0,K.useRef)(s);v.current=s,(0,K.useEffect)(()=>{let a=_.current;if(a!==e){if(_.current=e,e===`ready`&&a===`loading`){g(!1),r<=0?i<=0?(u(t),c(`revealing`)):c(`gridTweenReady`):c(`exiting`);return}e===`loading`&&a===`ready`&&(g(!1),r<=0?i<=0?(u(n),c(`loading`)):c(`gridTweenLoading`):(m(e=>e+1),c(`exitingReady`)))}},[r,e,n,t,i]),(0,K.useEffect)(()=>{o||e===`ready`&&v.current===`ready`&&(c(`revealing`),g(!1))},[r,e,a,o]),(0,K.useEffect)(()=>{switch(s){case`loading`:e===`loading`&&u(n);break;case`exiting`:u(n);break;case`exitingReady`:case`gridTweenLoading`:case`gridTweenReady`:case`revealing`:case`ready`:u(t)}},[s,e,n,t]);let y=(0,K.useCallback)(()=>{v.current===`exiting`&&c(`gridTweenReady`)},[]),b=(0,K.useCallback)(()=>{v.current===`exitingReady`&&c(`gridTweenLoading`)},[]),x=(0,K.useCallback)(()=>{if(v.current===`gridTweenLoading`){c(`loading`);return}v.current===`gridTweenReady`&&c(`revealing`)},[]);return(0,K.useEffect)(()=>{if(s!==`revealing`)return;if(f(e=>e+1),r<=0){c(`ready`),g(!0);return}let e=window.setTimeout(()=>{c(`ready`),g(!0)},r);return()=>window.clearTimeout(e)},[r,s]),{chartPhase:s,plotData:l,revealEpoch:d,concealEpoch:p,isLoaded:h,notifyLoadingPulseComplete:y,notifyRevealConcealComplete:b,notifyYDomainTweenComplete:x}}function Ul(e,t){let n=1/0,r=-1/0;for(let i of e)for(let e of t){let t=i[e];typeof t==`number`&&(t<n&&(n=t),t>r&&(r=t))}return n===1/0?{minValue:0,maxValue:100}:{minValue:n,maxValue:r}}function Wl(e,t,n){if(n!=null&&n>0)return[0,n*1.1];let{minValue:r,maxValue:i}=Ul(e,t);if(r>=0)return[0,i<=0?100:i*1.1];let a=(i-r)*.05||1;return[r-a,i+a]}function Gl(e,t){return e.key==null?(0,K.cloneElement)(e,{key:`chart-child-${t}`}):e}function Kl(e){let{width:t,height:n}=e;return t<10||n<10?null:(0,q.jsx)(ql,{...e})}var ql=(0,K.memo)(function({width:e,height:t,data:n,xDataKey:r,margin:i,animationDuration:a,animationEasing:o=zs,enterTransition:s,revealSignature:c=``,children:l,containerRef:u,lines:d,clipPathId:f,composedBarDataKeys:p,composedBarSize:m,composedMaxBarSize:h,composedBarGap:g,composedStacked:_,composedStackOffsets:v,composedStackGap:y,yScaleDomainMax:b,chartStatus:x=Kc,loadingLabel:S,yDomainTween:C=!0,yDomainTweenDuration:w=500,xDomain:T,xDomainSlotCount:E,tweenYDomainOnXDomainChange:D=!1,onPhaseChange:O}){let k=ml(),A=e-i.left-i.right,j=t-i.top-i.bottom,M=(0,K.useCallback)((e,t)=>{let n=Bo(d);return Wl(e,t,n.size===1&&n.has(`left`)&&b!=null?b:void 0)},[d,b]),N=(0,K.useMemo)(()=>{let e=d[0]?.dataKey??`value`;return n.length===0?$c({dataKey:e}):el(n,e)},[n,d]),{chartPhase:P,plotData:F,revealEpoch:I,concealEpoch:L,isLoaded:R,notifyLoadingPulseComplete:z,notifyRevealConcealComplete:B,notifyYDomainTweenComplete:ee}=Hl({animationDuration:a,chartStatus:x,revealSignature:c,skeletonData:N,skipEnterReveal:k,targetData:n,yDomainTweenDuration:w});(0,K.useEffect)(()=>{O?.(P)},[P,O]);let V=(0,K.useCallback)(e=>{let t=e[r];return t instanceof Date?t:new Date(t)},[r]),H=(0,K.useMemo)(()=>qn(e=>V(e)).left,[V]),U=(0,K.useMemo)(()=>T?Qc(F,T,V):F,[F,T,V]),te=(0,K.useMemo)(()=>ol(l),[l]),ne=(0,K.useMemo)(()=>{let e=T?T[0].getTime():Qn(F,e=>V(e).getTime())[0]??0,t=T?T[1].getTime():Qn(F,e=>V(e).getTime())[1]??e;return T||(t=cl(t,te)),Fo({range:[0,A],domain:[e,t]})},[A,F,te,V,T]),re=T?F:U,ie=(0,K.useMemo)(()=>{let e=d.map(e=>e.dataKey);return Xc(re,Zc(A),e)},[re,A,d]),ae=(0,K.useMemo)(()=>{let e=T&&E!=null?E:U.length;return e<2?0:A/(e-1)},[A,U.length,T,E]),oe=(0,K.useMemo)(()=>xl({lines:d,resolveDomain:e=>M(N,e)}),[d,M,N]),se=(0,K.useMemo)(()=>{let e=xl({lines:d,resolveDomain:e=>M(T?U:n,e)});if(te.length===0)return e;let t={...e};for(let n of Object.keys(e))t[n]=sl(e[n]??[0,100],te,n);for(let e of te)t[e.yAxisId]||(t[e.yAxisId]=sl([0,100],te,e.yAxisId));return t},[n,d,te,M,U,T]),W=El({chartPhase:P,durationMs:w,enabled:C,onSettled:ee,skeletonByAxis:oe,targetByAxis:se,tweenOnTargetChange:C||D&&T!=null}),ce=(0,K.useMemo)(()=>Ho({domainsByAxis:W,innerHeight:j,lines:d}),[W,j,d]),le=Vo(ce,No({range:[j,0],domain:[0,100],nice:!0})),ue=(0,K.useMemo)(()=>{let e=U.map(e=>V(e)),t=e[0],n=e.at(-1),r=(t&&n?n.getTime()-t.getTime():0)<1296e5?Wc:Hc;return e.map(e=>r.format(e))},[U,V]),{tooltipData:de,setTooltipData:fe,selection:G,clearSelection:pe,interactionHandlers:me,interactionStyle:he}=Vl({bisectDate:H,canInteract:R&&Jc(P),data:U,lines:d,margin:i,xAccessor:V,xScale:ne,yScale:le,yScales:ce}),ge=[],_e=[],ve=[],ye=[],be=[];K.Children.forEach(l,(e,t)=>{if(!(0,K.isValidElement)(e))return;let n=Mc(Gl(e,t));Vc(n)?ge.push(n):Bc(n)?ye.push(n):Fc(n)?be.push(n):Lc(n)?_e.push(n):Ic(n)?ve.push(n):ye.push(n)});let[xe,Se]=(0,K.useState)(()=>new Map),Ce=(0,K.useCallback)((e,t)=>{Se(n=>{let r=n.get(e);if(r&&r.yAxisId===t.yAxisId&&r.y1===t.y1&&r.y2===t.y2&&r.axisLabelColor===t.axisLabelColor)return n;let i=new Map(n);return i.set(e,t),i})},[]),we=(0,K.useCallback)(e=>{Se(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),Te=(0,K.useMemo)(()=>({registerReferenceArea:Ce,unregisterReferenceArea:we}),[Ce,we]),Ee=(0,K.useMemo)(()=>{let e=dl(l),t=[...xe.values()];return t.length===0?e:e.length===0?t:[...e,...t]},[l,xe]),De=(0,K.useMemo)(()=>({data:U,renderData:ie,xScale:ne,yScale:le,yScales:ce,width:e,height:t,innerWidth:A,innerHeight:j,margin:i,columnWidth:ae,tooltipData:de,setTooltipData:fe,containerRef:u,lines:d,referenceAreas:Ee,chartPhase:P,chartStatus:x,loadingLabel:S,yDomainTweenDuration:w,yDomainSkeletonByAxis:oe,yDomainTargetByAxis:se,isLoaded:R,animationDuration:a,animationEasing:o,enterTransition:s,revealEpoch:I,notifyLoadingPulseComplete:z,xAccessor:V,dateLabels:ue,xDomain:T,xDomainSlotCount:E,selection:G,clearSelection:pe,composedBarDataKeys:p,composedBarSize:m,composedMaxBarSize:h,composedBarGap:g,composedStacked:_,composedStackOffsets:v,composedStackGap:y}),[U,ie,ne,le,ce,e,t,A,j,i,ae,de,fe,u,d,Ee,P,x,S,w,oe,se,R,a,o,s,I,z,V,ue,T,E,G,pe,p,m,h,g,_,v,y]),Oe=!k&&ie.length>1&&A>0&&a>0,ke=P===`revealing`,Ae=P===`exitingReady`&&a>0,je=s??{...Vs,duration:a/1e3},Me=(0,K.useMemo)(()=>p?.length?Dc({barWidth:Ec({columnWidth:ae,composedBarGap:g,composedBarSize:m,composedMaxBarSize:h,dataLength:F.length,innerWidth:A,seriesCount:p.length,stacked:_}),gap:g,seriesCount:p.length,stacked:_}):0,[ae,p,g,m,h,_,A,F.length]);return(0,q.jsx)(fl.Provider,{value:Te,children:(0,q.jsx)(Ko,{value:De,children:(0,q.jsxs)(`svg`,{"aria-hidden":`true`,height:t,width:e,children:[(0,q.jsxs)(`defs`,{children:[ge,Oe?(0,q.jsx)(Yc,{animating:ke||Ae,clipPathId:f,enterTransition:je,height:j+20,mode:Ae?`conceal`:`reveal`,onComplete:Ae?B:void 0,padding:Me,revealEpoch:Ae?L:I,targetWidth:A}):null]}),(0,q.jsx)(`rect`,{fill:`transparent`,height:t,width:e,x:0,y:0}),(0,q.jsxs)(`g`,{...me,style:he,transform:`translate(${i.left},${i.top})`,children:[(0,q.jsx)(`rect`,{fill:`transparent`,height:j,width:A,x:0,y:0}),_e,ve,Oe?(0,q.jsx)(`g`,{clipPath:`url(#${f})`,children:ye}):ye,be]})]})})})}),Jl={top:40,right:40,bottom:40,left:40};function Yl(e){let t=e.type;return typeof e.type==`function`&&(t.displayName||t.name)||``}function Xl(e,t){let n=e.findIndex(e=>e.dataKey===t.dataKey);if(n===-1){e.push(t);return}e[n]=t}function Zl(e,t,n){let r=Yl(e);if(e.type!==kc&&r!==`SeriesBar`)return!1;let i=e.props;return!i.dataKey||(n.push(i.dataKey),Xl(t,{dataKey:i.dataKey,stroke:i.stroke||i.fill||`var(--chart-line-primary)`,strokeWidth:0}),!0)}function Ql(e,t){let n=Yl(e);if(e.type!==wc&&n!==`Line`)return!1;let r=e.props;return r.dataKey&&Xl(t,{dataKey:r.dataKey,stroke:r.stroke||`var(--chart-line-primary)`,strokeWidth:r.strokeWidth??2.5,yAxisId:r.yAxisId}),!0}function $l(e,t){let n=Yl(e);if(e.type!==Zs&&n!==`Area`)return!1;let r=e.props;return r.dataKey&&Xl(t,{dataKey:r.dataKey,stroke:r.stroke||r.fill||`var(--chart-line-primary)`,strokeWidth:r.strokeWidth??2,yAxisId:r.yAxisId}),!0}function eu(e){let t=[],n=[];return K.Children.forEach(e,e=>{(0,K.isValidElement)(e)&&(Zl(e,t,n)||Ql(e,t)||$l(e,t))}),{lines:t,barDataKeys:n}}function tu(e,t,n){let r=new Set(n),i=0;for(let a of e){let e=0;for(let t of n){let n=a[t];typeof n==`number`&&(e+=n)}let o=0;for(let e of t){if(r.has(e.dataKey))continue;let t=a[e.dataKey];typeof t==`number`&&(o=Math.max(o,t))}i=Math.max(i,e,o)}return i>0?i:void 0}function nu({width:e,height:t,data:n,xDataKey:r,margin:i,animationDuration:a,animationEasing:o,enterTransition:s,revealSignature:c,children:l,containerRef:u,barSize:d,maxBarSize:f,barGap:p,stacked:m=!1,stackGap:h=0,onPhaseChange:g}){let{lines:_,barDataKeys:v}=(0,K.useMemo)(()=>eu(l),[l]),y=(0,K.useMemo)(()=>{if(!(m&&v.length>0))return;let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];if(!r)continue;let i=new Map,a=0;for(let e of v){i.set(e,a);let t=r[e];typeof t==`number`&&(a+=t)}e.set(t,i)}return e},[n,v,m]),b=(0,K.useMemo)(()=>m&&v.length>0?tu(n,_,v):void 0,[n,_,v,m]);return(0,q.jsx)(Kl,{animationDuration:a,animationEasing:o,clipPathId:`composed-chart-grow-clip`,composedBarDataKeys:v.length>0?v:void 0,composedBarGap:p,composedBarSize:d,composedMaxBarSize:f,composedStacked:m,composedStackGap:h,composedStackOffsets:y,containerRef:u,data:n,enterTransition:s,height:t,lines:_,margin:i,onPhaseChange:g,revealSignature:c,width:e,xDataKey:r,yScaleDomainMax:b,children:l})}function ru({data:e,xDataKey:t=`date`,margin:n,animationDuration:r=1100,animationEasing:a,enterTransition:o,revealSignature:s,aspectRatio:c=`2 / 1`,className:l=``,children:u,barSize:d,maxBarSize:f,barGap:p=4,stacked:m=!1,stackGap:h=0,onPhaseChange:g}){let _=(0,K.useRef)(null),v={...Jl,...n};return(0,q.jsx)(`div`,{className:i(`relative w-full`,l),ref:_,style:{aspectRatio:c,touchAction:`none`},children:(0,q.jsx)(gc,{debounceTime:10,children:({width:n,height:i})=>(0,q.jsx)(nu,{animationDuration:r,animationEasing:a,barGap:p,barSize:d,containerRef:_,data:e,enterTransition:o,height:i,margin:v,maxBarSize:f,onPhaseChange:g,revealSignature:s,stacked:m,stackGap:h,width:n,xDataKey:t,children:u})})})}ru.displayName=`ComposedChart`;function iu(e){return`bandwidth`in e?e.bandwidth():0}function au(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??Lo(r,u),g=(f??0)+iu(r)/2,_=h.map((e,t)=>{let n=(Io(r(e))??0)+g;return{index:t,from:new Dl({x:0,y:n}),to:new Dl({x:i,y:n})}});return(0,q.jsx)(Ln,{className:(0,In.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,q.jsx)(Rn,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function ou(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??Lo(r,l),g=(d??0)+iu(r)/2,_=h.map((e,t)=>{let n=(Io(r(e))??0)+g;return{index:t,from:new Dl({x:n,y:0}),to:new Dl({x:n,y:i})}});return(0,q.jsx)(Ln,{className:(0,In.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,q.jsx)(Rn,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function su({innerWidth:e,shimmer:t,shimmerLength:n,shimmerSpeed:r,shimmerSync:i,active:a,oneShot:o=!1}){let s=_e(0),c=fe(),l=Zo/Math.max(r,.1),u=a&&t&&c!==!0&&e>0;(0,K.useEffect)(()=>{if(!u)return;let e=!1,t,n,r=()=>{e||(s.set(0),n=me(s,1,{duration:l,ease:[...$o],onComplete:()=>{e||(t=window.setTimeout(r,280))}}))};return i&&o?(s.set(0),n=me(s,1,{duration:l/2,ease:[...$o]}),()=>n?.stop()):i?(r(),()=>{e=!0,n?.stop(),t!==void 0&&window.clearTimeout(t)}):(s.set(0),n=me(s,1,{duration:l,repeat:1/0,ease:[...$o]}),()=>n?.stop())},[o,s,l,u,i]);let d=ve(s,t=>-n+t*(e+n*2));return{shimmerEnabled:u,shimmerTransform:ve(d,e=>`translate(${e}, 0)`)}}var cu=140,lu=1,uu=`color-mix(in oklch, var(--foreground) 68%, transparent)`;function du(e,t){return!t||e.length<=2?e:e.slice(1,-1)}function fu(e){let{hideHorizontalEdgeLines:t,numTicksRows:n,rowTickValues:r,yScale:i}=e,a=r??(i.ticks?i.ticks(n):[]),o=du(a,t);if(!(o===a&&!r&&!t))return o.length>0?o:void 0}function pu({horizontal:e=!0,vertical:t=!1,numTicksRows:n=5,numTicksColumns:r=10,rowTickValues:i,stroke:a=Q.grid,loadingStroke:o,strokeOpacity:s=1,strokeWidth:c=1,strokeDasharray:l=`4,4`,highlightRowValues:u,highlightRowStroke:d=Q.foregroundMuted,highlightRowStrokeOpacity:f=1,highlightRowStrokeWidth:p=1,highlightRowStrokeDasharray:m=`0`,fadeHorizontal:h=!0,fadeVertical:g=!1,hideHorizontalEdgeLines:_=!1,hideVerticalEdgeLines:v=!1,yAxisId:y,shimmer:b=!1,shimmerStroke:x=uu,shimmerLength:S=cu,shimmerSpeed:C=lu,shimmerSync:w=!1}){let{xScale:T,innerWidth:E,innerHeight:D,orientation:O,barScale:k,chartPhase:A}=qo(),j=Jo(y),M=b&&_l(A),N=vl(A)&&o!=null?o:a,{shimmerEnabled:P,shimmerTransform:F}=su({innerWidth:E,shimmer:b,shimmerLength:S,shimmerSpeed:C,shimmerSync:w,active:M}),I=O===`horizontal`&&k?j:T,L=fu({hideHorizontalEdgeLines:_,numTicksRows:n,rowTickValues:i,yScale:j}),R=t&&I&&typeof I==`function`&&v?(()=>{let e=du(I.ticks?.(r)??[],!0);return e.length>0?e:void 0})():void 0,z=(0,K.useId)(),B=`grid-rows-fade-${z}`,ee=`${B}-gradient`,V=`grid-shimmer-${z}`,H=`grid-cols-fade-${z}`,U=`${H}-gradient`,te=h?`url(#${B})`:void 0;return(0,q.jsxs)(`g`,{className:`chart-grid`,children:[e&&h&&(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:ee,x1:`0%`,x2:`100%`,y1:`0%`,y2:`0%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:`white`,stopOpacity:0}}),(0,q.jsx)(`stop`,{offset:`10%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`90%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:`white`,stopOpacity:0}})]}),(0,q.jsx)(`mask`,{id:B,children:(0,q.jsx)(`rect`,{fill:`url(#${ee})`,height:D,width:E,x:`0`,y:`0`})})]}),e&&P?(0,q.jsx)(`defs`,{children:(0,q.jsxs)(G.linearGradient,{gradientTransform:F,gradientUnits:`userSpaceOnUse`,id:V,x1:0,x2:S,y1:0,y2:0,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:x,stopOpacity:0}),(0,q.jsx)(`stop`,{offset:`35%`,stopColor:x,stopOpacity:.45}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:x,stopOpacity:1}),(0,q.jsx)(`stop`,{offset:`65%`,stopColor:x,stopOpacity:.45}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:x,stopOpacity:0})]})}):null,t&&g&&(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:U,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,style:{stopColor:`white`,stopOpacity:0}}),(0,q.jsx)(`stop`,{offset:`10%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`90%`,style:{stopColor:`white`,stopOpacity:1}}),(0,q.jsx)(`stop`,{offset:`100%`,style:{stopColor:`white`,stopOpacity:0}})]}),(0,q.jsx)(`mask`,{id:H,children:(0,q.jsx)(`rect`,{fill:`url(#${U})`,height:D,width:E,x:`0`,y:`0`})})]}),e&&(0,q.jsxs)(`g`,{mask:te,children:[(0,q.jsx)(au,{numTicks:L?void 0:n,scale:j,stroke:N,strokeDasharray:l,strokeOpacity:s,strokeWidth:c,tickValues:L,width:E}),P?(0,q.jsx)(au,{numTicks:L?void 0:n,scale:j,stroke:`url(#${V})`,strokeDasharray:l,strokeOpacity:1,strokeWidth:c,tickValues:L,width:E}):null]}),e&&u&&u.length>0?(0,q.jsx)(`g`,{className:`chart-grid-highlight-rows`,children:u.map(e=>{let t=j(e);return t==null||!Number.isFinite(t)?null:(0,q.jsx)(`line`,{stroke:d,strokeDasharray:m,strokeOpacity:f,strokeWidth:p,x1:0,x2:E,y1:t,y2:t},e)})}):null,t&&I&&typeof I==`function`&&(0,q.jsx)(`g`,{mask:g?`url(#${H})`:void 0,children:(0,q.jsx)(ou,{height:D,numTicks:R?void 0:r,scale:I,stroke:a,strokeDasharray:l,strokeOpacity:s,strokeWidth:c,tickValues:R})})]})}pu.displayName=`Grid`;var mu=e(L(),1),hu=24,gu=60,_u=(0,K.memo)(function({currentIndex:e,labels:t}){let n=t[e]??t[0]??``;return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-full bg-zinc-900 px-4 py-1 text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:(0,q.jsx)(`div`,{className:`flex h-6 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:n})})})}),vu=(0,K.memo)(function({currentIndex:e,labels:t}){let n=(0,K.useMemo)(()=>t.map((e,t)=>{let n=e.split(` `);return{month:n[0]||``,day:n[1]||``,full:e,key:`${e}::${t}`}}),[t]),r=(0,K.useMemo)(()=>{let e=[];return n.forEach((t,n)=>{let r=e.at(-1);(!r||r.month!==t.month)&&e.push({month:t.month,key:`${t.month}-${n}`,startIndex:n})}),e},[n]),i=(0,K.useMemo)(()=>{if(e<0||e>=n.length)return 0;for(let t=r.length-1;t>=0;t--){let n=r[t];if(n&&n.startIndex<=e)return t}return 0},[e,n.length,r]),a=(0,K.useRef)(-1),o=Qe(0,{stiffness:400,damping:35}),s=Qe(0,{stiffness:400,damping:35});if(o.set(-e*hu),i>=0){let e=a.current===-1,t=a.current!==i;(e||t)&&(s.set(-i*hu),a.current=i)}return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-full bg-zinc-900 px-4 py-1 text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsxs)(`div`,{className:`flex items-center justify-center gap-1`,children:[(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsx)(G.div,{className:`flex flex-col`,style:{y:s},children:r.map(e=>(0,q.jsx)(`div`,{className:`flex h-6 shrink-0 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:e.month})},e.key))})}),(0,q.jsx)(`div`,{className:`relative h-6 overflow-hidden`,children:(0,q.jsx)(G.div,{className:`flex flex-col`,style:{y:o},children:n.map(e=>(0,q.jsx)(`div`,{className:`flex h-6 shrink-0 items-center justify-center`,children:(0,q.jsx)(`span`,{className:`whitespace-nowrap font-medium text-sm`,children:e.day})},e.key))})})]})})})});function yu({currentIndex:e,labels:t,visible:n}){return!n||t.length===0?null:t.length>gu?(0,q.jsx)(_u,{currentIndex:e,labels:t}):(0,q.jsx)(vu,{currentIndex:e,labels:t})}yu.displayName=`DateTicker`;function bu(e){let[t,n]=(0,K.useState)(!1);(0,K.useEffect)(()=>{n(!0)},[]);let r=e.containerRef.current;return!(t&&r)||!e.visible?null:(0,q.jsx)(xu,{...e,container:r})}function xu({x:e,y:t,containerWidth:n,containerHeight:r,offset:a=16,className:o=``,children:s,left:c,top:l,flipped:u,springConfig:d,animate:f=!0,entrance:p=!0,panelStyle:m,backgroundColor:h=Q.tooltipBackground,container:g}){let{tooltipBoxSpring:_}=ks(),v=d??_,y=(0,K.useRef)(null),b=(0,K.useRef)(180),x=(0,K.useRef)(80),[S,C]=(0,K.useState)({left:e,top:t}),w=b.current,T=x.current,E=e+w+a>n,D=E?e-a-w:e+a,O=Math.max(a,Math.min(t-T/2,r-T-a)),k=Qe(D,v),A=Qe(O,v);f&&c===void 0&&k.set(D),f&&l===void 0&&A.set(O),(0,K.useLayoutEffect)(()=>{if(!y.current)return;let i=y.current,o=i.offsetWidth,s=i.offsetHeight;o>0&&(b.current=o),s>0&&(x.current=s);let u=b.current,d=x.current,p=e+u+a>n?e-a-u:e+a,m=Math.max(a,Math.min(t-d/2,r-d-a));if(!f){C({left:p,top:m});return}c===void 0&&k.set(p),l===void 0&&A.set(m)},[e,t,n,r,a,c,l,f,k,A]);let j=(0,K.useRef)(E),[M,N]=(0,K.useState)(0);(0,K.useEffect)(()=>{j.current!==E&&(N(e=>e+1),j.current=E)},[E]);let P=f?c??k:S.left,F=f?l??A:S.top,I=u??E,L=I?`right top`:`left top`,R=i(`min-w-[140px] overflow-hidden rounded-lg text-chart-tooltip-foreground shadow-lg`,m?.backgroundColor===void 0&&h===Q.tooltipBackground&&`bg-chart-tooltip-background`,m?.backdropFilter===void 0&&`backdrop-blur-md`),z={transformOrigin:L,...m?.backgroundColor===void 0&&{backgroundColor:h},...m};return p?(0,mu.createPortal)((0,q.jsx)(G.div,{animate:{opacity:1},className:i(`pointer-events-none absolute z-50`,o),exit:{opacity:0},initial:{opacity:0},ref:y,style:{left:P,top:F},transition:{duration:.1},children:(0,q.jsx)(G.div,{animate:{scale:1,opacity:1,x:0},className:R,initial:{scale:.85,opacity:0,x:I?20:-20},style:z,transition:{type:`spring`,stiffness:300,damping:25},children:s},M)}),g):(0,mu.createPortal)((0,q.jsx)(`div`,{className:i(`pointer-events-none absolute z-50`,o),ref:y,style:{left:S.left,top:S.top},children:(0,q.jsx)(`div`,{className:R,style:z,children:s})}),g)}bu.displayName=`TooltipBox`;function Su({title:e,rows:t,children:n}){return(0,q.jsx)(`div`,{className:`overflow-hidden`,children:(0,q.jsxs)(`div`,{className:`px-3 py-2.5`,children:[e&&(0,q.jsx)(`div`,{className:`mb-2 text-left font-medium text-chart-tooltip-foreground text-xs`,children:e}),(0,q.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,q.jsx)(`span`,{className:`text-chart-tooltip-muted text-sm`,children:e.label})]}),(0,q.jsx)(`span`,{className:`font-medium text-chart-tooltip-foreground text-sm tabular-nums`,children:typeof e.value==`number`?Gc(e.value):e.value})]},`${e.label}-${e.color}`))}),n&&(0,q.jsx)(`div`,{className:`mt-2 transition-opacity duration-200 ease-out`,children:n})]})})}Su.displayName=`TooltipContent`;function Cu(e,t){return e*2*Math.max(0,Math.min(.5,t))}function wu({x:e,y:t,halfExtent:n,cornerRadiusFraction:r,fill:i,stroke:a,strokeWidth:o,springConfig:s}){let{tooltipSpring:c}=ks(),l=s??c,u=Qe(e,l),d=Qe(t,l),f=n*2,p=Cu(n,r),m=ve(u,e=>e-n),h=ve(d,e=>e-n);return u.set(e),d.set(t),(0,q.jsx)(G.rect,{fill:i,height:f,rx:p,ry:p,stroke:a,strokeWidth:o,width:f,x:m,y:h})}function Tu({x:e,y:t,visible:n,color:r,size:i=5,strokeColor:a=Q.background,strokeWidth:o=2,variant:s=`dot`,cornerRadiusFraction:c=.25,springConfig:l,animate:u=!0}){let{tooltipSpring:d}=ks(),f=l??d,p=Qe(e,f),m=Qe(t,f),h=s===`ring`,g=h?`transparent`:r,_=h?r:a,v=h?o??1.5:o;if(u&&!h&&(p.set(e),m.set(t)),!n)return null;if(h){if(u)return(0,q.jsx)(wu,{cornerRadiusFraction:c,fill:g,halfExtent:i,springConfig:l,stroke:_,strokeWidth:v,x:e,y:t});let n=i*2,r=Cu(i,c);return(0,q.jsx)(`rect`,{fill:g,height:n,rx:r,ry:r,stroke:_,strokeWidth:v,width:n,x:e-i,y:t-i})}return u?(0,q.jsx)(G.circle,{cx:p,cy:m,fill:g,r:i,stroke:_,strokeWidth:v}):(0,q.jsx)(`circle`,{cx:e,cy:t,fill:g,r:i,stroke:_,strokeWidth:v})}Tu.displayName=`TooltipDot`;function Eu(e){return e===!1||e===`none`?{top:!1,bottom:!1,any:!1}:e===!0||e===`both`?{top:!0,bottom:!0,any:!0}:e===`top`?{top:!0,bottom:!1,any:!0}:{top:!1,bottom:!0,any:!0}}function Du(e,t=10){let n=Math.min(40,Math.max(2,t)),r=100-n;return e.any?e.top&&e.bottom?[{offset:`0%`,opacity:0},{offset:`${n}%`,opacity:1},{offset:`50%`,opacity:1},{offset:`${r}%`,opacity:1},{offset:`100%`,opacity:0}]:e.top?[{offset:`0%`,opacity:0},{offset:`${n}%`,opacity:1},{offset:`100%`,opacity:1}]:[{offset:`0%`,opacity:1},{offset:`${r}%`,opacity:1},{offset:`100%`,opacity:0}]:[{offset:`0%`,opacity:1}]}function Ou(e){if(typeof e==`number`)return e;switch(e){case`line`:return 1;case`thin`:return 2;case`medium`:return 4;case`thick`:return 8;default:return 1}}function ku(e){return e.visible?(0,q.jsx)(Au,{...e}):null}function Au({x:e,visible:t,height:n,width:r=`line`,span:i,columnWidth:a,colorEdge:o=Q.crosshair,colorMid:s=Q.crosshair,fadeEdges:c=`both`,fadeLength:l=10,animate:u=!0,gradientId:d=`tooltip-indicator-gradient`,springConfig:f,strokeDasharray:p}){let{tooltipSpring:m}=ks(),h=f??m,g=i!==void 0&&a!==void 0?i*a:Ou(r),_=e-g/2,v=e,y=Qe(_,h),b=Qe(v,h);u&&(y.set(_),b.set(v)),(0,K.useEffect)(()=>{y.set(_),b.set(v)},[b,y,v,_,t]);let x=s||o,S=Eu(c);if(p){let e=Math.max(1,g);return u?(0,q.jsx)(G.line,{stroke:x,strokeDasharray:p,strokeWidth:e,x1:b,x2:b,y1:0,y2:n}):(0,q.jsx)(`line`,{stroke:x,strokeDasharray:p,strokeWidth:e,x1:v,x2:v,y1:0,y2:n})}if(!S.any)return u?(0,q.jsx)(G.rect,{fill:x,height:n,width:g,x:y,y:0}):(0,q.jsx)(`rect`,{fill:x,height:n,width:g,x:_,y:0});let C=Du(S,l);return(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`defs`,{children:(0,q.jsx)(`linearGradient`,{id:d,x1:`0%`,x2:`0%`,y1:`0%`,y2:`100%`,children:C.map(e=>(0,q.jsx)(`stop`,{offset:e.offset,style:{stopColor:x,stopOpacity:e.opacity}},e.offset))})}),u?(0,q.jsx)(G.rect,{fill:`url(#${d})`,height:n,width:g,x:y,y:0}):(0,q.jsx)(`rect`,{fill:`url(#${d})`,height:n,width:g,x:_,y:0})]})}ku.displayName=`TooltipIndicator`;var ju=(0,K.memo)(function({showDatePill:e=!0,showCrosshair:t=!0,showDots:n=!0,dotVariant:r=`dot`,dotSize:i=5,dotRadiusFraction:a,dotScale:o=1,dotStrokeWidth:s,indicatorColor:c,content:l,rows:u,dotColor:d,children:f,className:p=``,container:m,springConfig:h,matchCrosshair:g=!1,damping:_,indicatorDasharray:v,indicatorFadeEdges:y,indicatorFadeLength:b,boxSpringConfig:x,panelStyle:S,backgroundColor:C}){let{tooltipData:w,width:T,height:E,innerHeight:D,margin:O,columnWidth:k,lines:A,xAccessor:j,dateLabels:M,containerRef:N,orientation:P,barXAccessor:F,bandWidth:I,squareSnap:L}=Xo(),{tooltipSpring:R}=ks(),z=P===`horizontal`,B=M.length>60,ee=(0,K.useMemo)(()=>{if(r!==`ring`||!I||A.length===0)return i*o;let e=A.length,t=L?.groupGap??(e>1?4:0);return(I-t*(e-1))/e/2*o},[I,o,i,r,A.length,L?.groupGap]),V=(0,K.useMemo)(()=>x?{animate:!B,springConfig:x}:g?{animate:!B,springConfig:h??R}:js(_),[x,_,B,g,h,R]),H=w!==null,U=w?.x??0,te=U+O.left,ne=A[0]?.dataKey,re=(ne?w?.yPositions[ne]??0:0)+O.top,ie=(0,K.useMemo)(()=>w?u?u(w.point):A.map(e=>({color:e.stroke,label:e.dataKey,value:w.point[e.dataKey]??0})):[],[w,A,u]),ae=(0,K.useMemo)(()=>(e,t)=>{if(u&&ie[t]?.color)return ie[t].color;if(d!=null){if(typeof d==`function`&&w)return d(w.point,e);if(typeof d==`string`)return d}return e.stroke},[d,u,w,ie]),oe=(0,K.useMemo)(()=>c==null?Q.crosshair:typeof c==`function`?w?c(w.point):Q.crosshair:c,[c,w]),se=(0,K.useMemo)(()=>{if(w)return F?F(w.point):Uc.format(j(w.point))},[w,F,j]),W=(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,height:`100%`,width:`100%`,children:(0,q.jsx)(`g`,{transform:`translate(${O.left},${O.top})`,children:(0,q.jsx)(ku,{animate:!B,colorEdge:oe,colorMid:oe,columnWidth:k,fadeEdges:v?`none`:y??`both`,fadeLength:b,height:D,springConfig:h,strokeDasharray:v,visible:H,width:`line`,x:U})})}),n&&H&&!z&&(0,q.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,height:`100%`,width:`100%`,children:(0,q.jsx)(`g`,{transform:`translate(${O.left},${O.top})`,children:A.map((e,t)=>(0,q.jsx)(Tu,{color:ae(e,t),cornerRadiusFraction:r===`ring`?a:void 0,size:ee,springConfig:h,strokeColor:Q.background,strokeWidth:r===`ring`?s:void 0,variant:r,visible:H,x:w?.xPositions?.[e.dataKey]??U,y:w?.yPositions[e.dataKey]??0},e.dataKey))})}),(0,q.jsx)(bu,{animate:V.animate,backgroundColor:C,className:p,containerHeight:E,containerRef:N,containerWidth:T,panelStyle:S,springConfig:V.springConfig,top:z?void 0:O.top,visible:H,x:te,y:z?re:O.top,children:l&&w?l({point:w.point,index:w.index}):!l&&(0,q.jsx)(Su,{rows:ie,title:se,children:f})}),(0,q.jsx)(Nu,{currentIndex:w?.index??0,discreteInteraction:B,enabled:e&&!z,labels:M,springConfig:h,visible:H,xWithMargin:te})]});return(0,mu.createPortal)(W,m)});function Mu(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(ju,{...e,container:i}):null}Mu.displayName=`ChartTooltip`;function Nu(e){return e.enabled&&e.visible&&e.labels.length>0?(0,q.jsx)(Pu,{...e}):null}function Pu({labels:e,currentIndex:t,xWithMargin:n,discreteInteraction:r,springConfig:i,visible:a}){let{tooltipSpring:o}=ks(),s=Qe(n,i??o);return r||s.set(n),(0,K.useEffect)(()=>{s.set(n)},[s,a]),(0,q.jsx)(G.div,{className:`pointer-events-none absolute z-50`,style:{left:r?n:s,transform:`translateX(-50%)`,bottom:4},children:(0,q.jsx)(yu,{currentIndex:t,labels:e,visible:a})})}var Fu=500;function Iu({label:e,x:t,crosshairX:n,hoveredLabel:r,isHovering:a,tickerHalfWidth:o,animatePosition:s}){let c=o+20,l=1;if(a&&n!==null){let i=Math.abs(t-n);i<o||r&&e===r?l=0:i<c&&(l=(i-o)/20)}return(0,q.jsx)(`div`,{className:`absolute`,style:{left:t,bottom:12,width:0,display:`flex`,justifyContent:`center`,transition:s?`left ${Fu}ms cubic-bezier(${$o.join(`, `)})`:void 0},children:(0,q.jsx)(`span`,{className:i(`whitespace-nowrap text-chart-label text-xs`),style:{opacity:l,transition:`opacity 0.4s ease-in-out`},children:e})})}var Lu=400;function Ru(e,t){if(t<0||t>e)return 0;let n=1;for(let r=0;r<t;r++)n=n*(e-r)/(r+1);return n}function zu(e,t){if(t===1)return e>=1?[[e]]:[];let n=[];for(let r=1;r<=e-(t-1);r++)for(let i of zu(e-r,t-1))n.push([r,...i]);return n}function Bu(e){let t=[0],n=0;for(let r of e)n+=r,t.push(n);return t}function Vu(e,t){let n=e-1;if(n<=0)return[0];let r=Array.from({length:t},(e,r)=>Math.round(r/(t-1)*n)),i=[...new Set(r)].sort((e,t)=>e-t);return i[0]!==0&&i.unshift(0),i.at(-1)!==n&&i.push(n),[...new Set(i)].sort((e,t)=>e-t)}function Hu(e,t){let n=e-1;if(n<=0)return[[0]];let r=t-1;return r<=0?[[0]]:Ru(n-1,r-1)>Lu?[Vu(e,t)]:zu(n,r).map(Bu)}function Uu(e,t,n,r){let i=new Set,a=[];for(let o of e){let e=t[o];if(!e)continue;let s=n[o]??Hc.format(r(e));i.has(s)||(i.add(s),a.push(o))}return a}function Wu(e){let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];r!=null&&i!=null&&t.push(r-i)}return t}function Gu(e){let t=Wu(e),n=Math.min(...t),r=t.indexOf(n);return r===t.length-1?0:r===0?1:2}function Ku(e,t,n){if(e.length<2)return{score:1/0,symmetryPenalty:1/0,countDistance:1/0,edgePreference:1/0};let r=[];for(let n=1;n<e.length;n++){let i=e[n],a=e[n-1];i!=null&&a!=null&&r.push(t(i)-t(a))}let i=Math.min(...r),a=Math.max(...r),o=r.reduce((e,t)=>e+t,0)/r.length,s=o>0?(a-i)/o:a-i,c=Math.abs(e.length-n),l=Wu(e),u=Math.min(...l),d=l.indexOf(u),f=d>0&&d<l.length-1?.08:0,p=l.reduce((e,t,n)=>e+Math.abs(t-(l.at(-1-n)??t)),0)/l.length;return{score:s+.1*c+f+p*.02,symmetryPenalty:p,countDistance:c,edgePreference:Gu(e)}}function qu(e,t,n,r){return e.score<t.score-1e-6?!0:Math.abs(e.score-t.score)>1e-6?!1:n<r?!0:n>r?!1:e.symmetryPenalty<t.symmetryPenalty-1e-6?!0:e.symmetryPenalty>t.symmetryPenalty+1e-6?!1:e.edgePreference<t.edgePreference}function Ju(e,t,n){if(e<=0)return[];if(e===1)return[0];if(e<=t)return Array.from({length:e},(e,t)=>t);let r=n?.resolveXPx??(e=>e),i=Math.max(2,t-1),a=Math.min(e,t+1),o=Vu(e,t),s=Ku(o,r,t),c=s.countDistance;for(let l=i;l<=a;l++)for(let i of Hu(e,l)){let e=n?.data&&n.dateLabels&&n.xAccessor?Uu(i,n.data,n.dateLabels,n.xAccessor):i;if(e.length<2)continue;let a=Ku(e,r,t),l=Math.abs(e.length-t);qu(a,s,l,c)&&(o=e,s=a,c=l)}return o}function Yu({data:e,dateLabels:t,marginLeft:n,targetTickCount:r,xAccessor:i,xScale:a}){let o=new Set,s=[],c=t=>{let n=e[t];return n?a(i(n))??0:t};for(let l of Ju(e.length,r,{data:e,dateLabels:t,resolveXPx:c,xAccessor:i})){let r=e[l];if(!r)continue;let c=i(r),u=t[l]??Hc.format(c);o.has(u)||(o.add(u),s.push({date:c,label:u,x:(a(c)??0)+n}))}return s}function Xu({marginLeft:e,numTicks:t,xScale:n}){let r=n.domain(),i=r[0],a=r[1];if(!(i&&a))return[];let o=i.getTime(),s=a.getTime()-o,c=Math.max(2,t),l=new Set,u=[];for(let t=0;t<c;t++){let r=t/(c-1),i=new Date(o+r*s),a=Hc.format(i);l.has(a)||(l.add(a),u.push({date:i,label:a,x:(n(i)??0)+e}))}return u}function Zu(e,t,n){if(e.length===0)return!1;let r=n.domain()[1],i=e.at(-1);return r&&i?r.getTime()>t(i).getTime():!1}function Qu(e,t,n,r,i,a){if(t.length===0||a<=0)return e;let o=t.at(-1),s=r.domain()[1];if(!(o&&s))return e;let c=n(o).getTime(),l=s.getTime();if(l<=c)return e;let u=new Set(e.map(e=>e.label)),d=[],f=Math.min(a,3);for(let e=1;e<=f;e++){let t=new Date(c+e/(f+1)*(l-c)),n=Hc.format(t);u.has(n)||(u.add(n),d.push({date:t,label:n,x:(r(t)??0)+i}))}let p=Hc.format(s);return u.has(p)||d.push({date:s,label:p,x:(r(s)??0)+i}),d.length===0?e:[...e,...d].sort((e,t)=>e.x-t.x)}function $u(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(ed,{...e,container:i}):null}var ed=(0,K.memo)(function({numTicks:e=5,tickerHalfWidth:t=50,tickMode:n=`data`,container:r}){let{xScale:i,margin:a,tooltipData:o,data:s,xAccessor:c,dateLabels:l,xDomain:u}=Xo(),d=(0,K.useMemo)(()=>{let t=n===`data`&&Zu(s,c,i);if(n===`domain`||t&&u==null)return Xu({marginLeft:a.left,numTicks:e,xScale:i});let r=Yu({data:s,dateLabels:l,marginLeft:a.left,targetTickCount:e,xAccessor:c,xScale:i});return t&&u!=null?Qu(r,s,c,i,a.left,Math.max(1,e-r.length+1)):r},[n,u,s,l,c,i,a.left,e]),f=o!==null,p=o?o.x+a.left:null,m=f&&o?l[o.index]??Hc.format(c(o.point)):null;return(0,mu.createPortal)((0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,children:d.map(e=>(0,q.jsx)(Iu,{animatePosition:u==null,crosshairX:p,hoveredLabel:m,isHovering:f,label:e.label,tickerHalfWidth:t,x:e.x},`${e.date.getTime()}-${e.x}`))}),r)});$u.displayName=`XAxis`;function td(e,t,n){let r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=e??r,o=t??i;return[Math.min(a,o),Math.max(a,o)]}function nd(e){if(e==null||!Number.isFinite(e))return 5;let t=Math.round(e);return t<1?1:t>10?10:t}var rd=500;function id(e,t,n){return n?n(e):t&&e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function ad(e,t,n,r){for(let i of r){if(!i.axisLabelColor||zo(i.yAxisId)!==t)continue;let[r,a]=td(i.y1,i.y2,n.domain()),o=n(a)??0,s=n(r)??0;if(e>=Math.min(o,s)&&e<=Math.max(o,s))return i.axisLabelColor}}function od(e){let{containerRef:t}=qo(),[n,r]=(0,K.useState)(!1);(0,K.useEffect)(()=>{r(!0)},[]);let i=t.current;return n&&i?(0,q.jsx)(sd,{...e,container:i}):null}var sd=(0,K.memo)(function({yAxisId:e,orientation:t=`left`,numTicks:n=5,formatLargeNumbers:r=!0,formatValue:i,container:a}){let{margin:o,referenceAreas:s}=qo(),c=Jo(e),l=t===`left`,u=zo(e),d=(0,K.useMemo)(()=>c.ticks(nd(n)).map(e=>{let t=(c(e)??0)+o.top;return{value:e,y:t,label:id(e,r,i),labelColor:ad(t-o.top,u,c,s)}}),[c,o.top,n,r,i,u,s]);return(0,mu.createPortal)((0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,children:(0,q.jsx)(`div`,{className:`absolute top-0 bottom-0`,style:l?{left:0,width:o.left}:{right:0,width:o.right},children:d.map(e=>(0,q.jsx)(`div`,{className:`absolute flex items-center`,style:{top:e.y,transform:`translateY(-50%)`,transition:`top ${rd}ms cubic-bezier(${$o.join(`, `)})`,...l?{right:0,justifyContent:`flex-end`,paddingRight:8}:{left:0,justifyContent:`flex-start`,paddingLeft:8}},children:(0,q.jsx)(`span`,{className:`text-chart-label text-xs`,style:e.labelColor?{color:e.labelColor}:void 0,children:e.label})},e.value))})}),a)});od.displayName=`YAxis`;var $={requests:{key:`requests`,label:`Requests`,color:`var(--chart-1)`},errors:{key:`errors`,label:`Errors`,color:`var(--destructive)`},p95:{key:`p95`,label:`P95`,color:`var(--chart-2)`}};function cd({data:e}){let t=e.map(e=>({date:e.date,requests:e.requests,errors:e.errors,p95:e.p95}));return(0,q.jsxs)(ru,{aspectRatio:`16 / 7`,barGap:0,className:`min-h-[240px]`,data:t,margin:{top:12,right:44,bottom:28,left:36},maxBarSize:16,xDataKey:`date`,children:[(0,q.jsx)(pu,{horizontal:!0,numTicksRows:4}),(0,q.jsx)(kc,{dataKey:$.requests.key,fill:$.requests.color,radius:2}),(0,q.jsx)(wc,{dataKey:$.errors.key,showMarkers:!1,stroke:$.errors.color,strokeWidth:2}),(0,q.jsx)(Zs,{dataKey:$.p95.key,fadeEdges:!0,fill:$.p95.color,fillOpacity:.28,showMarkers:!1,strokeWidth:2,yAxisId:`right`}),(0,q.jsx)(od,{formatLargeNumbers:!1,numTicks:4}),(0,q.jsx)(od,{formatValue:e=>Fe(e),numTicks:4,orientation:`right`,yAxisId:`right`}),(0,q.jsx)($u,{numTicks:6}),(0,q.jsx)(Mu,{rows:ld,showCrosshair:!0})]})}function ld(e){let t=ud(e.requests),n=ud(e.errors),r=ud(e.p95);return[{color:$.requests.color,label:$.requests.label,value:t},{color:$.errors.color,label:$.errors.label,value:n},{color:$.p95.color,label:$.p95.label,value:Fe(r)}]}function ud(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function dd({series:e,stats:t}){if(e.kind===`empty`||t.kind===`empty`)return(0,q.jsx)(Ne,{icon:o,title:`No runs in this window`,description:`The Console buffer has no traces for the selected lookback. Numbers stay empty — they are not zero.`});let n=rn(e.buckets),r=Math.round(t.errorRate*100);return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-slot":`observability-metrics`,children:[(0,q.jsxs)(`header`,{className:y,children:[(0,q.jsx)(`h2`,{className:i(N,`flex items-center px-2`),children:`Metrics`}),(0,q.jsxs)(`span`,{className:`ml-auto px-2 font-mono text-[10px] text-muted-foreground`,children:[e.buckets.length,` buckets`]})]}),(0,q.jsxs)(`div`,{className:`grid shrink-0 grid-cols-4 border-b border-border/60`,"data-slot":`observability-kpis`,children:[(0,q.jsx)(fd,{label:`Runs`,value:String(t.total)}),(0,q.jsx)(fd,{label:`Errors`,meta:`${r}%`,tone:t.errors>0?`warn`:`ok`,value:String(t.errors)}),(0,q.jsx)(fd,{label:`P95`,toneClassName:ge(he(t.p95Ms)),value:Fe(t.p95Ms)}),(0,q.jsx)(fd,{label:`P50`,toneClassName:ge(he(t.p50Ms)),value:Fe(t.p50Ms)})]}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 px-3 pt-3`,"data-slot":`observability-legend`,children:[(0,q.jsx)(pd,{color:$.requests.color,label:$.requests.label,shape:`bar`}),(0,q.jsx)(pd,{color:$.errors.color,label:$.errors.label,shape:`line`}),(0,q.jsx)(pd,{color:$.p95.color,label:`${$.p95.label} · right`,shape:`area`})]}),(0,q.jsx)(`div`,{className:`px-1 pb-2`,"data-slot":`observability-chart`,children:(0,q.jsx)(cd,{data:n})})]})]})}function fd({label:e,value:t,meta:n,tone:r,toneClassName:a}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-r border-border/60 px-3 py-2.5 last:border-r-0`,children:[(0,q.jsx)(`span`,{className:i(N,`text-muted-foreground`),children:e}),(0,q.jsxs)(`span`,{className:i(`font-mono text-lg leading-none font-semibold tabular-nums tracking-tight`,r===`warn`&&`text-destructive`,r===`ok`&&`text-foreground`,a),children:[t,n?(0,q.jsx)(`span`,{className:`ml-1.5 text-[10px] font-medium text-muted-foreground`,children:n}):null]})]})}function pd({color:e,label:t,shape:n}){return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(`shrink-0`,n===`bar`&&`h-2 w-2 rounded-[2px]`,n===`line`&&`h-0.5 w-3 rounded-full`,n===`area`&&`h-2 w-2.5 rounded-sm opacity-70`),style:{backgroundColor:e}}),t]})}function md(e){if(!e.error)return null;let t=e.error.data,n=t&&typeof t==`object`&&`reason`in t&&typeof t.reason==`string`?t.reason:null,r=Error(n??e.error.message??e.error.code);return r.code=e.error.code,r.data=e.error.data,r}function hd(){return I({mutationFn:async e=>{let t=await c(e),n=md(t);if(n)throw n;if(!t.data)throw Error(`Empty runs query`);return t.data}})}var gd=`SELECT flow, count(*) AS runs, round(avg(duration_ms), 1) AS avg_ms
|
|
2
2
|
FROM runs
|
|
3
3
|
GROUP BY flow
|
|
4
4
|
ORDER BY runs DESC`;function _d(){let[e,t]=(0,K.useState)(gd),[n,r]=(0,K.useState)(!0),a=hd(),o=a.error instanceof Error?a.error.message:a.error?String(a.error):null;return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-slot":`runs-query-panel`,children:[(0,q.jsxs)(`header`,{className:y,children:[(0,q.jsx)(`h2`,{className:i(N,`flex items-center px-2`),children:`Query`}),(0,q.jsx)(qe,{piiMasked:n,disabled:a.isPending,onToggle:()=>r(e=>!e)}),(0,q.jsxs)(`button`,{type:`button`,className:i(p,`ml-auto font-semibold disabled:pointer-events-none disabled:opacity-40`),disabled:a.isPending||e.trim().length===0,onClick:()=>a.mutate({sql:e,...n?{}:{revealPii:!0}}),"data-slot":`runs-query-run`,children:[(0,q.jsx)(M,{icon:F,className:`size-3.5`}),`Run`]})]}),(0,q.jsx)(`p`,{className:`shrink-0 border-b border-border/60 px-3 py-1.5 text-[11px] leading-relaxed text-muted-foreground`,"data-slot":`runs-query-pii-gap`,role:`note`,children:`Free-form SQL over persisted runs. Masking is column-key only (dim_* and JSON blobs) — aliases and expressions can leak classified values. Limitation: RunsQueryPiiProjectionGap. Not the same guarantee as GET /console/runs.`}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,q.jsx)(He,{value:e,onChange:t,language:`sql`,onRun:()=>a.mutate({sql:e,...n?{}:{revealPii:!0}}),label:`Runs SQL`})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 border-t border-border/60`,children:(0,q.jsx)(Ue,{rows:a.data?.rows??null,error:o,pending:a.isPending,meta:a.data?`${a.data.rowCount} rows${a.data.truncated?` (truncated)`:``} · ${a.data.durationMs}ms`:null,executed:e,storeRef:`runs`})})]})}function vd(e,t,n){return`${e}\u001f${t??``}\u001f${n}`}function yd(e,t,n){let r=xe(e,t,n).filter(Te);if(r.length===0)return{kind:`empty`};let i=new Map;for(let e of r){let t=e.error,n=vd(t,e.errorMessage,e.flow),r=i.get(n);if(!r){i.set(n,{key:n,error:t,errorMessage:e.errorMessage,flow:e.flow,count:1,latestStartedAt:e.startedAt,latestRunId:e.id});continue}let a=e.startedAt>=r.latestStartedAt;i.set(n,{...r,count:r.count+1,latestStartedAt:a?e.startedAt:r.latestStartedAt,latestRunId:a?e.id:r.latestRunId})}return{kind:`groups`,groups:[...i.values()].sort((e,t)=>t.count===e.count?t.latestStartedAt-e.latestStartedAt:t.count-e.count),windowMs:n}}function bd(e,t){let n=t.trim().toLowerCase();return n.length===0?e:e.filter(e=>e.error.toLowerCase().includes(n)||e.flow.toLowerCase().includes(n)||(e.errorMessage?.toLowerCase().includes(n)??!1))}function xd(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.error);if(!e){t.push(r.error),n.set(r.error,[r]);continue}e.push(r)}return t.map(e=>({error:e,groups:n.get(e)??[]}))}function Sd({group:e,selected:t,nowMs:n,onSelect:r}){return(0,q.jsxs)(`div`,{"data-slot":`observability-error-row`,"data-error-key":e.key,"data-selected":t?`true`:`false`,className:i(`group relative flex w-full items-stretch border-b border-border/60 text-xs transition-colors`,`hover:bg-muted/50 focus-within:bg-muted/50`,t&&`bg-muted/70`),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(A,`bg-destructive`)}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(e),className:`flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-1 pl-0 text-left outline-none`,children:[(0,q.jsx)(`span`,{className:`ml-2.5 size-1.5 shrink-0 rounded-full bg-destructive`,"aria-hidden":!0}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:e.flow}),e.errorMessage?(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.errorMessage]}):null]}),(0,q.jsx)(`span`,{className:`w-8 shrink-0 text-right font-mono tabular-nums text-[10px] text-muted-foreground`,children:e.count}),(0,q.jsx)(`span`,{className:`w-10 shrink-0 truncate text-right text-[10px] text-muted-foreground`,children:Cd(e.latestStartedAt,n)})]}),(0,q.jsx)(`button`,{type:`button`,className:i(`flex items-center px-2 text-[10px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`),"data-slot":`observability-error-open-trace`,onClick:t=>{t.stopPropagation(),r(e)},children:`Trace`})]})}function Cd(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.max(1,Math.round(n/1e3))}s`:n<36e5?`${Math.round(n/6e4)}m`:`${Math.round(n/36e5)}h`}function wd({errors:e,query:t,selectedErrorKey:n,nowMs:r,onQueryChange:i,onSelect:a}){let o=e.kind===`groups`?e.groups:[],s=(0,K.useMemo)(()=>bd(o,t),[o,t]),c=(0,K.useMemo)(()=>xd(s),[s]);return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-slot":`observability-error-list`,children:[(0,q.jsx)(`div`,{className:m,children:(0,q.jsx)(De,{"data-slot":`observability-error-search`,value:t,onChange:e=>i(e.target.value),placeholder:`Filter errors…`,"aria-label":`Filter errors`})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.kind===`empty`?(0,q.jsx)(`p`,{className:D,"data-slot":`observability-errors-empty`,children:`No errors in the Console buffer for this window.`}):s.length===0?(0,q.jsx)(`p`,{className:D,children:`No errors match this filter.`}):c.map(e=>(0,q.jsx)(Td,{error:e.error,groups:e.groups,selectedErrorKey:n,nowMs:r,onSelect:a},e.error))})]})}function Td({error:e,groups:t,selectedErrorKey:r,nowMs:a,onSelect:o}){let[s,c]=(0,K.useState)(!0),l=t.reduce((e,t)=>e+t.count,0);return(0,q.jsxs)(Be,{open:s,onOpenChange:c,className:f,children:[(0,q.jsx)(ze,{nativeButton:!1,className:n,render:t=>(0,q.jsxs)(`div`,{...t,children:[(0,q.jsx)(M,{icon:u,className:i(O,!s&&`-rotate-90`),"aria-hidden":!0}),(0,q.jsx)(M,{icon:x,className:`size-3.5 shrink-0 text-destructive`}),(0,q.jsx)(`span`,{className:_,children:e}),(0,q.jsx)(`span`,{className:w,children:l})]})}),(0,q.jsx)(Re,{children:t.map(e=>(0,q.jsx)(Sd,{group:e,selected:e.key===r,nowMs:a,onSelect:o},e.key))})]})}var Ed=Object.keys(be);function Dd({cells:e,window:t,onWindowChange:n,onInstancesClick:r}){return(0,q.jsx)(`section`,{"aria-label":`System health`,className:`shrink-0 border-b border-border/60 bg-background`,"data-slot":`observability-health-strip`,children:(0,q.jsxs)(`div`,{className:`flex min-h-10 flex-wrap items-stretch`,children:[e.map(e=>(0,q.jsx)(Od,{cell:e,onClick:e.id===`instances`?r:void 0},e.id)),(0,q.jsx)(`div`,{className:`ml-auto flex items-stretch`,role:`group`,"aria-label":`Lookback window`,children:Ed.map(e=>{let r=e===t;return(0,q.jsx)(Me,{label:`Last ${e}`,className:`flex self-stretch`,children:(0,q.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>n(e),className:i(p,`tabular-nums`,r?P:j),children:e})},e)})})]})})}function Od({cell:e,onClick:t}){let n=i(`flex items-center gap-1.5 self-stretch px-2 text-[10px] transition-colors`,e.tone===`warn`&&`text-destructive dark:text-rose-300`,e.tone===`ok`&&`text-foreground/85`,e.tone===`empty`&&`text-muted-foreground`,(t||e.href)&&`hover:bg-muted/50`),r=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:i(`size-1.5 shrink-0 rounded-full`,e.tone===`ok`&&`bg-emerald-500 dark:bg-emerald-400`,e.tone===`warn`&&`bg-destructive`,e.tone===`empty`&&`bg-muted-foreground/40`,e.id===`live`&&e.tone===`ok`&&`animate-pulse`)}),(0,q.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,q.jsx)(`span`,{className:`font-mono tabular-nums`,children:e.value})]});return t?(0,q.jsx)(`button`,{type:`button`,"data-slot":`health-cell-${e.id}`,"data-tone":e.tone,className:n,"aria-label":`${e.label} ${e.value}`,onClick:t,children:r}):e.href?(0,q.jsx)(ce,{to:e.href,"data-slot":`health-cell-${e.id}`,"data-tone":e.tone,className:n,"aria-label":`${e.label} ${e.value}`,children:r}):(0,q.jsx)(`span`,{role:e.tone===`warn`?`alert`:`status`,"data-slot":`health-cell-${e.id}`,"data-tone":e.tone,className:n,children:r})}function kd(e,t,n){let r=xe(e,t,n),i=0;for(let e of r)for(let t of e.effects)(t.kind===`ask`||t.kind===`call`&&Le(t.resource))&&(i+=1);return i===0?{kind:`empty`}:{kind:`summary`,asks:i,windowMs:n}}function Ad(e,t){let n=new Set(t.flatMap(e=>e.children.map(e=>e.effectRef)));return n.size===0?null:We(e,n)}function jd(e){return[Md(e.fleet),Nd(e.vaultCard),Pd(e.stores),Fd(e.runs,e.stores),Id(e.crons),Ld(e.signals),Rd(e.window),zd(e.liveStatus)]}function Md(e){return!e||e.kind===`empty`?{id:`instances`,label:`Instances`,value:`no fleet`,tone:`empty`}:e.alive===0?{id:`instances`,label:`Instances`,value:`0 alive`,tone:`warn`}:{id:`instances`,label:`Instances`,value:`${e.alive} alive`,tone:`ok`}}function Nd(e){if(!e)return{id:`vault`,label:`Vault`,value:`no backend`,tone:`empty`,href:`/vault`};let t=e.badges.find(e=>e.tone===`warn`);if(t)return{id:`vault`,label:`Vault`,value:t.label,tone:`warn`,href:`/vault`};let n=e.badges.find(e=>e.id===`unsealed`||e.id===`sealed`),r=e.facts.find(e=>e.label===`KEK generation`),i=[n?.label,r?.value].filter(e=>!!e);return{id:`vault`,label:`Vault`,value:i.length>0?i.join(` · `):e.title,tone:`ok`,href:`/vault`}}function Pd(e){if(e.length===0)return{id:`drift`,label:`Store`,value:`no stores`,tone:`empty`,href:`/store`};let t=e.filter(e=>e.migrationDrift?.drifted===!0).length;return t>0?{id:`drift`,label:`Store`,value:`${t} drifted`,tone:`warn`,href:`/store`}:{id:`drift`,label:`Store`,value:`in sync`,tone:`ok`,href:`/store`}}function Fd(e,t){let n=Ad(e,t);return n==null?{id:`lag`,label:`Replica`,value:`no lag observed`,tone:`empty`,href:`/store`}:{id:`lag`,label:`Replica`,value:Fe(n),tone:n>=250?`warn`:`ok`,href:`/store`}}function Id(e){if(e.length===0)return{id:`clock`,label:`Clock`,value:`no crons`,tone:`empty`};let t=e.filter(e=>e.health.overdue).length;if(t>0)return{id:`clock`,label:`Clock`,value:`${t} overdue`,tone:`warn`};let n=e.find(e=>e.health.leaderInstanceId)?.health.leaderInstanceId;return{id:`clock`,label:`Clock`,value:n?`lease ${Bd(n)}`:`on schedule`,tone:`ok`}}function Ld(e){if(e.length===0)return{id:`signal`,label:`Signal`,value:`no signals`,tone:`empty`};let t=e.reduce((e,t)=>e+t.dead,0),n=e.reduce((e,t)=>e+t.pending,0),r=e.reduce((e,t)=>t.outboxLagMs==null?e:e==null||t.outboxLagMs>e?t.outboxLagMs:e,null);return t>0?{id:`signal`,label:`Signal`,value:`${t} dead`,tone:`warn`}:r!=null&&r>=250?{id:`signal`,label:`Signal`,value:`${Fe(r)} lag`,tone:`warn`}:n>0?{id:`signal`,label:`Signal`,value:`${n} pending`,tone:`ok`}:{id:`signal`,label:`Signal`,value:`quiet`,tone:`ok`}}function Rd(e){if(e.kind===`empty`)return{id:`window`,label:`Runs`,value:`no recent runs`,tone:`empty`};let t=Math.round(e.errorRate*100);return{id:`window`,label:`Runs`,value:`P95 ${Fe(e.p95Ms)} · ${t}% err`,tone:e.errorRate>0||e.p95Ms>=250?`warn`:`ok`}}function zd(e){return e===`open`?{id:`live`,label:`Live`,value:`live`,tone:`ok`}:e===`connecting`?{id:`live`,label:`Live`,value:`connecting`,tone:`empty`}:{id:`live`,label:`Live`,value:`polling`,tone:`warn`}}function Bd(e){return e.length<=8?e:e.slice(0,8)}function Vd(){let e=Ie(),t=Pe(!0),n=Ve(),r=Ge(),a=Gt(),o=qt(),s=Yt(),c=Ut(),{selectedRunId:l,window:u,selectedErrorKey:d,query:f,view:m,setSelectedRun:g,setWindow:_,setSelectedError:b,setQuery:x,setView:S}=Se(),[w,T]=(0,K.useState)(!1),E=ke(),D=(0,q.jsx)(Ae,{open:E.open,onToggle:E.toggle,noun:`errors`,controlsId:`observability-errors`,dataSlot:`observability-errors-toggle`}),O=Date.now(),k=be[u],A=e.data??[],M=(0,K.useMemo)(()=>Ce(A,O,k),[A,O,k]),N=(0,K.useMemo)(()=>yd(A,O,k),[A,O,k]),P=(0,K.useMemo)(()=>sn(A,O,k),[A,O,k]),F=(0,K.useMemo)(()=>kd(A,O,k),[A,O,k]),I=(0,K.useMemo)(()=>Xt(A,O,k),[A,O,k]),L=(0,K.useMemo)(()=>Ke(r.data?.backend??null),[r.data?.backend]),R=(0,K.useMemo)(()=>jd({vaultCard:L,stores:n.data?.stores??[],runs:A,crons:a.data?.crons??[],signals:s.data?.signals??[],window:M,liveStatus:t,fleet:o.data}),[L,n.data?.stores,A,a.data?.crons,s.data?.signals,M,t,o.data]),z=(0,K.useMemo)(()=>l?A.find(e=>e.id===l)??null:null,[A,l]);return(0,q.jsxs)(`div`,{className:h,"data-slot":`observability-page`,children:[(0,q.jsx)(Dd,{cells:R,window:u,onWindowChange:_,onInstancesClick:()=>T(!0)}),(0,q.jsxs)(Ee,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[(0,q.jsx)(Oe,{panelRef:E.panelRef,collapsible:!0,collapsedSize:0,defaultSize:C.start.defaultSize,minSize:C.start.minSize,onResize:E.onResize,className:`min-h-0 overflow-hidden`,children:(0,q.jsx)(`div`,{id:`observability-errors`,className:`flex h-full min-h-0 flex-col overflow-hidden`,"data-slot":`observability-errors`,children:(0,q.jsx)(wd,{errors:N,query:f,selectedErrorKey:d,nowMs:O,onQueryChange:x,onSelect:e=>b(e.key,e.latestRunId)})})}),E.open?(0,q.jsx)(je,{withHandle:!0}):null,(0,q.jsx)(Oe,{defaultSize:C.end.defaultSize,minSize:C.end.minSize,className:`min-h-0 overflow-hidden`,children:(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:y,role:`tablist`,"aria-label":`Observability detail`,children:[D,(0,q.jsx)(`span`,{className:`w-px shrink-0 self-stretch bg-border/60`,"aria-hidden":!0}),(0,q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":m===`metrics`,className:i(p,`font-semibold tracking-[0.08em] uppercase`,m===`metrics`?v:j),onClick:()=>S(`metrics`),"data-slot":`observability-view-metrics`,children:`Metrics`}),(0,q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":m===`query`,className:i(p,`font-semibold tracking-[0.08em] uppercase`,m===`query`?v:j),onClick:()=>S(`query`),"data-slot":`observability-view-query`,children:`SQL`})]}),m===`query`?(0,q.jsx)(_d,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)($t,{ai:c.data,asks:F,tokens:I}),(0,q.jsx)(dd,{series:P,stats:M})]})]})})]}),(0,q.jsx)(ye,{run:z,onClose:()=>g(null)}),(0,q.jsx)(tn,{fleet:o.data,open:w,onClose:()=>T(!1)})]})}export{Vd as ObservabilityPage};
|