diff --git a/internal/mcp/dashboards.go b/internal/mcp/dashboards.go index ec5e1872a..567c35bbf 100644 --- a/internal/mcp/dashboards.go +++ b/internal/mcp/dashboards.go @@ -7,6 +7,7 @@ import ( "log/slog" "slices" "strings" + "time" "github.com/labstack/fanout/internal/dashboard" "github.com/modelcontextprotocol/go-sdk/mcp" @@ -95,7 +96,7 @@ func (s *Server) dashboardCreate(ctx context.Context, req *mcp.CallToolRequest, if err != nil { return nil, dashboardOutput{}, dashboardToolError(err) } - return summary(fmt.Sprintf("Created dashboard %q with %d widgets.", item.Name, len(item.State.Widgets))), dashboardOutput{Dashboard: item}, nil + return summary(fmt.Sprintf("Created dashboard %q with %d widgets.%s", item.Name, len(item.State.Widgets), s.emptyWidgetNote(ctx, item.State))), dashboardOutput{Dashboard: item}, nil } func (s *Server) dashboardUpdate(ctx context.Context, req *mcp.CallToolRequest, input DashboardUpdateInput) (*mcp.CallToolResult, dashboardOutput, error) { @@ -107,7 +108,85 @@ func (s *Server) dashboardUpdate(ctx context.Context, req *mcp.CallToolRequest, if err != nil { return nil, dashboardOutput{}, dashboardToolError(err) } - return summary(fmt.Sprintf("Updated dashboard %q with %d widgets.", item.Name, len(item.State.Widgets))), dashboardOutput{Dashboard: item}, nil + return summary(fmt.Sprintf("Updated dashboard %q with %d widgets.%s", item.Name, len(item.State.Widgets), s.emptyWidgetNote(ctx, item.State))), dashboardOutput{Dashboard: item}, nil +} + +// probeLimit bounds the work a single create or update can trigger. A design +// with more filtered cards than this is reported on its first few; the point is +// to catch a dashboard built entirely out of empty cards, not to audit each one. +const probeLimit = 8 + +// probeBudget caps how long the whole check may take. Whatever has answered by +// then is reported; the rest are left unmentioned rather than delaying a +// dashboard that is already saved. +const probeBudget = 3 * time.Second + +// emptyWidgetNote reports which of the new dashboard's filtered cards have +// nothing to show right now. +// +// A design is composed from what the model believes is there, and a filter it +// invents can match nothing at all — a demo dashboard shipped with "Error +// logs" and "Warnings" cards that were empty on arrival and stayed empty, +// because the service in question logs no such levels. Nothing in the tool +// result said so, so the model described them to the user as working views. +// Saying it here lets the model drop the card or explain it in the same turn. +// +// Probes never fail the call and never hold it open: an empty note is the +// honest answer when a probe cannot run, and a dashboard that saved correctly +// must not be reported as an error — or left waiting — because a follow-up +// query was slow. A log query over a busy window has been seen to take twelve +// seconds, and eight of those would be the answer's latency. +func (s *Server) emptyWidgetNote(ctx context.Context, state dashboard.State) string { + if s.queries == nil { + return "" + } + ctx, cancel := context.WithTimeout(ctx, probeBudget) + defer cancel() + scope, err := s.scope(QueryInput{Window: state.Filters.Window, Namespace: state.Filters.Namespace}) + if err != nil { + return "" + } + var empty []string + probes := 0 + for _, widget := range state.Widgets { + if probes >= probeLimit || ctx.Err() != nil { + break + } + service := widgetConfigString(widget, "service") + switch widget.Type { + case "logs": + severity, search := widgetConfigString(widget, "severity"), widgetConfigString(widget, "search") + if service == "" && severity == "" && search == "" { + continue + } + probes++ + result, probeErr := s.queries.Logs(ctx, scope, service, severity, search, 1) + if probeErr == nil && len(result.Data.Entries) == 0 { + empty = append(empty, widget.Title) + } + case "trace": + if service == "" && widgetConfigString(widget, "trace_id") == "" { + continue + } + probes++ + result, probeErr := s.queries.Trace(ctx, scope, widgetConfigString(widget, "trace_id"), service, 1) + if probeErr == nil && len(result.Data.Spans) == 0 { + empty = append(empty, widget.Title) + } + } + } + if len(empty) == 0 { + return "" + } + return fmt.Sprintf(" No data matches these cards in the dashboard's own window, so they will render empty: %s. Tell the user, or replace them.", strings.Join(empty, ", ")) +} + +func widgetConfigString(widget dashboard.Widget, key string) string { + value, ok := widget.Config[key].(string) + if !ok { + return "" + } + return strings.TrimSpace(value) } // dashboardOwner resolves the authenticated owner for a dashboard tool call. diff --git a/internal/mcp/dashboards_probe_test.go b/internal/mcp/dashboards_probe_test.go new file mode 100644 index 000000000..68c0f5f75 --- /dev/null +++ b/internal/mcp/dashboards_probe_test.go @@ -0,0 +1,79 @@ +package mcp + +import ( + "context" + "strings" + "testing" + + mcpgoauth "github.com/modelcontextprotocol/go-sdk/auth" + "github.com/modelcontextprotocol/go-sdk/mcp" + + "github.com/labstack/fanout/internal/dashboard" + controlstore "github.com/labstack/fanout/internal/store" +) + +func newDashboardToolFixture(t *testing.T, queries Observability) (*Server, *mcp.CallToolRequest) { + t.Helper() + database, err := controlstore.NewSQLite(":memory:") + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = database.Close() }) + if _, err := database.DB.ExecContext(context.Background(), `INSERT INTO users(id,email,name,role,active) VALUES('owner','owner@example.test','Owner','admin',1)`); err != nil { + t.Fatal(err) + } + server := New(queries, dashboard.New(database.DB, 30), "test") + req := &mcp.CallToolRequest{Params: &mcp.CallToolParamsRaw{}, Extra: &mcp.RequestExtra{TokenInfo: &mcpgoauth.TokenInfo{UserID: "owner", Scopes: []string{dashboard.OAuthScope}}}} + return server, req +} + +func filteredLogsDashboard() dashboard.State { + return dashboard.State{ + Filters: dashboard.Filters{Window: "6h"}, + Widgets: []dashboard.Widget{ + {ID: "errors", Type: "logs", Title: "Checkout Error Logs", Config: map[string]any{"service": "checkout", "severity": "ERROR"}, Enabled: true}, + {ID: "health", Type: "overview", Title: "System health", Enabled: true}, + }, + Layout: []dashboard.Layout{ + {I: "errors", X: 0, Y: 0, W: 6, H: 3}, + {I: "health", X: 6, Y: 0, W: 6, H: 3}, + }, + } +} + +func createText(t *testing.T, server *Server, req *mcp.CallToolRequest, name string, state dashboard.State) string { + t.Helper() + result, _, err := server.dashboardCreate(context.Background(), req, DashboardCreateInput{Name: name, State: state}) + if err != nil { + t.Fatalf("dashboardCreate: %v", err) + } + var text strings.Builder + for _, content := range result.Content { + if message, ok := content.(*mcp.TextContent); ok { + text.WriteString(message.Text) + } + } + return text.String() +} + +func TestDashboardCreateReportsWidgetsWithNothingToShow(t *testing.T) { + // The model composes a dashboard from what it believes is there. A filter + // that matches nothing produced a card that was empty on arrival and was + // still described to the user as a working view. + server, req := newDashboardToolFixture(t, &fakeObservability{}) + text := createText(t, server, req, "Checkout Order Path", filteredLogsDashboard()) + if !strings.Contains(text, "Checkout Error Logs") { + t.Fatalf("summary = %q, want the empty card named", text) + } + if !strings.Contains(text, "render empty") { + t.Fatalf("summary = %q, want it to say the card has nothing to show", text) + } +} + +func TestDashboardCreateStaysQuietWhenWidgetsHaveData(t *testing.T) { + server, req := newDashboardToolFixture(t, &fakeObservability{logEntries: 3}) + text := createText(t, server, req, "Checkout Order Path", filteredLogsDashboard()) + if strings.Contains(text, "render empty") { + t.Fatalf("summary = %q, want no warning when the card has data", text) + } +} diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go index 0feac6a79..ef33e3791 100644 --- a/internal/mcp/server_test.go +++ b/internal/mcp/server_test.go @@ -16,6 +16,10 @@ import ( type fakeObservability struct { scope observability.Scope + // Zero means the query matches nothing, which is what a widget probe is + // looking for; a test that needs a populated answer sets these. + logEntries int + traceSpans int } type fakeIntelligence struct { @@ -130,12 +134,12 @@ func (f *fakeObservability) Performance(_ context.Context, scope observability.S func (f *fakeObservability) Trace(_ context.Context, scope observability.Scope, _, _ string, _ int) (observability.Result[observability.TraceDetail], error) { f.scope = scope - return observability.Result[observability.TraceDetail]{Schema: observability.TraceSchema, Summary: "trace"}, nil + return observability.Result[observability.TraceDetail]{Schema: observability.TraceSchema, Summary: "trace", Data: observability.TraceDetail{Spans: make([]observability.TraceSpan, f.traceSpans)}}, nil } func (f *fakeObservability) Logs(_ context.Context, scope observability.Scope, _, _, _ string, _ int) (observability.Result[observability.Logs], error) { f.scope = scope - return observability.Result[observability.Logs]{Schema: observability.LogsSchema, Summary: "logs"}, nil + return observability.Result[observability.Logs]{Schema: observability.LogsSchema, Summary: "logs", Data: observability.Logs{Entries: make([]observability.LogEntry, f.logEntries)}}, nil } func TestOverviewReturnsSummaryAndStructuredOutput(t *testing.T) { diff --git a/internal/ui/dist/assets/auth-d1anOsyP.js b/internal/ui/dist/assets/auth-d1anOsyP.js new file mode 100644 index 000000000..b620fc187 --- /dev/null +++ b/internal/ui/dist/assets/auth-d1anOsyP.js @@ -0,0 +1 @@ +import{$ as e,A as t,C as n,G as r,Y as i,Z as a,_ as ee,a as o,c as s,d as c,f as l,h as u,ht as te,i as ne,j as d,k as f,l as re,m as ie,o as p,ot as m,p as h,pt as g,r as ae,s as _,t as v,u as y,x as oe,xt as se,y as ce}from"./brand-CCB4_HD8.js";var b=se(te(),1),le=b.use,x=b.useLayoutEffect;function S(e,t,n){b.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function C(e){let t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}var w=b.createContext(null);function T(e){return b.useContext(w)}function E(e){let t=T();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function D(e){let t=T(),n=E(),r=b.useRef(null);return x(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function O({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,b.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var k={root:`m_b183c0a2`},A=g(),ue=i((e,{color:t})=>({root:{"--code-bg":t?r(t,e):void 0}})),j=n(e=>{let t=d(`Code`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:ee,vars:o,color:s,block:c,mod:l,attributes:u,...te}=t,ne=f({name:`Code`,props:t,classes:k,className:r,style:i,classNames:n,styles:a,unstyled:ee,attributes:u,vars:o,varsResolver:ue});return(0,A.jsx)(oe,{component:c?`pre`:`code`,mod:[{block:c},l],...ne(`root`),...te,dir:`ltr`})});j.classes=k,j.varsResolver=ue,j.displayName=`@mantine/core/Code`;function M(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":m(t??`sm`,`pin-input-size`)}})),L=n(n=>{let{name:r,form:i,className:ee,value:o,defaultValue:s,variant:c,gap:l,style:te,size:ne,classNames:re,styles:p,unstyled:m,length:h,onChange:g,onComplete:ae,manageFocus:_,autoFocus:v,error:y,success:oe,radius:se,disabled:ce,oneTimeCode:le,placeholder:x,type:S,mask:C,readOnly:w,inputType:T,inputMode:E,ariaLabel:D,vars:k,id:ue,hiddenInputProps:j,rootRef:L,getInputProps:R,attributes:z,ref:de,...fe}=d([`Input`,`PinInput`],F,n),B=e(ue),pe=f({name:`PinInput`,classes:N,props:n,className:ee,style:te,classNames:re,styles:p,unstyled:m,attributes:z,vars:k,varsResolver:I}),{resolvedClassNames:V,resolvedStyles:H}=t({classNames:re,styles:p,props:n}),[U,me]=(0,b.useState)(-1),W=(0,b.useRef)([]),G=h??4,he=(0,b.useRef)(!1),[ge,K]=O({value:o===void 0?void 0:M(G,o),defaultValue:s?.split(``).slice(0,G),finalValue:M(G,``),onChange:e=>{let t=e.join(``).trim();g?.(t),t.length===G&&!he.current?(he.current=!0,ae?.(t)):t.length(S instanceof RegExp?S:S&&S in P?P[S]:null)?.test(e),X=(e,t)=>{if(_){if(e===`next`){let e=t+1;e=0&&W.current[e]?.focus()}}},Z=(e,t)=>{let n=[...q];return n[t]=e,K(n),n},_e=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Y(n)){K(M(G,n));let e=Math.min(n.length,G);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:ee}=e,o=ee.value;if(E===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),X(`prev`,t);break;case`ArrowRight`:e.preventDefault(),X(`next`,t);break;case`Tab`:a&&t>0&&_&&(e.preventDefault(),X(`prev`,t));break;case` `:e.preventDefault(),X(`next`,t);break;case`Delete`:e.preventDefault(),Z(``,t);break;case`Backspace`:o===``?(e.preventDefault(),X(`prev`,t)):(Z(``,t),t0&&i===q[t]&&(e.preventDefault(),X(`next`,t))}},ye=(e,t)=>{e.target.select(),me(t)},Q=()=>{me(-1)},$=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Y(t.trim())){let e=M(G,t);K(e);let n=e.filter(e=>e!==``).length;n>=G?W.current[G-1]?.focus():W.current[n]?.focus()}};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(u,{...fe,...pe(`root`),ref:L,role:`group`,id:B,gap:l,unstyled:m,wrap:`nowrap`,variant:c,__size:ne,dir:`ltr`,children:q.map((e,t)=>(0,b.createElement)(ie,{component:`input`,...pe(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:V,styles:H,size:ne,__staticSelector:`PinInput`,id:`${B}-${t+1}`,key:`${B}-${t}`,inputMode:E||(S===`number`?`numeric`:`text`),onChange:e=>_e(e,t),onKeyDown:e=>ve(e,t),onFocus:e=>ye(e,t),onBlur:Q,onPaste:$,type:T||(C?`password`:S===`number`?`tel`:`text`),radius:se,error:y,success:oe,variant:c,disabled:ce,ref:e=>{e&&(t===0&&a(de,e),W.current[t]=e)},autoComplete:le?`one-time-code`:`off`,placeholder:U===t?``:x,value:e,autoFocus:v&&t===0,unstyled:m,"aria-label":D,readOnly:w,...R?.(t)}))}),(0,A.jsx)(`input`,{type:`hidden`,name:r,form:i,value:J,...j})]})});L.classes={...N,...h.classes},L.varsResolver=I,L.displayName=`@mantine/core/PinInput`;var R=n(e=>(0,A.jsx)(h,{component:`input`,...d([`Input`,`InputWrapper`,`TextInput`],null,e),__staticSelector:`TextInput`}));R.classes=h.classes,R.displayName=`@mantine/core/TextInput`;var z=new Map([[`bold`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),b.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),de=new Map([[`bold`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),b.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),fe=new Map([[`bold`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),b.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,b.createElement(b.Fragment,null,b.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),B=b.forwardRef((e,t)=>b.createElement(o,{ref:t,...e,weights:z}));B.displayName=`ArrowLeftIcon`;var pe=B,V=b.forwardRef((e,t)=>b.createElement(o,{ref:t,...e,weights:de}));V.displayName=`ArrowRightIcon`;var H=V,U=b.forwardRef((e,t)=>b.createElement(o,{ref:t,...e,weights:fe}));U.displayName=`UserPlusIcon`;var me=U,W=`fanout.access-token`,G=`fanout:unauthorized`;function he(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function ge(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function K(){localStorage.removeItem(W)}function q(){K(),window.dispatchEvent(new Event(G))}async function J(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&q(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Y(){let e=await J(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&q(),window.location.assign(`/`)}var X=(0,b.createContext)(null);function Z(){let e=(0,b.useContext)(X);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var _e=(0,b.createContext)(null);function ve(){let e=(0,b.useContext)(_e);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function ye(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Q(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function $({children:e,wide:t=!1}){return(0,A.jsx)(oe,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,A.jsx)(re,{mih:`100dvh`,px:`md`,py:48,children:(0,A.jsx)(s,{size:t?680:480,w:`100%`,children:(0,A.jsx)(ce,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function be(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function xe(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Se({children:e}){let t=E(),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(`none`),[te,d]=(0,b.useState)(null),[f,ie]=(0,b.useState)(!1),[m,h]=(0,b.useState)(``),[g,se]=(0,b.useState)(``),[ce,le]=(0,b.useState)(be),[x,S]=(0,b.useState)(xe),[C,w]=(0,b.useState)(``),[T,D]=(0,b.useState)(!1),[O,k]=(0,b.useState)(0),[ue,M]=(0,b.useState)(()=>Date.now()),[N,P]=(0,b.useState)(!1),[F,I]=(0,b.useState)(``),[z,de]=(0,b.useState)(null),[fe,B]=(0,b.useState)(!1),V=(0,b.useRef)(null),U=he(),W=o===`user`;async function q(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),d(null);return}let t=await e.json().catch(()=>null);s(ge(t)),d(ye(t))}async function J(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;d(ye(await e.json().catch(()=>null)))}catch{}}(0,b.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,b.useEffect)(()=>{K(),Q(`/api/auth/status`).then(r).catch(e=>I(String(e))).finally(()=>a(!0)),q().catch(()=>s(`none`)).finally(()=>ie(!0));let e=()=>{s(`none`),d(null)};return window.addEventListener(G,e),()=>window.removeEventListener(G,e)},[]),(0,b.useEffect)(()=>{f&&o===`none`&&x&&(P(!0),I(``),Q(`/api/auth/login-link`,{token:x}).then(()=>{s(`user`),J()}).catch(e=>I(e instanceof Error?e.message:String(e))).finally(()=>{S(``),P(!1)}))},[x,f,o]),(0,b.useEffect)(()=>{W&&f&&U&&window.location.replace(U)},[W,U,f]),(0,b.useEffect)(()=>{if(O<=Date.now())return;let e=setInterval(()=>{M(Date.now()),Date.now()>=O&&clearInterval(e)},1e3);return()=>clearInterval(e)},[O]);let Y=Math.max(0,Math.ceil((O-ue)/1e3));(0,b.useEffect)(()=>{T&&!N&&F&&V.current?.querySelector(`input`)?.focus()},[N,T,F]);async function Z(e){try{await navigator.clipboard.writeText(e),B(!0)}catch{I(`Clipboard access failed. Select and copy the token manually.`)}}if(z?.ingest_token)return(0,A.jsx)($,{wide:!0,children:(0,A.jsxs)(_,{gap:`lg`,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(c,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,A.jsx)(p,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,A.jsx)(c,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,A.jsxs)(_,{gap:`xs`,children:[(0,A.jsx)(c,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,A.jsx)(j,{block:!0,children:z.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,A.jsxs)(_,{gap:`xs`,children:[(0,A.jsx)(c,{size:`sm`,fw:600,children:`Header`}),(0,A.jsxs)(j,{block:!0,children:[z.ingest_header_name??`Authorization`,`: Bearer `,z.ingest_token]})]}),F&&(0,A.jsx)(l,{color:`bad`,radius:`md`,children:F}),(0,A.jsxs)(u,{grow:!0,align:`stretch`,children:[(0,A.jsx)(y,{variant:`light`,radius:`md`,leftSection:fe?(0,A.jsx)(ne,{size:16,weight:`bold`}):(0,A.jsx)(ae,{size:16}),onClick:()=>void Z(`${z.ingest_header_name??`Authorization`}: Bearer ${z.ingest_token}`),children:fe?`Copied`:`Copy header`}),(0,A.jsx)(y,{radius:`md`,rightSection:(0,A.jsx)(H,{size:16,weight:`bold`}),onClick:()=>{s(`user`),de(null),J()},children:`Continue to Fanout`})]}),(0,A.jsx)(y,{variant:`subtle`,size:`compact-xs`,onClick:()=>void Z(z.ingest_token??``),children:`Copy token only`})]})});if(!f||!i||x)return(0,A.jsx)(re,{mih:`100dvh`,children:(0,A.jsx)(ee,{size:`sm`})});if(!n)return(0,A.jsx)($,{children:(0,A.jsxs)(_,{gap:`lg`,children:[(0,A.jsx)(v,{}),(0,A.jsx)(p,{order:1,children:`Fanout is unavailable`}),(0,A.jsx)(l,{color:`bad`,radius:`md`,children:F||`Authentication status could not be loaded.`})]})});if(W&&U)return null;if(W)return(0,A.jsx)(X.Provider,{value:n,children:(0,A.jsx)(_e.Provider,{value:te??{id:``,email:m,name:g,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=U?`/api/auth/oidc/start?return_to=${encodeURIComponent(U)}`:`/api/auth/oidc/start`;return(0,A.jsx)($,{children:(0,A.jsxs)(_,{gap:28,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(_,{gap:10,children:[(0,A.jsx)(c,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,A.jsx)(p,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,A.jsx)(c,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),F&&(0,A.jsx)(l,{color:`bad`,radius:`md`,children:F}),(0,A.jsx)(y,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,A.jsx)(H,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function ve(){P(!0),I(``);try{await Q(`/api/auth/start`,{email:m}),D(!0),w(``),k(Date.now()+3e4),M(Date.now())}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}async function Se(e){P(!0),I(``);try{await Q(`/api/auth/verify`,{email:m,code:e}),s(`user`),D(!1),w(``),k(0),J()}catch(e){w(``),I(e instanceof Error?e.message:String(e))}finally{P(!1)}}function Ce(){D(!1),w(``),I(``)}async function we(e){e.preventDefault(),P(!0),I(``);try{if(n?.setup_required){let e=await Q(`/api/auth/setup`,{email:m,name:g,setup_token:ce});e.ingest_token?de(e):(s(`user`),J())}else if(T){await Se(C);return}else{await ve();return}}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}let Te=T&&!n?.setup_required,Ee=n?.setup_required?`Create the first admin`:Te?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,De=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?Te?`We sent a code to ${m}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,A.jsx)($,{children:(0,A.jsxs)(_,{gap:28,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(_,{gap:10,children:[(0,A.jsx)(c,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,A.jsx)(p,{order:1,fz:{base:28,sm:32},lh:1.08,children:Ee}),De&&(0,A.jsx)(c,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:De})]}),(0,A.jsx)(`form`,{onSubmit:we,children:(0,A.jsxs)(_,{gap:`md`,children:[(0,A.jsx)(R,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:m,onChange:e=>h(e.currentTarget.value),disabled:T,variant:`filled`,radius:`md`,size:`md`,autoFocus:!T}),n?.setup_required&&(0,A.jsx)(R,{label:`Name`,placeholder:`Your name`,value:g,onChange:e=>se(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,A.jsx)(R,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:ce,onChange:e=>le(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),Te&&(0,A.jsxs)(_,{gap:`xs`,children:[(0,A.jsx)(c,{size:`sm`,fw:600,children:`Verification code`}),(0,A.jsx)(oe,{ref:V,children:(0,A.jsx)(L,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:C,onChange:w,onComplete:e=>void Se(e),disabled:N,error:!!F,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,A.jsxs)(u,{justify:`space-between`,gap:`xs`,children:[(0,A.jsxs)(c,{c:`dimmed`,size:`xs`,children:[`Sent to `,m]}),(0,A.jsx)(y,{variant:`subtle`,size:`compact-xs`,leftSection:(0,A.jsx)(pe,{size:12,weight:`bold`}),onClick:Ce,disabled:N,children:`Change email`})]}),(0,A.jsxs)(u,{justify:`space-between`,gap:`xs`,children:[(0,A.jsx)(c,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,A.jsx)(y,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ve(),disabled:N||Y>0,children:Y>0?`Resend in ${Y}s`:`Resend code`})]})]}),F&&(0,A.jsx)(l,{color:`bad`,radius:`md`,children:F}),Te?(0,A.jsx)(y,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:N,disabled:N||C.length<6,rightSection:(0,A.jsx)(H,{size:17,weight:`bold`}),children:`Verify code`}):(0,A.jsx)(y,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:N,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,A.jsx)(me,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,A.jsx)(H,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}export{Y as a,D as c,w as d,le as f,x as h,J as i,E as l,S as m,Z as n,R as o,C as p,ve as r,O as s,Se as t,T as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-XnnwteRX.js b/internal/ui/dist/assets/chat-Cxa6DFwb.js similarity index 80% rename from internal/ui/dist/assets/chat-XnnwteRX.js rename to internal/ui/dist/assets/chat-Cxa6DFwb.js index f714ad8c6..09187dba2 100644 --- a/internal/ui/dist/assets/chat-XnnwteRX.js +++ b/internal/ui/dist/assets/chat-Cxa6DFwb.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BOSJ7bPK.js","assets/brand-CCB4_HD8.js","assets/index-DSdcpqnK.js","assets/index-DQPTd0xk.css"])))=>i.map(i=>d[i]); -import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{n as T,t as E}from"./copy-DGK5qe2D.js";import{P as D,c as O,k,u as ee}from"./index-DSdcpqnK.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BIeBcZvf.js","assets/brand-CCB4_HD8.js","assets/auth-d1anOsyP.js","assets/use-computed-color-scheme-CeR2KQyq.js"])))=>i.map(i=>d[i]); +import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{a as T,o as E,s as D,t as O}from"./preload-helper-qpfFvVn3.js";import{n as k,t as ee}from"./copy-Bx9ZWqiL.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),tt=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(et());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),nt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),rt=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(tt()),r=nt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),it=ot(`end`),at=ot(`start`);function ot(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function st(e){let t=at(e),n=it(e);if(t&&n)return{start:t,end:n}}function ct(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ut(e.position):`start`in e||`end`in e?ut(e):`line`in e||`column`in e?lt(e):``}function lt(e){return dt(e&&e.line)+`:`+dt(e&&e.column)}function ut(e){return lt(e&&e.start)+`-`+lt(e&&e.end)}function dt(e){return e&&typeof e==`number`?e:1}var B=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ct(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};B.prototype.file=``,B.prototype.name=``,B.prototype.reason=``,B.prototype.message=``,B.prototype.stack=``,B.prototype.column=void 0,B.prototype.line=void 0,B.prototype.ancestors=void 0,B.prototype.cause=void 0,B.prototype.fatal=void 0,B.prototype.place=void 0,B.prototype.ruleId=void 0,B.prototype.source=void 0;var ft=C(rt(),1),pt={}.hasOwnProperty,mt=new Map,ht=/[A-Z]/g,gt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),_t=new Set([`td`,`th`]),vt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function yt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=At(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=kt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Qe:Ze,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=bt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function bt(e,t,n){if(t.type===`element`)return xt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return St(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return wt(e,t,n);if(t.type===`mdxjsEsm`)return Ct(e,t);if(t.type===`root`)return Tt(e,t,n);if(t.type===`text`)return Et(e,t)}function xt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=It(e,t.tagName,!1),o=jt(e,t),s=Nt(e,t);return gt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Se(e)})),Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function St(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Lt(e,t.position)}function Ct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lt(e,t.position)}function wt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:It(e,t.name,!0),o=Mt(e,t),s=Nt(e,t);return Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tt(e,t,n){let r={};return Ot(r,Nt(e,t)),e.create(t,e.Fragment,r,n)}function Et(e,t){return t.value}function Dt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ot(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function At(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=at(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function jt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&pt.call(t.properties,i)){let a=Pt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&_t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Mt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Lt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Lt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Nt(e,t){let n=[],r=-1,i=e.passKeys?new Map:mt;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(V(e,e.length,0,t),e):t}var Yt={}.hasOwnProperty;function Xt(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=cn(/[A-Za-z]/),G=cn(/[\dA-Za-z]/),en=cn(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}var nn=cn(/\d/),rn=cn(/[\dA-Fa-f]/),an=cn(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var on=cn(/\p{P}|\p{S}/u),sn=cn(/\s/);function cn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ln(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hn(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function gn(e){if(e===null||q(e)||sn(e))return 1;if(on(e))return 2}function _n(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xn(d,-c),xn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=H(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=H(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=H(l,_n(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=H(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=H(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,V(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(Pn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ln(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Rn={name:`codeIndented`,tokenize:Bn},zn={partial:!0,tokenize:Vn};function Bn(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):K(t)?e.attempt(zn,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||K(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Vn(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):K(e)?i(e):n(e)}}var Hn={name:`codeText`,previous:Wn,resolve:Un,tokenize:Gn};function Un(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&qn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),qn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function tr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||tn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function rr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ir(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ar={name:`definition`,tokenize:sr},or={partial:!0,tokenize:cr};function sr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return nr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?ir(e,l)(t):l(t)}function l(t){return tr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(or,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function cr(e,t,n){return r;function r(t){return q(t)?ir(e,i)(t):n(t)}function i(t){return rr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var lr={name:`hardBreakEscape`,tokenize:ur};function ur(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var dr={name:`headingAtx`,resolve:fr,tokenize:pr};function fr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function pr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var mr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),hr=[`pre`,`script`,`style`,`textarea`],gr={concrete:!0,name:`htmlFlow`,resolveTo:yr,tokenize:br},_r={partial:!0,tokenize:Sr},vr={partial:!0,tokenize:xr};function yr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function br(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&hr.includes(l)?(i=1,r.interrupt?t(s):O(s)):mr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(_r,N,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(vr,ee,N)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),M):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return hr.includes(n)?(e.consume(t),ie):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||K(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),ie)}function N(n){return e.exit(`htmlFlow`),t(n)}}function xr(e,t,n){let r=this;return i;function i(t){return K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Sr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(wn,t,n)}}var Cr={name:`htmlText`,tokenize:wr};function wr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):K(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,j(t)):J(t)?(e.consume(t),C):A(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,j(t)):J(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,j(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,j(t)):J(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):K(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||q(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return J(t)?Y(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var Tr={name:`labelEnd`,resolveAll:kr,resolveTo:Ar,tokenize:jr},Er={tokenize:Mr},Dr={tokenize:Nr},Or={tokenize:Pr};function kr(e){let t=-1,n=[];for(;++t=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:Kr},exit:Jr,name:`list`,tokenize:Gr},Ur={partial:!0,tokenize:Yr},Wr={partial:!0,tokenize:qr};function Gr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:nn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Vr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return nn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(wn,r.interrupt?n:u,e.attempt(Ur,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Kr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(wn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function qr(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Jr(e){e.exit(this.containerState.type)}function Yr(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Xr={name:`setextUnderline`,resolveTo:Zr,tokenize:Qr};function Zr(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Qr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var $r={tokenize:ei};function ei(e){let t=this,n=e.attempt(wn,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ti={resolveAll:ai()},ni=ii(`string`),ri=ii(`text`);function ii(e){return{resolveAll:ai(e===`text`?oi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++ihi,contentInitial:()=>li,disable:()=>gi,document:()=>ci,flow:()=>di,flowInitial:()=>ui,insideSpan:()=>mi,string:()=>fi,text:()=>pi}),ci={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:En},li={91:ar},ui={[-2]:Rn,[-1]:Rn,32:Rn},di={35:dr,42:Vr,45:[Xr,Vr],60:gr,61:Xr,95:Vr,96:Fn,126:Fn},fi={38:Mn,92:An},pi={[-5]:zr,[-4]:zr,[-3]:zr,33:Fr,38:Mn,42:vn,60:[Sn,Cr],91:Lr,92:[lr,An],93:Tr,95:vn,96:Hn},mi={null:[vn,ti]},hi={null:[42,95]},gi={null:[]};function _i(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=_n(a,l.events,l),l.events):[]}function f(e,t){return yi(p(e),t)}function p(e){return vi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function yi(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ni).call(a,void 0,e[0])}for(r.position={start:Ai(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ai(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ic(){return`!`}ac.peek=oc;function ac(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function oc(){return`!`}sc.peek=cc;function sc(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}uc.peek=dc;function uc(e,t,n,r){let i=Ks(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(lc(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function dc(e,t,n){return lc(e,n)?`<`:`[`}fc.peek=pc;function fc(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pc(){return`[`}function mc(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function hc(e){let t=mc(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gc(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _c(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vc(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?gc(n):mc(n),s=e.ordered?o===`.`?`)`:`.`:hc(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),_c(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xc(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Sc=Aa([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Cc(e,t,n,r){return(e.children.some(function(e){return Sc(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wc(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Tc.peek=Ec;function Tc(e,t,n,r){let i=wc(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Xs(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ys(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Xs(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ys(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ec(e,t,n){return n.options.strong||`*`}function Dc(e,t,n,r){return n.safe(e.value,r)}function Oc(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kc(e,t,n){let r=(_c(n)+(n.options.ruleSpaces?` `:``)).repeat(Oc(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ac={blockquote:Is,break:Bs,code:Ws,definition:qs,emphasis:Zs,hardBreak:Bs,heading:ec,html:tc,image:rc,imageReference:ac,inlineCode:sc,link:uc,linkReference:fc,list:vc,listItem:bc,paragraph:xc,root:Cc,strong:Tc,text:Dc,thematicBreak:kc};function jc(){return{enter:{table:Mc,tableData:Ic,tableHeader:Ic,tableRow:Pc},exit:{codeText:Lc,table:Nc,tableData:Fc,tableHeader:Fc,tableRow:Fc}}}function Mc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Nc(e){this.exit(e),this.data.inTable=void 0}function Pc(e){this.enter({type:`tableRow`,children:[]},e)}function Fc(e){this.exit(e)}function Ic(e){this.enter({type:`tableCell`,children:[]},e)}function Lc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rc(e,t){return t===`|`?t:e}function zc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` -`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-BOSJ7bPK.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=ee();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=ee();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(k,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=E();return(0,j.jsx)(k,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(T,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(T.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(T.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(T.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(T.Th,{children:e}),td:({children:e})=>(0,j.jsx)(T.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-BIeBcZvf.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=T();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=T();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(E,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=ee();return(0,j.jsx)(E,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(k,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(k.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(k.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(k.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(k.Th,{children:e}),td:({children:e})=>(0,j.jsx)(k.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-CtOVI6Uj.js b/internal/ui/dist/assets/chat._threadId-CtOVI6Uj.js new file mode 100644 index 000000000..906042cf6 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-CtOVI6Uj.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Cxa6DFwb.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js b/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js deleted file mode 100644 index f19511b86..000000000 --- a/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-XnnwteRX.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-CtOVI6Uj.js b/internal/ui/dist/assets/chat.index-CtOVI6Uj.js new file mode 100644 index 000000000..906042cf6 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-CtOVI6Uj.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Cxa6DFwb.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-u0MOvyAV.js b/internal/ui/dist/assets/chat.index-u0MOvyAV.js deleted file mode 100644 index f19511b86..000000000 --- a/internal/ui/dist/assets/chat.index-u0MOvyAV.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-XnnwteRX.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/copy-Bx9ZWqiL.js b/internal/ui/dist/assets/copy-Bx9ZWqiL.js new file mode 100644 index 000000000..24cac8e40 --- /dev/null +++ b/internal/ui/dist/assets/copy-Bx9ZWqiL.js @@ -0,0 +1 @@ +import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{A as d,f}from"./preload-helper-qpfFvVn3.js";var[p,m]=d(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:d,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?f:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:d})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/copy-DGK5qe2D.js b/internal/ui/dist/assets/copy-DGK5qe2D.js deleted file mode 100644 index ca71b59f2..000000000 --- a/internal/ui/dist/assets/copy-DGK5qe2D.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{I as d,U as f}from"./index-DSdcpqnK.js";var[p,m]=f(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:f,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?d:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-BxZStHQX.js b/internal/ui/dist/assets/dashboard-BxZStHQX.js new file mode 100644 index 000000000..a6b0043cd --- /dev/null +++ b/internal/ui/dist/assets/dashboard-BxZStHQX.js @@ -0,0 +1,24 @@ +import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as N,rt as te,s as P,st as F,u as ne,ut as re,vt as ie,w as ae,x as oe,xt as se,y as ce}from"./brand-CCB4_HD8.js";import{i as le,o as I,s as L}from"./auth-d1anOsyP.js";import{$ as ue,C as de,G as fe,H as pe,I as me,K as he,O as ge,P as _e,Q as ve,R as ye,S as be,T as xe,X as Se,Y as Ce,Z as we,_ as Te,c as Ee,d as De,f as Oe,g as ke,gt as Ae,h as je,i as Me,l as Ne,lt as Pe,m as Fe,mt as Ie,n as Le,o as Re,p as ze,s as Be,ut as Ve,v as He,w as Ue,x as We,y as Ge}from"./tokens-DbmTV7qX.js";import{A as Ke,D as qe,O as Je,f as Ye,j as Xe,o as Ze,s as Qe}from"./preload-helper-qpfFvVn3.js";import{t as $e}from"./use-computed-color-scheme-CeR2KQyq.js";import{n as et,t as tt}from"./copy-Bx9ZWqiL.js";var R=se(S(),1),z=M();function nt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function rt(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function it(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:lt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:ct}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(oe,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});ut.classes=lt,ut.displayName=`@mantine/core/Flex`;function dt(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>dt(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ft(e){return e?e.map(e=>dt(e)):[]}function pt(e){return e.reduce((e,t)=>`group`in t?{...e,...pt(t.items)}:(e[`${t.value}`]=t,e),{})}var mt={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},ht={error:null},gt=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),_t=n(e=>{let t=T(`ComboboxChevron`,ht,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:mt,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:gt,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(oe,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});_t.classes=mt,_t.varsResolver=gt,_t.displayName=`@mantine/core/ComboboxChevron`;var[vt,yt]=Ke(`Combobox component was not found in tree`);function bt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}bt.displayName=`@mantine/core/ComboboxClearButton`;var xt=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=yt();return(0,z.jsx)(Pe.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});xt.classes=mt,xt.displayName=`@mantine/core/ComboboxDropdown`;var St={refProp:`ref`},Ct=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,St,e);if(yt(),!Xe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(Pe.Target,{ref:r,refProp:n,children:t})});Ct.displayName=`@mantine/core/ComboboxDropdownTarget`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(oe,{...yt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});wt.classes=mt,wt.displayName=`@mantine/core/ComboboxEmpty`;function Tt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=yt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var Et={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Dt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,Et,e),d=qe(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=yt();return(0,R.cloneElement)(d,{...Tt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,Je(d))})});Dt.displayName=`@mantine/core/ComboboxEventsTarget`;var Ot=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(oe,{...yt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Ot.classes=mt,Ot.displayName=`@mantine/core/ComboboxFooter`;var kt=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=yt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(oe,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});kt.classes=mt,kt.displayName=`@mantine/core/ComboboxGroup`;var At=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(oe,{...yt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});At.classes=mt,At.displayName=`@mantine/core/ComboboxHeader`;function jt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}jt.displayName=`@mantine/core/ComboboxHiddenInput`;var Mt=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=yt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(oe,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Mt.classes=mt,Mt.displayName=`@mantine/core/ComboboxOption`;var Nt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=yt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(oe,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Nt.classes=mt,Nt.displayName=`@mantine/core/ComboboxOptions`;var Pt={withAriaAttributes:!0,withKeyboardNavigation:!0},Ft=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Pt,e),p=yt(),m=p.getStyles(`search`),h=Tt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Ft.classes=mt,Ft.displayName=`@mantine/core/ComboboxSearch`;var It={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Lt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,It,e),d=qe(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=yt(),p=(0,R.cloneElement)(d,{...Tt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(Pe.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});Lt.displayName=`@mantine/core/ComboboxTarget`;function Rt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function zt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=ot(f.current),t=it(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=ot(f.current),n=it(`#${l.current}`,t),r=n?at(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=ot(f.current),t=it(`#${l.current} [data-combobox-active]`,e);if(t){let n=at(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=ot(f.current),t=at(`#${l.current} [data-combobox-option]`,e);return b(zt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=ot(f.current),t=at(`#${l.current} [data-combobox-option]`,e);return b(Rt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=ot(f.current),t=at(`#${l.current} [data-combobox-option]`,e);return b(Bt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=ot(f.current),r=at(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=ot(f.current),r=at(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=ot(f.current);(at(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Ht={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Ut=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":te(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:re(n),"--combobox-option-fz":te(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Wt=e=>{let t=T(`Combobox`,Ht,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Vt(),x=o||b,S=E({name:p||`Combobox`,classes:mt,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Ut}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(vt,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(Pe,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Wt.extend=e=>e,Wt.classes=mt,Wt.varsResolver=Ut,Wt.displayName=`@mantine/core/Combobox`,Wt.Target=Lt,Wt.Dropdown=xt,Wt.Options=Nt,Wt.Option=Mt,Wt.Search=Ft,Wt.Empty=wt,Wt.Chevron=_t,Wt.Footer=Ot,Wt.Header=At,Wt.EventsTarget=Dt,Wt.DropdownTarget=Ct,Wt.Group=kt,Wt.ClearButton=bt,Wt.HiddenInput=jt;function Gt(e){return`group`in e}function Kt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Jt(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Gt(n))Jt(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Yt(e,t){return Array.isArray(e)?e.includes(t):e===t}function Xt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!Gt(e)){let c=Yt(r,e.value),l=t&&(c?(0,z.jsx)(ue,{className:mt.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:mt.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Wt.Option,{value:e.value,disabled:e.disabled,className:o({[mt.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Xt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Wt.Group,{label:e.group,children:c})}function Zt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=yt();Jt(e);let x=typeof i==`string`?(r||Kt)({options:e,search:l?i:``,limit:a??1/0}):e,S=qt(x),C=x.map((e,t)=>(0,z.jsx)(Xt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Gt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Wt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Wt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(Ye.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Wt.Empty,{children:m})]})})}function Qt(e){let t=e.currentTarget;return ot(t).activeElement!==t}function $t(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[en,tn]=Ke(`Progress.Root component was not found in tree`),nn={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},rn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(oe,{...tn().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});rn.classes=nn,rn.displayName=`@mantine/core/ProgressLabel`;var an=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),on=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:nn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:an});return(0,z.jsx)(en,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(oe,{mod:[{orientation:u},f],...m(`root`),...p})})});on.classes=nn,on.varsResolver=an,on.displayName=`@mantine/core/ProgressRoot`;var sn={withAria:!0},cn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,sn,e),h=tn(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(oe,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":st(h.autoContrast,g)?Ve({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});cn.classes=nn,cn.displayName=`@mantine/core/ProgressSection`;var ln=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)(on,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(cn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});ln.classes=nn,ln.displayName=`@mantine/core/Progress`,ln.Section=cn,ln.Root=on,ln.Label=rn;var un={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},dn=ae(n=>{let r=T([`Input`,`InputWrapper`,`Select`],un,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:N,checkIconPosition:te,withCheckIcon:P,withAlignedLabels:F,nothingFoundMessage:ne,name:re,form:ie,searchValue:ae,defaultSearchValue:oe,onSearchChange:se,allowDeselect:ce,error:le,rightSectionPointerEvents:I,id:ue,clearable:de,clearSectionMode:fe,clearButtonProps:pe,hiddenInputProps:me,renderOption:he,onClear:ge,autoComplete:_e,scrollAreaProps:ve,__defaultRightSection:ye,__clearSection:be,__clearable:xe,chevronColor:Se,autoSelectOnBlur:Ce,openOnFocus:we,attributes:Te,...Ee}=r,De=(0,R.useMemo)(()=>ft(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>pt(De),[De]),Ae=e(ue),[je,Me,Ne]=L({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=rt(Pe),[Ie,Le,Re]=L({value:ae,defaultValue:oe,finalValue:Pe?Pe.label:``,onChange:se}),ze=Vt({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Wt.ClearButton,{...pe,onClear:()=>{Me(null,null),Be(``),ge?.()}}),We=de&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Wt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:Te,floatingHeight:A,keepMounted:Ce,onOptionSubmit:e=>{x?.(e);let t=ce&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Wt.Target,{targetType:M?`input`:`button`,autoComplete:_e,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Wt.Chevron,{size:j,error:le,unstyled:o,color:Se}),__clearSection:Ue,__clearable:We,__clearSectionMode:fe,rightSection:N,rightSectionPointerEvents:I||`none`,...Ee,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Qt(e)){if(!C){let t=$t(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{we&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Ce&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:le,attributes:Te})}),(0,z.jsx)(Zt,{data:De,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!ne,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:te,withCheckIcon:P,withAlignedLabels:F,nothingFoundMessage:ne,unstyled:o,labelId:Ee.label?`${Ae}-label`:void 0,"aria-label":Ee.label?void 0:Ee[`aria-label`],renderOption:he,scrollAreaProps:ve})]}),(0,z.jsx)(Wt.HiddenInput,{value:je,name:re,form:ie,disabled:w,...me})]})});dn.classes={...ee.classes,...Wt.classes},dn.displayName=`@mantine/core/Select`;function fn(e){if(e!==void 0)return typeof e==`number`?re(e):e}function pn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":F(nt(e)),"--sg-spacing-y":F(nt(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":fn(r)}:{"--sg-cols":nt(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=F(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=F(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:Ie(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function mn(e){return typeof e==`object`&&e?y(e):[]}function hn(e){return e.sort((e,t)=>Ae(e)-Ae(t))}function gn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return hn(Array.from(new Set([...mn(e),...mn(t),...r===void 0?mn(n):[]])))}function _n({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":F(nt(e)),"--sg-spacing-y":F(nt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":fn(r)}:{"--sg-cols":nt(n)?.toString()}}),u=gn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=F(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=F(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var vn={container:`m_925c2d2c`,root:`m_2415a157`},yn={cols:1,spacing:`md`,type:`media`},bn=n(e=>{let t=T(`SimpleGrid`,yn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:vn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(_n,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(oe,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(pn,{...t,selector:`.${y}`}),(0,z.jsx)(oe,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});bn.classes=vn,bn.displayName=`@mantine/core/SimpleGrid`;var xn=class extends me{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),fe(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ye(t.mutationKey)!==ye(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ge();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){_e.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Sn(e,t){let n=Ce(t),[r]=R.useState(()=>new xn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(_e.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(pe)},[r]);if(i.error&&he(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Cn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),wn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),Tn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),En=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),Dn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:Cn}));On.displayName=`ArrowUpRightIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:wn}));An.displayName=`CaretDownIcon`;var jn=An,Mn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:Tn}));Mn.displayName=`ListMagnifyingGlassIcon`;var Nn=Mn,Pn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:En}));Pn.displayName=`SlidersHorizontalIcon`;var Fn=Pn,In=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:Dn}));In.displayName=`WarningCircleIcon`;var Ln=In;function Rn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function zn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Bn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Rn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=zn(r,u,s[0]),f=zn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Vn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Rn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Wn(d,0,s-r),f=Wn(f,0,l-i),{x:d,y:f}}function Hn(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Rn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Un(e,t,n){let{margin:r,rowHeight:i}=e,a=Rn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Wn(e,t,n){return Math.max(Math.min(e,n),t)}function Gn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Kn(e,t){for(let n=0;nGn(e,t))}function Jn(e,t){return t===`horizontal`?Xn(e):t===`vertical`||t===`wrap`?Yn(e):[...e]}function Yn(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Xn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Zn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Qn(e,t){for(let n=0;ne.static===!0)}function er(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function tr(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Kn(n,i);)i.y++}}return e}function ar(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Jn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=qn(d,t),p=f.length>0;if(p&&c)return tr(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ar(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ar(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return ar(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ar(e,n,l,u,r,c,i)}function sr(e,t,n){return Math.max(t,Math.min(n,e))}var cr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:sr(t,0,Math.max(0,r-e.w)),y:sr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:sr(t,1,Math.max(1,o)),h:sr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:sr(t,e.minW??1,e.maxW??1/0),h:sr(n,e.minH??1,e.maxH??1/0)}}}];function lr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ur(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function dr({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function fr({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function pr(e){return e*100+`%`}function mr(e,t,n,r){return e+n>r?t:n}function hr(e,t,n){return e<0?t:n}function gr(e){return Math.max(0,e)}function _r(e){return Math.max(0,e)}var vr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:hr(o,e.height,i),top:_r(o)}},yr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:mr(e.left,e.width,o,n),left:gr(i)}},br=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:_r(r),left:0}:{height:i,width:a,top:_r(r),left:o}},xr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:hr(r,e.height,a),top:_r(r)}},Sr={n:vr,ne:(e,t,n)=>vr(e,yr(e,t,n)),e:yr,se:(e,t,n)=>xr(e,yr(e,t,n)),s:xr,sw:(e,t,n)=>xr(e,br(e,t)),w:br,nw:(e,t,n)=>vr(e,br(e,t))};function Cr(e,t,n,r){let i=Sr[e];return i?i(t,{...t,...n},r):n}var wr={type:`transform`,scale:1,calcStyle(e){return dr(e)}},Tr={type:`absolute`,scale:1,calcStyle(e){return fr(e)}};function Er(e){return{type:`transform`,scale:e,calcStyle(e){return dr(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var Dr=wr,Or={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},kr={enabled:!0,bounded:!1,threshold:3},Ar={enabled:!0,handles:[`se`]},jr={enabled:!1,defaultItem:{w:1,h:1}};function Mr(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??$n(e).length>0;for(let i=o+1;it.y+t.h)break;Gn(t,o)&&Mr(e,o,n+t[a],r,s)}}t[r]=n}function Nr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Kn(e,t);)t.y--;let i;for(;(i=Kn(e,t))!==void 0;)Mr(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Pr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Kn(e,t);)t.x--;let i;for(;(i=Kn(e,t))!==void 0;)if(Mr(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Kn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Fr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=$n(e),r=Zn(n),i=Yn(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ur(e,t){let n=Hr(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Wr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Gr(e,t,n,r,i,a){let o=e[n];if(o)return tr(o);let s=e[r],c=Hr(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Jr=b(((e,t)=>{var n=qr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Yr=b(((e,t)=>{t.exports=Jr()()})),Xr=se(Yr(),1),Zr=se(k(),1);function Qr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Qr(e.changedTouches,e=>t===e.identifier)}function Si(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ci(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function wi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ci();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&Di(e.body,`react-draggable-transparent-selection`)}function Ti(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Ei(e)}):Ei(e)}function Ei(e){if(e)try{e.body&&Oi(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function Di(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Oi(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function ki(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Ii(r);let i=Li(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+ti(s.paddingLeft)+ti(o.marginLeft),top:-i.offsetTop+ti(s.paddingTop)+ti(o.marginTop),right:gi(a)-mi(i)-i.offsetLeft+ti(s.paddingRight)-ti(o.marginRight),bottom:hi(a)-pi(i)-i.offsetTop+ti(s.paddingBottom)-ti(o.marginBottom)}}return ei(r.right)&&(t=Math.min(t,r.right)),ei(r.bottom)&&(n=Math.min(n,r.bottom)),ei(r.left)&&(t=Math.max(t,r.left)),ei(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Ai(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function ji(e){return e.props.axis===`both`||e.props.axis===`x`}function Mi(e){return e.props.axis===`both`||e.props.axis===`y`}function Ni(e,t,n){let r=typeof t==`number`?xi(e,t):null;if(typeof t==`number`&&!r)return null;let i=Li(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return _i(r||e,a,n.props.scale)}function Pi(e,t,n){let r=!ei(e.lastX),i=Li(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Fi(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ii(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Li(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Ri=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},zi={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Bi=zi.mouse,Vi=class extends R.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ui(e.target,this.props.handle,t)||this.props.cancel&&ui(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=Si(e);this.touchIdentifier=r;let i=Ni(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Pi(this,a,o);Ri(`DraggableCore: handleDragStart: %j`,s),Ri(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&wi(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,di(n,Bi.move,this.handleDrag),di(n,Bi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Ni(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Ai(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Pi(this,n,r);if(Ri(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Ni(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Ai(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Pi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Ti(a.ownerDocument),Ri(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Ri(`DraggableCore: Removing handlers`),fi(a.ownerDocument,Bi.move,this.handleDrag),fi(a.ownerDocument,Bi.stop,this.handleDragStop))},this.onMouseDown=e=>(Bi=zi.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Bi=zi.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Bi=zi.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Bi=zi.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&di(e,zi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;fi(t,zi.mouse.move,this.handleDrag),fi(t,zi.touch.move,this.handleDrag),fi(t,zi.mouse.stop,this.handleDragStop),fi(t,zi.touch.stop,this.handleDragStop),fi(e,zi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Ti(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Zr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Ri(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return R.cloneElement(R.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Vi.displayName=`DraggableCore`,Vi.propTypes={allowAnyClick:Xr.default.bool,allowMobileScroll:Xr.default.bool,children:Xr.default.node.isRequired,disabled:Xr.default.bool,enableUserSelectHack:Xr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Xr.default.arrayOf(Xr.default.number),handle:Xr.default.string,cancel:Xr.default.string,nodeRef:Xr.default.object,nonce:Xr.default.string,onStart:Xr.default.func,onDrag:Xr.default.func,onStop:Xr.default.func,onMouseDown:Xr.default.func,scale:Xr.default.number,className:ni,style:ni,transform:ni},Vi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Hi=class extends R.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Ri(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Fi(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Ri(`Draggable: onDrag: %j`,t);let n=Fi(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=ki(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Fi(this,t))===!1)return!1;Ri(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Ri(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Zr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:s,position:c,positionOffset:l,scale:u,...d}=this.props,f={},p=null,m=!c||this.state.dragging,h=c||r,g={x:ji(this)&&m?this.state.x:h.x,y:Mi(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=yi(g,l):f=vi(g,l);let _=R.Children.only(n),v=o(_.props.className||``,i,{[a]:this.state.dragging,[s]:this.state.dragged});return R.createElement(Vi,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},R.cloneElement(_,{className:v,style:{..._.props.style,...f},transform:p}))}};Hi.displayName=`Draggable`,Hi.propTypes={...Vi.propTypes,axis:Xr.default.oneOf([`both`,`x`,`y`,`none`]),bounds:Xr.default.oneOfType([Xr.default.shape({left:Xr.default.number,right:Xr.default.number,top:Xr.default.number,bottom:Xr.default.number}),Xr.default.string,Xr.default.oneOf([!1])]),defaultClassName:Xr.default.string,defaultClassNameDragging:Xr.default.string,defaultClassNameDragged:Xr.default.string,defaultPosition:Xr.default.shape({x:Xr.default.number,y:Xr.default.number}),positionOffset:Xr.default.shape({x:Xr.default.oneOfType([Xr.default.number,Xr.default.string]),y:Xr.default.oneOfType([Xr.default.number,Xr.default.string])}),position:Xr.default.shape({x:Xr.default.number,y:Xr.default.number}),className:ni,style:ni,transform:ni},Hi.defaultProps={...Vi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Ui=b(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>De,default:()=>Oe}),t.exports=d(f);var p=u(S()),m=u(Yr()),h=u(k()),g=Ui();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function se(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ce(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function le(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??ce();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ue(e.body,`react-draggable-transparent-selection`)}function I(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{L(e)}):L(e)}function L(e){if(e)try{e.body&&de(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function ue(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function de(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function fe(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:ye(r);let i=be(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+b(s.paddingLeft)+b(o.marginLeft),top:-i.offsetTop+b(s.paddingTop)+b(o.marginTop),right:F(a)-te(i)-i.offsetLeft+b(s.paddingRight)-b(o.marginRight),bottom:P(a)-N(i)-i.offsetTop+b(s.paddingBottom)-b(o.marginBottom)}}return y(r.right)&&(t=Math.min(t,r.right)),y(r.bottom)&&(n=Math.min(n,r.bottom)),y(r.left)&&(t=Math.max(t,r.left)),y(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function me(e){return e.props.axis===`both`||e.props.axis===`x`}function he(e){return e.props.axis===`both`||e.props.axis===`y`}function ge(e,t,n){let r=typeof t==`number`?oe(e,t):null;if(typeof t==`number`&&!r)return null;let i=be(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return ne(r||e,a,n.props.scale)}function _e(e,t,n){let r=!y(e.lastX),i=be(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ve(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function ye(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function be(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var xe=u(S()),Se=u(Yr()),Ce=u(k()),we=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Te={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Ee=Te.mouse,De=class extends xe.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!j(e.target,this.props.handle,t)||this.props.cancel&&j(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=se(e);this.touchIdentifier=r;let i=ge(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=_e(this,a,o);we(`DraggableCore: handleDragStart: %j`,s),we(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&le(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,ee(n,Ee.move,this.handleDrag),ee(n,Ee.stop,this.handleDragStop))},this.handleDrag=e=>{let t=ge(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=pe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(we(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=ge(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=pe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I(a.ownerDocument),we(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(we(`DraggableCore: Removing handlers`),M(a.ownerDocument,Ee.move,this.handleDrag),M(a.ownerDocument,Ee.stop,this.handleDragStop))},this.onMouseDown=e=>(Ee=Te.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Ee=Te.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Ee=Te.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Ee=Te.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&ee(e,Te.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;M(t,Te.mouse.move,this.handleDrag),M(t,Te.touch.move,this.handleDrag),M(t,Te.mouse.stop,this.handleDragStop),M(t,Te.touch.stop,this.handleDragStop),M(e,Te.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ce.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(we(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return xe.cloneElement(xe.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};De.displayName=`DraggableCore`,De.propTypes={allowAnyClick:Se.default.bool,allowMobileScroll:Se.default.bool,children:Se.default.node.isRequired,disabled:Se.default.bool,enableUserSelectHack:Se.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Se.default.arrayOf(Se.default.number),handle:Se.default.string,cancel:Se.default.string,nodeRef:Se.default.object,nonce:Se.default.string,onStart:Se.default.func,onDrag:Se.default.func,onStop:Se.default.func,onMouseDown:Se.default.func,scale:Se.default.number,className:x,style:x,transform:x},De.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Oe=class extends p.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(we(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ve(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;we(`Draggable: onDrag: %j`,t);let n=ve(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=fe(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ve(this,t))===!1)return!1;we(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(we(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=h.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,_={x:me(this)&&m?this.state.x:h.x,y:he(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=ie(_,c):d=re(_,c);let v=p.Children.only(n),y=(0,g.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return p.createElement(De,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},p.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};Oe.displayName=`Draggable`,Oe.propTypes={...De.propTypes,axis:m.default.oneOf([`both`,`x`,`y`,`none`]),bounds:m.default.oneOfType([m.default.shape({left:m.default.number,right:m.default.number,top:m.default.number,bottom:m.default.number}),m.default.string,m.default.oneOf([!1])]),defaultClassName:m.default.string,defaultClassNameDragging:m.default.string,defaultClassNameDragged:m.default.string,defaultPosition:m.default.shape({x:m.default.number,y:m.default.number}),positionOffset:m.default.shape({x:m.default.oneOfType([m.default.number,m.default.string]),y:m.default.oneOfType([m.default.number,m.default.string])}),position:m.default.shape({x:m.default.number,y:m.default.number}),className:x,style:x,transform:x},Oe.defaultProps={...De.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:De})})),Gi=b(((e,t)=>{var n=Wi(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),Ki=b((e=>{e.__esModule=!0,e.cloneElement=c;var t=n(S());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(Yr());Gi();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),Ji=b((e=>{e.__esModule=!0,e.default=void 0;var t=o(S()),n=Gi(),r=Ki(),i=qi(),a=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function o(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(o=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=u({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,i=e.children,o=e.className,l=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let d=e.resizeHandles;e.transformScale;let f=c(e,a);return(0,r.cloneElement)(i,u(u({},f),{},{className:(o?o+` `:``)+`react-resizable`,children:[...t.Children.toArray(i.props.children),...d.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,s({},l,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};e.default=m,m.propTypes=i.resizableProps,m.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),Yi=b((e=>{e.__esModule=!0,e.default=void 0;var t=s(S()),n=o(Yr()),r=o(Ji()),i=qi(),a=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,i=e.handleSize;e.onResize;let o=e.onResizeStart,s=e.onResizeStop,l=e.draggableOpts,d=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,h=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=m(e,a);return t.createElement(r.default,{axis:h,draggableOpts:l,handle:n,handleSize:i,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:d,onResizeStart:o,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},t.createElement(`div`,c({},y,{style:u(u({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=h,h.propTypes=u(u({},i.resizableProps),{},{children:n.default.element})})),Xi=b(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Ji().default,t.exports.ResizableBox=Yi().default})),Zi=b(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function ee(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=ee,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),Qi=Xi(),$i=Zi();function ea(e){let{children:t,cols:n,containerWidth:r,margin:i,containerPadding:a,rowHeight:s,maxRows:c,isDraggable:l,isResizable:u,isBounded:d,static:f,useCSSTransforms:p=!0,usePercentages:m=!1,transformScale:h=1,positionStrategy:g,dragThreshold:_=0,droppingPosition:v,className:y=``,style:b,handle:x=``,cancel:S=``,x:C,y:w,w:T,h:E,minW:D=1,maxW:O=1/0,minH:k=1,maxH:A=1/0,i:j,resizeHandles:ee,resizeHandle:M,constraints:N=cr,layoutItem:te,layout:P=[],onDragStart:F,onDrag:ne,onDragStop:re,onResizeStart:ie,onResize:ae,onResizeStop:oe}=e,[se,ce]=(0,R.useState)(!1),[le,I]=(0,R.useState)(!1),L=(0,R.useRef)(null),ue=(0,R.useRef)({left:0,top:0}),de=(0,R.useRef)({top:0,left:0,width:0,height:0}),fe=(0,R.useRef)(void 0),pe=(0,R.useRef)(P);pe.current=P;let me=(0,R.useRef)(null),he=(0,R.useRef)(null),ge=(0,R.useRef)(!1),_e=(0,R.useRef)({x:0,y:0}),ve=(0,R.useRef)(!1),ye=(0,R.useMemo)(()=>({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:c,rowHeight:s}),[n,a,r,i,c,s]),be=(0,R.useMemo)(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:s,margin:i,layout:[]}),[n,c,r,s,i]),xe=(0,R.useCallback)(()=>({...be,layout:pe.current}),[be]),Se=(0,R.useMemo)(()=>te??{i:j,x:C,y:w,w:T,h:E,minW:D,maxW:O,minH:k,maxH:A},[te,j,C,w,T,E,D,O,k,A]),Ce=(0,R.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return dr(e);let t=fr(e);return m?{...t,left:pr(e.left/r),width:pr(e.width/r)}:t},[g,p,m,r]),we=(0,R.useCallback)((e,{node:t})=>{if(!F)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(ue.current=l,_>0){let t=e;_e.current={x:t.clientX,y:t.clientY},ge.current=!0,ve.current=!1,ce(!0);return}ce(!0);let u=Hn(ye,l.top,l.left),{x:d,y:f}=lr(N,Se,u.x,u.y,xe());F(j,d,f,{e,node:t,newPosition:l})},[F,h,ye,g,_,N,Se,xe,j]),Te=(0,R.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!ne||!se)return;let o=e;if(ge.current&&!ve.current){let n=o.clientX-_e.current.x,r=o.clientY-_e.current.y;if(Math.hypot(n,r)<_)return;if(ve.current=!0,ge.current=!1,F){let n=Hn(ye,ue.current.top,ue.current.left),{x:r,y:i}=lr(N,Se,n.x,n.y,xe());F(j,r,i,{e,node:t,newPosition:ue.current})}}let c=ue.current.top+a,l=ue.current.left+n;if(d){let{offsetParent:e}=t;if(e){let t=e.clientHeight-zn(E,s,i[1]);c=Wn(c,0,t);let n=Rn(ye),a=r-zn(T,n,i[0]);l=Wn(l,0,a)}}let u={top:c,left:l};ue.current=u;let f=Hn(ye,c,l),{x:p,y:m}=lr(N,Se,f.x,f.y,xe());ne(j,p,m,{e,node:t,newPosition:u})},[ne,F,se,_,d,E,s,i,ye,r,T,j,N,Se,xe]),Ee=(0,R.useCallback)((e,{node:t})=>{if(!re||!se)return;let n=ge.current;if(ge.current=!1,ve.current=!1,_e.current={x:0,y:0},n){ce(!1),ue.current={left:0,top:0};return}let{left:r,top:i}=ue.current,a={top:i,left:r};ce(!1),ue.current={left:0,top:0};let o=Hn(ye,i,r),{x:s,y:c}=lr(N,Se,o.x,o.y,xe());re(j,s,c,{e,node:t,newPosition:a})},[re,se,ye,N,Se,xe,j]);me.current=we,he.current=Te;let De=(0,R.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?ie:o===`onResize`?ae:oe;if(!s)return;let c;c=t?Cr(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=Un(ye,c.width,c.height),{w:u,h:d}=ur(N,Se,l.w,l.h,i,xe());s(j,u,d,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[ie,ae,oe,r,ye,j,N,Se,xe]),Oe=(0,R.useCallback)((e,t)=>{I(!0);let n=Bn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResizeStart`)},[De,ye,C,w,T,E]),ke=(0,R.useCallback)((e,t)=>{let n=Bn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResize`)},[De,ye,C,w,T,E]),Ae=(0,R.useCallback)((e,t)=>{I(!1),de.current={top:0,left:0,width:0,height:0};let n=Bn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResizeStop`)},[De,ye,C,w,T,E]);(0,R.useEffect)(()=>{if(!v)return;let e=L.current;if(!e)return;let t=fe.current||{left:0,top:0},n=se&&(v.left!==t.left||v.top!==t.top);if(!se){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};me.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-ue.current.left,deltaY:v.top-ue.current.top,lastX:ue.current.left,lastY:ue.current.top,x:v.left,y:v.top};he.current?.(v.e,t)}fe.current=v},[v,se,j]);let je=Bn(ye,C,w,T,E,se?ue.current:null,le?de.current:null),Me=R.Children.only(t),Ne=Rn(ye),Pe=[zn(D,Ne,i[0]),zn(k,s,i[1])],Fe=[zn(O,Ne,i[0]),zn(A,s,i[1])],Ie=Me.props,Le=Ie.className,Re=Ie.style,ze=R.cloneElement(Me,{ref:L,className:o(`react-grid-item`,Le,y,{static:f,resizing:le,"react-draggable":l,"react-draggable-dragging":se,dropping:!!v,cssTransforms:p}),style:{...b,...Re,...Ce(je)}}),Be=M;return ze=(0,z.jsx)(Qi.Resizable,{draggableOpts:{disabled:!u},className:u?void 0:`react-resizable-hide`,width:je.width,height:je.height,minConstraints:Pe,maxConstraints:Fe,onResizeStart:Oe,onResize:ke,onResizeStop:Ae,transformScale:h,resizeHandles:ee,handle:Be,children:ze}),ze=(0,z.jsx)(Vi,{disabled:!l,onStart:we,onDrag:Te,onStop:Ee,handle:x,cancel:`.react-resizable-handle`+(S?`,`+S:``),scale:h,nodeRef:L,children:ze}),ze}var ta=()=>{},na=`react-grid-layout`,ra=!1;try{ra=/firefox/i.test(navigator.userAgent)}catch{}function ia(e,t){let n=R.Children.toArray(e),r=R.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!R.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(er(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Zn(i),w:1,h:1})}});let o=ir(i,{cols:n});return r.compact(o,n)}function oa(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:s,positionStrategy:c=Dr,compactor:l,constraints:u=cr,layout:d=[],droppingItem:f,autoSize:p=!0,className:m=``,style:h={},innerRef:g,onLayoutChange:_=ta,onDragStart:v=ta,onDrag:y=ta,onDragStop:b=ta,onResizeStart:x=ta,onResize:S=ta,onResizeStop:C=ta,onDrop:w=ta,onDropDragOver:T=ta}=e,E=(0,R.useMemo)(()=>({...Or,...r}),[r]),D=(0,R.useMemo)(()=>({...kr,...i}),[i]),O=(0,R.useMemo)(()=>({...Ar,...a}),[a]),k=(0,R.useMemo)(()=>({...jr,...s}),[s]),{cols:A,rowHeight:j,maxRows:ee,margin:M,containerPadding:N}=E,{enabled:te,bounded:P,handle:F,cancel:ne,threshold:re}=D,{enabled:ie,handles:ae,handleComponent:oe}=O,{enabled:se,defaultItem:ce,onDragOver:le}=k,I=l??Vr(`vertical`),L=I.type,ue=I.allowOverlap,de=I.preventCollision??!1,fe=(0,R.useMemo)(()=>f??{i:`__dropping-elem__`,...ce},[f,ce]),pe=c.type===`transform`,me=c.scale,he=N??M,[ge,_e]=(0,R.useState)(!1),[ve,ye]=(0,R.useState)(()=>aa(d,t,A,I)),[be,xe]=(0,R.useState)(null),[Se,Ce]=(0,R.useState)(!1),[we,Te]=(0,R.useState)(null),[Ee,De]=(0,R.useState)(),Oe=(0,R.useRef)(null),ke=(0,R.useRef)(null),Ae=(0,R.useRef)(null),je=(0,R.useRef)(0),Me=(0,R.useRef)(ve),Ne=(0,R.useRef)(d),Pe=(0,R.useRef)(t),Fe=(0,R.useRef)(L),Ie=(0,R.useRef)(ve);Ie.current=ve,(0,R.useEffect)(()=>{_e(!0),(0,$i.deepEqual)(ve,d)||_(ve)},[]),(0,R.useEffect)(()=>{if(be||we)return;let e=!(0,$i.deepEqual)(d,Ne.current),n=!ia(t,Pe.current),r=L!==Fe.current;if(e||n||r){let n=aa(e?d:ve,t,A,I);(0,$i.deepEqual)(n,ve)||ye(n)}Ne.current=d,Pe.current=t,Fe.current=L},[d,t,A,L,I,be,we,ve]),(0,R.useEffect)(()=>{if(!be&&!(0,$i.deepEqual)(ve,Me.current)){Me.current=ve;let e=ve.filter(e=>e.i!==fe.i);_(e)}},[ve,be,_,fe.i]);let Le=(0,R.useMemo)(()=>{if(!p)return;let e=Zn(ve),t=he[1];return e*j+(e-1)*M[1]+t*2+`px`},[p,ve,j,M,he]),Re=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Qn(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};Oe.current=er(a),Ae.current=i,xe(o),v(i,a,a,null,r.e,r.node)},[v]),ze=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Oe.current,o=Qn(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=ar(i,o,t,n,!0,de,L,A,ue);y(c,a,o,s,r.e,r.node),ye(I.compact(c,A)),xe(s)},[de,L,A,ue,I,y]),Be=(0,R.useCallback)((e,t,n,r)=>{if(!be)return;let i=Ie.current,a=Oe.current,o=Qn(i,e);if(!o)return;let s=ar(i,o,t,n,!0,de,L,A,ue),c=I.compact(s,A);b(c,a,o,null,r.e,r.node);let l=Ae.current;Oe.current=null,Ae.current=null,xe(null),ye(c),l&&!(0,$i.deepEqual)(l,c)&&_(c)},[be,de,L,A,ue,I,b,_]),Ve=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Qn(i,e);a&&(ke.current=er(a),Ae.current=i,Ce(!0),x(i,a,a,null,r.e,r.node))},[x]),He=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=ke.current,{handle:o}=r,s=!1,c,l,[u,d]=rr(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),de&&!ue&&qn(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=ar(u,d,c,l,!0,de,L,A,ue));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node),ye(I.compact(f,A)),xe(p)},[de,L,A,ue,I,S]),Ue=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=ke.current,o=Qn(i,e),s=I.compact(i,A);C(s,a,o??null,null,r.e,r.node);let c=Ae.current;ke.current=null,Ae.current=null,xe(null),Ce(!1),ye(s),c&&!(0,$i.deepEqual)(c,s)&&_(s)},[A,I,C,_]),We=(0,R.useCallback)(()=>{let e=Ie.current;if(!e.some(e=>e.i===fe.i)){Te(null),xe(null),De(void 0);return}let t=I.compact(e.filter(e=>e.i!==fe.i),A);ye(t),Te(null),xe(null),De(void 0)},[fe.i,A,I]),Ge=(0,R.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),ra&&!e.nativeEvent.target?.classList.contains(na))return!1;let t=le?le(e.nativeEvent):T(e);if(t===!1)return we&&We(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...fe,...a},s=e.currentTarget.getBoundingClientRect(),c={cols:A,margin:M,maxRows:ee,rowHeight:j,containerWidth:n,containerPadding:he},l=Rn(c),u=zn(o.w,l,M[0]),d=zn(o.h,j,M[1]),f=u/2,p=d/2,m=e.clientX-s.left+r-f,h=e.clientY-s.top+i-p,g=Math.max(0,m),_=Math.max(0,h),v={left:g/me,top:_/me,e:e.nativeEvent};if(we)Ee&&(Ee.left!==v.left||Ee.top!==v.top)&&De(v);else{let e=Vn(c,_,g,o.w,o.h);Te((0,z.jsx)(`div`,{},o.i)),De(v);let t=Ie.current.filter(e=>e.i!==o.i);ye([...t,{...o,x:e.x,y:e.y,static:!1,isDraggable:!0}])}},[we,Ee,fe,le,T,We,me,A,M,ee,j,n,he]),Ke=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),je.current--,je.current<0&&(je.current=0),je.current===0&&We()},[We]),qe=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),je.current++},[]),Je=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=Ie.current,n=t.find(e=>e.i===fe.i);je.current=0,We(),w(t,n,e.nativeEvent)},[fe.i,We,w]),Ye=(0,R.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=Qn(ve,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&te,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&ie,o=r.resizeHandles||[...ae],s=i&&P&&r.isBounded!==!1,l=oe;return(0,z.jsx)(ea,{containerWidth:n,cols:A,margin:M,containerPadding:he,maxRows:ee,rowHeight:j,cancel:ne,handle:F,onDragStart:Re,onDrag:ze,onDragStop:Be,onResizeStart:Ve,onResize:He,onResizeStop:Ue,isDraggable:i,isResizable:a,isBounded:s,useCSSTransforms:pe&&ge,usePercentages:!ge,transformScale:me,positionStrategy:c,dragThreshold:re,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?Ee:void 0,resizeHandles:o,resizeHandle:l,constraints:u,layoutItem:r,layout:ve,children:e},r.i)},[ve,n,A,M,he,ee,j,ne,F,Re,ze,Be,Ve,He,Ue,te,ie,P,pe,ge,me,c,re,Ee,ae,oe,u]),Xe=()=>be?(0,z.jsx)(ea,{w:be.w,h:be.h,x:be.x,y:be.y,i:be.i,className:`react-grid-placeholder ${Se?`placeholder-resizing`:``}`,containerWidth:n,cols:A,margin:M,containerPadding:he,maxRows:ee,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:pe,transformScale:me,constraints:u,layout:ve,children:(0,z.jsx)(`div`,{})}):null,Ze=o(na,m),Qe={height:Le,...h};return(0,z.jsxs)(`div`,{ref:g,className:Ze,style:Qe,onDrop:se?Je:void 0,onDragLeave:se?Ke:void 0,onDragEnter:se?qe:void 0,onDragOver:se?Ge:void 0,children:[R.Children.map(t,e=>R.isValidElement(e)?Ye(e):null),se&&we&&Ye(we,!0),Xe()]})}var sa={lg:1200,md:996,sm:768,xs:480,xxs:0},ca={lg:12,md:10,sm:6,xs:4,xxs:2},la=()=>{};function ua(e,t,n,r){let i=[];R.Children.forEach(t,t=>{if(!R.isValidElement(t)||t.key===null)return;let n=String(t.key),r=e.find(e=>e.i===n);if(r)i.push({...r,i:n});else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Zn(i),w:1,h:1})}});let a=ir(i,{cols:n});return r.compact(a,n)}function da(e){let{children:t,width:n,breakpoint:r,breakpoints:i=sa,cols:a=ca,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=la,onLayoutChange:p=la,onWidthChange:m=la,...h}=e,g=d??Vr(`vertical`),_=g.type,v=g.allowOverlap,y=(0,R.useMemo)(()=>r??Ur(i,n),[]),b=(0,R.useMemo)(()=>Wr(y,a),[y,a]),x=(0,R.useMemo)(()=>Gr(o,i,y,y,b,_),[]),[S,C]=(0,R.useState)(y),[w,T]=(0,R.useState)(b),[E,D]=(0,R.useState)(x),[O,k]=(0,R.useState)(o),A=(0,R.useRef)(n),j=(0,R.useRef)(r),ee=(0,R.useRef)(i),M=(0,R.useRef)(a),N=(0,R.useRef)(o),te=(0,R.useRef)(_),P=(0,R.useRef)(O);(0,R.useEffect)(()=>{P.current=O},[O]);let F=(0,R.useMemo)(()=>(0,$i.deepEqual)(o,N.current)?null:Gr(o,i,S,S,w,g),[o,i,S,w,g]),ne=F??E;(0,R.useEffect)(()=>{F!==null&&(D(F),k(o),P.current=o,N.current=o)},[F,o]),(0,R.useEffect)(()=>{if(_!==te.current){let e=g.compact(tr(ne),w),t={...P.current,[S]:e};D(e),k(t),P.current=t,p(e,t),te.current=_}},[_,g,ne,w,v,S,p]),(0,R.useEffect)(()=>{let e=n!==A.current,o=r!==j.current,s=!(0,$i.deepEqual)(i,ee.current),c=!(0,$i.deepEqual)(a,M.current);if(e||o||s||c){let e=r??Ur(i,n),o=Wr(e,a),d=S;if(d!==e||s||c){let n={...P.current};n[d]||(n[d]=tr(E));let r=Gr(n,i,e,d,o,g);r=ua(r,t,o,g),n[e]=r,C(e),T(o),D(r),k(n),P.current=n,f(e,o),p(r,n)}let h=Kr(l,e),_=u?Kr(u,e):null;m(n,h,o,_),A.current=n,j.current=r,ee.current=i,M.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let re=(0,R.useCallback)(e=>{let t={...P.current,[S]:e};D(e),k(t),P.current=t,p(e,t)},[S,p]),ie=(0,R.useMemo)(()=>Kr(l,S),[l,S]),ae=(0,R.useMemo)(()=>u===null?null:Kr(u,S),[u,S]),oe=(0,R.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:ie,containerPadding:ae}),[w,s,c,ie,ae]);return(0,z.jsx)(oa,{...h,width:n,gridConfig:oe,compactor:g,onLayoutChange:re,layout:ne,children:t})}function fa(e){let{children:t,width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,rowHeight:u,maxRows:d,margin:f,containerPadding:p,droppingItem:m,compactType:h,preventCollision:g=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:y=!0,isBounded:b=!1,draggableHandle:x,draggableCancel:S,isResizable:C=!0,resizeHandles:w=[`se`],resizeHandle:T,isDroppable:E=!1,useCSSTransforms:D=!0,transformScale:O=1,autoSize:k,className:A,style:j,innerRef:ee,onDragStart:M,onDrag:N,onDragStop:te,onResizeStart:P,onResize:F,onResizeStop:ne,onDrop:re,onDropDragOver:ie}=e,ae=h===void 0?`vertical`:h;v===!1&&(ae=null);let oe={enabled:y,bounded:b,handle:x,cancel:S},se={enabled:C,handles:w,handleComponent:T},ce={enabled:E},le;le=D?O===1?wr:Er(O):Tr;let I=Vr(ae,_,g);return(0,z.jsx)(da,{width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,rowHeight:u,maxRows:d,margin:f,containerPadding:p,compactor:I,dragConfig:oe,resizeConfig:se,dropConfig:ce,positionStrategy:le,droppingItem:m,autoSize:k,className:A,style:j,innerRef:ee,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,onDragStart:M,onDrag:N,onDragStop:te,onResizeStart:P,onResize:F,onResizeStop:ne,onDrop:re,onDropDragOver:ie,children:t})}fa.displayName=`ResponsiveReactGridLayout`;var pa=fa,ma=`react-grid-layout`;function ha(e){function t(t){let{measureBeforeMount:n=!1,className:r,style:i,...a}=t,[s,c]=(0,R.useState)(1280),[l,u]=(0,R.useState)(!1),d=(0,R.useRef)(null),f=(0,R.useRef)(null);return(0,R.useEffect)(()=>{u(!0)},[]),(0,R.useEffect)(()=>{let e=d.current;if(!(e instanceof HTMLElement))return;let t=null,n=new ResizeObserver(e=>{if(e[0]){let n=Math.round(e[0].contentRect.width);t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{c(e=>e===n?e:n),t=null})}});return n.observe(e),f.current=n,()=>{t!==null&&cancelAnimationFrame(t),n.unobserve(e),n.disconnect()}},[l]),n&&!l?(0,z.jsx)(`div`,{className:o(r,ma),style:i,ref:d}):(0,z.jsx)(e,{innerRef:d,className:r,style:i,...a,width:s})}return t.displayName=`WidthProvider(${e.displayName||e.name||`Component`})`,t}function ga(e){return e.reduce((e,t)=>Math.max(e,t.y+t.h),0)}function _a(e,t){return e.map(e=>({...e,x:0,w:t,minW:Math.min(e.minW??1,t)}))}var va=[`overview`,`topology`,`activity`,`assistant`,`performance`,`trace`,`logs`],ya={overview:{w:4,h:3,minW:3,minH:3},activity:{w:4,h:5,minW:3,minH:4},assistant:{w:4,h:3,minW:3,minH:3},topology:{w:8,h:5,minW:4,minH:4},performance:{w:8,h:5,minW:4,minH:4},logs:{w:8,h:5,minW:4,minH:4},trace:{w:8,h:4,minW:4,minH:4}};function ba(e,t){return e.xe.y)),o=(t,r)=>!e.some(e=>ba(e,{x:t,y:a,w:r,h:n}));for(let e=0;e+t<=r;e+=1)if(o(e,t))return{x:e,y:a,w:t};let s=e.reduce((e,t)=>ba(t,{x:0,y:a,w:r,h:n})?Math.max(e,t.x+t.w):e,0),c={x:s,w:0};for(let e=Math.min(s,r);ec.w&&(c={x:e,w:t-e}),e=t}return c.w>=i?{x:c.x,y:a,w:c.w}:{x:0,y:ga(e),w:t}}var Sa=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Ca(e){return`${(e*100).toFixed(e>=.1?1:2)}%`}function wa(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(e>=100?0:1)}ms`}function Ta(e,t,n=!1){let r=new Date(e);if(Number.isNaN(r.valueOf()))return e;let[i,a]=t.split(`/`),o=new Date(i),s=new Date(a),c=!Number.isNaN(o.valueOf())&&!Number.isNaN(s.valueOf())&&s.valueOf()-o.valueOf()>864e5;return r.toLocaleString([],{...c?{month:`short`,day:`numeric`}:{},hour:`numeric`,minute:`2-digit`,...n?{second:`2-digit`}:{}})}var Ea=function(e,t){return Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ea(e,t)};function B(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Ea(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Da=`12px sans-serif`,Oa=20,ka=100,Aa=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function ja(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n=0)s=o*n.length;else for(var c=0;c=Ka&&(Ga=0),Ga++}function Ja(){var e=[...arguments];typeof console<`u`&&console.error.apply(console,e)}function V(e){if(typeof e!=`object`||!e)return e;var t=e,n=Ia.call(e);if(n===`[object Array]`){if(!To(e)){t=[];for(var r=0,i=e.length;r`u`&&typeof self<`u`?Io.worker=!0:!Io.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(Io.node=!0,Io.svgSupported=!0):Lo(navigator.userAgent,Io);function Lo(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var Ro=`.`,zo=`___EC__COMPONENT__CONTAINER___`,Bo=`___EC__EXTENDED_CLASS___`;function Vo(e){var t={main:``,sub:``};if(e){var n=e.split(Ro);t.main=n[0]||``,t.sub=n[1]||``}return t}function Ho(e){xo(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function Uo(e){return!!(e&&e[Bo])}function Wo(e,t){e.$constructor=e,e.extend=function(e){var t=this,n;return Go(t)?n=function(e){B(t,e);function t(){return e.apply(this,arguments)||this}return t}(t):(n=function(){(e.$constructor||t).apply(this,arguments)},$a(n,this)),H(n.prototype,e),n[Bo]=!0,n.extend=this.extend,n.superCall=Yo,n.superApply=Xo,n.superClass=t,n}}function Go(e){return K(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function Ko(e,t){e.extend=t.extend}var qo=Math.round(Math.random()*10);function Jo(e){var t=[`__\0is_clz`,qo++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function Yo(e,t){var n=[...arguments].slice(2);return this.superClass.prototype[t].apply(e,n)}function Xo(e,t,n){return this.superClass.prototype[t].apply(e,n)}function Zo(e){var t={};e.registerClass=function(e){var r=e.type||e.prototype.type;if(r){Ho(r),e.prototype.type=r;var i=Vo(r);if(!i.sub)t[i.main]=e;else if(i.sub!==zo){var a=n(i);a[i.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[zo]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=Vo(e),r=[],i=t[n.main];return i&&i[zo]?U(i,function(e,t){t!==zo&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[Vo(e).main]},e.getAllClassMainTypes=function(){var e=[];return U(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[Vo(e).main];return n&&n[zo]};function n(e){var n=t[e.main];return(!n||!n[zo])&&(n=t[e.main]={},n[zo]=!0),n}}function Qo(e,t){for(var n=0;n=0||i&&Qa(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var $o=Qo([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),es=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return $o(this,e,t)},e}(),ts=function(){function e(e){this.value=e}return e}(),ns=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new ts(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),rs=function(){function e(e){this._list=new ns,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new ts(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),is=new rs(50);function as(e){if(typeof e==`string`){var t=is.get(e);return t&&t.image}return e}function os(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=is.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!cs(t)&&a.pending.push(o)):(t=Na.loadImage(e,ss,ss),t.__zrImageSrc=e,is.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}function ss(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;tu||d>f||p>m||h>g)return!1;var _=!(u=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){Zs(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n){e!==t&&Zs(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Vs.x=Us.x=t.x,Vs.y=Ws.y=t.y,Hs.x=Ws.x=t.x+t.width,Hs.y=Us.y=t.y+t.height,Vs.transform(n),Ws.transform(n),Hs.transform(n),Us.transform(n),e.x=Is(Vs.x,Hs.x,Us.x,Ws.x),e.y=Is(Vs.y,Hs.y,Us.y,Ws.y);var s=Ls(Vs.x,Hs.x,Us.x,Ws.x),c=Ls(Vs.y,Hs.y,Us.y,Ws.y);e.width=s-e.x,e.height=c-e.y},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=us(e||[]),ps(e,e,bs(rc,-t.x,-t.y)),hs(e,e,bs(rc,r,i)),ps(e,e,bs(rc,n.x,n.y)),e},e}(),Ys=Z.create,Xs=Z.set,Zs=Z.copy,Qs=Z.calculateTransform,$s=Z.applyTransform,ec=Z.contain,tc=new Z(0,0,0,0),nc=new Z(0,0,0,0),rc=[];function ic(e,t,n,r,i,a,o,s){var c=Rs(t-n),l=Rs(r-e),u=Is(c,l),d=zs[i],f=zs[1-i],p=Bs[i];t=l||!Gs.bidirectional)&&(Ks[d]=-l,Ks[f]=0,Gs.useDir&&Gs.calcDirMTV())))}function ac(){var e=0,t=new Fs,n=new Fs,r={minTv:new Fs,maxTv:new Fs,useDir:!1,dirMinTv:new Fs,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=Ls(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=r.minTv,o=r.dirMinTv,s=a.y*a.y+a.x*a.x,c=Math.sin(e),l=Math.cos(e),u=c*a.y+l*a.x;if(i(u)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(n.x=s*l/u,n.y=s*c/u,i(n.x)&&i(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()=uc)){e||=`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=Na.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?lc=uc:i>2&&lc++,t}}var lc=0,uc=5;function dc(e,t){return e.asciiWidthMapTried||=(e.asciiWidthMap=cc(e.font),!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function fc(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=Na.measureText(t,e.font).width,n.put(t,r)),r}function pc(e,t,n,r){var i=fc(oc(t),e),a=_c(t);return new Z(hc(0,i,n),gc(0,a,r),i,a)}function mc(e,t,n,r){var i=((e||``)+``).split(` +`);if(i.length===1)return pc(i[0],t,n,r);for(var a=new Z(0,0,0,0),o=0;o=0?parseFloat(e)/100*t:parseFloat(e):e}function yc(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=vc(r[0],n.width),l+=vc(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`}return e||={},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var bc=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function xc(e,t,n,r,i,a){if(!n){e.text=``,e.isTruncated=!1;return}var o=(t+``).split(` +`);a=Sc(n,r,i,a);for(var s=!1,c={},l=0,u=o.length;l=s;l++)c-=s;var u=fc(o,n);return u>c&&(n=``,u=0),c=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=c,i.containerWidth=e,i}function Cc(e,t,n){var r=n.containerWidth,i=n.contentWidth,a=n.fontMeasureInfo;if(!r){e.textLine=``,e.isTruncated=!1;return}var o=fc(a,t);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=n.maxIterations){t+=n.ellipsis;break}var c=s===0?wc(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,c),o=fc(a,t)}t===``&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function wc(e,t,n){for(var r=0,i=0,a=e.length;ig&&p){var y=Math.floor(g/f);m||=_.length>y,_=_.slice(0,y),v=_.length*f}if(i&&u&&h!=null)for(var b=Sc(h,l,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),x={},S=0;S<_.length;S++)Cc(x,_[S],b),_[S]=x.textLine,m||=x.isTruncated;for(var C=g,w=0,T=oc(l),S=0;S<_.length;S++)w=Math.max(fc(T,_[S]),w);h??=w;var E=h;return C+=c,E+=s,{lines:_,height:g,outerWidth:E,outerHeight:C,lineHeight:f,calculatedLineHeight:d,contentWidth:w,contentHeight:v,width:h,isTruncated:m}}var Ec=function(){function e(){}return e}(),Dc=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),Oc=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function kc(e,t,n,r,i){var a=new Oc,o=Rc(e);if(!o)return a;var s=t.padding,c=s?s[1]+s[3]:0,l=s?s[0]+s[2]:0,u=t.width;u==null&&n!=null&&(u=n-c);var d=t.height;d==null&&r!=null&&(d=r-l);for(var f=t.overflow,p=(f===`break`||f===`breakAll`)&&u!=null?{width:u,accumWidth:0,breakAll:f===`breakAll`}:null,m=bc.lastIndex=0,h;(h=bc.exec(o))!=null;){var g=h.index;g>m&&Ac(a,o.substring(m,g),t,p),Ac(a,h[2],t,p,h[1]),m=bc.lastIndex}md){var te=a.lines.length;O>0?(T.tokens=T.tokens.slice(0,O),C(T,D,E),a.lines=a.lines.slice(0,w+1)):a.lines=a.lines.slice(0,w),a.isTruncated=a.isTruncated||a.lines.length0&&m+r.accumWidth>r.width&&(u=t.split(` +`),l=!0),r.accumWidth=m}else{var h=Pc(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=h.accumWidth+p,d=h.linesWidths,u=h.lines}}u||=t.split(` +`);for(var g=oc(c),_=0;_=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Mc=no(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{});function Nc(e){return!jc(e)||!!Mc[e]}function Pc(e,t,n,r,i){for(var a=[],o=[],s=``,c=``,l=0,u=0,d=oc(t),f=0;fn:i+u+m>n){u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m));continue}u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p)}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function Fc(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;Z.set(Ic,hc(n,o,i),gc(r,s,a),o,s),Z.intersect(t,Ic,null,Lc);var c=Lc.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=hc(c.x,c.width,i,!0),e.baseY=gc(c.y,c.height,a,!0)}}var Ic=new Z(0,0,0,0),Lc={outIntersectRect:{},clamp:!0};function Rc(e){return e==null?e=``:e+=``}function zc(e){var t=Rc(e.text),n=e.font;return Bc(e,fc(oc(n),t),_c(n),null)}function Bc(e,t,n,r){var i=new Z(hc(e.x||0,t,e.textAlign),gc(e.y||0,n,e.textBaseline),t,n),a=r??(Vc(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Vc(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}var Hc=us,Uc=5e-5;function Wc(e){return e>Uc||e<-Uc}var Gc=[],Kc=[],qc=ls(),Jc=Math.abs,Yc=function(){function e(){}return e.prototype.getLocalTransform=function(e){return Xc(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return Wc(this.rotation)||Wc(this.x)||Wc(this.y)||Wc(this.scaleX-1)||Wc(this.scaleY-1)||Wc(this.skewX)||Wc(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(Hc(n),this.invTransform=null);return}n||=ls(),t?this.getLocalTransform(n):Hc(n),e&&(t?fs(n,e,n):ds(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||ls(),gs(this.invTransform,n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Gc);var n=Gc[0]<0?-1:1,r=Gc[1]<0?-1:1,i=((Gc[0]-n)*t+n)/Gc[0]||0,a=((Gc[1]-r)*t+r)/Gc[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||ls(),fs(Kc,e.invTransform,t),t=Kc);var n=this.originX,r=this.originY;(n||r)&&(qc[4]=n,qc[5]=r,fs(Kc,t,qc),Kc[4]-=n,Kc[5]-=r,t=Kc),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Ms(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Ms(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&Jc(e[0]-1)>1e-10&&Jc(e[3]-1)>1e-10?Math.sqrt(Jc(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){$c(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&ms(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),Xc=Yc.getLocalTransform;function Zc(){return new Yc}var Qc=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function $c(e,t){return Xa(e,t,Qc)}var el={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-el.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?el.bounceIn(e*2)*.5:el.bounceOut(e*2-1)*.5+.5}},tl=Math.pow,nl=Math.sqrt,rl=1e-8,il=1e-4,al=nl(3),ol=1/3,sl=_s(),cl=_s(),ll=_s();function ul(e){return e>-rl&&erl||e<-rl}function fl(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function pl(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function ml(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(ul(u)&&ul(d)){if(ul(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(ul(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=nl(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-tl(-y,ol):tl(y,ol),b=b<0?-tl(-b,ol):tl(b,ol);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*nl(u*u*u)),S=Math.acos(x)/3,C=nl(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+al*Math.sin(S)))/(3*o),T=(-s+C*(w-al*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function hl(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(ul(o)){if(dl(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(ul(u))i[0]=-a/(2*o);else if(u>0){var d=nl(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function gl(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function _l(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;sl[0]=c,sl[1]=l;for(var v=0;v<1;v+=.05)cl[0]=fl(e,n,i,o,v),cl[1]=fl(t,r,a,s,v),g=js(sl,cl),g=0&&g=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(ul(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=nl(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Sl(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Cl(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function wl(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;sl[0]=o,sl[1]=s;for(var f=0;f<1;f+=.05){cl[0]=yl(e,n,i,f),cl[1]=yl(t,r,a,f);var p=js(sl,cl);p=0&&p=1?1:ml(0,r,a,1,e,s)&&fl(0,i,o,1,s[0])}}}var Ol=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||No,this.ondestroy=e.ondestroy||No,this.onrestart=e.onrestart||No,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=K(e)?e:el[e]||Dl(e)},e}(),kl={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Al(e){return e=Math.round(e),e<0?0:e>255?255:e}function jl(e){return e=Math.round(e),e<0?0:e>360?360:e}function Ml(e){return e<0?0:e>1?1:e}function Nl(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Al(parseFloat(t)/100*255):Al(parseInt(t,10))}function Pl(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Ml(parseFloat(t)/100):Ml(parseFloat(t))}function Fl(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function Il(e,t,n){return e+(t-e)*n}function Ll(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Rl(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var zl=new rs(20),Bl=null;function Vl(e,t){Bl&&Rl(Bl,t),Bl=zl.put(e,Bl||t.slice())}function Hl(e,t){if(e){t||=[];var n=zl.get(e);if(n)return Rl(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in kl)return Rl(t,kl[r]),Vl(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){Ll(t,0,0,0,1);return}return Ll(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),Vl(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){Ll(t,0,0,0,1);return}return Ll(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),Vl(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?Ll(t,+l[0],+l[1],+l[2],1):Ll(t,0,0,0,1);u=Pl(l.pop());case`rgb`:if(l.length>=3)return Ll(t,Nl(l[0]),Nl(l[1]),Nl(l[2]),l.length===3?u:Pl(l[3])),Vl(e,t),t;Ll(t,0,0,0,1);return;case`hsla`:if(l.length!==4){Ll(t,0,0,0,1);return}return l[3]=Pl(l[3]),Ul(l,t),Vl(e,t),t;case`hsl`:if(l.length!==3){Ll(t,0,0,0,1);return}return Ul(l,t),Vl(e,t),t;default:return}}Ll(t,0,0,0,1)}}function Ul(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Pl(e[1]),i=Pl(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],Ll(t,Al(Fl(o,a,n+1/3)*255),Al(Fl(o,a,n)*255),Al(Fl(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Wl(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function Gl(e,t){var n=Hl(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return Xl(n,n.length===4?`rgba`:`rgb`)}}function Kl(e,t,n){if(t&&t.length&&e>=0&&e<=1){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Al(Il(o[0],s[0],c)),n[1]=Al(Il(o[1],s[1],c)),n[2]=Al(Il(o[2],s[2],c)),n[3]=Ml(Il(o[3],s[3],c)),n}}function ql(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=Hl(t[i]),s=Hl(t[a]),c=r-i,l=Xl([Al(Il(o[0],s[0],c)),Al(Il(o[1],s[1],c)),Al(Il(o[2],s[2],c)),Ml(Il(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function Jl(e,t,n,r){var i=Hl(e);if(e)return i=Wl(i),t!=null&&(i[0]=jl(K(t)?t(i[0]):t)),n!=null&&(i[1]=Pl(K(n)?n(i[1]):n)),r!=null&&(i[2]=Pl(K(r)?r(i[2]):r)),Xl(Ul(i),`rgba`)}function Yl(e,t){var n=Hl(e);if(n&&t!=null)return n[3]=Ml(t),Xl(n,`rgba`)}function Xl(e,t){if(e&&e.length){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function Zl(e,t){var n=Hl(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var Ql=new rs(100);function $l(e){if(q(e)){var t=Ql.get(e);return t||(t=Gl(e,-.1),Ql.put(e,t)),t}if(ho(e)){var n=H({},e);return n.colorStops=W(e.colorStops,function(e){return{offset:e.offset,color:Gl(e.color,-.1)}}),n}return e}var eu=Math.round;function tu(e){var t;if(!e||e===`transparent`)e=`none`;else if(typeof e==`string`&&e.indexOf(`rgba`)>-1){var n=Hl(e);n&&(e=`rgb(`+n[0]+`,`+n[1]+`,`+n[2]+`)`,t=n[3])}return{color:e,opacity:t??1}}var nu=1e-4;function ru(e){return e-nu}function iu(e){return eu(e*1e3)/1e3}function au(e){return eu(e*1e4)/1e4}function ou(e){return`matrix(`+iu(e[0])+`,`+iu(e[1])+`,`+iu(e[2])+`,`+iu(e[3])+`,`+au(e[4])+`,`+au(e[5])+`)`}var su={left:`start`,right:`end`,center:`middle`,middle:`middle`};function cu(e,t,n){return n===`top`?e+=t/2:n===`bottom`&&(e-=t/2),e}function lu(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function uu(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(`,`)}function du(e){return e&&!!e.image}function fu(e){return e&&!!e.svgElement}function pu(e){return du(e)||fu(e)}function mu(e){return e.type===`linear`}function hu(e){return e.type===`radial`}function gu(e){return e&&(e.type===`linear`||e.type===`radial`)}function _u(e){return`url(#`+e+`)`}function vu(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function yu(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Po,i=Y(e.scaleX,1),a=Y(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,c=[];return(t||n)&&c.push(`translate(`+t+`px,`+n+`px)`),r&&c.push(`rotate(`+r+`)`),(i!==1||a!==1)&&c.push(`scale(`+i+`,`+a+`)`),(o||s)&&c.push(`skew(`+eu(o*Po)+`deg, `+eu(s*Po)+`deg)`),c.join(` `)}var bu=(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})(),xu=Array.prototype.slice;function Su(e,t,n){return(t-e)*n+e}function Cu(e,t,n,r){for(var i=t.length,a=0;ar?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so)r.length=o;else for(var s=a;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Ru,s=t;if(to(t)){var c=ju(t);o=c,(c===1&&!uo(t[0])||c===2&&!uo(t[0][0]))&&(a=!0)}else if(uo(t)&&!go(t))o=Mu;else if(q(t)){if(!isNaN(+t))o=Mu;else{var l=Hl(t);l&&(s=l,o=Fu)}}else if(ho(t)){var u=H({},s);u.colorStops=W(t.colorStops,function(e){return{offset:e.offset,color:Hl(e.color)}}),mu(t)?o=Iu:hu(t)&&(o=Lu),s=u}i===0?this.valType=o:(o!==this.valType||o===Ru)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=K(n)?n:el[n]||Dl(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=Bu(r),c=zu(r),l=0;l=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;lt);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Vu:e[s];if((Bu(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(Bu(i))i===Nu?Cu(g,f[r],p[r],h):wu(g,f[r],p[r],h);else if(zu(i)){var _=f[r],v=p[r],y=i===Iu;e[s]={type:y?`linear`:`radial`,x:Su(_.x,v.x,h),y:Su(_.y,v.y,h),colorStops:W(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:Su(e.offset,n.offset,h),color:Au(Cu([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=Su(_.x2,v.x2,h),e[s].y2=Su(_.y2,v.y2,h)):e[s].r=Su(_.r,v.r,h)}else if(c)Cu(g,f[r],p[r],h),n||(e[s]=Au(g));else{var b=Su(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===Mu?e[n]=e[n]+r:t===Fu?(Hl(e[n],Vu),Tu(Vu,Vu,r,1),e[n]=Au(Vu)):t===Nu?Tu(e[n],e[n],r,1):t===Pu&&Eu(e[n],e[n],r,1)},e}(),Uu=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){Ja(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,ao(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a0&&s.addKeyframe(0,ku(c),r),this._trackKeys.push(o)}s.addKeyframe(e,ku(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),Wu=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Yu:Ju},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&Hl(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,Xl(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},H(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(J(e))for(var n=ao(e),r=0;r0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Zu,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===Zu;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(Qa(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){Ja(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=this._textContent,l=dd(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,pd(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=Qa(r,e),a=Qa(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b0}var md=`__zr_style_`+Math.round(Math.random()*10),hd={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},gd={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};hd[md]=!0;var _d=[`z`,`z2`,`invisible`],vd=[`invisible`],yd=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=ao(t),r=0;r1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(Od[0]=Ed(i)*n+e,Od[1]=Td(i)*r+t,kd[0]=Ed(a)*n+e,kd[1]=Td(a)*r+t,l(s,Od,kd),u(c,Od,kd),i%=Dd,i<0&&(i+=Dd),a%=Dd,a<0&&(a+=Dd),i>a&&!o?a+=Dd:ii&&(Ad[0]=Ed(p)*n+e,Ad[1]=Td(p)*r+t,l(s,Ad,s),u(c,Ad,c))}var Rd={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},zd=[],Bd=[],Vd=[],Hd=[],Ud=[],Wd=[],Gd=Math.min,Kd=Math.max,qd=Math.cos,Jd=Math.sin,Yd=Math.abs,Xd=Math.PI,Zd=Xd*2,Qd=typeof Float32Array<`u`,$d=[];function ef(e){return Math.round(e/Xd*1e8)/1e8%2*Xd}function tf(e,t){var n=ef(e[0]);n<0&&(n+=Zd);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=Zd?i=n+Zd:t&&n-i>=Zd?i=n-Zd:!t&&n>i?i=n+(Zd-ef(n-i)):t&&n0&&(this._ux=Yd(n/Ku/e)||0,this._uy=Yd(n/Ku/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Rd.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=Yd(e-this._xi),r=Yd(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Rd.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Rd.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Rd.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),$d[0]=r,$d[1]=i,tf($d,a),r=$d[0],i=$d[1];var o=i-r;return this.addData(Rd.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=qd(i)*n+e,this._yi=Jd(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Rd.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Rd.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&Qd&&(this.data=new Float32Array(t));for(var n=0;n0&&a))for(var o=0;ol.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){Vd[0]=Vd[1]=Ud[0]=Ud[1]=Number.MAX_VALUE,Hd[0]=Hd[1]=Wd[0]=Wd[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;an||Yd(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Rd.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=vl(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Rd.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Tl(i,a,y,b,h,g,10),i=h,a=g;break;case Rd.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=qd(D)*T+C,s=Jd(D)*E+w),m=Kd(T,E)*Gd(Zd,Math.abs(O)),i=qd(k)*T+C,a=Jd(k)*E+w;break;case Rd.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Rd.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x0&&(e.lineTo(y,b),v=0),S){case Rd.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Rd.L:u=n[x++],d=n[x++];var w=Yd(u-c),T=Yd(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Rd.C:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++],M=n[x++],N=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;gl(c,k,j,M,D,zd),gl(l,A,ee,N,D,Bd),e.bezierCurveTo(zd[1],Bd[1],zd[2],Bd[2],zd[3],Bd[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,ee,M,N),c=M,l=N;break;case Rd.Q:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Cl(c,k,j,D,zd),Cl(l,A,ee,D,Bd),e.quadraticCurveTo(zd[1],Bd[1],zd[2],Bd[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,ee),c=j,l=ee;break;case Rd.A:var te=n[x++],P=n[x++],F=n[x++],ne=n[x++],re=n[x++],ie=n[x++],ae=n[x++],oe=!n[x++],se=F>ne?F:ne,ce=Yd(F-ne)>.001,le=re+ie,I=!1;if(f){var E=p[g++];h+E>_&&(le=re+ie*(_-h)/E,I=!0),h+=E}if(ce&&e.ellipse?e.ellipse(te,P,F,ne,ae,re,le,oe):e.arc(te,P,se,re,le,oe),I)break lo;C&&(o=qd(re)*F+te,s=Jd(re)*ne+P),c=qd(le)*F+te,l=Jd(le)*ne+P;break;case Rd.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var L=n[x++],ue=n[x++];if(f){var E=p[g++];if(h+E>_){var de=_-h;e.moveTo(u,d),e.lineTo(u+Gd(de,L),d),de-=L,de>0&&e.lineTo(u+L,d+Gd(de,ue)),de-=ue,de>0&&e.lineTo(u+Kd(L-de,0),d+ue),de-=L,de>0&&e.lineTo(u,d+Kd(ue-de,0));break lo}h+=E}e.rect(u,d,L,ue);break;case Rd.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Rd,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function rf(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||at+d&&u>r+d&&u>a+d&&u>s+d||ue+d&&l>n+d&&l>i+d&&l>o+d||lt+l&&c>r+l&&c>a+l||ce+l&&s>n+l&&s>i+l||sn||u+li&&(i+=lf);var f=Math.atan2(c,s);return f<0&&(f+=lf),f>=r&&f<=i||f+lf>=r&&f+lf<=i}function df(e,t,n,r,i,a){if(a>t&&a>r||ai?s:0}var ff=nf.CMD,pf=Math.PI*2,mf=1e-4;function hf(e,t){return Math.abs(e-t)t&&l>r&&l>a&&l>s||l1&&vf(),p=fl(t,r,a,s,_f[0]),f>1&&(m=fl(t,r,a,s,_f[1]))),f===2?g<_f[0]?d+=pt&&s>r&&s>a||s=0&&l<=1){for(var u=0,d=yl(t,r,a,l),f=0;fn||s<-n)return 0;var c=Math.sqrt(n*n-s*s);gf[0]=-c,gf[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=pf-1e-4){r=0,i=pf;var u=a?1:-1;return o>=gf[0]+e&&o<=gf[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=pf,i+=pf);for(var f=0,p=0;p<2;p++){var m=gf[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=pf+h),(h>=r&&h<=i||h+pf>=r&&h+pf<=i)&&(h>Math.PI/2&&h1&&(n||(s+=df(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case ff.M:u=a[m++],d=a[m++],c=u,l=d;break;case ff.L:if(n){if(rf(c,l,a[m],a[m+1],t,r,i))return!0}else s+=df(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case ff.C:if(n){if(af(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=yf(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case ff.Q:if(n){if(of(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=bf(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case ff.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=df(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(uf(_,v,b,x,x+S,C,t,w,i))return!0}else s+=xf(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case ff.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(rf(u,d,f,d,t,r,i)||rf(f,d,f,p,t,r,i)||rf(f,p,u,p,t,r,i)||rf(u,p,u,d,t,r,i))return!0}else s+=df(f,d,f,p,r,i),s+=df(u,p,u,d,r,i);break;case ff.Z:if(n){if(rf(c,l,u,d,t,r,i))return!0}else s+=df(c,l,u,d,r,i);c=u,l=d}}return!n&&!hf(l,d)&&(s+=df(c,l,u,d,r,i)||0),s!==0}function Cf(e,t,n){return Sf(e,0,!1,t,n)}function wf(e,t,n,r){return Sf(e,t,!0,n,r)}var Tf=Za({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},hd),Ef={style:Za({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},gd.style)},Df=Qc.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),Of=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Ju:t>.2?Xu:Yu}if(e)return Yu}return Ju},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(q(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==Zl(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new nf(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),wf(a,o/s,e,t)))return!0}if(this.hasFill())return Cf(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:H(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return jo(Tf,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=H({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=H({},r.shape),H(c,n.shape)):(c=H({},i?this.shape:r.shape),H(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=H({},this.shape);for(var l={},u=ao(c),d=0;di&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5),e.closePath()}var If=Math.round;function Lf(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(If(r*2)===If(i*2)&&(e.x1=e.x2=zf(r,s,!0)),If(a*2)===If(o*2)&&(e.y1=e.y2=zf(a,s,!0)),e):e}}function Rf(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=zf(r,s,!0),e.y=zf(i,s,!0),e.width=Math.max(zf(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(zf(i+o,s,!1)-e.y,o===0?0:1),e):e}}function zf(e,t,n){if(!t)return e;var r=If(e*2);return(r+If(t))%2==0?r/2:(r+(n?1:-1))/2}var Bf=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),Vf={},Hf=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Bf},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=Rf(Vf,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?Ff(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Of);Hf.prototype.type=`rect`;var Uf={fill:`#000`},Wf=2,Gf={},Kf={style:Za({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},gd.style)},qf=function(e){B(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=Uf,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,T=0;T=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&op(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=ip(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(Af),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=rp(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=np(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=Wf,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=vo(s.opacity,t.opacity,1),Qf(p,s),y&&(p.lineWidth=vo(s.lineWidth,t.lineWidth,g),p.lineDash=Y(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(Bc(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(Hf),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=Y(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(Pf),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=Y(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=vo(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return $f(e)&&(t=[e.fontStyle,e.fontWeight,Zf(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&So(t)||e.textFont||e.font},t}(yd),Jf={left:!0,right:1,center:1},Yf={top:1,bottom:1,middle:1},Xf=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function Zf(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function Qf(e,t){for(var n=0;n0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var Sp=Cp;function Cp(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return wp(e,t,n)}function wp(e,t,n){return q(e)?Ep(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function Tp(e){return q(e)&&Ep(e)}function Ep(e){return!!lp(e).match(/%$/)}function Dp(e,t,n){return isNaN(t)?n?``+e:+e:(t=up(dp(0,t),cp),e=(+e).toFixed(t),n?e:+e)}function Op(e){return e.sort(function(e,t){return e-t}),e}function kp(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(pp(e*t)/t===e)return n}return Ap(e)}function Ap(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return dp(0,(a<0?0:i-1-a)-r)}function jp(e,t,n){var r=fp(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=_p(2*fp(n||1)*fp(r))/vp,a=_p(fp(t))/vp,o=dp(0,hp(-i+a));return isFinite(o)||(o=NaN),o}function Mp(e,t){var n=dp(kp(e),kp(t)),r=e+t;return n>cp?r:Dp(r,n)}var Np=gp(2,53)-1;function Pp(e){var t=yp*2;return(e%t+t)%t}function Fp(e){return e>-sp&&e=10&&t++,t}function Bp(e,t){var n=zp(e),r=gp(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,Dp(e,-n)}function Vp(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})();function Fm(){return[1/0,-1/0]}function Im(e,t){Bm(t)&&(te[1]&&(e[1]=t))}function Lm(e,t){Bm(t)&&te[1]&&(e[1]=t)}function zm(e,t){Vm(t[0],t[1])&&(t[0]e[1]&&(e[1]=t[1]))}function Bm(e){return e!=null&&isFinite(e)}function Vm(e,t){return Bm(e)&&Bm(t)&&e<=t}function Hm(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function Um(e){Vm(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function Wm(){var e=`__ec_once_`+Gm++;return function(t,n){Mo(t,e)||(t[e]=1,n())}}var Gm=Wp();function Km(e,t,n){var r=X(),i=0;U(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function qm(e){return e.value+``}function Jm(e){return e+``}function Ym(e,t){return Y(t,!0)?e.seriesIndex+2:0}function Xm(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function Zm(e,t){return{seriesType:e,overallReset:t}}function Qm(e){return{overallReset:e}}var $m=wm(),eh=function(e,t,n,r){if(r){var i=$m(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType=`chart`,r.type===`group`&&r.traverse(function(r){var i=$m(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType=`chart`})}},th=`series`,nh=X([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),rh=`original`,ih=`arrayRows`,ah=`objectRows`,oh=`keyedColumns`,sh=`typedArray`,ch=`unknown`,lh=`column`,uh=`Roam`,dh=[`getDom`,`getZr`,`getWidth`,`getHeight`,`getDevicePixelRatio`,`dispatchAction`,`isSSR`,`isDisposed`,`on`,`off`,`getDataURL`,`getConnectedDataURL`,`getOption`,`getId`,`updateLabelLayout`],fh=function(){function e(e){U(dh,function(t){this[t]=so(e[t],e)},this)}return e}();function ph(e,t){return t.mainType===`series`?e.getViewOfSeriesModel(t):e.getViewOfComponentModel(t)}var mh=1,hh={},gh=wm(),_h=wm(),vh=[`emphasis`,`blur`,`select`],yh=[`normal`,`emphasis`,`blur`,`select`],bh=`highlight`,xh=`downplay`,Sh=`select`,Ch=`unselect`,wh=`toggleSelect`,Th=`selectchanged`;function Eh(e){return e!=null&&e!==`none`}function Dh(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function Oh(e){Dh(e,`emphasis`,2)}function kh(e){e.hoverState===2&&Dh(e,`normal`,0)}function Ah(e){Dh(e,`blur`,1)}function jh(e){e.hoverState===1&&Dh(e,`normal`,0)}function Mh(e){e.selected=!0}function Nh(e){e.selected=!1}function Ph(e,t,n){t(e,n)}function Fh(e,t,n){Ph(e,t,n),e.isGroup&&e.traverse(function(e){Ph(e,t,n)})}function Ih(e,t){switch(t){case`emphasis`:e.hoverState=2;break;case`normal`:e.hoverState=0;break;case`blur`:e.hoverState=1;break;case`select`:e.selected=!0}}function Lh(e,t,n,r){for(var i=e.style,a={},o=0;o=0,a=!1;if(e instanceof Of){var o=gh(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(Eh(s)||Eh(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=H({},r),l=H({},l),l.fill=s):!Eh(l.fill)&&Eh(s)?(a=!0,r=H({},r),l=H({},l),l.fill=$l(s)):!Eh(l.stroke)&&Eh(c)&&(a||(r=H({},r),l=H({},l)),l.stroke=$l(c)),r.style=l}}if(r&&r.z2==null){a||(r=H({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function zh(e,t,n){if(n&&n.z2==null){n=H({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Bh(e,t,n){var r=Qa(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Lh(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=H({},n),o=H({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Vh(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Rh(this,e,t,n);if(e===`blur`)return Bh(this,e,n);if(e===`select`)return zh(this,e,n)}return n}function Hh(e){e.stateProxy=Vh;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Vh),n&&(n.stateProxy=Vh)}function Uh(e,t){!Zh(e,t)&&!e.__highByOuter&&Fh(e,Oh)}function Wh(e,t){!Zh(e,t)&&!e.__highByOuter&&Fh(e,kh)}function Gh(e,t){e.__highByOuter|=1<<(t||0),Fh(e,Oh)}function Kh(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Fh(e,kh)}function qh(e){Fh(e,Ah)}function Jh(e){Fh(e,jh)}function Yh(e){Fh(e,Mh)}function Xh(e){Fh(e,Nh)}function Zh(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Qh(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=_h(i),o=ph(e,i),s=t===`series`;!s&&r.push(o),a.isBlured&&(o.group.traverse(function(e){jh(e)}),s&&n.push(i)),a.isBlured=!1}),U(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function $h(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function cg(e,t,n){hg(e,!0),Fh(e,Hh),dg(e,t,n)}function lg(e){hg(e,!1)}function ug(e,t,n,r){r?lg(e):cg(e,t,n)}function dg(e,t,n){var r=$m(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var fg=[`emphasis`,`blur`,`select`],pg={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function mg(e,t,n,r){n||=`itemStyle`;for(var i=0;i1&&(o*=Eg(m),s*=Eg(m));var h=(i===a?-1:1)*Eg((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+Og(d)*g-Dg(d)*_,y=(t+r)/2+Dg(d)*g+Og(d)*_,b=Mg([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Mg(x,S);if(jg(x,S)<=-1&&(C=kg),jg(x,S)>=1&&(C=0),C<0){var w=Math.round(C/kg*1e6)/1e6;C=kg*2+w%2*kg}u.addData(l,v,y,o,s,b,C,d,a)}var Pg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Fg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Ig(e){var t=new nf;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=nf.CMD,c=e.match(Pg);if(!c)return t;for(var l=0;l=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=Qa(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=Qa(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nA*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function s_(e){var t;if(G(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function c_(e,t){var n,r=n_(t.r,0),i=n_(t.r0||0,0),a=r>0;if(a||i>0){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=e_(c-s),p=f>Yg&&f%Yg;if(p>i_&&(f=p),!(r>i_))e.moveTo(l,u);else if(f>Yg-i_)e.moveTo(l+r*Zg(s),u+r*Xg(s)),e.arc(l,u,r,s,c,!d),i>i_&&(e.moveTo(l+i*Zg(c),u+i*Xg(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*Zg(s),j=r*Xg(s),ee=i*Zg(c),M=i*Xg(c),N=f>i_;if(N){var te=t.cornerRadius;te&&(n=s_(te),m=n[0],h=n[1],g=n[2],_=n[3]);var P=e_(r-i)/2;if(v=r_(P,g),y=r_(P,_),b=r_(P,m),x=r_(P,h),w=S=n_(v,y),T=C=n_(b,x),(S>i_||C>i_)&&(E=r*Zg(c),D=r*Xg(c),O=i*Zg(s),k=i*Xg(s),fi_){var ce=r_(g,w),le=r_(_,w),I=o_(O,k,A,j,r,ce,d),L=o_(E,D,ee,M,r,le,d);e.moveTo(l+I.cx+I.x0,u+I.cy+I.y0),w0&&e.arc(l+I.cx,u+I.cy,ce,$g(I.y0,I.x0),$g(I.y1,I.x1),!d),e.arc(l,u,r,$g(I.cy+I.y1,I.cx+I.x1),$g(L.cy+L.y1,L.cx+L.x1),!d),le>0&&e.arc(l+L.cx,u+L.cy,le,$g(L.y1,L.x1),$g(L.y0,L.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>i_)||!N)e.lineTo(l+ee,u+M);else if(T>i_){var ce=r_(m,T),le=r_(h,T),I=o_(ee,M,E,D,i,-le,d),L=o_(A,j,O,k,i,-ce,d);e.lineTo(l+I.cx+I.x0,u+I.cy+I.y0),T0&&e.arc(l+I.cx,u+I.cy,le,$g(I.y0,I.x0),$g(I.y1,I.x1),!d),e.arc(l,u,i,$g(I.cy+I.y1,I.cx+I.x1),$g(L.cy+L.y1,L.cx+L.x1),d),ce>0&&e.arc(l+L.cx,u+L.cy,ce,$g(L.y1,L.x1),$g(L.y0,L.x0),!d))}else e.lineTo(l+ee,u+M),e.arc(l,u,i,c,s,d)}e.closePath()}}}var l_=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),u_=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new l_},t.prototype.buildPath=function(e,t){c_(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Of);u_.prototype.type=`sector`;var d_=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),f_=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new d_},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(Of);f_.prototype.type=`ring`;function p_(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f=2){if(r){var a=p_(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;sI_[1]){if(i=!1,L_.negativeSize||n)return i;var s=P_(I_[0]-F_[1]),c=P_(F_[0]-I_[1]);M_(s,c)>z_.len()&&(s=c||!L_.bidirectional)&&(Fs.scale(R_,o,-c*r),L_.useDir&&L_.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function K_(e,t,n,r,i,a){G_(`update`,e,t,n,r,i,a)}function q_(e,t,n,r,i,a){G_(`enter`,e,t,n,r,i,a)}function J_(e){if(!e.__zr)return!0;for(var t=0;tD_,BezierCurve:()=>T_,BoundingRect:()=>Z,Circle:()=>Gg,CompoundPath:()=>O_,Ellipse:()=>qg,Group:()=>Ug,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>Pf,IncrementalDisplayable:()=>H_,Line:()=>x_,LinearGradient:()=>A_,OrientedBoundingRect:()=>B_,Path:()=>Of,Point:()=>Fs,Polygon:()=>g_,Polyline:()=>v_,RadialGradient:()=>j_,Rect:()=>Hf,Ring:()=>f_,Sector:()=>u_,Text:()=>qf,WH:()=>nv,XY:()=>tv,applyTransform:()=>_v,calcZ2Range:()=>Bv,clipPointsByRect:()=>Sv,clipRectByRect:()=>Cv,createIcon:()=>wv,decomposeTransform:()=>Wv,ensureCopyRect:()=>Lv,ensureCopyTransform:()=>Rv,expandOrShrinkRect:()=>kv,extendPath:()=>av,extendShape:()=>rv,getCurrentCanvasPainter:()=>Kv,getShapeClass:()=>sv,getTransform:()=>gv,groupTransition:()=>xv,initProps:()=>q_,isBoundingRectAxisAligned:()=>Fv,isElementRemoved:()=>J_,lineLineIntersect:()=>Ev,linePolygonIntersect:()=>Tv,makeImage:()=>lv,makePath:()=>cv,mergePath:()=>dv,payloadDisableAnimation:()=>Uv,registerShape:()=>ov,removeElement:()=>Y_,removeElementWithFadeOut:()=>Z_,resizePath:()=>fv,retrieveZInfo:()=>zv,setTooltipConfig:()=>Mv,subPixelOptimize:()=>hv,subPixelOptimizeLine:()=>pv,subPixelOptimizeRect:()=>mv,transformDirection:()=>vv,traverseElements:()=>Pv,traverseUpdateZ:()=>Vv,updateProps:()=>K_}),ev={},tv=[`x`,`y`],nv=[`width`,`height`];function rv(e){return Of.extend(e)}var iv=Vg;function av(e,t){return iv(e,t)}function ov(e,t){ev[e]=t}function sv(e){if(ev.hasOwnProperty(e))return ev[e]}function cv(e,t,n,r){var i=Bg(e,t);return n&&(r===`center`&&(n=uv(n,i.getBoundingRect())),fv(i,n)),i}function lv(e,t,n){var r=new Pf({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(uv(t,i))}}});return r}function uv(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var dv=Hg;function fv(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function pv(e,t){return Lf(e,e,{lineWidth:t}),e}function mv(e,t){return Rf(e,e,t),e}var hv=zf;function gv(e,t){for(var n=us([]);e&&e!==t;)fs(n,e.getLocalTransform(),n),e=e.parent;return n}function _v(e,t,n){return t&&!to(t)&&(t=Yc.getLocalTransform(t)),n&&(t=gs([],t)),Ms([],e,t)}function vv(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:fp(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:fp(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=_v(a,t,n),fp(a[0])>fp(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function yv(e){return!e.isGroup}function bv(e){return e.shape!=null}function xv(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){yv(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return bv(e)&&(t.shape=V(e.shape)),t}var a=r(e);t.traverse(function(e){if(yv(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),K_(e,r,n,$m(e).dataIndex)}}})}function Sv(e,t){return W(e,function(e){var n=e[0];n=dp(n,t.x),n=up(n,t.x+t.width);var r=e[1];return r=dp(r,t.y),r=up(r,t.y+t.height),[n,r]})}function Cv(e,t){var n=dp(e.x,t.x),r=up(e.x+e.width,t.x+t.width),i=dp(e.y,t.y),a=up(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function wv(e,t,n){var r=H({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),Za(i,n),new Pf(r)):cv(e.replace(`path://`,``),r,n,`center`)}function Tv(e,t,n,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=Dv(p,m,u,d)/f;return!(g<0||g>1)}function Dv(e,t,n,r){return e*r-n*t}function Ov(e){return e<=1e-6&&e>=-1e-6}function kv(e,t,n,r,i){return t==null?e:(uo(t)?Av[0]=Av[1]=Av[2]=Av[3]=t:(Av[0]=t[0],Av[1]=t[1],Av[2]=t[2],Av[3]=t[3]),r&&(Av[0]=dp(0,Av[0]),Av[1]=dp(0,Av[1]),Av[2]=dp(0,Av[2]),Av[3]=dp(0,Av[3])),n&&(Av[0]=-Av[0],Av[1]=-Av[1],Av[2]=-Av[2],Av[3]=-Av[3]),jv(e,Av,`x`,`width`,3,1,i&&i[0]||0),jv(e,Av,`y`,`height`,0,2,i&&i[1]||0),e)}var Av=[0,0,0,0];function jv(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=dp(0,up(o,c)),e[r]=0?-t[i]:t[a]>=0?c+t[a]:fp(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function Mv(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=q(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&U(ao(c),function(e){Mo(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=$m(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:Za({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Nv(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Pv(e,t){if(e){if(G(e))for(var n=0;nt&&(t=r),rt&&(n=t=0),{min:n,max:t}}function Vv(e,t,n){Hv(e,t,n,-1/0)}function Hv(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f1)for(var o=0;ol&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};qy=(e={},e[ih+`_`+lh]={pure:!0,appendData:i},e[ih+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[ah]={pure:!0,appendData:i},e[oh]={pure:!0,appendData:function(e){var t=this._data;U(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[rh]={appendData:i},e[sh]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;tt},gte:function(e,t){return e>=t}};(function(){function e(e,t){uo(t)||$p(``),this._opFn=hb[e],this._rvalFloat=Hp(t)}return e.prototype.evaluate=function(e){return uo(e)?this._opFn(e,this._rvalFloat):this._opFn(Hp(e),this._rvalFloat)},e})();var gb=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=uo(e)?e:Hp(e),r=uo(t)?t:Hp(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=q(e),s=q(t);o&&(n=s?e:0),s&&(r=o?t:0)}return nr?-this._resultLT:0},e}();(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Hp(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Hp(e)===this._rvalFloat)}return this._isEQ?t:!t},e})();function _b(e){var t=``,n=-1/0,r=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+=`G`+e.g,n=e.g),e.ge!=null&&(t+=`GE`+e.ge,r=e.ge),e.l!=null&&(t+=`L`+e.l,i=e.l),e.le!=null&&(t+=`LE`+e.le,a=e.le)),{key:t,g:n,ge:r,l:i,le:a}}function vb(e,t){return t>e.g&&t>=e.ge&&t`u`?Array:Uint32Array,bb=typeof Uint16Array>`u`?Array:Uint16Array,xb=typeof Int32Array>`u`?Array:Int32Array,Sb=typeof Float64Array>`u`?Array:Float64Array,Cb={float:Sb,int:xb,ordinal:Array,number:Array,time:Sb},wb;function Tb(e){return e>65535?yb:bb}function Eb(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function Db(e,t,n,r,i){var a=Cb[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;lh[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=W(a,function(e){return e.property}),l=0;lg[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;he[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return sg[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(Tb(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;fc&&(c=l,u=v)}T>0&&To&&(m=o-l);for(var h=0;hp&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);ul-p&&(s=l-p,o.length=s);for(var m=0;mu[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();id&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return mb(e[r],this._dimensions[r])}wb={arrayRows:e,objectRows:function(e,t,n,r){return mb(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return mb(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),kb=wm(),Ab={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},jb=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=Pb(this.source))},e.prototype.getSourceDimensionIndex=function(e){return Y(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Hy(this.source),n=!Fb(e),r=``,i=[],a=0,o=0;a30}var Ib=J,Lb=W,Rb=typeof Int32Array>`u`?Array:Int32Array,zb=`e\0\0`,Bb=-1,Vb=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],Hb=[`_approximateExtent`],Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Mb(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),G(i)?i=i.slice():Ib(i)&&(i=H({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,Ib(t)?H(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){Ib(e)?H(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?H(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){eh(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){U(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:Lb(this.dimensions,this._getDimInfo,this),this.hostModel),qb(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];K(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(yo(arguments)))})},e.internalField=function(){Ub=function(e){var t=e._invertedIndicesMap;U(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new Rb(a.categories.length);for(var s=0;s1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function Zb(e,t){Ny(e)||(e=Fy(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=X(),a=[],o=Qb(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Fb(o),c=r===e.dimensionsDefine,l=c?Pb(e):Nb(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=X(u),f=new xb(o),p=0;p0&&(e.name+=t-1)}),new jb({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function Qb(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return U(t,function(e){var t;J(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function $b(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var ex={},tx={},nx=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n(ex,!0),this._normalMasterList=n(tx,!1);function n(n,r){var i=[];return U(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){U(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){if(e===`matrix`||e===`calendar`){ex[e]=t;return}tx[e]=t},e.get=function(e){return tx[e]||ex[e]},e}();function rx(e){return!!ex[e]}var ix=X();function ax(e){var t=e.getShallow(`coord`,!0),n=1;if(t==null){var r=ix.get(e.type);r&&r.getCoord2&&(n=2,t=r.getCoord2(e))}return{coord:t,from:n}}function ox(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=0;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=1,a||(i=0)):r===`box`&&(i=2,!a&&!rx(n)&&(i=0))}return{coordSysType:n,kind:i}}function sx(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=ox(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==1&&(o=1,s=n),o===0||s!==n)return 0;var c=r(n,t);return c?(o===1?t.coordinateSystem=c:t.boxCoordinateSystem=c,o):0}var cx=function(){function e(e){this.coordSysDims=[],this.axisMap=X(),this.categoryAxisMap=X(),this.coordSysName=e}return e}();function lx(e){var t=e.get(`coordinateSystem`),n=new cx(t),r=ux[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var ux={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,Om).models[0],a=e.getReferringComponents(`yAxis`,Om).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),dx(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),dx(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,Om).models[0];t.coordSysDims=[`single`],n.set(`single`,i),dx(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,Om).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),dx(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),dx(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();U(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),dx(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,Om).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}};function dx(e){return e.get(`type`)===`category`}function fx(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;px(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f,p=!0;function m(e){return e.type!==`ordinal`&&e.type!==`time`}if(U(a,function(e,t){q(e)&&(a[t]=e={name:e}),m(e)||(p=!1)}),U(a,function(e,t){c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&m(e)&&(!p||e.coordDim!==`x`&&e.coordDim!==`angle`)&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var h=u.coordDim,g=u.type,_=0;U(a,function(e){e.coordDim===h&&_++});var v={name:d,coordDim:h,coordDimIndex:_,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:_+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,g),y.storeDimIndex=s.ensureCalculationDimension(d,g)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function px(e){return!Mb(e.schema)}function mx(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function hx(e,t){return mx(e,t)?e.getCalculationInfo(`stackResultDimension`):t}function gx(e,t){var n=e.get(`coordinateSystem`),r=nx.get(n),i;return t&&t.coordSysDims&&(i=W(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=db(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function _x(e,t,n){var r,i;return n&&U(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function vx(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Fy(e)):(i=r.getSource(),a=i.sourceFormat===rh);var o=lx(t),s=gx(t,o),c=n.useEncodeDefaulter,l=K(c)?c:c?co(Dy,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=Zb(i,u),f=_x(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=fx(t,{schema:d,store:p}),h=new Xb(d,t);h.setCalculationInfo(m);var g=f!=null&&yx(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function yx(e){if(e.sourceFormat===`original`)return!G(om(bx(e.data||[])))}function bx(e){for(var t=0;t=0&&n.push(e)}),n}}function Ex(e,t){return Ya(Ya({},e,!0),t,!0)}var Dx=Math.log(2);function Ox(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){U(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function Ix(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?kx(s,o):kx(o,s))}function Lx(e){return e.nodeName.toUpperCase()===`CANVAS`}var Rx=/([&<>"'])/g,zx={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Bx(e){return e==null?``:(e+``).replace(Rx,function(e,t){return zx[t]})}var Vx={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},Hx={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},Ux=`ZH`,Wx=`EN`,Gx=Wx,Kx={},qx={},Jx=Io.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||Gx).toUpperCase().indexOf(Ux)>-1?Ux:Gx}():Gx;function Yx(e,t){e=e.toUpperCase(),qx[e]=new by(t),Kx[e]=t}function Xx(e){if(q(e)){var t=Kx[e.toUpperCase()]||{};return e===Ux||e===Wx?V(t):Ya(V(t),V(Kx[Gx]),!1)}return Ya(V(e),V(Kx[Gx]),!1)}function Zx(e){return qx[e]}function Qx(){return qx[Gx]}Yx(Wx,Vx),Yx(Ux,Hx);var $x=null;function eS(){return $x}function tS(e,t){var n=eS(),r=t.breakOption,i=t.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,e)),i}function nS(e){var t=e.brk;return t?t.breaks:[]}function rS(e){var t=e.brk;return t?t.hasBreaks():!1}var iS=1e3,aS=iS*60,oS=aS*60,sS=oS*24,cS=sS*365,lS={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},uS={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},dS=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,fS=`{yyyy}-{MM}-{dd}`,pS={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:fS,hour:fS+` `+uS.hour,minute:fS+` `+uS.minute,second:fS+` `+uS.second,millisecond:dS},mS=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],hS=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function gS(e){return!q(e)&&!K(e)?_S(e):e}function _S(e){e||={};var t={},n=!0;return U(mS,function(t){n&&=e[t]==null}),U(mS,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=mS[s],l=J(a)&&!G(a)?a[c]:a,u=void 0;G(l)?(u=l.slice(),o=u[0]||``):q(l)?(o=l,u=[o]):(o==null?o=uS[r]:lS[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function vS(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function yS(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function bS(e){return e===yS(e)}function xS(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function SS(e,t,n,r){var i=Lp(e),a=i[ES(n)](),o=i[DS(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[OS(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[kS(n)](),d=(u-1)%12+1,f=i[AS(n)](),p=i[jS(n)](),m=i[MS(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof by?r:Zx(r||Jx)||Qx()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,vS(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,vS(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,vS(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,vS(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,vS(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,vS(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,vS(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,vS(m,3)).replace(/{S}/g,m+``)}function CS(e,t,n,r,i){var a=null;if(q(n))a=n;else if(K(n)){var o={time:e.time,level:e.time?e.time.level:0},s=eS();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=wS(e.value,i);a=n[u][u][0]}}return SS(new Date(e.value),a,i,r)}function wS(e,t){var n=Lp(e),r=n[DS(t)]()+1,i=n[OS(t)](),a=n[kS(t)](),o=n[AS(t)](),s=n[jS(t)](),c=n[MS(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function TS(e,t,n){switch(t){case`year`:e[PS(n)](0);case`month`:e[FS(n)](1);case`day`:e[IS(n)](0);case`hour`:e[LS(n)](0);case`minute`:e[RS(n)](0);case`second`:e[zS(n)](0)}return e}function ES(e){return e?`getUTCFullYear`:`getFullYear`}function DS(e){return e?`getUTCMonth`:`getMonth`}function OS(e){return e?`getUTCDate`:`getDate`}function kS(e){return e?`getUTCHours`:`getHours`}function AS(e){return e?`getUTCMinutes`:`getMinutes`}function jS(e){return e?`getUTCSeconds`:`getSeconds`}function MS(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function NS(e){return e?`setUTCFullYear`:`setFullYear`}function PS(e){return e?`setUTCMonth`:`setMonth`}function FS(e){return e?`setUTCDate`:`setDate`}function IS(e){return e?`setUTCHours`:`setHours`}function LS(e){return e?`setUTCMinutes`:`setMinutes`}function RS(e){return e?`setUTCSeconds`:`setSeconds`}function zS(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function BS(e){if(!Up(e))return q(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function VS(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var HS=bo;function US(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&So(e)?e:`-`}function a(e){return qp(e)}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?Lp(e):e;if(!isNaN(+c))return SS(c,r,n);if(s)return`-`}if(t===`ordinal`)return lo(e)?i(e):uo(e)&&a(e)?e+``:`-`;var l=Hp(e);return a(l)?BS(l):lo(e)?i(e):typeof e==`boolean`?e+``:`-`}var WS=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],GS=function(e,t){return`{`+e+(t??``)+`}`};function KS(e,t,n){G(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a`:``:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function JS(e,t){return t||=`transparent`,q(e)?e:J(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var YS=U,XS=[`left`,`right`,`top`,`bottom`,`width`,`height`],ZS=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function QS(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var $S=QS;co(QS,`vertical`),co(QS,`horizontal`);function eC(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function tC(e,t,n){n=HS(n||0);var r=t.width,i=t.height,a=Sp(e.left,r),o=Sp(e.top,i),s=Sp(e.right,r),c=Sp(e.bottom,i),l=Sp(e.width,r),u=Sp(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new Z((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}function nC(e,t,n){var r=e.getShallow(`preserveAspect`,!0);if(!r)return t;var i=t.width/t.height;if(Math.abs(Math.atan(n)-Math.atan(i))<1e-9)return t;var a=e.getShallow(`preserveAspectAlign`,!0),o=e.getShallow(`preserveAspectVerticalAlign`,!0),s={width:t.width,height:t.height},c=r===`cover`;return i>n&&!c||i=u)return a;for(var d=0;d=0;o--)a=Ya(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return km(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return eC(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(by);Ko(dC,by),Zo(dC),Cx(dC),Tx(dC,fC);function fC(e){var t=[];return U(dC.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=W(t,function(e){return Vo(e).main}),e!==`dataset`&&Qa(t,`dataset`)<=0&&t.unshift(`dataset`),t}var pC=wm(),mC=wm(),hC=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=rm(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return vC(this,pC,r,i,e,t,n)},e.prototype.clearColorPalette=function(){yC(this,pC)},e}();function gC(e,t,n,r){return vC(e,mC,rm(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function _C(e,t){for(var n=e.length,r=0;rt)return e[r];return e[n-1]}function vC(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:_C(r,o);if(u||=n,u&&u.length){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function yC(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var bC=/\{@(.+?)\}/g,xC=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),a=n.getName(e),o=n.getRawDataItem(e),s=n.getItemVisual(e,`style`),c=s&&s[n.getItemVisual(e,`drawType`)||`fill`],l=s&&s.stroke,u=this.mainType,d=u===`series`,f=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:i,data:o,dataType:t,value:r,color:c,borderColor:l,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:[`seriesName`,`name`,`value`]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,a){t||=`normal`;var o=this.getData(n),s=this.getDataParams(e,n);if(a&&(s.value=a.interpolatedValue),r!=null&&G(s.value)&&(s.value=s.value[r]),i||=o.getItemModel(e).get(t===`normal`?[`label`,`formatter`]:[t,`label`,`formatter`]),K(i))return s.status=t,s.dimensionIndex=r,i(s);if(q(i))return KS(i,s).replace(bC,function(t,n){var r=n.length,i=n;i.charAt(0)===`[`&&i.charAt(r-1)===`]`&&(i=+i.slice(1,r-1));var s=sb(o,e,i);if(a&&G(a.interpolatedValue)){var c=o.getDimensionIndex(i);c>=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return sb(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function SC(e){var t,n;return J(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function CC(e){return new wC(e)}var wC=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f1&&r>0?s:o}};return a;function o(){return t=e?null:a9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(RC(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=po(o)?sh:rh,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=Y(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=Y(u.sourceHeader,d.sourceHeader),m=Y(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Py(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Py(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&zC(``);var i,a=[],o=[];return U(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&zC(``),a.push(t),o.push(e._getVersionSign())}),n?i=PC(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Iy(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||n>0&&!e.noHeader;return U(e.blocks,function(e){var n=ZC(e);n>=t&&(t=n+ +(r&&(!n||YC(e)&&!e.noHeader)))}),t}return 0}function QC(e,t,n,r){var i=t.noHeader,a=tw(ZC(t)),o=[],s=t.blocks||[];xo(!s||G(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(Mo(l,c)){var u=new gb(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}U(s,function(n,i){var s=t.valueFormatter,c=XC(n)(s?H(H({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):nw(r,o.join(``),i?n:a.html);if(i)return d;var f=US(t.header,`ordinal`,e.useUTC),p=GC(r,e.renderMode).nameStyle,m=WC(r);return e.renderMode===`richText`?aw(e,f,p)+a.richText+d:nw(r,`
`+Bx(f)+`
`+d,n)}function $C(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=G(e)?e:[e],W(e,function(e,t){return US(e,G(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||Q.color.secondary,i),f=a?``:US(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.rawDataIndex),h=!s||!a,g=!s&&a,_=GC(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:aw(e,f,v))+(o?``:ow(e,m,h,g,y)):nw(r,(s?``:d)+(a?``:rw(f,!s,v))+(o?``:iw(m,h,g,y)),n)}}function ew(e,t,n,r,i,a){if(e)return XC(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function tw(e){return{html:KC[e],richText:qC[e]}}function nw(e,t,n){var r=`
`,i=`margin: `+n+`px 0 0`,a=WC(e);return`
`+t+r+`
`}function rw(e,t,n){var r=t?`margin-left:2px`:``;return``+Bx(e)+``}function iw(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=G(e)?e:[e],``+W(e,function(e){return Bx(e)}).join(`  `)+``}function aw(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function ow(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(G(t)?t.join(` `):t,a)}function sw(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return JS(n)}function cw(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var lw=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Wp()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=qS({color:t,type:e,renderMode:n,markerId:r});return q(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};G(t)?U(t,function(e){return H(n,e)}):H(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function uw(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=G(s),l=sw(t,n),u,d,f,p;if(o>1||c&&!o){var m=dw(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=sb(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=vm(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return JC(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[JC(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!So(y),value:u,valueType:d,rawDataIndex:i.getRawIndex(n)})].concat(f||[])})}function dw(e,t,n,r,i){var a=t.getData(),o=no(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?U(r,function(e){u(sb(a,n,e),e)}):U(e,u);function u(e,t){var n=a.getDimensionInfo(t);n&&n.otherDims.tooltip!==!1&&(o?l.push(JC(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var fw=wm();function pw(e,t){return e.getName(t)||e.getId(t)}var mw=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=CC({count:_w,reset:vw}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(fw(this).sourceManager=new LC(this)).prepareSource();var r=this.getInitialData(e,n);bw(r,this),this.dataTask.context.data=r,fw(this).dataBeforeProcessed=r,hw(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=oC(this),r=n?cC(e):{},i=this.subType;dC.hasClass(i)&&(i+=`Series`),Ya(e,t.getTheme().get(this.subType)),Ya(e,this.getDefaultOption()),im(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&sC(e,r,n)},t.prototype.mergeOption=function(e,t){e=Ya(this.option,e,!0),this.fillDataTextStyle(e.data);var n=oC(this);n&&sC(this.option,e,n);var r=fw(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);bw(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,fw(this).dataBeforeProcessed=i,hw(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!po(e))for(var t=[`show`],n=0;n=0&&u<0)&&(l=v,u=_,d=0),_===u&&(c[d++]=m))}return c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return uw({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(Io.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=hC.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[pw(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(a&&o){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){J(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c0&&this._innerSelect(e,t)}},t.registerClass=function(e){return dC.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(dC);eo(mw,xC),eo(mw,hC),Ko(mw,dC);function hw(e){var t=e.name;vm(e)||(e.name=gw(e)||t)}function gw(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return U(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function _w(e){return e.model.getRawData().count()}function vw(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),yw}function yw(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function bw(e,t){U(Ao(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,co(xw,t))})}function xw(e,t){var n=Sw(e);return n&&n.setOutputEnd((t||this).count()),t}function Sw(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}var Cw=Of.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),ww={line:x_,rect:Hf,roundRect:Hf,square:Hf,circle:Gg,diamond:Of.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:Of.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:Of.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:Cw},Tw={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},Ew={};U(ww,function(e,t){Ew[t]=new e});var Dw=Of.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=yc(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=Ew[r];i||=(r=`rect`,Ew[r]),Tw[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function Ow(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Q.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function kw(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?lv(e.slice(8),new Z(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?cv(e.slice(7),{},new Z(t,n,r,i),o?`center`:`cover`):new Dw({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=Ow,a&&c.setColor(a),c}function Aw(e){return G(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function jw(e,t){if(e!=null)return G(e)||(e=[e,e]),[Sp(e[0],t[0])||0,Sp(Y(e[1],e[0]),t[1])||0]}var Mw=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e){return vx(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Ug,n=kw(`line`,0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual(`symbol`),i=this.getData().getVisual(`symbolRotate`),a=r===`none`?`circle`:r,o=e.itemHeight*.8,s=kw(a,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=(e.iconRotate===`inherit`?i:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),a.indexOf(`empty`)>-1&&(s.style.stroke=s.style.fill,s.style.fill=Q.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1,triggerEvent:!1},t}(mw);function Nw(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=sb(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o=0&&r.push(t[a])}return r.join(` `)}var Fw=function(e){B(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=kw(e,-1,-1,2,2,null,a);o.attr({z2:Y(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=Iw,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Gh(this.childAt(0))},t.prototype.downplay=function(){Kh(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):K_(f,p,o,n),Q_(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,q_(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=Zv(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=jw(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof Pf){var S=a.style;a.useStyle(H({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(H({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;Xv(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):Nw(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),ug(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=$m(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Y_(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Y_(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return Aw(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Ug);function Iw(e,t){this.parent.drift(e,t)}function Lw(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function Rw(e){return e!=null&&!J(e)&&(e={isIgnore:e}),e||{}}function zw(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:Zv(t),cursorStyle:t.get(`cursor`)}}function Bw(e,t,n,r,i,a,o){var s=new e(t,n,r,i);return s.setPosition(a),t.setItemGraphicEl(n,s),o.add(s),s}var Vw=function(){function e(e){this.group=new Ug,this._SymbolCtor=e||Fw}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=Rw(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=this._seriesScope=zw(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);Lw(e,i,r,t)&&Bw(a,e,r,s,c,i,n)}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!Lw(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):K_(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var n=this,r=t.getStore(),i=0,a=r.count();i0?n=r[0]:r[1]<0&&(n=r[1]),n}function Ww(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function Gw(e,t){return!isFinite(e)||!isFinite(t)}var Kw=typeof Float32Array<`u`?Float32Array:void 0,qw=typeof Float64Array<`u`?Float64Array:void 0;function Jw(e){return Yw({ctor:Kw},e).arr}function Yw(e,t){var n=e.arr,r=e.ctor;if(t>Np&&(t=Np),!n||e.typed&&n.length=i||h<0)break;if(Gw(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g=r||Gw(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,ee=v-u,M=C-v,N=void 0,te=void 0;if(s===`x`){N=Math.abs(A),te=Math.abs(j);var P=E>0?1:-1;p=_-P*N*o,m=v,O=_+P*te*o,k=v}else if(s===`y`){N=Math.abs(ee),te=Math.abs(M);var F=D>0?1:-1;p=_,m=v-F*N*o,O=_,k=v+F*te*o}else N=Math.sqrt(A*A+ee*ee),te=Math.sqrt(j*j+M*M),T=te/(te+N),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=Qw(O,$w(S,_)),k=Qw(k,$w(C,v)),O=$w(O,Qw(S,_)),k=$w(k,Qw(C,v)),E=O-_,D=k-v,p=_-E*N/te,m=v-D*N/te,p=Qw(p,$w(l,_)),m=Qw(m,$w(u,v)),p=$w(p,Qw(l,_)),m=$w(m,Qw(u,v)),E=_-p,D=v-m,O=_+E*te/N,k=v+D*te/N}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var tT=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),nT=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new tT},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&Gw(n[i*2-2],n[i*2-1]);i--);for(;r=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?ml(i,u,f,m,e,s):ml(a,d,p,h,e,s);if(v>0)for(var y=0;y=0){var _=o?fl(a,d,p,h,b):fl(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(Of),rT=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(tT),iT=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new rT},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&Gw(n[a*2-2],n[a*2-1]);a--);for(;i=t[0]&&e<=t[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){MT(this._extents,0,e,t)},setExtent2:function(e,t,n){var r=this._extents;r[e]||(r[e]=r[0].slice()),MT(r,e,t,n)},freeze:function(){}};function MT(e,t,n,r){Vm(n,r)&&(e[t][0]=n,e[t][1]=r)}function NT(e){return PT(e)||IT(e)}function PT(e){return e.type===`interval`}function FT(e){return e.type===`time`}function IT(e){return e.type===`log`}function LT(e){return e.type===`ordinal`}function RT(e){var t=zp(e),n=gp(10,t),r=pp(e/n);return r?r===2?r=3:r===3?r=5:r*=2:r=1,Dp(r*n,-t)}function zT(e){return kp(e)+2}function BT(e,t){return _p(e)/_p(t)}function VT(e,t,n){var r=n&&n.lookup;if(r){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==r[0]&&c(r[0],!0,!0);for(var s=i;s<=r[1];s+=o)c(s,!1,s===r[0]||s===r[1]);s-o!==r[1]&&c(r[1],!0,!0);function c(e,t,r){n({value:e,offInterval:t},r)}}var KT=function(e){B(t,e);function t(n){var r=e.call(this)||this;r.type=`ordinal`,r.parse=t.parse,wT(r,t.decoratedMethods);var i=n.ordinalMeta;i||=new bT({}),G(i)&&(i=new bT({categories:W(i,function(e){return J(e)?e.value:e})})),r._ordinalMeta=i;var a=CT(null,null,n.extent||[0,i.categories.length-1]);return r._mapper=a.mapper,TT(r,a.mapper),r}return t.parse=function(e){return e==null?e=NaN:q(e)?(e=this._ordinalMeta.getOrdinal(e),e??=NaN):e=pp(e),e},t.prototype.getTicks=function(){var e=[];return GT(this,0,function(t){e.push(t)}),e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=up(a,t.length);i=0&&e=0&&e=0&&eo[0]&&mi[1]||!isFinite(p)||!isFinite(i[1]))break}else{if(m>f)break;p=up(p,i[1]),m===f&&(p=i[1])}if(l.push({value:p}),p=Dp(p+n,a),s){var h=s.calcNiceTickMultiple(p,d);h>=0&&(p=Dp(p+h*n,a))}if(l.length>0&&p===l[l.length-1].value)break;if(l.length>u)return[]}var g=l.length?l[l.length-1].value:i[1];return r[1]>g&&l.push({value:e.expandToNicedExtent?Dp(g+n,a):r[1]}),c&&o.pruneTicksByBreak(e.pruneByBreak,l,s.breaks,function(e){return e.value},t.interval,r),c&&e.breakTicks!==`none`&&o.addBreaksToTicks(l,s.breaks,r),l},t.prototype.getMinorTicks=function(e){return qT(this,e,nS(this),this._cfg.interval)},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=kp(e.value)||0:n===`auto`&&(n=this._cfg.intervalPrecision),BS(Dp(e.value,n,!0))},t.type=`interval`,t}(vT);vT.registerClass(JT);var YT=function(e,t,n,r){for(;n>>1;e[i][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function eE(e){var t=30*sS;return e/=t,e>6?6:e>3?3:e>2?2:1}function tE(e){return e/=oS,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function nE(e,t){return e/=t?aS:iS,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function rE(e){return dp(Bp(e,!0),1)}function iE(e,t,n){var r=Math.max(0,Qa(mS,t)-1);return TS(new Date(e),mS[r],n).getTime()}function aE(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function oE(e,t,n,r,i,a){var o=hS,s=0;function c(e,t,n,i,o,c,l){for(var u=aE(o,e),d=t,f=new Date(d);d3e3));)if(f[o](f[i]()+e),d=f.getTime(),a){var p=a.calcNiceTickMultiple(d,u);p>0&&(f[o](f[i]()+p*e),d=f.getTime())}l.push({value:d,notAdd:d>r[1]})}function l(e,i,a){var o=[],s=!i.length;if(!QT(yS(e),r[0],r[1],n)){s&&(i=[{value:iE(r[0],e,n)},{value:r[1]}]);for(var l=0;l=r[0]&&u<=r[1]&&c(f,u,d,p,m,h,o),e===`year`&&a.length>1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l=r[0]&&v<=r[1]&&f++)}var y=i/t;if(f>y*1.5&&p>y/1.5||(u.push(g),f>y||e===o[m]))break}d=[]}}for(var b=ro(W(u,function(e){return ro(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),x=b.length-1,S=[],m=0;mr[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!D||D.values&&(a=s);var c=ZT.length,l=Math.min(YT(ZT,a,0,c),c-1),u=ZT[l][1],d=ZT[Math.max(l-1,0)][0];e.setTimeInterval({approxInterval:a,interval:u,minLevelUnit:d})};vT.registerClass(XT);var cE=0,lE=1,uE=2,dE=function(e){B(t,e);function t(n){var r=e.call(this)||this;r.type=`log`,r.parse=JT.parse,r.base=n.logBase||10;var i=[],a=[],o=r._lookup={from:i,to:a};i[cE]=i[lE]=a[cE]=a[lE]=NaN,wT(r,t.mapperMethods);var s=eS(),c=n.breakOption,l={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(c,r,{noNegative:!0},uE,l),r.powStub=new JT({breakParsed:l.original}),r.intervalStub=new JT({breakParsed:l.transformed}),TT(r,r.intervalStub),r}return t.prototype.getTicks=function(e){var t=this.base,n=this.powStub,r=eS(),i=this.intervalStub,a={lookup:{from:i.getExtent(),to:n.getExtent()}};return W(i.getTicks(e||{}),function(e){var i=e.value,o=VT(i,t,a),s;if(r){var c=r.getTicksBreakOutwardTransform(this,e,nS(n),this._lookup);c&&(s=c.vBreak,o=c.tickVal)}return{value:o,break:s}},this)},t.prototype.getMinorTicks=function(e){return qT(this,e,nS(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(e,t){return this.intervalStub.getLabel(e,t)},t.type=`log`,t.mapperMethods={needTransform:function(){return!0},normalize:function(e){return this.intervalStub.normalize(BT(e,this.base))},scale:function(e){return VT(this.intervalStub.scale(e),this.base,null)},transformIn:function(e,t){return e=BT(e,this.base),t&&t.depth===2?e:this.intervalStub.transformIn(e,t)},transformOut:function(e,t){var n=t?t.depth:null;return fE.depth=n,pE.lookup=this._lookup,VT(n===2?e:this.intervalStub.transformOut(e,fE),this.base,pE)},contain:function(e){return this.powStub.contain(e)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){if(!(!Vm(t,n)||t<=0||n<=0)){var r=mE,i=mE;if(e===0){var a=this._lookup;r=a.to,i=a.from}this.powStub.setExtent2(e,r[cE]=t,r[lE]=n);var o=this.base;this.intervalStub.setExtent2(e,i[cE]=BT(t,o),i[lE]=BT(n,o))}},getFilter:function(){return{g:0}},sanitize:function(e,t){return Vm(t[0],t[1])&&qp(e)&&e<=0&&(e=t[0]),e},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(e,t){return t===null?this.powStub.getExtentUnsafe(e,null):this.intervalStub.getExtentUnsafe(e,t)}},t}(vT);vT.registerClass(dE);var fE={},pE={},mE=[],hE={value:1,category:1,time:1,log:1},gE=wm();function _E(e){var t=e.get(`type`);return(t==null||!Mo(hE,t)&&!vT.getClass(t))&&(t=`value`),t}function vE(e,t,n){var r=eS(),i;switch(r&&(i=kE(e,t,n)),t){case`category`:return new KT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Fm()});case`time`:return new XT({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`),breakOption:i});case`log`:return new dE({logBase:e.get(`logBase`),breakOption:i});case`value`:return new JT({breakOption:i});default:return new((vT.getClass(t))||JT)({})}}function yE(e,t,n){var r=n?DT(e,null):e.getExtentUnsafe(0,null),i=r[0],a=r[1];return Vm(i,a)?i===t||a===t?2:it?1:3:3}function bE(e){gE(e).noOnMyZero=!0}function xE(e){return gE(e).noOnMyZero}function SE(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=gS(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}if(q(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};if(K(t)){if(e.type===`category`)return function(n,r){return t(CE(e,n),n.value-e.scale.getExtent()[0],null)};var r=eS();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(CE(e,n),i,a)}}return function(t){return e.scale.getLabel(t)}}function CE(e,t){var n=e.scale;return LT(n)?n.getLabel(t):t.value}function wE(e){return e.get(`interval`)??`auto`}function TE(e){return e.type===`category`&&wE(e.getLabelModel())===0}function EE(e,t){var n={};return U(e.mapDimensionsAll(t),function(t){n[hx(e,t)]=!0}),ao(n)}function DE(e){return e===`middle`||e===`center`}function OE(e){return e.getShallow(`show`)}function kE(e,t,n){var r=e.get(`breaks`,!0);if(r!=null)return!eS()||!n||!AE(t)?void 0:r}function AE(e){return e!==`category`}function jE(e,t,n,r,i,a){var o=IT(e),s=o?e.intervalStub:e;if(s.setExtent(r[0],r[1]),o){var c=e.powStub,l={depth:2},u=e.transformOut(r[0],l),d=e.transformOut(r[1],l),f=UT(n,r);t[0]&&!f[0]&&(u=i[0]),t[1]&&!f[1]&&(d=i[1]),c.setExtent(u,d)}s.setConfig(a)}function ME(e,t){return LT(e)?e.getRawOrdinalNumber(t.value):t.value}function NE(e,t){return LT(e)&&!!t.get(`boundaryGap`)}function PE(e,t){if(e.length===t.length){for(var n=0;nt){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function VE(e,t,n){var r=e.getVisual(`visualMeta`);if(r&&r.length&&e.count()&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=W(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=BE(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;U(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new A_(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function HE(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!r||i){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&UE(a,t))){var o=t.mapDimension(a.dim),s={};return U(a.getViewLabels(),function(e){e.tick.offInterval||(s[ME(a.scale,e.tick)]=1)}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function UE(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function WE(e){for(var t=e.length/2;t>0&&Gw(e[t*2-2],e[t*2-1]);t--);return t-1}function GE(e,t){return[e[t*2],e[t*2+1]]}function KE(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function qE(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var ee=f.getState(`emphasis`).style;ee.lineWidth=+f.style.lineWidth+1}$m(f).seriesIndex=e.seriesIndex,ug(f,k,A,j);var M=LE(e.get(`smooth`)),N=e.get(`smoothMonotone`);if(f.setShape({smooth:M,smoothMonotone:N,connectNulls:x}),p){var te=a.getCalculationInfo(`stackedOnSeries`),P=0;p.useStyle(Za(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),te&&(P=LE(te.get(`smooth`))),p.setShape({smooth:M,stackedOnSmooth:P,smoothMonotone:N,connectNulls:x}),mg(p,e,`areaStyle`),$m(p).seriesIndex=e.seriesIndex,ug(p,k,A,j)}var F=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=F)}),this._polyline.onHoverStateChange=F,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_;var ne=e.get(`triggerEvent`),re=e.get(`triggerLineEvent`),ie=re===!0||ne===!0||ne===`line`,ae=re===!0||ne===!0||ne===`area`;this.packEventData(e,f,ie),p&&this.packEventData(e,p,ae)},t.prototype.packEventData=function(e,t,n){$m(t).eventData=n?{componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`,selfType:t===this._polygon?`area`:`line`}:null},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=Cm(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(Gw(c,l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new Fw(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else cT.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=Cm(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else cT.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;Ih(this._polyline,e),t&&Ih(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new nT({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new iT({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);K(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=K(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=K(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(qE(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new qf({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=WE(o);c>=0&&(Xv(a,Zv(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?Nw(i,e):Pw(i,n)},enableTextSetter:!0},YE(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=KE(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=GE(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Pm(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=GE(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=sy(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=Zw(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=zE(u.stackedOnCurrent,u.current,n,i,o),d=zE(u.current,null,n,i,o),m=zE(u.stackedOnNext,u.next,n,i,o),p=zE(u.next,null,n,i,o)),IE(d,p)>3e3||c&&IE(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),K_(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),K_(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;tt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;q(i)?p=QE[i]:K(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,$E))}}}}}function tD(e){e.registerChartView(XE),e.registerSeriesModel(Mw),e.registerLayout(ZE(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,eD(`line`))}var nD=wm(),rD=wm(),iD={estimate:1,determine:2};function aD(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function oD(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=e.scale;return{labels:W(cD(n,r),function(t,n){return{formattedLabel:SE(e)(t,n),rawLabel:r.getLabel(t),tick:t}})}}return e.type===`category`?lD(e,t):fD(e)}function sD(e,t,n){var r=e.scale,i=e.getTickModel().get(`customValues`);return i?{ticks:cD(i,r)}:e.type===`category`?dD(e,t):{ticks:r.getTicks(n)}}function cD(e,t){var n=t.getExtent(),r=[];return U(e,function(e){e=t.parse(e),e>=n[0]&&e<=n[1]&&r.push(e)}),Km(r,Jm,null),Op(r),W(r,function(e){return{value:e}})}function lD(e,t){var n=e.getLabelModel(),r=uD(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function uD(e,t,n){var r=mD(e),i=wE(t),a=n.kind===iD.estimate;if(!a){var o=gD(r,i);if(o)return o}var s,c;K(i)?s=CD(e,i,!1):(c=i===`auto`?vD(e,n):i,s=CD(e,c,!1));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return _D(r,i,l),!0}):_D(r,i,l),l}function dD(e,t){var n=pD(e),r=wE(t),i=gD(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),K(r))a=CD(e,r,!0);else if(r===`auto`){var s=uD(e,e.getLabelModel(),aD(iD.determine));o=s.labelCategoryInterval,a=W(s.labels,function(e){return e.tick})}else o=r,a=CD(e,o,!0);return _D(n,r,{ticks:a,tickCategoryInterval:o})}function fD(e){var t=e.scale.getTicks(),n=SE(e);return{labels:W(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tick:t}})}}var pD=hD(`axisTick`),mD=hD(`axisLabel`);function hD(e){return function(t){return rD(t)[e]||(rD(t)[e]={list:[]})}}function gD(e,t){for(var n=0;nu&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=mc(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===iD.estimate?(t.out.noPxChangeTryDetermine.push(so(bD,null,e,S,c)),S):xD(e,S,c)??S}function bD(e,t,n){return xD(e,t,n)==null}function xD(e,t,n){var r=nD(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function SD(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function CD(e,t,n){var r=SE(e),i=e.scale,a=[],o=K(t);return GT(i,o?0:t,function(e,s){var c=i.getLabel(e);if(o){var l=!!t(e.value,c);if(e.offInterval=!l,!l&&!s)return}a.push(n?e:{formattedLabel:r(e),rawLabel:c,tick:e})}),a}var wD=wm();function TD(e){wD(e).prepare={}}function ED(e){wD(e).fullUpdate={}}function DD(e){return wD(e).prepare}function OD(e){return wD(e).fullUpdate}var kD=Wm(),AD=wm(),jD=wm();function MD(e,t){var n=e.model,r=AD(OD(n.ecModel)).keyed,i=r&&r.get(t);return i&&i.get(n.uid)}function ND(e,t){return ID(MD(e,t))}function PD(e,t){var n=[];return FD(e.model.ecModel,function(e){for(var r=0;r0?(t>o&&(o=t),a=!1):t===-2&&(a=!0))}),qp(n)&&n>0&&qp(o)?(e.w=r/n*o,e.w2=o):a&&(e.w=r*YD,e.w2=e.w*n/r)}var $D=[0,1],eO=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this.scale;return e=n.normalize(n.parse(e)),xp(e,$D,tO(this),t)},e.prototype.coordToData=function(e,t){var n=xp(e,tO(this),$D,t);return this.scale.scale(n)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=W(sD(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,function(e){return{coord:this.dataToCoord(ME(this.scale,e)),tick:e}},this),r=t.get(`alignWithLabel`),i=nO(this,n,r);return W(n,function(e){return{coord:e.coord,tickValue:e.tick.value,onBand:i}})},e.prototype.getMinorTicksCoords=function(){if(LT(this.scale))return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),W(this.scale.getMinorTicks(e),function(e){return W(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=aD(iD.determine),oD(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){return XD(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(e){return e||=aD(iD.determine),yD(this,e)},e}();function tO(e){var t=e.getExtent();if(e.onBand){var n=(t[1]-t[0])/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function nO(e,t,n){var r=t.length;if(!e.onBand||n||!r)return!1;var i=XD(e).w;if(!i)return!1;U(t,function(e){e.coord-=i/2});var a=e.scale.getExtent(),o=t[r-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}var rO=function(e){B(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(eO),iO=[`label`,`labelLine`,`layoutOption`,`priority`,`defaultAttr`,`marginForce`,`minMarginForce`,`marginDefault`,`suggestIgnore`],aO=1,oO=2,sO=aO|oO;function cO(e,t,n){n||=sO,t?e.dirty|=n:e.dirty&=~n}function lO(e,t){return t||=sO,e.dirty==null||!!(e.dirty&t)}function uO(e){if(e)return lO(e)&&dO(e,e.label,e),e}function dO(e,t,n){var r=t.getComputedTransform();e.transform=Rv(e.transform,r);var i=e.localRect=Lv(e.localRect,t.getBoundingRect()),a=t.style,o=a.margin,s=n&&n.marginForce,c=n&&n.minMarginForce,l=n&&n.marginDefault,u=a.__marginType;u==null&&l&&(o=l,u=ly.textMargin);for(var d=0;d<4;d++)fO[d]=u===ly.minMargin&&c&&c[d]!=null?c[d]:s&&s[d]!=null?s[d]:o?o[d]:0;u===ly.textMargin&&kv(i,fO,!1,!1);var f=e.rect=Lv(e.rect,i);return r&&f.applyTransform(r),u===ly.minMargin&&kv(f,fO,!1,!1),e.axisAligned=Fv(r),(e.label=e.label||{}).ignore=t.ignore,cO(e,!1),cO(e,!0,oO),e}var fO=[0,0,0,0];function pO(e,t,n){return e.transform=Rv(e.transform,n),e.localRect=Lv(e.localRect,t),e.rect=Lv(e.rect,t),n&&e.rect.applyTransform(n),e.axisAligned=Fv(n),e.obb=void 0,(e.label=e.label||{}).ignore=!1,e}function mO(e,t){if(e){e.label.x+=t.x,e.label.y+=t.y,e.label.markRedraw();var n=e.transform;n&&(n[4]+=t.x,n[5]+=t.y);var r=e.rect;r&&(r.x+=t.x,r.y+=t.y);var i=e.obb;i&&i.fromBoundingRect(e.localRect,n)}}function hO(e,t){for(var n=0;n.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new Z(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var kO=ls(),AO=new Z(0,0,0,0),jO=function(e,t,n,r,i,a){if(DE(e.nameLocation)){var o=a.stOccupiedRect;o&&MO(pO({},o,a.transGroup.transform),r,i)}else NO(a.labelInfoList,a.dirVec,r,i)};function MO(e,t,n){var r=new Fs;vO(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&mO(t,r)}function NO(e,t,n,r){for(var i=Fs.dot(r,t)>=0,a=0,o=e.length;a0?`top`:`bottom`,i=`center`):Fp(r-SO)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),FO=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],IO={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(Ms(u,u,l),Ms(d,d,l));var p=H({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&rS(r.axis.scale))bO().buildAxisBreakLine(r,i,a,m);else{var h=new x_(H({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));pv(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);q(g)&&(g=[g,g]),(q(_)||uo(_))&&(_=[_,_]);var v=jw(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];U([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=kw(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){GO(t,i,s)&&LO(e,t,n,r,i,a,o,iD.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){GO(t,i,s)&&LO(e,t,n,r,i,a,o,iD.determine);var c=UO(e,i,a,r);BO(e,t.labelLayoutList,c),WO(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(QO(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new Fs(0,0),_=new Fs(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=ls();_.transform(ms(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*SO/180);var b,x;DE(u)?b=PO.innerTextLayout(e.rotation,y??e.rotation,d):(b=RO(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=_o(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new qf({x:g.x,y:g.y,rotation:b.rotation,silent:PO.isLabelSilent(r),style:Qv(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(Mv({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=PO.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,$m(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=uO({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:DE(u)?CO[E]:wO[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}};function LO(e,t,n,r,i,a,o,s){qO(t)||KO(e,t,i,s,r,o);var c=t.labelLayoutList;YO(e,r,c,a),ek(r,e.rotation,c);var l=e.optionHideOverlap;zO(r,c,l),l&&_O(ro(c,function(e){return e&&!e.label.ignore})),OO(e,n,r,c)}function RO(e,t,n,r){var i=Pp(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return Fp(i-SO/2)?(o=c?`bottom`:`top`,a=`center`):Fp(i-SO*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=iSO/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function zO(e,t,n){var r=e.axis,i=e.get([`axisLabel`,`customValues`]);if(TE(r))return;function a(e,a,o){var s=uO(t[a]),c=uO(t[o]),l=r.scale;if(s&&c){if(e==null){if(!n&&i)return;var u=TO(s.label).labelInfo.tick;if(FT(l)&&u.notNice||LT(l)&&u.offInterval){VO(s.label);return}}if(e===!1||s.suggestIgnore){VO(s.label);return}if(c.suggestIgnore){VO(c.label);return}var d=.1;if(!n){var f=[0,0,0,0];s=hO({marginForce:f},s),c=hO({marginForce:f},c)}vO(s,c,null,{touchThreshold:d})&&VO(e?c.label:s.label)}}var o=e.get([`axisLabel`,`showMinLabel`]),s=e.get([`axisLabel`,`showMaxLabel`]),c=t.length;a(o,0,1),a(s,c-1,c-2)}function BO(e,t,n){e.showMinorTicks||U(t,function(e){if(e&&e.label.ignore)for(var t=0;t0&&u[1]>0&&!d[0]&&(u[0]=0),u[0]<0&&u[1]<0&&!d[1]&&(u[1]=0));var y=!1;u[0]>u[1]&&(u.reverse(),y=!0);var b=uk(e,t.get(`startValue`,!0)),x=b!=null;!qp(b)&&r&&(b=e.getDefaultStartValue?e.getDefaultStartValue():0),qp(b)&&(x||!_||v)&&(bu[1]&&!d[1]&&(u[1]=b,d[1]=!0)),lk(this._i={scale:e,dataMM:l,noZoomEffMM:u,zoomMM:[],fixMM:d,zoomFixMM:[!1,!1],startValue:b,isBlank:g,incl0:v,tggAxInv:y,ctnShp:i},u)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var e=this._i,t=e.zoomMM,n=e.noZoomEffMM,r=e.zoomFixMM,i=e.fixMM,a={fixMM:i,zoomFixMM:r,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=a.effMM;return t[0]!=null&&(o[0]=t[0],i[0]=r[0]=!0),t[1]!=null&&(o[1]=t[1],i[1]=r[1]=!0),lk(e,o),a},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(e,t){this._i.zoomMM[e]=t},e}();function lk(e,t){var n=e.scale,r=e.dataMM;n.sanitize&&(t[0]=n.sanitize(t[0],r),t[1]=n.sanitize(t[1],r),Um(t))}function uk(e,t){return t==null?null:go(t)?NaN:e.parse(t)}function dk(e,t){var n;if(LT(e))n=[0,0];else{var r=t.get(`boundaryGap`);typeof r==`boolean`&&(r=null),n=G(r)?r:[r,r]}return[fk(n[0]),fk(n[1])]}function fk(e){return vc(typeof e==`boolean`?0:e,1)||0}function pk(e){var t=ok(e.scale);return t.extent||=Fm(),t}function mk(e,t){pk(e).dimIdxInCoord=t.get(e.dim)}function hk(e,t){var n=e.scale,r=e.model,i=e.dim;n.rawExtentInfo||gk(n,e,i,r,t)}function gk(e,t,n,r,i){var a=pk(t),o=a.extent,s=!1;LD(t,function(r){if(r.boxCoordinateSystem){var i=ax(r).coord,c=a.dimIdxInCoord;if(c>=0&&G(i)){var l=i[c];l!=null&&!G(l)&&Im(o,e.parse(l))}}else if(r.coordinateSystem){var u=r.getData();if(u){var d=e.getFilter?e.getFilter():null;U(EE(u,n),function(e){zm(o,u.getApproximateExtent(e,d))})}r.__requireStartValue&&r.__requireStartValue(t)&&(s=!0)}});var c=Sk(e,t,r);vk(e,new ck(e,r,o,s,c),i),a.extent=null}function _k(e,t){var n=e.scale;vk(n,new ck(n,e.model,t,!1,!1),sk)}function vk(e,t,n){e.rawExtentInfo=t,t.from=n}function yk(e,t){bk.set(e,t)}var bk=X();function xk(e,t,n,r,i){e.rawExtentInfo||_k({scale:e,model:t},i||Fm());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),r&&a.tggAxInv&&n&&!n.get(`legacyMinMaxDontInverseAxis`)&&(r.inverse=!r.inverse),a}function Sk(e,t,n){var r=NE(e,n),i=n.get(`containShape`,!0);if(i==null&&!r&&(i=!0),!i)return!1;var a=!1;return VD(t,function(e){a=!!bk.get(e)||a}),a}function Ck(e,t,n,r){if(n.ctnShp){var i;if(VD(e,function(t){var n=bk.get(t);if(n){var a=n(e,r);a&&(i||=[0,0],Lm(i,a[0]),Rm(i,a[1]),bE(e))}}),i){var a=t.getExtent();if(LT(t))e.onBand||t.setExtent2(1,up(a[0],a[0]+i[0]),dp(a[1],a[1]+i[1]));else{var o=a.slice();n.zoomFixMM[0]||(o[0]=up(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),n.zoomFixMM[1]||(o[1]=dp(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&t.setExtent2(1,o[0],o[1])}}}}function wk(){UD(`liPosMinGap`,Tk)}function Tk(e,t,n){var r=X(),i=n.serUids,a=n.liPosMinGap,o,s=t.axis,c=s.scale,l=c.needTransform(),u=c.getFilter?c.getFilter():null,d=_b(u);function f(n){zD(e,t.sers,function(e){var t=e.getRawData(),r=t.getDimensionIndex(t.mapDimension(s.dim));r>=0&&n(r,e,t.getStore())})}var p=0;if(f(function(e,t,n){r.set(t.uid,1),(!i||!i.hasKey(t.uid))&&(o=!0),p+=n.count()}),(!i||i.keys().length!==r.keys().length)&&(o=!0),!o&&a!=null){t.liPosMinGap=a;return}Yw(Ek,p);var m=0;f(function(e,t,n){for(var r=0,i=n.count();r0&&v0?-2:-1,n.serUids=r}var Ek=Yw({ctor:qw},50);function Dk(e){return function(t,n){var r=XD(t,{fromStat:{key:e}});if(qp(r.w2))return[-r.w2/2,r.w2/2]}}function Ok(e,t){return e+`|&`+t}function kk(e){return wk(),{liPosMinGap:!LT(e.scale)}}function Ak(e,t,n,r){qD(e,{key:t,seriesType:n,coordSysType:r,getMetrics:kk})}function jk(e){return e.scale.rawExtentInfo.makeRenderInfo().startValue}var Mk={left:0,right:0,top:0,bottom:0},Nk=[`25%`,`25%`],Pk=`cartesian2d`,Fk=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=cC(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&sC(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&sC(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:Mk,outerBoundsContain:`all`,outerBoundsClampWidth:Nk[0],outerBoundsClampHeight:Nk[1],backgroundColor:Q.color.transparent,borderWidth:1,borderColor:Q.color.neutral30},t}(dC),Ik=Wm(),Lk=`__ec_stack_`;function Rk(e){return e.get(`stack`)||Lk+e.seriesIndex}function zk(e,t){var n=Bk(e,t);return n.columnMap=Vk(n),n}function Bk(e,t){var n=Ok(t,Pk),r=[],i=XD(e,{fromStat:{key:n},min:1});return RD(e,n,function(e){r.push({barWidth:Sp(e.get(`barWidth`),i.w),barMaxWidth:Sp(e.get(`barMaxWidth`),i.w),barMinWidth:Sp(e.get(`barMinWidth`)||(Wk(e)?.5:1),i.w),barGap:e.get(`barGap`),barCategoryGap:e.get(`barCategoryGap`),defaultBarGap:e.get(`defaultBarGap`),stackId:Rk(e)})}),{bandWidthResult:i,seriesInfo:r}}function Vk(e){var t=e.bandWidthResult.w,n=t,r=0,i,a,o=[],s={};U(e.seriesInfo,function(e,t){t||(a=e.defaultBarGap||0);var c=e.stackId;Mo(s,c)||r++;var l=s[c];l||(l=s[c]={width:0,maxWidth:0},o.push(c));var u=e.barWidth;u&&!l.width&&(l.width=u,u=up(n,u),n-=u);var d=e.barMaxWidth;d&&(l.maxWidth=d);var f=e.barMinWidth;f&&(l.minWidth=f);var p=e.barGap;p!=null&&(a=p);var m=e.barCategoryGap;m!=null&&(i=m)}),i??=dp(35-o.length*4,15)+`%`;var c=Sp(i,t),l=Sp(a,1),u=(n-c)/(r+(r-1)*l);u=dp(u,0),U(o,function(e){var t=s[e],i=t.maxWidth,a=t.minWidth;if(t.width){var o=t.width;i&&(o=up(o,i)),a&&(o=dp(o,a)),t.width=o,n-=o+l*o,r--}else{var o=u;i&&io&&(o=a),o!==u&&(t.width=o,n-=o+l*o,r--)}}),u=(n-c)/(r+(r-1)*l),u=dp(u,0);var d=0,f;U(o,function(e){var t=s[e];t.width||=u,f=t,d+=t.width*(1+l)}),f&&(d-=f.width*l);var p={},m=-d/2;return U(o,function(e){var n=s[e];p[e]=p[e]||{bandWidth:t,offset:m,width:n.width},m+=n.width*(1+l)}),p}function Hk(e){return{seriesType:e,overallReset:function(t){var n=Ok(e,Pk);BD(t,n,function(t){var r=zk(t,e);RD(t,n,function(e){var t=r.columnMap[Rk(e)];e.getData().setLayout({bandWidth:t.bandWidth,offset:t.offset,size:t.width})})})}}}function Uk(e){return{seriesType:e,plan:aT(),reset:function(e){if(nk(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=mx(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=i.toGlobalCoord(i.dataToCoord(jk(i))),p=Wk(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&Jw(r*3),c=p&&s&&Jw(r*3),l=p&&Jw(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);u&&(T=n.dataToPoint([E,w])[0]),D=T,O=j[1]+_,k=j[0]-T,A=g,fp(k)s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.prototype.__requireStartValue=function(e){return this.getBaseAxis()!==e},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(mw);mw.registerClass(qk);var Jk=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return vx(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.__preparePipelineContext=function(e,t){var n=Xm(this,e,t);return n.progressiveRender&&(n.large=!0),n},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=Ex(qk.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:Q.color.primary,borderWidth:2}},realtimeSort:!1}),t}(qk),Yk=`\0__throttleOriginMethod`,Xk=`\0__throttleRate`,Zk=`\0__throttleType`;function Qk(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){var e=[...arguments];r=new Date().getTime(),c=this,l=e;var f=u||t,p=u||n;u=null,s=r-(p?i:a)-f,clearTimeout(o),p?o=setTimeout(d,f):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function $k(e,t,n,r){var i=e[t];if(i){var a=i[Yk]||i,o=i[Zk];if(i[Xk]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=Qk(a,n,r===`debounce`),i[Yk]=a,i[Zk]=r,i[Xk]=n}return i}}function eA(e,t){var n=e[t];n&&n[Yk]&&(n.clear&&n.clear(),e[t]=n[Yk])}var tA=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),nA=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new tA},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-cMath.PI/2&&ua)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){Z_(t,e,$m(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(cT),dA={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=cA(t.x,e.x),s=lA(t.x+t.width,i),c=cA(t.y,e.y),l=lA(t.y+t.height,a),u=si?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=lA(t.r,e.r),a=cA(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},fA={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new Hf({shape:H({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?nA:u_,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=rA(xA(i),{isRoundCap:l===nA}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?K_:q_)(u,{shape:p},a)}return u}};function pA(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function mA(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?K_:q_)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?K_:q_)(n,{shape:l},u,i)}function hA(e,t){for(var n=0;n0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function bA(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function xA(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function SA(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;H(u,sA(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?jA(i,a.coordinateSystem):MA(i,a.coordinateSystem),p=Zv(r);Xv(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:Nw(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,iA(e,h===`outside`?f:h,xA(o),r.get([`label`,`rotate`]))}cy(m,p,a.getRawValue(n),function(e){return Pw(t,e)});var g=r.getModel([`emphasis`]);ug(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),mg(e,r),bA(i)&&(e.style.fill=`none`,e.style.stroke=`none`,U(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function CA(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var wA=function(){function e(){}return e}(),TA=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new wA},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c=0?n:null},30,!1);function OA(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function kA(e,t,n){if(_T(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function AA(e,t,n){return new(e.type===`polar`?u_:Hf)({shape:kA(t,n,e),silent:!0,z2:0})}function jA(e,t){return e.height===0?t.getOtherAxis(t.getBaseAxis()).inverse?`bottom`:`top`:e.height>0?`bottom`:`top`}function MA(e,t){return e.width===0?t.getOtherAxis(t.getBaseAxis()).inverse?`left`:`right`:e.width>=0?`right`:`left`}function NA(e){e.registerChartView(uA),e.registerSeriesModel(Jk),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Hk(`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Uk(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,eD(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})}),Kk(e)}function PA(e,t,n,r,i){var a=e+t;n.isSilent(a)||r.eachComponent({mainType:`series`,subType:`pie`},function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,o=i.selected,s=0;s=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),LA=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),RA=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new LA(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new LA(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new LA(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new LA(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new LA(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new LA(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),zA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,BA=[],VA=Io.browser.firefox&&+Io.browser.version.split(`.`)[0]<39;function HA(e,t,n,r){return n||={},r?UA(e,t,n):VA&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?UA(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function UA(e,t,n){if(Io.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(Lx(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}if(Px(BA,e,r,i)){n.zrX=BA[0],n.zrY=BA[1];return}}n.zrX=n.zrY=0}function WA(e){return e||window.event}function GA(e,t,n){if(t=WA(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&HA(e,i,t,n)}else{HA(e,t,t,n);var a=KA(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&zA.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function KA(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function qA(e,t,n,r){e.addEventListener(t,n,r)}function JA(e,t,n,r){e.removeEventListener(t,n,r)}var YA=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function XA(e){return e.which===2||e.which===3}var ZA=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a1&&r&&r.length>1){var a=QA(r)/QA(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=$A(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}},tj=`silent`;function nj(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:rj}}function rj(){YA(this.event)}var ij=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Wu),aj=function(){function e(e,t){this.x=e,this.y=t}return e}(),oj=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],sj=new Z(0,0,0,0),cj=function(e){B(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new aj(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new ij,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new RA(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(U(oj,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=dj(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new aj(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new aj(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=nj(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new aj(e,t);if(uj(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new Z(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(sj.copy(u.getBoundingRect()),u.transform&&sj.applyTransform(u.transform),sj.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function lj(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||tj}return!1}function uj(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=lj(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==tj)){t.target=o;break}}}function dj(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var fj=32,pj=7;function mj(e){for(var t=0;e>=fj;)t|=e&1,e>>=1;return e+t}function hj(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function gj(e,t,n){for(n--;t>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function vj(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function yj(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function bj(e,t){var n=pj,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]=pj||m>=pj);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-vj(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c=pj||g>=pj);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;cs&&(c=s),_j(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var Sj=!1;function Cj(){Sj||(Sj=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function wj(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Tj=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=wj}return e.prototype.traverse=function(e,t){for(var n=0;n=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),Ej=Io.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};function Dj(){return new Date().getTime()}var Oj=function(e){B(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Dj()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(Ej(t),!e._paused&&e.update())}Ej(t)},t.prototype.start=function(){this._running||(this._time=Dj(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=Dj(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=Dj()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new Uu(e,t.loop);return this.addAnimator(n),n},t}(Wu),kj=300,Aj=Io.domSupported,jj=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:W(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),Mj={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},Nj=!1;function Pj(e){var t=e.pointerType;return t===`pen`||t===`touch`}function Fj(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function Ij(e){e&&(e.zrByTouch=!0)}function Lj(e,t){return GA(e.dom,new zj(e,t),!0)}function Rj(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var zj=function(){function e(e,t){this.stopPropagation=No,this.stopImmediatePropagation=No,this.preventDefault=No,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),Bj={mousedown:function(e){e=GA(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=GA(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=GA(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=GA(this.dom,e);var t=e.toElement||e.relatedTarget;Rj(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){Nj=!0,e=GA(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){Nj||(e=GA(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=GA(this.dom,e),Ij(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),Bj.mousemove.call(this,e),Bj.mousedown.call(this,e)},touchmove:function(e){e=GA(this.dom,e),Ij(e),this.handler.processGesture(e,`change`),Bj.mousemove.call(this,e)},touchend:function(e){e=GA(this.dom,e),Ij(e),this.handler.processGesture(e,`end`),Bj.mouseup.call(this,e),+new Date-this.__lastTouchMoment0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t=0;o--)r[o]&&!ym(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[mM],e},t.prototype.setTheme=function(e){this._theme=new by(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i=t:n===`max`?e<=t:e===t}function DM(e,t){return e.join(`,`)===t.join(`,`)}var OM=U,kM=J,AM=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function jM(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=AM.length;n0?e[n-1].seriesModel:null)}),eN(e))})}function eN(e){U(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=Mp(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var tN=function(){function e(){this.group=new Ug,this.uid=Sx(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();Wo(tN),Zo(tN);var nN=wm(),rN={itemStyle:Qo(_y,!0),lineStyle:Qo(my,!0)},iN={lineStyle:`stroke`,itemStyle:`fill`};function aN(e,t){return e.visualStyleMapper||rN[t]||(console.warn(`Unknown style type '`+t+`'.`),rN.itemStyle)}function oN(e,t){return e.visualDrawType||iN[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var sN={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=aN(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=oN(e,r),c=a[s],l=K(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||K(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||K(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=H({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},cN=new by,lN={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=aN(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){cN.option=n[r];var o=i(cN);H(e.ensureUniqueItemVisual(t,`style`),o),cN.option.decal&&(e.setItemVisual(t,`decal`,cN.option.decal),cN.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},uN={performRawSeries:!0,overallReset:function(e){var t=X();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=e.type+`-`+e.getColorBy();nN(e).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(e){if(!e.isColorBySeries()){var t=e.getRawData(),n={},r=e.getData(),i=nN(e).scope,a=oN(e,e.visualStyleAccessPath||`itemStyle`);r.each(function(e){var t=r.getRawIndex(e);n[t]=e}),t.each(function(o){var s=n[o];if(r.getItemVisual(s,`colorFromPalette`)){var c=r.ensureUniqueItemVisual(s,`style`),l=t.getName(o)||o+``,u=t.count();c[a]=e.getColorFromPalette(l,i,u)}})}})}},dN=Math.PI;function fN(e,t){t||={},Za(t,{text:`loading`,textColor:Q.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:Q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ug,r=new Hf({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new qf({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Hf({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new D_({shape:{startAngle:-dN/2,endAngle:-dN/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:dN*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:dN*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var pN=function(){function e(e,t,n,r){this._stageTaskMap=X(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid);e.pipelineContext=n.context=e.__preparePipelineContext?e.__preparePipelineContext(t,n):Xm(e,t,n)},e.prototype.restorePipelines=function(e,t){var n=this,r=n._pipelineMap=X();t.eachSeries(function(t){var i=e.painter.type===`canvas`&&t.getProgressive(),a=t.uid;r.set(a,{id:a,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(t,t.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;U(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});xo(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;U(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=X(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||CC({plan:vN,reset:yN,count:SN}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||CC({reset:mN});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=X(),c=e.seriesType,l=e.getTargetSeries,u=e.dirtyOnOverallProgress,d=!1;xo(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):U(n.getSeries(),f);function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,CC({reset:hN,onDirty:_N})));n.context={model:e,dirtyOnOverallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return K(e)&&(e={overallReset:e,seriesType:CN(e)}),e.uid=Sx(`stageHandler`),t&&(e.visualType=t),e},e}();function mN(e){e.overallReset(e.ecModel,e.api,e.payload)}function hN(e){return e.dirtyOnOverallProgress&&gN}function gN(){this.agent.dirty(),this.getDownstream().dirty()}function _N(){this.agent&&this.agent.dirty()}function vN(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function yN(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=rm(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?W(t,function(e,t){return xN(t)}):bN}var bN=xN(0);function xN(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),NN=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],PN=NN.concat([`symbolKeepAspect`]),FN={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&XN(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function $N(e,t,n){for(var r=t.type===`radial`?QN(e,t,n):ZN(e,t,n),i=t.colorStops,a=0;a0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:uo(e)?[e]:G(e)?e:null}function iP(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&rP(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=W(n,function(e){return e/i}),r/=i)}return[n,r]}var aP=new nf(!0);function oP(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function sP(e){return typeof e==`string`&&e!==`none`}function cP(e){var t=e.fill;return t!=null&&t!==`none`}function lP(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function uP(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function dP(e,t,n){var r=os(t.image,t.__image,n);if(cs(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Po),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function fP(e,t,n,r,i){var a,o=oP(n),s=cP(n),c=n.strokePercent,l=c<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var d=t.path||aP,f=t.__dirty;if(!r){var p=n.fill,m=n.stroke,h=s&&!!p.colorStops,g=o&&!!m.colorStops,_=s&&!!p.image,v=o&&!!m.image,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0;(h||g)&&(C=t.getBoundingRect()),h&&(y=f?$N(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(b=f?$N(e,m,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),_&&(x=f||!t.__canvasFillPattern?dP(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(S=f||!t.__canvasStrokePattern?dP(e,m,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),h?e.fillStyle=y:_&&(x?e.fillStyle=x:s=!1),g?e.strokeStyle=b:v&&(S?e.strokeStyle=S:o=!1)}var w=t.getGlobalScale();d.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,E;e.setLineDash&&n.lineDash&&(a=iP(t),T=a[0],E=a[1]);var D=!0;(u||f&4)&&(d.setDPR(e.dpr),l?d.setContext(null):(d.setContext(e),D=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),D&&d.rebuildPath(e,l?c:1),T&&(e.setLineDash(T),e.lineDashOffset=E),r?(i.batchFill=s,i.batchStroke=o):n.strokeFirst?(o&&uP(e,n),s&&lP(e,n)):(s&&lP(e,n),o&&uP(e,n)),T&&e.setLineDash([])}function pP(e,t,n){var r=t.__image=os(n.image,t.__image,t,t.onload);if(r&&cs(r)){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function mP(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=iP(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(oP(n)&&e.strokeText(i,n.x,n.y),cP(n)&&e.fillText(i,n.x,n.y)):(cP(n)&&e.fillText(i,n.x,n.y),oP(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var hP=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],gP=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function _P(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){OP(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?hd.opacity:o}(r||t.blend!==n.blend)&&(a||=(OP(e,i),!0),e.globalCompositeOperation=t.blend||hd.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[cF]){if(this._disposed){this.id;return}var r,i,a;if(J(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[cF]=!0,BF(this),!this._model||t){var o=new CM(this._api),s=this._theme,c=this._model=new gM;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},JF);var l={seriesTransition:a,optionChanged:!0};if(n)this[uF]={silent:r,updateParams:l},this[cF]=!1,this.getZr().wakeUp();else{try{SF(this),TF.update.call(this,null,l)}catch(e){throw this[uF]=null,this[cF]=!1,e}this._ssr||this._zr.flush(),this[uF]=null,this[cF]=!1,kF.call(this,r),AF.call(this,r)}}},t.prototype.setTheme=function(e,t){if(!this[cF]){if(this._disposed){this.id;return}var n=this._model;if(n){var r=t&&t.silent,i=null;this[uF]&&(r??=this[uF].silent,i=this[uF].updateParams,this[uF]=null),this[cF]=!0,BF(this);try{this._updateTheme(e),n.setTheme(this._theme),SF(this),TF.update.call(this,{type:`setTheme`},i)}catch(e){throw this[cF]=!1,e}this[cF]=!1,kF.call(this,r),AF.call(this,r)}}},t.prototype._updateTheme=function(e){q(e)&&(e=XF[e]),e&&(e=V(e),e&&ZM(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Io.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return U(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;U(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return U(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if($F[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();U(QF,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(V(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=Na.createCanvas(),h=$j(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return U(u,function(e){var t=e.left-o,n=e.top-s;g+=``+e.dom+``}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}return e.connectedBackgroundColor&&h.add(new Hf({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),U(u,function(e){var t=new Pf({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t,n){return EF(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return EF(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return EF(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return U(Em(n,e),function(e,n){n.indexOf(`Models`)>=0&&U(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=Em(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?RN(i,t):LN(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;U(UF,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&BN(i,function(e){var t=$m(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=H({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;U(KF,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),FA(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&jm(this.getDom(),tI,``);var e=this,t=e._api,n=e._model;U(e._componentsViews,function(e){e.dispose(n,t)}),U(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete QF[e.id]},t.prototype.resize=function(e){if(!this[cF]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[uF]&&(r??=this[uF].silent,n=!0,this[uF]=null),this[cF]=!0,BF(this);try{n&&SF(this),TF.update.call(this,{type:`resize`,animation:H({duration:0},e&&e.animation)})}catch(e){throw this[cF]=!1,e}this[cF]=!1,kF.call(this,r),AF.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(J(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),ZF[e]){var n=ZF[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=H({},e);return t.type=GF[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(J(t)||(t={silent:!!t}),WF[e.type]&&this._model){if(this[cF]){this._pendingActions.push(e);return}var n=t.silent;OF.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&Io.browser.weChat&&this._throttledZrFlush(),kF.call(this,n),AF.call(this,n)}},t.prototype.updateLabelLayout=function(){VN.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){SF=function(e){TD(e._model);var t=e._scheduler;t.restorePipelines(e._zr,e._model),t.prepareStageTasks(),CF(e,!0),CF(e,!1),t.plan()},CF=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;cY(t.get(`hoverLayerThreshold`),cM.hoverLayerThreshold)&&!Io.node&&!Io.worker;(e._usingTHL||a)&&(t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){var t=e.states.emphasis;t&&t.hoverLayer!==2&&(t.hoverLayer=+!!a)})}}),e._usingTHL=a)}}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=zv(e);t.eachRendered(function(e){return Vv(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!J_(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(J_(e))return;if(e instanceof Of&&bg(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}IF=function(e){return new(function(t){B(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Gh(t,n),RF(e)},n.prototype.leaveEmphasis=function(t,n){Kh(t,n),RF(e)},n.prototype.enterBlur=function(t){qh(t),RF(e)},n.prototype.leaveBlur=function(t){Jh(t),RF(e)},n.prototype.enterSelect=function(t){Yh(t),RF(e)},n.prototype.leaveSelect=function(t){Xh(t),RF(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getECUpdateCycleVersion=function(){return e[lF]},n.prototype.usingTHL=function(){return e._usingTHL},n}(fh))(e)},LF=function(e){function t(e,t){for(var n=0;n=0)){mI.push(n);var o=pN.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function gI(e,t){ZF[e]=t}function _I(e,t,n){var r=WN(`registerMap`);r&&r(e,t,n)}var vI=NC;pI($P,sN),pI(nF,lN),pI(nF,uN),pI($P,FN),pI(nF,IN),pI(oF,HP),aI(ZM),oI(KP,QM),gI(`default`,fN),uI({type:bh,event:bh,update:bh},No),uI({type:xh,event:xh,update:xh},No),uI({type:Sh,event:Th,update:Sh,action:No,refineEvent:yI,publishNonRefinedEvent:!0}),uI({type:Ch,event:Th,update:Ch,action:No,refineEvent:yI,publishNonRefinedEvent:!0}),uI({type:wh,event:Th,update:wh,action:No,refineEvent:yI,publishNonRefinedEvent:!0});function yI(e,t,n,r){return{eventContent:{selected:sg(n),isFromClick:t.isFromClick||!1}}}iI(`default`,{}),iI(`dark`,jN);var bI=[],xI={registerPreprocessor:aI,registerProcessor:oI,registerPostInit:sI,registerPostUpdate:cI,registerUpdateLifecycle:lI,registerAction:uI,registerCoordinateSystem:dI,registerLayout:fI,registerVisual:pI,registerTransform:vI,registerLoading:gI,registerMap:_I,registerImpl:UN,PRIORITY:sF,ComponentModel:dC,ComponentView:tN,SeriesModel:mw,ChartView:cT,registerComponentModel:function(e){dC.registerClass(e)},registerComponentView:function(e){tN.registerClass(e)},registerSeriesModel:function(e){mw.registerClass(e)},registerChartView:function(e){cT.registerClass(e)},registerCustomSeries:function(e,t){KN(e,t)},registerSubTypeDefaulter:function(e,t){dC.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){eM(e,t)}};function SI(e){if(G(e)){U(e,function(e){SI(e)});return}Qa(bI,e)>=0||(bI.push(e),K(e)&&(e={install:e}),e.install(xI))}var CI=function(){function e(){}return e.prototype.needIncludeZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),wI=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`grid`,Om).models[0]},t.type=`cartesian2dAxis`,t}(dC);eo(wI,CI);var TI={show:!0,z:0,inverse:!1,name:``,nameLocation:`end`,nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:`...`,placeholder:`.`},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:`auto`,onZeroAxisIndex:null,lineStyle:{color:Q.color.axisLine,width:1,type:`solid`},symbol:[`none`,`none`],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:Q.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:Q.color.axisSplitLine,width:1,type:`solid`}},splitArea:{show:!1,areaStyle:{color:[Q.color.backgroundTint,Q.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:Q.color.neutral00,borderColor:Q.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:`auto`}},EI=Ya({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:`auto`,show:`auto`},axisLabel:{interval:`auto`}},TI),DI=Ya({boundaryGap:[0,0],axisLine:{show:`auto`},axisTick:{show:`auto`},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:Q.color.axisMinorSplitLine,width:1}}},TI),OI={category:EI,value:DI,time:Ya({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:`bold`}}},splitLine:{show:!1}},DI),log:Za({logBase:10},DI)};function kI(e,t,n,r){U(hE,function(i,a){var o=Ya(Ya({},OI[a],!0),r,!0),s=function(e){B(n,e);function n(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t+`Axis.`+a,n}return n.prototype.mergeDefaultAndTheme=function(e,t){var n=oC(this),r=n?cC(e):{};Ya(e,t.getTheme().get(a+`Axis`)),Ya(e,this.getDefaultOption()),e.type=AI(e),n&&sC(e,r,n)},n.prototype.optionUpdated=function(){this.option.type===`category`&&(this.__ordinalMeta=bT.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if(t.type===`category`)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.updateAxisBreaks=function(e){var t=bO();return t?t.updateModelAxisBreak(this,e):{breaks:[]}},n.type=t+`Axis.`+a,n.defaultOption=o,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+`Axis`,AI)}function AI(e){return e.type||(e.data?`category`:`value`)}var jI=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return W(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ro(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),MI=[`x`,`y`];function NI(e){return(e.type===`interval`||e.type===`time`)&&!rS(e)}var PI=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=Pk,t.dimensions=MI,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(NI(e)&&NI(t)){var n=DT(e,null),r=DT(t,null),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(o&&s){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=gs([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new Z(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return Ms(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return Ms(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new Z(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(jI);function FI(e,t){var n=e.scale,r=e.model,i=xk(n,r,r.ecModel,e,null),a=IT(n),o=IT(t)?t.intervalStub:t,s=a?n.intervalStub:n,c=n.base,l=o.getTicks(),u=o.getTicks({expandToNicedExtent:!0}),d=l.length-1,f,p,m;if(d===1)f=p=0,m=1;else if(d===2){var h=fp(l[0].value-l[1].value),g=fp(l[1].value-l[2].value);f=p=0,h===g?m=2:(m=1,h=C[1])return!0})):b[1]?(T=C[1],A(function(){if(N(),k=Dp(O-E*m,D),j(),w<=C[0])return!0})):A(function(){k=Dp(hp(C[0]/E)*E,D),O=Dp(mp(C[1]/E)*E,D);var e=pp((O-k)/E);if(e<=m){var t=m-e,n=void 0,r=i.incl0||a;if(r&&C[0]===0)n=[0,t];else if(r&&C[1]===0)n=[t,0];else{var o=mp(t/2);n=t%2==0?[o,o]:w+T=C[1])return!0}})}jE(n,b,S,[w,T],x,{interval:E,intervalCount:m,intervalPrecision:D,niceExtent:[k,O]})}function II(e,t){var n=IT(e),r=n?e.intervalStub:e,i=t.fixMinMax||[],a=n?e.getExtent():null,o=r.getExtent(),s=HT(o,i,t.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var c=n?RI(r,t):LI(r,t),l=c.intervalPrecision,u=c.interval,d=t.userInterval;d!=null&&(c.interval=d,c.intervalPrecision=zT(d)),i[0]||(s[0]=Dp(mp(s[0]/u)*u,l)),i[1]||(s[1]=Dp(hp(s[1]/u)*u,l)),d!=null&&(c.niceExtent=s.slice()),jE(e,i,o,s,a,c)}function LI(e,t){var n=WT(t.splitNumber,5),r=kT(e),i=t.minInterval,a=t.maxInterval,o=Bp(r/n,!0);i!=null&&oa&&(o=a);var s=zT(o),c=e.getExtent(),l=[Dp(hp(c[0]/o)*o,s),Dp(mp(c[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:l}}function RI(e,t){var n=WT(t.splitNumber,10),r=e.getExtent(),i=kT(e),a=dp(Rp(i),1);n/i*a<=.5&&(a*=10);var o=zT(a),s=[Dp(hp(r[0]/a)*a,o),Dp(mp(r[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:s}}function zI(e){var t=e.scale,n=e.model,r=n.axis,i=n.ecModel;BI(t,n,r,i,null)}function BI(e,t,n,r,i){var a=xk(e,t,r,n,i),o=PT(e)||FT(e);VI(e,{splitNumber:t.get(`splitNumber`),fixMinMax:a.fixMM,userInterval:t.get(`interval`),minInterval:o?t.get(`minInterval`):null,maxInterval:o?t.get(`maxInterval`):null,rawExtentResult:a}),n&&r&&Ck(n,e,a,r)}function VI(e,t){HI[e.type](e,t)}var HI={interval:II,log:II,time:sE,ordinal:No},UI=[[3,1],[0,2]],WI=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=MI,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;U(this._axesList,function(e){hk(e,1);var t=e.scale;LT(t)&&t.setSortInfo(e.model.get(`categorySortInfo`))});function r(e){for(var t=ao(e),n=[],r=t.length-1;r>=0;r--){var i=e[+t[r]];i.__alignTo?n.push(i):zI(i)}U(n,function(e){YI(e,e.__alignTo)?zI(e):FI(e,e.__alignTo.scale)})}r(n.x),r(n.y);var i={};U(n.x,function(e){KI(n,`y`,e,i)}),U(n.y,function(e){KI(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=iC(e,t),i=this._rect=tC(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(ZI(a,i),!n){var c=tL(i,o,a,s,t),l=void 0;if(s)$I?($I(this._axesList,i),ZI(a,i)):l=eL(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=rL(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=eL(d,f,p,i,a,c,r))}nL(i,a,iD.determine,null,l,r),U(this._coordsList,function(e){e.calcAffineTransform()})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}J(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r=0;i--){var a=e[+t[i]];NT(a.scale)&&kE(a.model,a.type,!0)==null&&(a.model.get(`alignTicks`)&&a.model.get(`interval`)==null?r.push(a):n=a)}n||=r.pop(),n&&U(r,function(e){e.__alignTo=n})}function YI(e,t){return rS(e.scale)||rS(t.scale)||t.scale.getTicks().length<2}function XI(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function ZI(e,t){U(e.x,function(e){return QI(e,t.x,t.width)}),U(e.y,function(e){return QI(e,t.y,t.height)})}function QI(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),XI(e,t)}var $I;function eL(e,t,n,r,i,a,o){nL(r,i,iD.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=io(s,function(e){return e>0})==null;return kv(r,s,!0,!0,n),ZI(i,r),c;function l(e){U(i[tv[e]],function(t){if(OE(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i0&&!go(t)&&t>1e-4&&(e/=t),e}}function tL(e,t,n,r,i){var a=new DO(iL);return U(n,function(n){return U(n,function(n){if(OE(n.model)){var o=!r;n.axisBuilder=ik(e,t,n.model,i,a,o)}})}),a}function nL(e,t,n,r,i,a){var o=n===iD.determine;U(t,function(t){return U(t,function(t){OE(t.model)&&(ak(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[tv[1-t]]=e[nv[t]]<=a.refContainer[nv[t]]*.5?0:1-t==1?2:1}U(t,function(e,t){return U(e,function(e){OE(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function rL(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=tC(e.get(`outerBounds`,!0)||Mk,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||Qa([`all`,`axisLabel`],a)<0?`all`:a,s=[wp(Y(e.get(`outerBoundsClampWidth`,!0),Nk[0]),t.width),wp(Y(e.get(`outerBoundsClampHeight`,!0),Nk[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var iL=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;jO(e,t,n,r,i,a),DE(e.nameLocation)||U(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&NO(e.labelInfoList,e.dirVec,r,i)})};function aL(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return oL(n,e,t),n.seriesInvolved&&cL(n,e),n}function oL(e,t,n){var r=t.getComponent(`tooltip`),i=t.getComponent(`axisPointer`),a=i.get(`link`,!0)||[],o=[];U(n.getCoordinateSystems(),function(n){if(!n.axisPointerEnabled)return;var s=hL(n.model),c=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var l=n.model.getModel(`tooltip`,r);if(U(n.getAxes(),co(p,!1,null)),n.getTooltipAxes&&r&&l.get(`show`)){var u=l.get(`trigger`)===`axis`,d=l.get([`axisPointer`,`type`])===`cross`,f=n.getTooltipAxes(l.get([`axisPointer`,`axis`]));(u||d)&&U(f.baseAxes,co(p,!d||`cross`,u)),d&&U(f.otherAxes,co(p,`cross`,!1))}function p(r,s,u){var d=u.model.getModel(`axisPointer`,i),f=d.get(`show`);if(f&&(f!==`auto`||r||mL(d))){s??=d.get(`triggerTooltip`),d=r?sL(u,l,i,t,r,s):d;var p=d.get(`snap`),m=d.get(`triggerEmphasis`),h=hL(u.model),g=s||p||u.type===`category`,_=e.axesInfo[h]={key:h,axis:u,coordSys:n,axisPointerModel:d,triggerTooltip:s,triggerEmphasis:m,involveSeries:g,snap:p,useHandle:mL(d),seriesModels:[],linkGroup:null};c[h]=_,e.seriesInvolved=e.seriesInvolved||g;var v=lL(a,u);if(v!=null){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[h]=_,y.mapper=a[v].mapper,_.linkGroup=y}}}})}function sL(e,t,n,r,i,a){var o=t.getModel(`axisPointer`),s=[`type`,`snap`,`lineStyle`,`shadowStyle`,`label`,`animation`,`animationDurationUpdate`,`animationEasingUpdate`,`z`],c={};U(s,function(e){c[e]=V(o.get(e))}),c.snap=e.type!==`category`&&!!a,o.get(`type`)===`cross`&&(c.type=`line`);var l=c.label||={};if(l.show??=!1,i===`cross`&&(l.show=o.get([`label`,`show`])??!0,!a)){var u=c.lineStyle=o.get(`crossStyle`);u&&Za(l,u.textStyle)}return e.model.getModel(`axisPointer`,new by(c,n,r))}function cL(e,t){t.eachSeries(function(t){var n=t.coordinateSystem,r=t.get([`tooltip`,`trigger`],!0),i=t.get([`tooltip`,`show`],!0);n&&n.model&&r!==`none`&&r!==!1&&r!==`item`&&i!==!1&&t.get([`axisPointer`,`show`],!0)!==!1&&U(e.coordSysAxesInfo[hL(n.model)],function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),e.seriesDataCount??=0,e.seriesDataCount+=t.getData().count())})})}function lL(e,t){for(var n=t.model,r=t.dim,i=0;i=0||e===t}function dL(e){var t=fL(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=mL(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent();(o==null||o>c[1])&&(o=c[1]),o3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(AL(this._zr,`globalPan`)||PL(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(YA(r.event),r.__ecRoamConsumed=!0,VL(e,t,n,r,i))},t}(Wu);function PL(e){return e.__ecRoamConsumed}var FL=wm();function IL(e){var t=FL(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function LL(e,t,n,r){for(var i=IL(e).roam,a=i[t]=i[t]||[],o=0;o1e-6;NR[0]=o?(i[0]-r.x)/a:i[0],NR[1]=o?(i[1]-r.y)/a:i[1],Ms(NR,NR,e.mtRawInv);var s=kR(e,NR);PR(t,s,a),U(n,function(e){e!==t&&PR(e,s.slice(),a)})}var NR=[];function PR(e,t,n){var r=e.option;r.center=t,r.zoom=n}function FR(e,t){if(t){var n=t.min||0,r=t.max||1/0;e=Math.max(Math.min(r,e),n)}return e}function IR(e,t){var n=t.getShallow(`nodeScaleRatio`,!0)||1,r=UL(e);return((r.zoom-1)*n+1)/(r.trans[2].scaleX||1)}function LR(e,t,n,r,i,a,o,s){if(!wR(e)){n.disable();return}n.enable(Y(e.get(`roam`),o),{api:t,zInfo:{component:e},triggerInfo:{roamTrigger:e.get(`roamTrigger`),isInSelf:r,isInClip:function(e,t,n){return!i||i.contain(t,n)}}});function c(n){var r=e.mainType,i=Uv(Za({type:zR(r,e.subType,uh)},n));s&&(i.componentType=r),i[r+`Id`]=e.id,t.dispatchAction(i)}n.off(`pan`).off(`zoom`).on(`pan`,function(e){a&&a(`pan`),c({dx:e.dx,dy:e.dy})}).on(`zoom`,function(e){a&&a(`zoom`),c({zoom:e.scale,originX:e.originX,originY:e.originY})})}new Z(0,0,0,0);function RR(e,t,n){var r=zR(t,n,uh);e.registerAction({type:r,event:r,update:`none`},function(e,r,i){r.eachComponent(Am(e,t,n),function(t){CR(e,t),TR(e,t,r,i)})})}function zR(e,t,n){return(e===`series`?t===`map`?`geo`:t:e)+n}function BR(e){return e.zoom!=null}function VR(e,t,n,r,i,a,o){var s=new GL(null,jR(e.ecModel,t));return nR(s,n,r,i,a),o?rR(s,o.x,o.y,o.width,o.height):rR(s,n,r,i,a),tR(s,e),s}var HR=wm();function UR(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:`data`}),e.datas=e.mainData=null,XR(t,n,e),U(n,function(n){U(t.TRANSFERABLE_METHODS,function(t){n.wrapMethod(t,co(WR,e))})}),t.wrapMethod(`cloneShallow`,co(KR,e)),U(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,co(GR,e))}),xo(n[t.dataType]===t)}function WR(e,t){if(YR(this)){var n=H({},HR(this).datas);n[this.dataType]=t,XR(t,n,e)}else ZR(t,this.dataType,HR(this).mainData,e);return t}function GR(e,t){return e.struct&&e.struct.update(),t}function KR(e,t){return U(HR(t).datas,function(n,r){n!==t&&ZR(n.cloneShallow(),r,t,e)}),t}function qR(e){var t=HR(this).mainData;return e==null||t==null?t:HR(t).datas[e]}function JR(){var e=HR(this).mainData;return e==null?[{data:e}]:W(ao(HR(e).datas),function(t){return{type:t,data:HR(e).datas[t]}})}function YR(e){return HR(e).mainData===e}function XR(e,t,n){HR(e).datas={},U(t,function(t,r){ZR(t,r,e,n)})}function ZR(e,t,n,r){HR(n).datas[t]=e,HR(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=qR,e.getLinkedDataAll=JR}var QR=U,$R=J,ez=-1,tz=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=V(t);this.type=r,this.mappingMethod=n,this._normalizeData=pz[n];var a=e.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],n===`piecewise`?(iz(i),nz(i)):n===`category`?i.categories?rz(i):iz(i,!0):(xo(n!==`linear`||i.dataExtent),iz(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return so(this._normalizeData,this)},e.listVisualTypes=function(){return ao(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){J(e)?U(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,a=G(t)?[]:J(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var o=n.call(r,e,t);i?a=o:a[t]=o}),a},e.retrieveVisuals=function(t){var n={},r;return t&&QR(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(n[i]=t[i],r=!0)}),r?n:null},e.prepareVisualTypes=function(e){if(G(e))e=e.slice();else if($R(e)){var t=[];QR(e,function(e,n){t.push(n)}),e=t}else return[];return e.sort(function(e,t){return t===`color`&&e!==`color`&&e.indexOf(`color`)===0?1:-1}),e},e.dependsOn=function(e,t){return t===`color`?!!(e&&e.indexOf(t)===0):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,a=0,o=t.length;a=0;a--)r[a]??(delete n[t[a]],t.pop())}function iz(e,t){var n=e.visual,r=[];J(n)?QR(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),fz(e,r)}function az(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:uz([0,1])}}function oz(e){var t=this.option.visual;return t[Math.round(xp(e,[0,1],[0,t.length-1],!0))]||{}}function sz(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function cz(e){var t=this.option.visual;return t[this.option.loop&&e!==ez?e%t.length:e]}function lz(){return this.option.visual[0]}function uz(e){return{linear:function(t){return xp(t,e,this.option.visual,!0)},category:cz,piecewise:function(t,n){var r=dz.call(this,n);return r??=xp(t,e,this.option.visual,!0),r},fixed:lz}}function dz(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[tz.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function fz(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=W(t,function(e){return Hl(e)||[0,0,0,1]})),t}var pz={linear:function(e){return xp(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=tz.findPieceIndex(e,t,!0);if(n!=null)return xp(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??ez},fixed:No};function mz(e,t,n){return e?t<=n:t=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof _z||(t=this._nodesMap[hz(t)]),t){for(var i=n===`out`?`outEdges`:n===`in`?`inEdges`:`edges`,a=0;a=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i=0&&!e.hasKey(p)&&(e.set(p,!0),a.push(f.node1))}for(s=0;s=0&&!e.hasKey(v)&&(e.set(v,!0),o.push(_.node2))}}}return{edge:e.keys(),node:t.keys()}},e}(),vz=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=n??-1}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=X(),t=X();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i=0&&!e.hasKey(u)&&(e.set(u,!0),n.push(l.node1))}for(i=0;i=0&&!e.hasKey(m)&&(e.set(m,!0),r.push(p.node2))}return{edge:e.keys(),node:t.keys()}},e}();function yz(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||`value`),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}eo(_z,yz(`hostGraph`,`data`)),eo(vz,yz(`hostGraph`,`edgeData`));function bz(e,t,n,r,i){for(var a=new gz(r),o=0;o `+f)),l++)}var p=n.get(`coordinateSystem`),m;if(p===`cartesian2d`||p===`polar`||p===`matrix`)m=vx(e,n);else{var h=nx.get(p),g=h&&h.dimensions||[];Qa(g,`value`)<0&&g.concat([`value`]);var _=Zb(e,{coordDimensions:g,encodeDefine:n.getEncode()}).dimensions;m=new Xb(_,n),m.initData(e)}var v=new Xb([`value`],n);return v.initData(c,s),i&&i(m,v),UR({mainData:m,struct:a,structAttr:`graph`,datas:{node:m,edge:v},datasAttr:{node:`data`,edge:`edgeData`}}),a.update(),a}var xz=`-->`,Sz=function(e){return e.get(`autoCurveness`)||null},Cz=function(e,t){var n=Sz(e),r=20,i=[];if(uo(n))r=n;else if(G(n)){e.__curvenessList=n;return}t>r&&(r=t);var a=r%2?r+2:r+3;i=[];for(var o=0;o `),value:i.value,noValue:i.value==null})}return uw({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=W(this.option.categories||[],function(e){return e.value==null?H({value:0},e):e}),t=new Xb([`value`],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get(`layout`)===`force`&&this.get([`force`,`layoutAnimation`]))},t.prototype.__ownRoamView=function(){var e=this.coordinateSystem;return vR(e)&&e},t.type=`series.`+Mz,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={z:2,coordinateSystem:`view`,legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:`center`,top:`center`,symbol:`circle`,symbolSize:10,edgeSymbol:[`none`,`none`],edgeSymbolSize:10,edgeLabel:{position:`middle`,distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:`{b}`},itemStyle:{},lineStyle:{color:Q.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:Q.color.primary}}},t}(mw);function Pz(e){return e instanceof Array||(e=[e,e]),e}var Fz=Zm(Mz,Iz);function Iz(e){e.eachSeriesByType(Mz,function(e){var t=e.getGraph(),n=e.getEdgeData(),r=Pz(e.get(`edgeSymbol`)),i=Pz(e.get(`edgeSymbolSize`));n.setVisual(`fromSymbol`,r&&r[0]),n.setVisual(`toSymbol`,r&&r[1]),n.setVisual(`fromSymbolSize`,i&&i[0]),n.setVisual(`toSymbolSize`,i&&i[1]),n.setVisual(`style`,e.getModel(`lineStyle`).getLineStyle()),n.each(function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),a=Pz(r.getShallow(`symbol`,!0)),o=Pz(r.getShallow(`symbolSize`,!0)),s=r.getModel(`lineStyle`).getLineStyle(),c=n.ensureUniqueItemVisual(e,`style`);switch(H(c,s),c.stroke){case`source`:var l=i.node1.getVisual(`style`);c.stroke=l&&l.fill;break;case`target`:var l=i.node2.getVisual(`style`);c.stroke=l&&l.fill}a[0]&&i.setVisual(`fromSymbol`,a[0]),a[1]&&i.setVisual(`toSymbol`,a[1]),o[0]&&i.setVisual(`fromSymbolSize`,o[0]),o[1]&&i.setVisual(`toSymbolSize`,o[1])})})}function Lz(e){var t=e.coordinateSystem;if(!(t&&t.type!==`view`)){var n=e.getGraph();n.eachNode(function(e){var t=e.getModel();e.setLayout([+t.get(`x`),+t.get(`y`)])}),Rz(n,e)}}function Rz(e,t){e.eachEdge(function(e,n){var r=vo(e.getModel().get([`lineStyle`,`curveness`]),-jz(e,t,n,!0),0),i=ys(e.node1.getLayout()),a=ys(e.node2.getLayout()),o=[i,a];+r&&o.push([(i[0]+a[0])/2-(i[1]-a[1])*r,(i[1]+a[1])/2-(a[0]-i[0])*r]),e.setLayout(o)})}var zz=Zm(Mz,Bz);function Bz(e,t){e.eachSeriesByType(Mz,function(e){var t=e.get(`layout`),n=e.coordinateSystem;if(n&&n.type!==`view`){var r=e.getData(),i=[];U(n.dimensions,function(e){i=i.concat(r.mapDimensionsAll(e))});for(var a=0;a0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0].8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Ug),mB=function(){function e(e){this.group=new Ug,this._LineCtor=e||pB}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=gB(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=gB(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!hB(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i0}function gB(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:Zv(t)}}function _B(e){return isNaN(e[0])||isNaN(e[1])}function vB(e){return e&&!_B(e[0])&&!_B(e[1])}var yB=[],bB=[],xB=[],SB=yl,CB=js,wB=Math.abs;function TB(e,t,n){for(var r=e[0],i=e[1],a=e[2],o=1/0,s,c=n*n,l=.1,u=.1;u<=.9;u+=.1){yB[0]=SB(r[0],i[0],a[0],u),yB[1]=SB(r[1],i[1],a[1],u);var d=wB(CB(yB,t)-c);d=0?s+=l:s-=l:m>=0?s-=l:s+=l}return s}function EB(e,t){var n=[],r=Cl,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(e,s){var c=e.getLayout(),l=e.getVisual(`fromSymbol`),u=e.getVisual(`toSymbol`);c.__original||(c.__original=[ys(c[0]),ys(c[1])],c[2]&&c.__original.push(ys(c[2])));var d=c.__original;if(c[2]!=null){if(vs(i[0],d[0]),vs(i[1],d[2]),vs(i[2],d[1]),l&&l!==`none`){var f=Hz(e.node1),p=TB(i,d[0],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(u&&u!==`none`){var f=Hz(e.node2),p=TB(i,d[1],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}vs(c[0],i[0]),vs(c[1],i[2]),vs(c[2],i[1])}else{if(vs(a[0],d[0]),vs(a[1],d[1]),Cs(o,a[1],a[0]),Ds(o,o),l&&l!==`none`){var f=Hz(e.node1);Ss(a[0],a[0],o,f*t)}if(u&&u!==`none`){var f=Hz(e.node2);Ss(a[1],a[1],o,-f*t)}vs(c[0],a[0]),vs(c[1],a[1])}})}var DB=wm();function OB(e){if(e)return DB(e).bridge}var kB=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=Mz,t}return t.prototype.init=function(e,t){var n=new Vw,r=new mB,i=this.group,a=new Ug;this._controller=new NL(t.getZr()),a.add(n.group),a.add(r.group),i.add(a),this._symbolDraw=n,this._lineDraw=r,this._mainGroup=a,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=wR(e),a=!1;this._model=e,this._api=n,this._active=!0;var o=this._mainGroup,s=this._getThumbnailInfo();s&&s.bridge.reset(n);var c=this._symbolDraw,l=this._lineDraw;i&&yR(o,2,i,this._firstRender?null:e),EB(e.getGraph(),Vz(e));var u=e.getData();c.updateData(u);var d=e.getEdgeData();l.updateData(d),this._updateNodeAndLinkScale(),i&&LR(e,n,this._controller,function(t,n,r){return e.coordinateSystem.containPoint([n,r])},null),clearTimeout(this._layoutTimeout);var f=e.forceLayout,p=e.get([`force`,`layoutAnimation`]);f&&(a=!0,this._startForceLayoutIteration(f,n,p));var m=e.get(`layout`);u.graph.eachNode(function(t){var i=t.dataIndex,a=t.getGraphicEl(),o=t.getModel();if(a){a.off(`drag`).off(`dragend`);var s=o.get(`draggable`);s&&a.on(`drag`,function(o){switch(m){case`force`:f.warmUp(),!r._layouting&&r._startForceLayoutIteration(f,n,p),f.setFixed(i),u.setItemLayout(i,[a.x,a.y]);break;case`circular`:u.setItemLayout(i,[a.x,a.y]),t.setLayout({fixed:!0},!0),Gz(e,`symbolSize`,t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(i,[a.x,a.y]),Rz(e.getGraph(),e),r.updateLayout(e)}}).on(`dragend`,function(){f&&f.setUnfixed(i)}),a.setDraggable(s,!!o.get(`cursor`)),o.get([`emphasis`,`focus`])===`adjacency`&&($m(a).focus=t.getAdjacentDataIndices())}}),u.graph.eachEdge(function(e){var t=e.getGraphicEl(),n=e.getModel().get([`emphasis`,`focus`]);t&&n===`adjacency`&&($m(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var h=e.get(`layout`)===`circular`&&e.get([`circular`,`rotateLabel`]),g=u.getLayout(`cx`),_=u.getLayout(`cy`);u.graph.eachNode(function(e){qz(e,h,g,_)}),this._firstRender=!1,a||this._renderThumbnail(e,n,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},t.prototype._startForceLayoutIteration=function(e,t,n){var r=this,i=!1;(function a(){e.step(function(e){r.updateLayout(r._model),(e||!i)&&(i=!0,r._renderThumbnail(r._model,t,r._symbolDraw,r._lineDraw)),(r._layouting=!e)&&(n?r._layoutTimeout=setTimeout(a,16):a())})})()},t.prototype.__updateOnOwnRoam=function(e,t,n){var r=wR(t);this._active&&r&&(yR(this._mainGroup,2,r,null),BR(e)&&(this._updateNodeAndLinkScale(),EB(t.getGraph(),Vz(t)),this._lineDraw.updateLayout(),n.updateLabelLayout()),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=Vz(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(n)})},t.prototype.updateLayout=function(e){this._active&&(EB(e.getGraph(),Vz(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var e=this._model,t=e.coordinateSystem;if(t.type===`view`){var n=OB(e);if(n)return{bridge:n,coordSys:t}}},t.prototype._updateThumbnailWindow=function(){var e=this._getThumbnailInfo();e&&e.bridge.updateWindow(qL(null,e.coordSys),this._api)},t.prototype._renderThumbnail=function(e,t,n,r){var i=this._getThumbnailInfo();if(i){var a=new Ug,o=n.group.children(),s=r.group.children(),c=new Ug,l=new Ug;a.add(l),a.add(c);for(var u=0;ua&&(t[1-r]=Mp(t[r],d.sign*a)),t}function IB(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function LB(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var RB=wm(),zB=V,BB=so,VB=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Ug,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=co(HB,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}KB(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&XD(r).w>o)return!0;if(a){var s=fL(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=RB(e).pointerEl=new $_[i.type](zB(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=RB(e).labelEl=new qf(zB(t.label));e.add(i),WB(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=RB(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=RB(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),WB(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=wv(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){YA(e.event)},onmousedown:BB(this._onHandleDragMove,this,0,0),drift:BB(this._onHandleDragMove,this),ondragend:BB(this._onHandleDragEnd,this)}),n.add(r)),KB(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);G(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,$k(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){HB(this._axisPointerModel,!t&&this._moveAnimation,this._handle,GB(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(GB(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(GB(r)),RB(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),eA(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function HB(e,t,n,r){UB(RB(n).lastProp,r)||(RB(n).lastProp=r,t?K_(n,r,e):(n.stopAnimation(),n.attr(r)))}function UB(e,t){if(J(e)&&J(t)){var n=!0;return U(t,function(t,r){n&&=UB(e[r],t)}),!!n}return e===t}function WB(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function GB(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function KB(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function qB(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function JB(e,t,n,r,i){var a=XB(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=HS(o.get(`padding`)||0),c=o.getFont(),l=mc(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),YB(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:Qv(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function YB(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function XB(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:CE(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};U(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),q(o)?a=o.replace(`{value}`,a):K(o)&&(a=o(s))}return a}function ZB(e,t,n){var r=ls();return ms(r,r,n.rotation),ps(r,r,n.position),_v([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function QB(e,t,n,r,i,a){var o=PO.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),JB(t,r,i,a,{position:ZB(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function $B(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function eV(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function tV(e,t,n){return XD(e,{fromStat:{sers:W(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function nV(e,t,n){return[dp(up(t[0],t[1]),e-n/2),up(e+n/2,dp(t[0],t[1]))]}var rV=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=iV(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=qB(r),f=aV[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}QB(t,e,tk(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=tk(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=ZB(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=iV(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=up(o[1],l[c]),l[c]=dp(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(VB);function iV(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var aV={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:$B([t,r[0]],[t,r[1]],oV(e))}},shadow:function(e,t,n,r,i,a){var o=tV(e,i,a),s=r[1]-r[0],c=nV(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:eV([l,r[0]],[u-l,s],oV(e))}}};function oV(e){return e.dim===`x`?0:1}var sV=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:Q.color.border,width:1,type:`dashed`},shadowStyle:{color:Q.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:Q.color.neutral00,padding:[5,7,5,7],backgroundColor:Q.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:Q.color.accent40,throttle:40}},t}(dC),cV=wm(),lV=U;function uV(e,t,n){if(!Io.node){var r=t.getZr();cV(r).records||(cV(r).records={}),dV(r,t);var i=cV(r).records[e]||(cV(r).records[e]={});i.handler=n}}function dV(e,t){if(cV(e).initialized)return;cV(e).initialized=!0,n(`click`,co(mV,`click`)),n(`mousemove`,co(mV,`mousemove`)),n(`mousewheel`,co(mV,`mousewheel`)),n(`globalout`,pV);function n(n,r){e.on(n,function(n){var i=hV(t);lV(cV(e).records,function(e){e&&r(e,n,i.dispatchAction)}),fV(i.pendings,t)})}}function fV(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function pV(e,t,n){e.handler(`leave`,null,n)}function mV(e,t,n,r){t.handler(e,n,r)}function hV(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function gV(e,t){if(!Io.node){var n=t.getZr();(cV(n).records||{})[e]&&(cV(n).records[e]=null)}}var _V=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;uV(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){gV(`axisPointer`,t)},t.prototype.dispose=function(e,t){gV(`axisPointer`,t)},t.type=`axisPointer`,t}(tN);function vV(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=Cm(a,e);if(o==null||o<0||G(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(W(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var yV=wm();function bV(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||so(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){AV(i)&&(i=vV({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=AV(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||AV(i),f={},p={},m={list:[],map:{}},h={showPointer:co(CV,p),showTooltip:co(wV,m)};U(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);U(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=OV(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&xV(e,o,h,!1,f)}})});var g={};return U(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&U(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,kV(t),kV(e)))),g[e.key]=a}})}),U(g,function(e,t){xV(u[t],e,h,!0,f)}),TV(p,u,f),EV(m,i,e,o),DV(u,o,n),f}}function xV(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=SV(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&H(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function SV(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return U(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(qp(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),U(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function CV(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function wV(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=hL(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function TV(e,t,n){var r=n.axesInfo=[];U(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function EV(e,t,n,r){if(AV(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function DV(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=yV(r)[i]||{},o=yV(r)[i]={};U(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&U(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}U(a,function(e,t){!o[t]&&c.push(l(e))}),U(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function OV(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function kV(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function AV(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function jV(e){_L.registerAxisPointerClass(`CartesianAxisPointer`,rV),e.registerComponentModel(sV),e.registerComponentView(_V),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!G(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=aL(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},bV)}function MV(e){SI(OL),SI(jV)}function NV(e,t){var n=HS(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new Hf({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var PV=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click|mousewheel`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:Q.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:Q.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:Q.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:Q.color.tertiary,fontSize:14}},t}(dC);function FV(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function IV(e){if(Io.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`
`}function KV(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(Io.transformSupported?``+HV+i:`,left`+i+`,top`+i)),VV+`:`+a}function qV(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!Io.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=Io.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+HV+`:`+o+`;`:[[`top`,0],[`left`,0],[LV,o]]}function JV(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=Y(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),U([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function YV(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=cw(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(KV(a,n,r)),o&&i.push(`background-color:`+o),U([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=VS(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(JV(d)),f!=null&&i.push(`padding:`+HS(f).join(`px `)+`px`),i.join(`;`)+`;`}function XV(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&Mx(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var ZV=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Io.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(q(i)?document.querySelector(i):mo(i)?i:K(i)&&i(e.getDom()));XV(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;GA(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=BV(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=UV+YV(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+qV(i[0],i[1],!0)+(`border-color:`+JS(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(q(i)&&n.get(`trigger`)===`item`&&!FV(n)&&(o=GV(n,r,i)),q(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,G(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(e.get(`trigger`)!==`axis`&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!Io.node&&n.getDom()){var i=aH(r,n);this._ticket=``;var a=r.dataByCoordSys,o=uH(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=nH;c.x=r.x,c.y=r.y,c.update(),$m(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=vV(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(aH(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&iH([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if($m(n).ssrType===`legend`)return;this._lastDataByCoordSys=null,this._cbParamsList=null;var i,a;BN(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||($m(e).dataIndex==null?$m(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=so(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=iH([t.tooltipOption],r),o=this._renderMode,s=[],c=JC(`section`,{blocks:[],noHeader:!0}),l=[],u=new lw;U(e,function(e){U(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value,a=t.axis,d=a.scale.parse(i);if(t&&i!=null){var f=XB(i,a,n,e.seriesDataIndices,e.valueLabelOpt),p=JC(`section`,{header:f,noHeader:!So(f),sortBlocks:!0,blocks:[]});c.blocks.push(p),U(e.seriesDataIndices,function(i){var a=n.getSeriesByIndex(i.seriesIndex),c=i.dataIndexInside,m=a.getDataParams(c);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=CE(t.axis,{value:d}),m.axisValueLabel=f,m.marker=u.makeTooltipMarker(`item`,JS(m.color),o);var h=SC(a.formatTooltip(c,!0,null)),g=h.frag;if(g){var _=iH([a],r).get(`valueFormatter`);p.blocks.push(_?H({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=ew(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?` + +`:`
`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=$m(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=iH([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new lw;h.marker=g.makeTooltipMarker(`item`,JS(h.color),d);var _=SC(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?ew(y?H({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=$m(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(q(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=V(a),a.content=Bx(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=iH(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new lw;this._showOrMove(d,function(){var n=V(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,e.get(`showContent`)&&e.get(`show`)){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u){if(q(u)){var p=e.ecModel.get(`useUTC`),m=G(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=SS(m.axisValue,d,p)),d=KS(d,n,!0)}else if(K(u)){var g=so(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||G(t))return{color:r||i};if(!G(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),K(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),G(t))n=Sp(t[0],s),r=Sp(t[1],c);else if(J(t)){var p=t;p.width=l[0],p.height=l[1];var m=tC(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(q(t)&&o){var h=cH(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=oH(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=lH(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=lH(d)?l[1]/2:d===`bottom`?l[1]:0),FV(e)){var h=sH(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&U(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&U(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&U(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&U(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){!Io.node&&t.getDom()&&(eA(this,`_updatePosition`),this._tooltipContent.dispose(),gV(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(tN);function iH(e,t,n){var r=t.ecModel,i;n?(i=new by(n,r,r),i=new by(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof by&&(o=o.get(`tooltip`,!0)),q(o)&&(o={formatter:o}),o&&(i=new by(o,i,r)))}return i}function aH(e,t){return e.dispatchAction||so(t.dispatchAction,t)}function oH(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function sH(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function cH(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function lH(e){return e===`center`||e===`middle`}function uH(e,t,n){var r=Dm(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=km(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=$m(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function dH(e){SI(jV),e.registerComponentModel(PV),e.registerComponentView(rH),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},No),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},No)}var fH=U;function pH(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function mH(e,t,n){var r={};return fH(t,function(t){var a=r[t]=i();fH(e[t],function(e,r){if(tz.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new tz(i),r===`opacity`&&(i=V(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new tz(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function hH(e,t,n){var r;U(n,function(e){t.hasOwnProperty(e)&&pH(t[e])&&(r=!0)}),r&&U(n,function(n){t.hasOwnProperty(n)&&pH(t[n])?e[n]=V(t[n]):delete e[n]})}function gH(e,t,n,r){var i={};return U(e,function(e){i[e]=tz.prepareVisualTypes(t[e])}),{progress:function(e,a){var o;r!=null&&(o=a.getDimensionIndex(r));function s(e){return LN(a,l,e)}function c(e,t){zN(a,l,e,t)}for(var l,u=a.getStore();(l=e.next())!=null;){var d=a.getRawDataItem(l);if(!(d&&d.visualMap===!1))for(var f=r==null?l:u.get(o,l),p=n(f),m=t[p],h=i[p],g=0,_=h.length;g<_;g++){var v=h[g];m[v]&&m[v].applyVisual(f,s,c)}}}}}var _H=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},vH=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),G(t)&&U(t,function(e,r){q(e)&&(e={type:e}),t[r]=Ya(e,_H(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Q.size.m,align:`auto`,backgroundColor:Q.color.transparent,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Q.color.disabled,inactiveBorderColor:Q.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Q.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Q.color.tertiary,borderWidth:1,borderColor:Q.color.border},emphasis:{selectorLabel:{show:!0,color:Q.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(dC),yH=co,bH=U,xH=Ug,SH=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new xH),this.group.add(this._selectorGroup=new xH),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=iC(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=tC(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=tC(Za({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=NV(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=X(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),bH(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===` +`)){var p=new xH;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,yH(TH,f,null,r,d)).on(`mouseover`,yH(EH,m.name,null,r,d)).on(`mouseout`,yH(DH,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=$m(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Hl(h.fill);_&&_[3]===0&&(_[3]=.2,h=H(H({},h),{fill:Xl(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,yH(TH,null,f,r,d)).on(`mouseover`,yH(EH,null,f,r,d)).on(`mouseout`,yH(DH,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=$m(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};$m(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();bH(e,function(e){var r=e.type,i=new qf({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),Xv(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),cg(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=CH(c,r,o,s,d,m,u),y=new xH,b=r.getModel(`textStyle`);if(K(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(wH({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;q(w)&&w?T=w.replace(`{name}`,t??``):K(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new qf({style:Qv(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Hf({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Mv({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),cg(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();$S(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){$S(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(tN);function CH(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),bH(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:IP(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function wH(e){var t=e.icon||`roundRect`,n=kw(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function TH(e,t,n,r){DH(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),EH(e,t,n,r)}function EH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function DH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function OH(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),kH(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){U(i,function(t,n){e[t?`select`:`unSelect`](n)}),kH(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function kH(e,t){var n=t||{};return U(e.getData(),function(t){var r=t.get(`name`);if(r!==` +`&&r!==``){var i=e.isSelected(r);n[r]=Mo(n,r)?n[r]&&i:i}}),n}function AH(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,co(OH,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,co(OH,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,co(OH,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,co(OH,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,co(OH,`unSelect`))}var jH=Qm(MH);function MH(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;nn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=Y(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Hf({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&K_(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;U([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,q(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=LH[i],o=RH[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(SH);function BH(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function VH(e){SI(NH),e.registerComponentModel(PH),e.registerComponentView(zH),BH(e)}function HH(e){SI(NH),SI(VH)}var UH={get:function(e,t,n){var r=V((WH[e]||{})[t]);return n&&G(r)?r[r.length-1]:r}},WH={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},GH=tz.mapVisual,KH=tz.eachVisual,qH=G,JH=U,YH=Op,XH=xp,ZH=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&hH(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=so(e,this),this.controllerVisuals=mH(this.option.controller,t,e),this.targetVisuals=mH(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return JH(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=km(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return W(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){U(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],G(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(q(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(K(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=YH([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=io(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Ya(r,n),Ya(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){qH(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},JH(r,function(e,t){if(tz.isValidType(t)){var n=UH.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;JH(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&V(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&V(n)||(a?s[0]:[s[0],s[0]])),c.symbol=GH(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;KH(l,function(e){e>u&&(u=e)}),c.symbolSize=GH(l,function(e){return XH(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(dC),QH=[20,140],$H=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=QH[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=QH[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):G(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),U(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=Op((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=eU(this,`outOfRange`,this.getExtent()),n=eU(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Ug(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);oU([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=aU(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=_v(n.handleLabelPoints[l],gv(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=aU(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=_v(c.indicatorLabelPoint,gv(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||mU(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Sm(u,d);this._dispatchHighDown(`downplay`,iU(f[0],n)),this._dispatchHighDown(`highlight`,iU(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(BN(e.target,function(e){var n=$m(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function yU(e,t,n,r){for(var i=t.targetVisuals[r],a=tz.prepareVisualTypes(i),o={color:RN(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(gU,_U),U(vU,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(xU))}function TU(e){e.registerComponentModel($H),e.registerComponentView(dU),wU(e)}var EU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],DU[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=V(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=W(this._pieceList,function(e){return e=V(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=tz.listVisualTypes(),i=this.isCategory();U(t.pieces,function(e){U(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),U(n,function(e,n){var r=!1;U(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&U(this.stateList,function(e){(t[e]||(t[e]={}))[n]=UH.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,U(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;U(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=V(e)},t.prototype.getValueState=function(e){var t=tz.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){tz.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return U(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=Ex(ZH.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(ZH),DU={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function OU(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var kU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=_o(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),U(o.viewPieceList,function(o){var s=o.piece,u=new Ug;u.onclick=so(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new qf({style:Qv(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:Y(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),$S(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:iU(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return rU(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Ug,o=this.visualMapModel.textStyleModel;a.add(new qf({style:Qv(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=W(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=kw(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=V(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,U(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(tU);function AU(e){e.registerComponentModel(EU),e.registerComponentView(kU),wU(e)}function jU(e){SI(TU),SI(AU)}var MU={label:{enabled:!0},decal:{show:!1}},NU=wm(),PU=wm(),FU=Qm(IU);function IU(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=PU(e).scope||(PU(e).scope={}),i=V(MU);Ya(i.label,e.getLocaleModel().get(`aria`),!1),Ya(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=X();e.eachSeries(function(e){e.isColorBySeries()||(NU(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(K(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=gC(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=NU(t).scope;n.each(function(e){var t=n.getRawIndex(e);s[t]=e});var l=o.count();o.each(function(e){var r=s[e],i=o.getName(e)||e+``,a=gC(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?H(H({},t),e):t;return n.dirty=!0,n}})}}function o(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=Za(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var o=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(o,d),p;if(!(o<1)){var m=c();p=m?s(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=o>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=s(g,{seriesCount:o}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=s(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:l(e.subType)});var i=e.getData();if(i.count()>u){var c=a.get([`data`,`partialData`]);n+=s(c,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_=HU:-c>=HU),f=c>0?c%HU:c%HU+HU,p=!1;p=d?!0:!ru(u)&&f>=VU==!!l;var m=e+n*BU(a),h=t+r*zU(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*UU);if(d){var _=1/this._p,v=(l?1:-1)*(HU-_);this._add(`A`,n,r,g,1,+l,e+n*BU(a+v),t+r*zU(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*BU(o),b=t+r*zU(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d`}function oW(e){return``}function sW(e,t){t||={};var n=t.newline?` +`:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return aW(i,a)+(i===`style`?o||``:Bx(o))+(t?``+n+W(t,function(e){return r(e)}).join(n)+n:``)+oW(i)}return r(e)}function cW(e,t,n){n||={};var r=n.newline?` +`:``,i=` {`+r,a=r+`}`,o=W(ao(e),function(t){return t+i+W(ao(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(ao(t),function(e){return`@keyframes `+e+i+W(ao(t[e]),function(n){return n+i+W(ao(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function lW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function uW(e,t,n,r){return iW(`svg`,`root`,{width:e,height:t,xmlns:QU,"xmlns:xlink":$U,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var dW=0;function fW(){return dW++}var pW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},mW=`transform-origin`;function hW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new WU;return i.reset(vu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function gW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[mW]=n+`px `+r+`px`)}var _W={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function vW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function yW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=lW(n.zrId);t.animation=!0,xW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=ao(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=vW(i,n);return a.replace(o,s)}}function bW(e){return q(e)?pW[e]?`cubic-bezier(`+pW[e]+`)`:Dl(e)?e:``:``}function xW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof O_){var s=yW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return vW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+fW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function SW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};CW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=$l(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),CW(r,t,n,!0)}}}function CW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+fW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var wW=Math.round;function TW(e){return e&&q(e.src)}function EW(e){return e&&K(e.toDataURL)}function DW(e,t,n,r){ZU(function(i,a){var o=i===`fill`||i===`stroke`;o&&gu(a)?HW(t,e,i,r):o&&pu(a)?UW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),VW(n,e,r)}function OW(e,t){var n=nM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[nW+`silent`]=`true`))}function kW(e){return ru(e[0]-1)&&ru(e[1])&&ru(e[2])&&ru(e[3]-1)}function AW(e){return ru(e[4])&&ru(e[5])}function jW(e,t,n){if(t&&!(AW(t)&&kW(t))){var r=n?10:1e4;e.transform=kW(t)?`translate(`+wW(t[4]*r)/r+` `+wW(t[5]*r)/r+`)`:ou(t)}}function MW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;xo(f,g),xo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=os(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=iW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=yu(i);x&&(o.patternTransform=x);var S=iW(`pattern`,``,o,[d]),C=sW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=iW(`pattern`,T,o,[d])),t[n]=_u(T)}}function WW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=iW(`clipPath`,a,o,[LW(e,n)])}t[`clip-path`]=_u(a)}function GW(e){return document.createTextNode(e)}function KW(e,t,n){e.insertBefore(t,n)}function qW(e,t){e.removeChild(t)}function JW(e,t){e.appendChild(t)}function YW(e){return e.parentNode}function XW(e){return e.nextSibling}function ZW(e,t){e.textContent=t}var QW=58,$W=120,eG=iW(``,``);function tG(e){return e===void 0}function nG(e){return e!==void 0}function rG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function iG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function aG(e){var t,n=e.children,r=e.tag;if(nG(r)){var i=e.elm=rW(r);if(cG(eG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,oG(e,m,n,i,c)):sG(e,t,r,a))}function uG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(cG(e,t),tG(t.text)?nG(r)&&nG(i)?r!==i&&lG(n,r,i):nG(i)?(nG(e.text)&&ZW(n,``),oG(n,null,i,0,i.length-1)):nG(r)?sG(n,r,0,r.length-1):nG(e.text)&&ZW(n,``):e.text!==t.text&&(nG(r)&&sG(n,r,0,r.length-1),ZW(n,t.text)))}function dG(e,t){if(iG(e,t))uG(e,t);else{var n=e.elm,r=YW(n);aG(t),r!==null&&(KW(r,t.elm,XW(n)),sG(r,[e],0,0))}return t}var fG=0,pG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=mG(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+fG++,this._oldVNode=uW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=rW(`svg`);cG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,dG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return BW(e,lW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=lW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=hG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=iW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(ao(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(iW(`defs`,`defs`,{},c)),e.animation){var l=cW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=iW(`style`,`stl`,{},[],l);a.push(u)}}return uW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},sW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=nI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function vG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function yG(e){return Me[e?`dark`:`light`]}function bG(e){let t=e?5:7;return{ok:Be[t],warn:Ne[t],bad:Le[t],info:Re[t]}}function xG(e,t){let n=Ee[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function SG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function CG(e,t){let n=bG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:yG(t).muted}function wG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(ce,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(oe,{mt:4,children:i})]})}function TG({health:e,label:t}){return(0,z.jsx)(ve,{color:vG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function EG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Nn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function DG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(oe,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(Ln,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(ne,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}SI([tD]);function OG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(_G,{option:r,height:28,label:n})}var kG={unhealthy:0,degraded:1,healthy:2};function AG({widget:e,filters:t,agentAvailable:n,onOpenChat:r}){let i=Fe(`overview`,je(t,e.config,[`service`]));if(i.isError)return(0,z.jsx)(DG,{retry:()=>void i.refetch()});let a=[...i.data?.data.services??[]].sort((e,t)=>(kG[e.health]??3)-(kG[t.health]??3)||t.error_rate-e.error_rate);if(i.data&&a.length===0)return(0,z.jsx)(EG,{text:`No recent activity`});let o=e=>r(`Investigate the ${e} service. Explain its errors and latency.`);return(0,z.jsx)(Ye,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(et,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:n,children:[(0,z.jsx)(et.Thead,{children:(0,z.jsxs)(et.Tr,{children:[(0,z.jsx)(et.Th,{children:`Service`}),(0,z.jsx)(et.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(et.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(et.Tbody,{children:a.map(e=>(0,z.jsxs)(et.Tr,{...n&&{onClick:()=>o(e.service),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),o(e.service))},tabIndex:0,role:`button`,"aria-label":`Investigate ${e.service}`,style:{cursor:`pointer`}},children:[(0,z.jsx)(et.Td,{children:(0,z.jsx)(TG,{health:e.health,label:e.service})}),(0,z.jsx)(et.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:wa(e.p95_ms)})}),(0,z.jsx)(et.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ca(e.error_rate)})})]},e.service))})]})})}function jG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=ke(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(P,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(ne,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(be,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var MG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`,`service`]};function NG(e){return Object.hasOwn(MG,e)?MG[e]:void 0}function PG(e){return(NG(e)?.length??0)>0}function FG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:De(t.config,`service`),severity:De(t.config,`severity`),search:De(t.config,`search`),trace_id:De(t.config,`trace_id`)})},[e,t.config]);let s=NG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(Se,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(P,{children:[s.includes(`service`)&&(0,z.jsx)(dn,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(dn,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(I,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(I,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(ne,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(ne,{type:`submit`,children:`Save`})]})]})})})}SI([NA]);function IG({widget:e,filters:t,dark:n}){let r=Fe(`logs`,je(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=yG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>CG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Ta(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(DG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(EG,{text:`No matching logs in this window`}):(0,z.jsxs)(P,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(oe,{h:72,children:(0,z.jsx)(_G,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(Ye,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(et,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(et.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(et.Tr,{children:[(0,z.jsx)(et.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Ta(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(et.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ve,{size:`xs`,color:SG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(et.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(et.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function LG({widget:e,filters:t,dark:n}){let r=je(t,e.config,[`service`]),i=Fe(`overview`,r),a=Fe(`performance`,r);if(i.isError)return(0,z.jsx)(DG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=bG(n),u=o?.health===`unknown`,d=o?u?`No data`:o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(P,{gap:`sm`,children:[(0,z.jsxs)(bn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(wG,{label:`Health`,value:d,color:o?vG(o.health):void 0,hint:o?u?`No telemetry in this window`:`${Sa.format(o.service_count)} services`:void 0}),(0,z.jsx)(wG,{label:`Error rate`,value:o&&!u?Ca(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o&&!u?`${Sa.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(OG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&!u&&(0,z.jsxs)(oe,{children:[(0,z.jsxs)(ln.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(ln.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(ln.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(ln.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(RG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(RG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(RG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function RG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(oe,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}SI([tD]);function zG({widget:e,filters:t,dark:n}){let r=Fe(`performance`,je(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=yG(n),t=i.provenance.window;return{color:[xG(`operations`,n),bG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Ta(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>wa(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(DG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(EG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(P,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(oe,{style:{flex:1,minHeight:120},children:(0,z.jsx)(_G,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(et,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(et.Tbody,{children:o.map(e=>(0,z.jsxs)(et.Tr,{children:[(0,z.jsxs)(et.Td,{children:[(0,z.jsx)(ve,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(et.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Sa.format(e.calls),` calls`]})}),(0,z.jsx)(et.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:wa(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}SI([PB]);function BG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=je(t,e.config,[`service`]),a=Fe(`topology`,i),o=a.data?.data,s=(0,R.useMemo)(()=>{if(!o)return null;let e=yG(n),t=bG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...o.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:o.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,o]);return a.isError?(0,z.jsx)(DG,{retry:()=>void a.refetch()}):o&&o.nodes.length===0?(0,z.jsx)(EG,{text:`No service relationships in this window`}):(0,z.jsxs)(P,{gap:4,h:`100%`,children:[s&&(0,z.jsx)(_G,{option:s,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),o&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[o.nodes.length,` services · `,o.edges.length,` `,o.edges.length===1?`route`:`routes`]})]})}function VG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function HG({widget:e,filters:t,dark:n}){let r=Fe(`trace`,je(t,e.config,[`trace_id`,`service`]));if(r.isError)return(0,z.jsx)(DG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(EG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(P,{gap:`sm`,children:[(0,z.jsxs)(bn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(wG,{label:`Duration`,value:i?wa(i.duration_ms):`—`}),(0,z.jsx)(wG,{label:`Spans`,value:i?Sa.format(i.spans.length):`—`}),(0,z.jsx)(wG,{label:`Services`,value:i?Sa.format(i.services.length):`—`}),(0,z.jsx)(wG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(UG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,VG(i.trace_id)]}),(0,z.jsx)(WG,{value:i.trace_id})]})]})}function UG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(P,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(oe,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Ze,{label:`${e.service} · ${e.operation} · ${wa(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(oe,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(oe,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:xG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:wa(e.duration_ms)})]},e.span_id)})})}function WG({value:e}){let{state:t,copy:n}=tt();return(0,z.jsx)(Ze,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Qe,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(N,{size:12})})})}var GG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},KG={overview:LG,topology:BG,activity:AG,assistant:jG,performance:zG,trace:HG,logs:IG};function qG(){return(0,z.jsx)(EG,{text:`This view type is not supported by this version`})}function JG(e){return Object.hasOwn(KG,e)?KG[e]:qG}function YG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(!1),d=JG(t.type);return(0,z.jsxs)(ce,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(P,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(we,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(we.Target,{children:(0,z.jsx)(Qe,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ue,{size:18,weight:`bold`})})}),(0,z.jsxs)(we.Dropdown,{children:[PG(t.type)&&(0,z.jsx)(we.Item,{leftSection:(0,z.jsx)(Fn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(we.Item,{color:`bad`,leftSection:(0,z.jsx)(We,{size:15}),onClick:()=>u(!0),children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(d,{...e})})]}),(0,z.jsx)(FG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i}),(0,z.jsx)(Se,{opened:l,onClose:()=>u(!1),title:`Remove ${t.title}?`,centered:!0,radius:`md`,children:(0,z.jsxs)(P,{gap:`md`,children:[(0,z.jsx)(_,{size:`sm`,c:`dimmed`,children:`This takes the card off the dashboard for everyone who opens it. You can add it again from Add view, but its size and settings are not kept.`}),(0,z.jsxs)(x,{justify:`flex-end`,gap:`sm`,children:[(0,z.jsx)(ne,{variant:`default`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,z.jsx)(ne,{color:`bad`,size:`sm`,onClick:()=>{u(!1),r()},children:`Remove`})]})]})})]})}var XG=ha(pa),ZG=`fanout.dashboard-id`,QG={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function $G(e){return Object.hasOwn(ya,e)?ya[e]:void 0}function eK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r,urlFilters:i,onFiltersChange:a}){let o=Ce(),s=$e(`light`)===`dark`,c=xe({queryKey:He,queryFn:()=>Ge(`/api/dashboards`),refetchInterval:3e4}),[l,u]=(0,R.useState)(()=>e||localStorage.getItem(ZG)||``),d=Sn({mutationFn:async e=>{if(!f.data)throw Error(`No dashboard selected`);let t=await le(`/api/dashboards/${encodeURIComponent(f.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:f.data.name,description:f.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${l}`},onSuccess:e=>{o.setQueryData([`dashboard`,e.id],e),o.invalidateQueries({queryKey:He})},onError:e=>console.error(`Dashboard save failed`,e)}),f=xe({queryKey:[`dashboard`,l],queryFn:()=>Ge(`/api/dashboards/${encodeURIComponent(l)}`),enabled:!!l,refetchInterval:d.isPending||d.isError?!1:3e4}),[p,m]=(0,R.useState)(QG),[h,g]=(0,R.useState)(`lg`),[y,b]=(0,R.useState)(null),S=(0,R.useMemo)(()=>({window:Oe.some(e=>e.value===i?.window)?i.window:p.filters.window,namespace:i?.namespace??p.filters.namespace}),[i?.window,i?.namespace,p.filters.window,p.filters.namespace]),C=Fe(`overview`,je(S),!!f.data),w=(0,R.useMemo)(()=>(C.data?.data.services??[]).map(e=>e.service),[C.data]),T=ze();(0,R.useEffect)(()=>{e&&e!==l&&(u(e),localStorage.setItem(ZG,e))},[e,l]),(0,R.useEffect)(()=>{let t=c.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))&&!e){if(l&&t.some(e=>e.id===l)){r?.(l,!0);return}D((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,c.data,l]),(0,R.useEffect)(()=>{d.isPending||d.isError||f.data?.state&&m(f.data.state)},[f.data?.updated_at,d.isPending,d.isError]),(0,R.useEffect)(()=>{d.reset()},[l]);let E=(0,R.useMemo)(()=>{let e=new Map(p.widgets.map(e=>[e.id,e.type])),t=p.layout.map(t=>{let n=$G(e.get(t.i)??`overview`)??ya.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:_a(t,6),xs:_a(t,2),xxs:_a(t,1)}},[p.layout,p.widgets]);function D(e,t=!1){u(e),localStorage.setItem(ZG,e),r?.(e,t)}function O(e){m(e),d.mutate(e)}function k(e){let t=Te(),n=ya[e],r=xa(p.layout,n.w,n.h,12,n.minW);O({...p,widgets:[...p.widgets,{id:t,type:e,title:GG[e],enabled:!0}],layout:[...p.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function j(e){O({...p,filters:e}),a?.(e)}function ee(e){O({...p,widgets:p.widgets.filter(t=>t.id!==e),layout:p.layout.filter(t=>t.i!==e)})}function M(e,t){O({...p,widgets:p.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(c.isLoading||l&&f.isLoading)return(0,z.jsx)(tK,{label:`Loading your dashboard…`});let N=c.data?.dashboards??[];if(e&&N.length>0&&!N.some(t=>t.id===e))return(0,z.jsx)(nK,{onOpenDefault:()=>D((N.find(e=>e.is_default)??N[0]).id,!0)});if(c.isError||f.isError)return(0,z.jsx)(tK,{label:`Your dashboard is unavailable. Try refreshing.`});let te=f.data;return te?(0,z.jsxs)(oe,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(P,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(oe,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:te.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:te.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(ut,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(dn,{"aria-label":`Window`,value:S.window,onChange:e=>e&&j({...S,window:e}),data:Oe,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(I,{"aria-label":`Namespace`,value:y??S.namespace,onChange:e=>b(e.currentTarget.value),onBlur:e=>{b(null),j({...S,namespace:e.currentTarget.value.trim()})},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[T&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(T))]}),(0,z.jsxs)(we,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(we.Target,{children:(0,z.jsx)(ne,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(de,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(jn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(we.Dropdown,{children:va.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(we.Item,{onClick:()=>k(e),children:GG[e]},e))})]}),t&&(0,z.jsx)(ne,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(kn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),d.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(Ln,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(ne,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>d.mutate(p),children:`Retry save`})]})}),(0,z.jsx)(XG,{className:`dashboard-grid`,layouts:E,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:g,onDragStop:e=>{h===`lg`&&O({...p,layout:[...e]})},onResizeStop:e=>{h===`lg`&&O({...p,layout:[...e]})},children:p.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(YG,{widget:e,filters:S,dark:s,services:w,agentAvailable:t,onOpenChat:n,onRemove:()=>ee(e.id),onConfigure:t=>M(e.id,t)})},e.id))})]}):(0,z.jsx)(tK,{label:`Preparing your dashboard…`})}function tK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}function nK({onOpenDefault:e}){return(0,z.jsx)(D,{mih:`50vh`,children:(0,z.jsxs)(P,{align:`center`,gap:`xs`,children:[(0,z.jsx)(A,{order:1,fz:24,lts:`-0.02em`,children:`This dashboard isn't here`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ta:`center`,children:`The link may be out of date, or the dashboard may have been renamed or deleted.`}),(0,z.jsx)(ne,{mt:`sm`,variant:`default`,size:`sm`,onClick:e,children:`Open your default dashboard`})]})})}export{eK as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-qOWEIeHc.js b/internal/ui/dist/assets/dashboard-qOWEIeHc.js deleted file mode 100644 index 97c1072c1..000000000 --- a/internal/ui/dist/assets/dashboard-qOWEIeHc.js +++ /dev/null @@ -1,24 +0,0 @@ -import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as te,rt as ne,s as N,st as P,u as re,ut as ie,vt as ae,w as oe,x as se,xt as ce,y as le}from"./brand-CCB4_HD8.js";import{n as F,t as I}from"./copy-DGK5qe2D.js";import{A as L,B as ue,C as de,D as fe,E as pe,F as me,G as he,H as ge,I as _e,L as ve,M as ye,N as be,O as xe,P as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,_ as ke,a as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,r as Ue,t as We,v as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./index-DSdcpqnK.js";var R=ce(S(),1),z=M();function Xe(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ze(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function Qe(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:rt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:nt}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(se,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});it.classes=rt,it.displayName=`@mantine/core/Flex`;function at(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>at(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ot(e){return e?e.map(e=>at(e)):[]}function st(e){return e.reduce((e,t)=>`group`in t?{...e,...st(t.items)}:(e[`${t.value}`]=t,e),{})}var ct={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},lt={error:null},ut=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),dt=n(e=>{let t=T(`ComboboxChevron`,lt,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:ct,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:ut,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(se,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});dt.classes=ct,dt.varsResolver=ut,dt.displayName=`@mantine/core/ComboboxChevron`;var[ft,pt]=Ee(`Combobox component was not found in tree`);function mt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}mt.displayName=`@mantine/core/ComboboxClearButton`;var ht=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=pt();return(0,z.jsx)(me.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});ht.classes=ct,ht.displayName=`@mantine/core/ComboboxDropdown`;var gt={refProp:`ref`},_t=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,gt,e);if(pt(),!Oe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(me.Target,{ref:r,refProp:n,children:t})});_t.displayName=`@mantine/core/ComboboxDropdownTarget`;var vt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});vt.classes=ct,vt.displayName=`@mantine/core/ComboboxEmpty`;function yt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=pt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var bt={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},xt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,bt,e),d=Ye(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt();return(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,ue(d))})});xt.displayName=`@mantine/core/ComboboxEventsTarget`;var St=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});St.classes=ct,St.displayName=`@mantine/core/ComboboxFooter`;var Ct=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=pt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(se,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Ct.classes=ct,Ct.displayName=`@mantine/core/ComboboxGroup`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});wt.classes=ct,wt.displayName=`@mantine/core/ComboboxHeader`;function Tt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Tt.displayName=`@mantine/core/ComboboxHiddenInput`;var Et=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=pt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(se,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Et.classes=ct,Et.displayName=`@mantine/core/ComboboxOption`;var Dt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=pt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(se,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Dt.classes=ct,Dt.displayName=`@mantine/core/ComboboxOptions`;var Ot={withAriaAttributes:!0,withKeyboardNavigation:!0},kt=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Ot,e),p=pt(),m=p.getStyles(`search`),h=yt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});kt.classes=ct,kt.displayName=`@mantine/core/ComboboxSearch`;var At={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},jt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,At,e),d=Ye(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt(),p=(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(me.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});jt.displayName=`@mantine/core/ComboboxTarget`;function Mt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Nt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=et(f.current),n=Qe(`#${l.current}`,t),r=n?$e(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-active]`,e);if(t){let n=$e(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Nt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Mt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Pt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=et(f.current);($e(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var It={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Lt=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Rt=e=>{let t=T(`Combobox`,It,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Ft(),x=o||b,S=E({name:p||`Combobox`,classes:ct,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Lt}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(ft,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(me,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Rt.extend=e=>e,Rt.classes=ct,Rt.varsResolver=Lt,Rt.displayName=`@mantine/core/Combobox`,Rt.Target=jt,Rt.Dropdown=ht,Rt.Options=Dt,Rt.Option=Et,Rt.Search=kt,Rt.Empty=vt,Rt.Chevron=dt,Rt.Footer=St,Rt.Header=wt,Rt.EventsTarget=xt,Rt.DropdownTarget=_t,Rt.Group=Ct,Rt.ClearButton=mt,Rt.HiddenInput=Tt;function zt(e){return`group`in e}function Bt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Ht(e,t=new Set){if(Array.isArray(e))for(let n of e)if(zt(n))Ht(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Ut(e,t){return Array.isArray(e)?e.includes(t):e===t}function Wt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!zt(e)){let c=Ut(r,e.value),l=t&&(c?(0,z.jsx)(be,{className:ct.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:ct.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Rt.Option,{value:e.value,disabled:e.disabled,className:o({[ct.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Wt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Rt.Group,{label:e.group,children:c})}function Gt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=pt();Ht(e);let x=typeof i==`string`?(r||Bt)({options:e,search:l?i:``,limit:a??1/0}):e,S=Vt(x),C=x.map((e,t)=>(0,z.jsx)(Wt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},zt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Rt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Rt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(_e.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Rt.Empty,{children:m})]})})}function Kt(e){let t=e.currentTarget;return et(t).activeElement!==t}function qt(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[Jt,Yt]=Ee(`Progress.Root component was not found in tree`),Xt={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},Zt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(se,{...Yt().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});Zt.classes=Xt,Zt.displayName=`@mantine/core/ProgressLabel`;var Qt=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),$t=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Qt});return(0,z.jsx)(Jt,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(se,{mod:[{orientation:u},f],...m(`root`),...p})})});$t.classes=Xt,$t.varsResolver=Qt,$t.displayName=`@mantine/core/ProgressRoot`;var en={withAria:!0},tn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,en,e),h=Yt(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(se,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":tt(h.autoContrast,g)?Ce({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});tn.classes=Xt,tn.displayName=`@mantine/core/ProgressSection`;var nn=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)($t,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(tn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});nn.classes=Xt,nn.displayName=`@mantine/core/Progress`,nn.Section=tn,nn.Root=$t,nn.Label=Zt;var rn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},an=oe(n=>{let r=T([`Input`,`InputWrapper`,`Select`],rn,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:te,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,name:ie,form:ae,searchValue:oe,defaultSearchValue:se,onSearchChange:ce,allowDeselect:le,error:F,rightSectionPointerEvents:I,id:L,clearable:ue,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:ve,__clearSection:ye,__clearable:be,chevronColor:xe,autoSelectOnBlur:Se,openOnFocus:Ce,attributes:we,...Te}=r,Ee=(0,R.useMemo)(()=>ot(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>st(Ee),[Ee]),Ae=e(L),[je,Me,Ne]=De({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=Ze(Pe),[Ie,Le,Re]=De({value:oe,defaultValue:se,finalValue:Pe?Pe.label:``,onChange:ce}),ze=Ft({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Rt.ClearButton,{...fe,onClear:()=>{Me(null,null),Be(``),he?.()}}),We=ue&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Rt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:we,floatingHeight:A,keepMounted:Se,onOptionSubmit:e=>{x?.(e);let t=le&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Rt.Target,{targetType:M?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Rt.Chevron,{size:j,error:F,unstyled:o,color:xe}),__clearSection:Ue,__clearable:We,__clearSectionMode:de,rightSection:te,rightSectionPointerEvents:I||`none`,...Te,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Kt(e)){if(!C){let t=qt(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{Ce&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Se&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:F,attributes:we})}),(0,z.jsx)(Gt,{data:Ee,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!re,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,unstyled:o,labelId:Te.label?`${Ae}-label`:void 0,"aria-label":Te.label?void 0:Te[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,z.jsx)(Rt.HiddenInput,{value:je,name:ie,form:ae,disabled:w,...pe})]})});an.classes={...ee.classes,...Rt.classes},an.displayName=`@mantine/core/Select`;function on(e){if(e!==void 0)return typeof e==`number`?ie(e):e}function sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:ge(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function cn(e){return typeof e==`object`&&e?y(e):[]}function ln(e){return e.sort((e,t)=>he(e)-he(t))}function un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return ln(Array.from(new Set([...cn(e),...cn(t),...r===void 0?cn(n):[]])))}function dn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),u=un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var fn={container:`m_925c2d2c`,root:`m_2415a157`},pn={cols:1,spacing:`md`,type:`media`},mn=n(e=>{let t=T(`SimpleGrid`,pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:fn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sn,{...t,selector:`.${y}`}),(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});mn.classes=fn,mn.displayName=`@mantine/core/SimpleGrid`;var hn=class extends we{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Te(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&de(t.mutationKey)!==de(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function gn(e,t){let n=fe(t),[r]=R.useState(()=>new hn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ke)},[r]);if(i.error&&pe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),vn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),yn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),bn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),xn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Sn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:_n}));Sn.displayName=`ArrowUpRightIcon`;var Cn=Sn,wn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:vn}));wn.displayName=`CaretDownIcon`;var Tn=wn,En=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:yn}));En.displayName=`ListMagnifyingGlassIcon`;var Dn=En,On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:bn}));On.displayName=`SlidersHorizontalIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:xn}));An.displayName=`WarningCircleIcon`;var jn=An;function Mn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Nn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Pn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Mn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Nn(r,u,s[0]),f=Nn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Fn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Mn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Rn(d,0,s-r),f=Rn(f,0,l-i),{x:d,y:f}}function In(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Mn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ln(e,t,n){let{margin:r,rowHeight:i}=e,a=Mn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Rn(e,t,n){return Math.max(Math.min(e,n),t)}function zn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Bn(e,t){for(let n=0;nzn(e,t))}function Hn(e,t){return t===`horizontal`?Wn(e):t===`vertical`||t===`wrap`?Un(e):[...e]}function Un(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Wn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Gn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Kn(e,t){for(let n=0;ne.static===!0)}function Jn(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Yn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bn(n,i);)i.y++}}return e}function $n(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Hn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=Vn(d,t),p=f.length>0;if(p&&c)return Yn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return $n(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return $n(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return $n(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:$n(e,n,l,u,r,c,i)}function tr(e,t,n){return Math.max(t,Math.min(n,e))}var nr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:tr(t,0,Math.max(0,r-e.w)),y:tr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:tr(t,1,Math.max(1,o)),h:tr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:tr(t,e.minW??1,e.maxW??1/0),h:tr(n,e.minH??1,e.maxH??1/0)}}}];function rr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ir(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ar({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function or({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function sr(e){return e*100+`%`}function cr(e,t,n,r){return e+n>r?t:n}function lr(e,t,n){return e<0?t:n}function ur(e){return Math.max(0,e)}function dr(e){return Math.max(0,e)}var fr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:lr(o,e.height,i),top:dr(o)}},pr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:cr(e.left,e.width,o,n),left:ur(i)}},mr=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:dr(r),left:0}:{height:i,width:a,top:dr(r),left:o}},hr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:lr(r,e.height,a),top:dr(r)}},gr={n:fr,ne:(e,t,n)=>fr(e,pr(e,t,n)),e:pr,se:(e,t,n)=>hr(e,pr(e,t,n)),s:hr,sw:(e,t,n)=>hr(e,mr(e,t)),w:mr,nw:(e,t,n)=>fr(e,mr(e,t))};function _r(e,t,n,r){let i=gr[e];return i?i(t,{...t,...n},r):n}var vr={type:`transform`,scale:1,calcStyle(e){return ar(e)}},yr={type:`absolute`,scale:1,calcStyle(e){return or(e)}};function br(e){return{type:`transform`,scale:e,calcStyle(e){return ar(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var xr=vr,Sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Cr={enabled:!0,bounded:!1,threshold:3},wr={enabled:!0,handles:[`se`]},Tr={enabled:!1,defaultItem:{w:1,h:1}};function Er(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??qn(e).length>0;for(let i=o+1;it.y+t.h)break;zn(t,o)&&Er(e,o,n+t[a],r,s)}}t[r]=n}function Dr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Bn(e,t);)t.y--;let i;for(;(i=Bn(e,t))!==void 0;)Er(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Or(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Bn(e,t);)t.x--;let i;for(;(i=Bn(e,t))!==void 0;)if(Er(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Bn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var kr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=qn(e),r=Gn(n),i=Un(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Lr(e,t){let n=Ir(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Rr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function zr(e,t,n,r,i,a){let o=e[n];if(o)return Yn(o);let s=e[r],c=Ir(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hr=b(((e,t)=>{var n=Vr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ur=b(((e,t)=>{t.exports=Hr()()})),Wr=ce(Ur(),1),Gr=ce(k(),1);function Kr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Kr(e.changedTouches,e=>t===e.identifier)}function gi(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _i(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_i();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} -`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&xi(e.body,`react-draggable-transparent-selection`)}function yi(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{bi(e)}):bi(e)}function bi(e){if(e)try{e.body&&Si(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function xi(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Si(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Ci(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Ai(r);let i=ji(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+Yr(s.paddingLeft)+Yr(o.marginLeft),top:-i.offsetTop+Yr(s.paddingTop)+Yr(o.marginTop),right:ui(a)-ci(i)-i.offsetLeft+Yr(s.paddingRight)-Yr(o.marginRight),bottom:li(a)-si(i)-i.offsetTop+Yr(s.paddingBottom)-Yr(o.marginBottom)}}return Jr(r.right)&&(t=Math.min(t,r.right)),Jr(r.bottom)&&(n=Math.min(n,r.bottom)),Jr(r.left)&&(t=Math.max(t,r.left)),Jr(r.top)&&(n=Math.max(n,r.top)),[t,n]}function wi(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ti(e){return e.props.axis===`both`||e.props.axis===`x`}function Ei(e){return e.props.axis===`both`||e.props.axis===`y`}function Di(e,t,n){let r=typeof t==`number`?hi(e,t):null;if(typeof t==`number`&&!r)return null;let i=ji(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return di(r||e,a,n.props.scale)}function Oi(e,t,n){let r=!Jr(e.lastX),i=ji(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ki(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ai(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ji(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Mi=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ni={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Pi=Ni.mouse,Fi=class extends R.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ii(e.target,this.props.handle,t)||this.props.cancel&&ii(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=gi(e);this.touchIdentifier=r;let i=Di(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Oi(this,a,o);Mi(`DraggableCore: handleDragStart: %j`,s),Mi(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&vi(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,ai(n,Pi.move,this.handleDrag),ai(n,Pi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=wi(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(Mi(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=wi(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&yi(a.ownerDocument),Mi(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Mi(`DraggableCore: Removing handlers`),oi(a.ownerDocument,Pi.move,this.handleDrag),oi(a.ownerDocument,Pi.stop,this.handleDragStop))},this.onMouseDown=e=>(Pi=Ni.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Pi=Ni.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Pi=Ni.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Pi=Ni.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&ai(e,Ni.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;oi(t,Ni.mouse.move,this.handleDrag),oi(t,Ni.touch.move,this.handleDrag),oi(t,Ni.mouse.stop,this.handleDragStop),oi(t,Ni.touch.stop,this.handleDragStop),oi(e,Ni.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&yi(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Mi(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return R.cloneElement(R.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Fi.displayName=`DraggableCore`,Fi.propTypes={allowAnyClick:Wr.default.bool,allowMobileScroll:Wr.default.bool,children:Wr.default.node.isRequired,disabled:Wr.default.bool,enableUserSelectHack:Wr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Wr.default.arrayOf(Wr.default.number),handle:Wr.default.string,cancel:Wr.default.string,nodeRef:Wr.default.object,nonce:Wr.default.string,onStart:Wr.default.func,onDrag:Wr.default.func,onStop:Wr.default.func,onMouseDown:Wr.default.func,scale:Wr.default.number,className:Xr,style:Xr,transform:Xr},Fi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Ii=class extends R.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Mi(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ki(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Mi(`Draggable: onDrag: %j`,t);let n=ki(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Ci(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ki(this,t))===!1)return!1;Mi(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Mi(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:s,position:c,positionOffset:l,scale:u,...d}=this.props,f={},p=null,m=!c||this.state.dragging,h=c||r,g={x:Ti(this)&&m?this.state.x:h.x,y:Ei(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=pi(g,l):f=fi(g,l);let _=R.Children.only(n),v=o(_.props.className||``,i,{[a]:this.state.dragging,[s]:this.state.dragged});return R.createElement(Fi,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},R.cloneElement(_,{className:v,style:{..._.props.style,...f},transform:p}))}};Ii.displayName=`Draggable`,Ii.propTypes={...Fi.propTypes,axis:Wr.default.oneOf([`both`,`x`,`y`,`none`]),bounds:Wr.default.oneOfType([Wr.default.shape({left:Wr.default.number,right:Wr.default.number,top:Wr.default.number,bottom:Wr.default.number}),Wr.default.string,Wr.default.oneOf([!1])]),defaultClassName:Wr.default.string,defaultClassNameDragging:Wr.default.string,defaultClassNameDragged:Wr.default.string,defaultPosition:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),positionOffset:Wr.default.shape({x:Wr.default.oneOfType([Wr.default.number,Wr.default.string]),y:Wr.default.oneOfType([Wr.default.number,Wr.default.string])}),position:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),className:Xr,style:Xr,transform:Xr},Ii.defaultProps={...Fi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Li=b(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>De,default:()=>Oe}),t.exports=d(f);var p=u(S()),m=u(Ur()),h=u(k()),g=Li();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ce(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function le(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function F(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??le();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} -`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ue(e.body,`react-draggable-transparent-selection`)}function I(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{L(e)}):L(e)}function L(e){if(e)try{e.body&&de(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function ue(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function de(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function fe(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:ye(r);let i=be(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+b(s.paddingLeft)+b(o.marginLeft),top:-i.offsetTop+b(s.paddingTop)+b(o.marginTop),right:P(a)-ne(i)-i.offsetLeft+b(s.paddingRight)-b(o.marginRight),bottom:N(a)-te(i)-i.offsetTop+b(s.paddingBottom)-b(o.marginBottom)}}return y(r.right)&&(t=Math.min(t,r.right)),y(r.bottom)&&(n=Math.min(n,r.bottom)),y(r.left)&&(t=Math.max(t,r.left)),y(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function me(e){return e.props.axis===`both`||e.props.axis===`x`}function he(e){return e.props.axis===`both`||e.props.axis===`y`}function ge(e,t,n){let r=typeof t==`number`?se(e,t):null;if(typeof t==`number`&&!r)return null;let i=be(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return re(r||e,a,n.props.scale)}function _e(e,t,n){let r=!y(e.lastX),i=be(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ve(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function ye(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function be(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var xe=u(S()),Se=u(Ur()),Ce=u(k()),we=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Te={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Ee=Te.mouse,De=class extends xe.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!j(e.target,this.props.handle,t)||this.props.cancel&&j(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ce(e);this.touchIdentifier=r;let i=ge(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=_e(this,a,o);we(`DraggableCore: handleDragStart: %j`,s),we(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&F(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,ee(n,Ee.move,this.handleDrag),ee(n,Ee.stop,this.handleDragStop))},this.handleDrag=e=>{let t=ge(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=pe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(we(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=ge(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=pe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I(a.ownerDocument),we(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(we(`DraggableCore: Removing handlers`),M(a.ownerDocument,Ee.move,this.handleDrag),M(a.ownerDocument,Ee.stop,this.handleDragStop))},this.onMouseDown=e=>(Ee=Te.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Ee=Te.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Ee=Te.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Ee=Te.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&ee(e,Te.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;M(t,Te.mouse.move,this.handleDrag),M(t,Te.touch.move,this.handleDrag),M(t,Te.mouse.stop,this.handleDragStop),M(t,Te.touch.stop,this.handleDragStop),M(e,Te.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ce.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(we(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return xe.cloneElement(xe.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};De.displayName=`DraggableCore`,De.propTypes={allowAnyClick:Se.default.bool,allowMobileScroll:Se.default.bool,children:Se.default.node.isRequired,disabled:Se.default.bool,enableUserSelectHack:Se.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Se.default.arrayOf(Se.default.number),handle:Se.default.string,cancel:Se.default.string,nodeRef:Se.default.object,nonce:Se.default.string,onStart:Se.default.func,onDrag:Se.default.func,onStop:Se.default.func,onMouseDown:Se.default.func,scale:Se.default.number,className:x,style:x,transform:x},De.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Oe=class extends p.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(we(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ve(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;we(`Draggable: onDrag: %j`,t);let n=ve(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=fe(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ve(this,t))===!1)return!1;we(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(we(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=h.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,m=!s||this.state.dragging,h=s||r,_={x:me(this)&&m?this.state.x:h.x,y:he(this)&&m?this.state.y:h.y};this.state.isElementSVG?f=ae(_,c):d=ie(_,c);let v=p.Children.only(n),y=(0,g.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return p.createElement(De,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},p.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};Oe.displayName=`Draggable`,Oe.propTypes={...De.propTypes,axis:m.default.oneOf([`both`,`x`,`y`,`none`]),bounds:m.default.oneOfType([m.default.shape({left:m.default.number,right:m.default.number,top:m.default.number,bottom:m.default.number}),m.default.string,m.default.oneOf([!1])]),defaultClassName:m.default.string,defaultClassNameDragging:m.default.string,defaultClassNameDragged:m.default.string,defaultPosition:m.default.shape({x:m.default.number,y:m.default.number}),positionOffset:m.default.shape({x:m.default.oneOfType([m.default.number,m.default.string]),y:m.default.oneOfType([m.default.number,m.default.string])}),position:m.default.shape({x:m.default.number,y:m.default.number}),className:x,style:x,transform:x},Oe.defaultProps={...De.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:De})})),zi=b(((e,t)=>{var n=Ri(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),Bi=b((e=>{e.__esModule=!0,e.cloneElement=c;var t=n(S());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(Ur());zi();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),Hi=b((e=>{e.__esModule=!0,e.default=void 0;var t=o(S()),n=zi(),r=Bi(),i=Vi(),a=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function o(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(o=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=u({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,i=e.children,o=e.className,l=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let d=e.resizeHandles;e.transformScale;let f=c(e,a);return(0,r.cloneElement)(i,u(u({},f),{},{className:(o?o+` `:``)+`react-resizable`,children:[...t.Children.toArray(i.props.children),...d.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,s({},l,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};e.default=m,m.propTypes=i.resizableProps,m.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),Ui=b((e=>{e.__esModule=!0,e.default=void 0;var t=s(S()),n=o(Ur()),r=o(Hi()),i=Vi(),a=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,n=e.handle,i=e.handleSize;e.onResize;let o=e.onResizeStart,s=e.onResizeStop,l=e.draggableOpts,d=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,h=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=m(e,a);return t.createElement(r.default,{axis:h,draggableOpts:l,handle:n,handleSize:i,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:d,onResizeStart:o,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},t.createElement(`div`,c({},y,{style:u(u({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=h,h.propTypes=u(u({},i.resizableProps),{},{children:n.default.element})})),Wi=b(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Hi().default,t.exports.ResizableBox=Ui().default})),Gi=b(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function ee(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=ee,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),Ki=Wi(),qi=Gi();function Ji(e){let{children:t,cols:n,containerWidth:r,margin:i,containerPadding:a,rowHeight:s,maxRows:c,isDraggable:l,isResizable:u,isBounded:d,static:f,useCSSTransforms:p=!0,usePercentages:m=!1,transformScale:h=1,positionStrategy:g,dragThreshold:_=0,droppingPosition:v,className:y=``,style:b,handle:x=``,cancel:S=``,x:C,y:w,w:T,h:E,minW:D=1,maxW:O=1/0,minH:k=1,maxH:A=1/0,i:j,resizeHandles:ee,resizeHandle:M,constraints:te=nr,layoutItem:ne,layout:N=[],onDragStart:P,onDrag:re,onDragStop:ie,onResizeStart:ae,onResize:oe,onResizeStop:se}=e,[ce,le]=(0,R.useState)(!1),[F,I]=(0,R.useState)(!1),L=(0,R.useRef)(null),ue=(0,R.useRef)({left:0,top:0}),de=(0,R.useRef)({top:0,left:0,width:0,height:0}),fe=(0,R.useRef)(void 0),pe=(0,R.useRef)(N);pe.current=N;let me=(0,R.useRef)(null),he=(0,R.useRef)(null),ge=(0,R.useRef)(!1),_e=(0,R.useRef)({x:0,y:0}),ve=(0,R.useRef)(!1),ye=(0,R.useMemo)(()=>({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:c,rowHeight:s}),[n,a,r,i,c,s]),be=(0,R.useMemo)(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:s,margin:i,layout:[]}),[n,c,r,s,i]),xe=(0,R.useCallback)(()=>({...be,layout:pe.current}),[be]),Se=(0,R.useMemo)(()=>ne??{i:j,x:C,y:w,w:T,h:E,minW:D,maxW:O,minH:k,maxH:A},[ne,j,C,w,T,E,D,O,k,A]),Ce=(0,R.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return ar(e);let t=or(e);return m?{...t,left:sr(e.left/r),width:sr(e.width/r)}:t},[g,p,m,r]),we=(0,R.useCallback)((e,{node:t})=>{if(!P)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(ue.current=l,_>0){let t=e;_e.current={x:t.clientX,y:t.clientY},ge.current=!0,ve.current=!1,le(!0);return}le(!0);let u=In(ye,l.top,l.left),{x:d,y:f}=rr(te,Se,u.x,u.y,xe());P(j,d,f,{e,node:t,newPosition:l})},[P,h,ye,g,_,te,Se,xe,j]),Te=(0,R.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!re||!ce)return;let o=e;if(ge.current&&!ve.current){let n=o.clientX-_e.current.x,r=o.clientY-_e.current.y;if(Math.hypot(n,r)<_)return;if(ve.current=!0,ge.current=!1,P){let n=In(ye,ue.current.top,ue.current.left),{x:r,y:i}=rr(te,Se,n.x,n.y,xe());P(j,r,i,{e,node:t,newPosition:ue.current})}}let c=ue.current.top+a,l=ue.current.left+n;if(d){let{offsetParent:e}=t;if(e){let t=e.clientHeight-Nn(E,s,i[1]);c=Rn(c,0,t);let n=Mn(ye),a=r-Nn(T,n,i[0]);l=Rn(l,0,a)}}let u={top:c,left:l};ue.current=u;let f=In(ye,c,l),{x:p,y:m}=rr(te,Se,f.x,f.y,xe());re(j,p,m,{e,node:t,newPosition:u})},[re,P,ce,_,d,E,s,i,ye,r,T,j,te,Se,xe]),Ee=(0,R.useCallback)((e,{node:t})=>{if(!ie||!ce)return;let n=ge.current;if(ge.current=!1,ve.current=!1,_e.current={x:0,y:0},n){le(!1),ue.current={left:0,top:0};return}let{left:r,top:i}=ue.current,a={top:i,left:r};le(!1),ue.current={left:0,top:0};let o=In(ye,i,r),{x:s,y:c}=rr(te,Se,o.x,o.y,xe());ie(j,s,c,{e,node:t,newPosition:a})},[ie,ce,ye,te,Se,xe,j]);me.current=we,he.current=Te;let De=(0,R.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?ae:o===`onResize`?oe:se;if(!s)return;let c;c=t?_r(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=Ln(ye,c.width,c.height),{w:u,h:d}=ir(te,Se,l.w,l.h,i,xe());s(j,u,d,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[ae,oe,se,r,ye,j,te,Se,xe]),Oe=(0,R.useCallback)((e,t)=>{I(!0);let n=Pn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResizeStart`)},[De,ye,C,w,T,E]),ke=(0,R.useCallback)((e,t)=>{let n=Pn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResize`)},[De,ye,C,w,T,E]),Ae=(0,R.useCallback)((e,t)=>{I(!1),de.current={top:0,left:0,width:0,height:0};let n=Pn(ye,C,w,T,E),r={...t,handle:t.handle};De(e,r,n,`onResizeStop`)},[De,ye,C,w,T,E]);(0,R.useEffect)(()=>{if(!v)return;let e=L.current;if(!e)return;let t=fe.current||{left:0,top:0},n=ce&&(v.left!==t.left||v.top!==t.top);if(!ce){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};me.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-ue.current.left,deltaY:v.top-ue.current.top,lastX:ue.current.left,lastY:ue.current.top,x:v.left,y:v.top};he.current?.(v.e,t)}fe.current=v},[v,ce,j]);let je=Pn(ye,C,w,T,E,ce?ue.current:null,F?de.current:null),Me=R.Children.only(t),Ne=Mn(ye),Pe=[Nn(D,Ne,i[0]),Nn(k,s,i[1])],Fe=[Nn(O,Ne,i[0]),Nn(A,s,i[1])],Ie=Me.props,Le=Ie.className,Re=Ie.style,ze=R.cloneElement(Me,{ref:L,className:o(`react-grid-item`,Le,y,{static:f,resizing:F,"react-draggable":l,"react-draggable-dragging":ce,dropping:!!v,cssTransforms:p}),style:{...b,...Re,...Ce(je)}}),Be=M;return ze=(0,z.jsx)(Ki.Resizable,{draggableOpts:{disabled:!u},className:u?void 0:`react-resizable-hide`,width:je.width,height:je.height,minConstraints:Pe,maxConstraints:Fe,onResizeStart:Oe,onResize:ke,onResizeStop:Ae,transformScale:h,resizeHandles:ee,handle:Be,children:ze}),ze=(0,z.jsx)(Fi,{disabled:!l,onStart:we,onDrag:Te,onStop:Ee,handle:x,cancel:`.react-resizable-handle`+(S?`,`+S:``),scale:h,nodeRef:L,children:ze}),ze}var Yi=()=>{},Xi=`react-grid-layout`,Zi=!1;try{Zi=/firefox/i.test(navigator.userAgent)}catch{}function Qi(e,t){let n=R.Children.toArray(e),r=R.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!R.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(Jn(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Gn(i),w:1,h:1})}});let o=Qn(i,{cols:n});return r.compact(o,n)}function ea(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:s,positionStrategy:c=xr,compactor:l,constraints:u=nr,layout:d=[],droppingItem:f,autoSize:p=!0,className:m=``,style:h={},innerRef:g,onLayoutChange:_=Yi,onDragStart:v=Yi,onDrag:y=Yi,onDragStop:b=Yi,onResizeStart:x=Yi,onResize:S=Yi,onResizeStop:C=Yi,onDrop:w=Yi,onDropDragOver:T=Yi}=e,E=(0,R.useMemo)(()=>({...Sr,...r}),[r]),D=(0,R.useMemo)(()=>({...Cr,...i}),[i]),O=(0,R.useMemo)(()=>({...wr,...a}),[a]),k=(0,R.useMemo)(()=>({...Tr,...s}),[s]),{cols:A,rowHeight:j,maxRows:ee,margin:M,containerPadding:te}=E,{enabled:ne,bounded:N,handle:P,cancel:re,threshold:ie}=D,{enabled:ae,handles:oe,handleComponent:se}=O,{enabled:ce,defaultItem:le,onDragOver:F}=k,I=l??Fr(`vertical`),L=I.type,ue=I.allowOverlap,de=I.preventCollision??!1,fe=(0,R.useMemo)(()=>f??{i:`__dropping-elem__`,...le},[f,le]),pe=c.type===`transform`,me=c.scale,he=te??M,[ge,_e]=(0,R.useState)(!1),[ve,ye]=(0,R.useState)(()=>$i(d,t,A,I)),[be,xe]=(0,R.useState)(null),[Se,Ce]=(0,R.useState)(!1),[we,Te]=(0,R.useState)(null),[Ee,De]=(0,R.useState)(),Oe=(0,R.useRef)(null),ke=(0,R.useRef)(null),Ae=(0,R.useRef)(null),je=(0,R.useRef)(0),Me=(0,R.useRef)(ve),Ne=(0,R.useRef)(d),Pe=(0,R.useRef)(t),Fe=(0,R.useRef)(L),Ie=(0,R.useRef)(ve);Ie.current=ve,(0,R.useEffect)(()=>{_e(!0),(0,qi.deepEqual)(ve,d)||_(ve)},[]),(0,R.useEffect)(()=>{if(be||we)return;let e=!(0,qi.deepEqual)(d,Ne.current),n=!Qi(t,Pe.current),r=L!==Fe.current;if(e||n||r){let n=$i(e?d:ve,t,A,I);(0,qi.deepEqual)(n,ve)||ye(n)}Ne.current=d,Pe.current=t,Fe.current=L},[d,t,A,L,I,be,we,ve]),(0,R.useEffect)(()=>{if(!be&&!(0,qi.deepEqual)(ve,Me.current)){Me.current=ve;let e=ve.filter(e=>e.i!==fe.i);_(e)}},[ve,be,_,fe.i]);let Le=(0,R.useMemo)(()=>{if(!p)return;let e=Gn(ve),t=he[1];return e*j+(e-1)*M[1]+t*2+`px`},[p,ve,j,M,he]),Re=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Kn(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};Oe.current=Jn(a),Ae.current=i,xe(o),v(i,a,a,null,r.e,r.node)},[v]),ze=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Oe.current,o=Kn(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=$n(i,o,t,n,!0,de,L,A,ue);y(c,a,o,s,r.e,r.node),ye(I.compact(c,A)),xe(s)},[de,L,A,ue,I,y]),Be=(0,R.useCallback)((e,t,n,r)=>{if(!be)return;let i=Ie.current,a=Oe.current,o=Kn(i,e);if(!o)return;let s=$n(i,o,t,n,!0,de,L,A,ue),c=I.compact(s,A);b(c,a,o,null,r.e,r.node);let l=Ae.current;Oe.current=null,Ae.current=null,xe(null),ye(c),l&&!(0,qi.deepEqual)(l,c)&&_(c)},[be,de,L,A,ue,I,b,_]),Ve=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=Kn(i,e);a&&(ke.current=Jn(a),Ae.current=i,Ce(!0),x(i,a,a,null,r.e,r.node))},[x]),He=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=ke.current,{handle:o}=r,s=!1,c,l,[u,d]=Zn(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),de&&!ue&&Vn(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=$n(u,d,c,l,!0,de,L,A,ue));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node),ye(I.compact(f,A)),xe(p)},[de,L,A,ue,I,S]),Ue=(0,R.useCallback)((e,t,n,r)=>{let i=Ie.current,a=ke.current,o=Kn(i,e),s=I.compact(i,A);C(s,a,o??null,null,r.e,r.node);let c=Ae.current;ke.current=null,Ae.current=null,xe(null),Ce(!1),ye(s),c&&!(0,qi.deepEqual)(c,s)&&_(s)},[A,I,C,_]),We=(0,R.useCallback)(()=>{let e=Ie.current;if(!e.some(e=>e.i===fe.i)){Te(null),xe(null),De(void 0);return}let t=I.compact(e.filter(e=>e.i!==fe.i),A);ye(t),Te(null),xe(null),De(void 0)},[fe.i,A,I]),Ge=(0,R.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),Zi&&!e.nativeEvent.target?.classList.contains(Xi))return!1;let t=F?F(e.nativeEvent):T(e);if(t===!1)return we&&We(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...fe,...a},s=e.currentTarget.getBoundingClientRect(),c={cols:A,margin:M,maxRows:ee,rowHeight:j,containerWidth:n,containerPadding:he},l=Mn(c),u=Nn(o.w,l,M[0]),d=Nn(o.h,j,M[1]),f=u/2,p=d/2,m=e.clientX-s.left+r-f,h=e.clientY-s.top+i-p,g=Math.max(0,m),_=Math.max(0,h),v={left:g/me,top:_/me,e:e.nativeEvent};if(we)Ee&&(Ee.left!==v.left||Ee.top!==v.top)&&De(v);else{let e=Fn(c,_,g,o.w,o.h);Te((0,z.jsx)(`div`,{},o.i)),De(v);let t=Ie.current.filter(e=>e.i!==o.i);ye([...t,{...o,x:e.x,y:e.y,static:!1,isDraggable:!0}])}},[we,Ee,fe,F,T,We,me,A,M,ee,j,n,he]),Ke=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),je.current--,je.current<0&&(je.current=0),je.current===0&&We()},[We]),qe=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),je.current++},[]),Je=(0,R.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=Ie.current,n=t.find(e=>e.i===fe.i);je.current=0,We(),w(t,n,e.nativeEvent)},[fe.i,We,w]),Ye=(0,R.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=Kn(ve,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&ne,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&ae,o=r.resizeHandles||[...oe],s=i&&N&&r.isBounded!==!1,l=se;return(0,z.jsx)(Ji,{containerWidth:n,cols:A,margin:M,containerPadding:he,maxRows:ee,rowHeight:j,cancel:re,handle:P,onDragStart:Re,onDrag:ze,onDragStop:Be,onResizeStart:Ve,onResize:He,onResizeStop:Ue,isDraggable:i,isResizable:a,isBounded:s,useCSSTransforms:pe&&ge,usePercentages:!ge,transformScale:me,positionStrategy:c,dragThreshold:ie,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?Ee:void 0,resizeHandles:o,resizeHandle:l,constraints:u,layoutItem:r,layout:ve,children:e},r.i)},[ve,n,A,M,he,ee,j,re,P,Re,ze,Be,Ve,He,Ue,ne,ae,N,pe,ge,me,c,ie,Ee,oe,se,u]),Xe=()=>be?(0,z.jsx)(Ji,{w:be.w,h:be.h,x:be.x,y:be.y,i:be.i,className:`react-grid-placeholder ${Se?`placeholder-resizing`:``}`,containerWidth:n,cols:A,margin:M,containerPadding:he,maxRows:ee,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:pe,transformScale:me,constraints:u,layout:ve,children:(0,z.jsx)(`div`,{})}):null,Ze=o(Xi,m),Qe={height:Le,...h};return(0,z.jsxs)(`div`,{ref:g,className:Ze,style:Qe,onDrop:ce?Je:void 0,onDragLeave:ce?Ke:void 0,onDragEnter:ce?qe:void 0,onDragOver:ce?Ge:void 0,children:[R.Children.map(t,e=>R.isValidElement(e)?Ye(e):null),ce&&we&&Ye(we,!0),Xe()]})}var ta={lg:1200,md:996,sm:768,xs:480,xxs:0},na={lg:12,md:10,sm:6,xs:4,xxs:2},ra=()=>{};function ia(e,t,n,r){let i=[];R.Children.forEach(t,t=>{if(!R.isValidElement(t)||t.key===null)return;let n=String(t.key),r=e.find(e=>e.i===n);if(r)i.push({...r,i:n});else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:Gn(i),w:1,h:1})}});let a=Qn(i,{cols:n});return r.compact(a,n)}function aa(e){let{children:t,width:n,breakpoint:r,breakpoints:i=ta,cols:a=na,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=ra,onLayoutChange:p=ra,onWidthChange:m=ra,...h}=e,g=d??Fr(`vertical`),_=g.type,v=g.allowOverlap,y=(0,R.useMemo)(()=>r??Lr(i,n),[]),b=(0,R.useMemo)(()=>Rr(y,a),[y,a]),x=(0,R.useMemo)(()=>zr(o,i,y,y,b,_),[]),[S,C]=(0,R.useState)(y),[w,T]=(0,R.useState)(b),[E,D]=(0,R.useState)(x),[O,k]=(0,R.useState)(o),A=(0,R.useRef)(n),j=(0,R.useRef)(r),ee=(0,R.useRef)(i),M=(0,R.useRef)(a),te=(0,R.useRef)(o),ne=(0,R.useRef)(_),N=(0,R.useRef)(O);(0,R.useEffect)(()=>{N.current=O},[O]);let P=(0,R.useMemo)(()=>(0,qi.deepEqual)(o,te.current)?null:zr(o,i,S,S,w,g),[o,i,S,w,g]),re=P??E;(0,R.useEffect)(()=>{P!==null&&(D(P),k(o),N.current=o,te.current=o)},[P,o]),(0,R.useEffect)(()=>{if(_!==ne.current){let e=g.compact(Yn(re),w),t={...N.current,[S]:e};D(e),k(t),N.current=t,p(e,t),ne.current=_}},[_,g,re,w,v,S,p]),(0,R.useEffect)(()=>{let e=n!==A.current,o=r!==j.current,s=!(0,qi.deepEqual)(i,ee.current),c=!(0,qi.deepEqual)(a,M.current);if(e||o||s||c){let e=r??Lr(i,n),o=Rr(e,a),d=S;if(d!==e||s||c){let n={...N.current};n[d]||(n[d]=Yn(E));let r=zr(n,i,e,d,o,g);r=ia(r,t,o,g),n[e]=r,C(e),T(o),D(r),k(n),N.current=n,f(e,o),p(r,n)}let h=Br(l,e),_=u?Br(u,e):null;m(n,h,o,_),A.current=n,j.current=r,ee.current=i,M.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let ie=(0,R.useCallback)(e=>{let t={...N.current,[S]:e};D(e),k(t),N.current=t,p(e,t)},[S,p]),ae=(0,R.useMemo)(()=>Br(l,S),[l,S]),oe=(0,R.useMemo)(()=>u===null?null:Br(u,S),[u,S]),se=(0,R.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:ae,containerPadding:oe}),[w,s,c,ae,oe]);return(0,z.jsx)(ea,{...h,width:n,gridConfig:se,compactor:g,onLayoutChange:ie,layout:re,children:t})}function oa(e){let{children:t,width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,rowHeight:u,maxRows:d,margin:f,containerPadding:p,droppingItem:m,compactType:h,preventCollision:g=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:y=!0,isBounded:b=!1,draggableHandle:x,draggableCancel:S,isResizable:C=!0,resizeHandles:w=[`se`],resizeHandle:T,isDroppable:E=!1,useCSSTransforms:D=!0,transformScale:O=1,autoSize:k,className:A,style:j,innerRef:ee,onDragStart:M,onDrag:te,onDragStop:ne,onResizeStart:N,onResize:P,onResizeStop:re,onDrop:ie,onDropDragOver:ae}=e,oe=h===void 0?`vertical`:h;v===!1&&(oe=null);let se={enabled:y,bounded:b,handle:x,cancel:S},ce={enabled:C,handles:w,handleComponent:T},le={enabled:E},F;F=D?O===1?vr:br(O):yr;let I=Fr(oe,_,g);return(0,z.jsx)(aa,{width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,rowHeight:u,maxRows:d,margin:f,containerPadding:p,compactor:I,dragConfig:se,resizeConfig:ce,dropConfig:le,positionStrategy:F,droppingItem:m,autoSize:k,className:A,style:j,innerRef:ee,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,onDragStart:M,onDrag:te,onDragStop:ne,onResizeStart:N,onResize:P,onResizeStop:re,onDrop:ie,onDropDragOver:ae,children:t})}oa.displayName=`ResponsiveReactGridLayout`;var sa=oa,ca=`react-grid-layout`;function la(e){function t(t){let{measureBeforeMount:n=!1,className:r,style:i,...a}=t,[s,c]=(0,R.useState)(1280),[l,u]=(0,R.useState)(!1),d=(0,R.useRef)(null),f=(0,R.useRef)(null);return(0,R.useEffect)(()=>{u(!0)},[]),(0,R.useEffect)(()=>{let e=d.current;if(!(e instanceof HTMLElement))return;let t=null,n=new ResizeObserver(e=>{if(e[0]){let n=Math.round(e[0].contentRect.width);t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{c(e=>e===n?e:n),t=null})}});return n.observe(e),f.current=n,()=>{t!==null&&cancelAnimationFrame(t),n.unobserve(e),n.disconnect()}},[l]),n&&!l?(0,z.jsx)(`div`,{className:o(r,ca),style:i,ref:d}):(0,z.jsx)(e,{innerRef:d,className:r,style:i,...a,width:s})}return t.displayName=`WidthProvider(${e.displayName||e.name||`Component`})`,t}function ua(e){return e.reduce((e,t)=>Math.max(e,t.y+t.h),0)}function da(e,t){return e.map(e=>({...e,x:0,w:t,minW:Math.min(e.minW??1,t)}))}var fa=[`overview`,`topology`,`activity`,`assistant`,`performance`,`trace`,`logs`],pa={overview:{w:4,h:3,minW:3,minH:3},activity:{w:4,h:5,minW:3,minH:4},assistant:{w:4,h:3,minW:3,minH:3},topology:{w:8,h:5,minW:4,minH:4},performance:{w:8,h:5,minW:4,minH:4},logs:{w:8,h:5,minW:4,minH:4},trace:{w:8,h:4,minW:4,minH:4}};function ma(e,t){return e.xe.y)),o=(t,r)=>!e.some(e=>ma(e,{x:t,y:a,w:r,h:n}));for(let e=0;e+t<=r;e+=1)if(o(e,t))return{x:e,y:a,w:t};let s=e.reduce((e,t)=>ma(t,{x:0,y:a,w:r,h:n})?Math.max(e,t.x+t.w):e,0),c={x:s,w:0};for(let e=Math.min(s,r);ec.w&&(c={x:e,w:t-e}),e=t}return c.w>=i?{x:c.x,y:a,w:c.w}:{x:0,y:ua(e),w:t}}var ga=[{value:`15m`,label:`15 minutes`},{value:`1h`,label:`1 hour`},{value:`6h`,label:`6 hours`},{value:`24h`,label:`24 hours`},{value:`168h`,label:`7 days`},{value:`720h`,label:`30 days`}];function _a(e){return ga.find(t=>t.value===e)?.label??e}function va(e,t){let n=e?.[t];return typeof n==`string`?n:``}function ya(e,t,n=[]){let r=new URLSearchParams({window:e.window,limit:`40`});e.namespace&&r.set(`namespace`,e.namespace);for(let e of n){let n=va(t,e);n&&r.set(e,n)}return r}function ba(e,t){return[`observability`,e,t.toString()]}var xa=e=>e.state.status===`error`?15e3:3e4;function Sa(e,t,n=!0){return Je({queryKey:ba(e,t),queryFn:()=>Ne(`/api/observability/${e}?${t}`),enabled:n,refetchInterval:xa})}function Ca(e){return e.getQueryCache().findAll({queryKey:[`observability`]}).reduce((e,t)=>Math.max(e,t.state.dataUpdatedAt),0)||null}function wa(){let e=fe(),[t,n]=(0,R.useState)(()=>Ca(e));return(0,R.useEffect)(()=>e.getQueryCache().subscribe(()=>n(Ca(e))),[e]),t}var Ta=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Ea(e){return`${(e*100).toFixed(e>=.1?1:2)}%`}function Da(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(e>=100?0:1)}ms`}function Oa(e,t,n=!1){let r=new Date(e);if(Number.isNaN(r.valueOf()))return e;let[i,a]=t.split(`/`),o=new Date(i),s=new Date(a),c=!Number.isNaN(o.valueOf())&&!Number.isNaN(s.valueOf())&&s.valueOf()-o.valueOf()>864e5;return r.toLocaleString([],{...c?{month:`short`,day:`numeric`}:{},hour:`numeric`,minute:`2-digit`,...n?{second:`2-digit`}:{}})}var ka=function(e,t){return ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ka(e,t)};function B(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);ka(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Aa=`12px sans-serif`,ja=20,Ma=100,Na=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function Pa(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n=0)s=o*n.length;else for(var c=0;c=Ya&&(Ja=0),Ja++}function Za(){var e=[...arguments];typeof console<`u`&&console.error.apply(console,e)}function V(e){if(typeof e!=`object`||!e)return e;var t=e,n=za.call(e);if(n===`[object Array]`){if(!Oo(e)){t=[];for(var r=0,i=e.length;r`u`&&typeof self<`u`?zo.worker=!0:!zo.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(zo.node=!0,zo.svgSupported=!0):Bo(navigator.userAgent,zo);function Bo(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var Vo=`.`,Ho=`___EC__COMPONENT__CONTAINER___`,Uo=`___EC__EXTENDED_CLASS___`;function Wo(e){var t={main:``,sub:``};if(e){var n=e.split(Vo);t.main=n[0]||``,t.sub=n[1]||``}return t}function Go(e){wo(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function Ko(e){return!!(e&&e[Uo])}function qo(e,t){e.$constructor=e,e.extend=function(e){var t=this,n;return Jo(t)?n=function(e){B(t,e);function t(){return e.apply(this,arguments)||this}return t}(t):(n=function(){(e.$constructor||t).apply(this,arguments)},no(n,this)),H(n.prototype,e),n[Uo]=!0,n.extend=this.extend,n.superCall=Qo,n.superApply=$o,n.superClass=t,n}}function Jo(e){return K(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function Yo(e,t){e.extend=t.extend}var Xo=Math.round(Math.random()*10);function Zo(e){var t=[`__\0is_clz`,Xo++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function Qo(e,t){var n=[...arguments].slice(2);return this.superClass.prototype[t].apply(e,n)}function $o(e,t,n){return this.superClass.prototype[t].apply(e,n)}function es(e){var t={};e.registerClass=function(e){var r=e.type||e.prototype.type;if(r){Go(r),e.prototype.type=r;var i=Wo(r);if(!i.sub)t[i.main]=e;else if(i.sub!==Ho){var a=n(i);a[i.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[Ho]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=Wo(e),r=[],i=t[n.main];return i&&i[Ho]?U(i,function(e,t){t!==Ho&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[Wo(e).main]},e.getAllClassMainTypes=function(){var e=[];return U(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[Wo(e).main];return n&&n[Ho]};function n(e){var n=t[e.main];return(!n||!n[Ho])&&(n=t[e.main]={},n[Ho]=!0),n}}function ts(e,t){for(var n=0;n=0||i&&to(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var ns=ts([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),rs=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return ns(this,e,t)},e}(),is=function(){function e(e){this.value=e}return e}(),as=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new is(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),os=function(){function e(e){this._list=new as,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new is(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),ss=new os(50);function cs(e){if(typeof e==`string`){var t=ss.get(e);return t&&t.image}return e}function ls(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=ss.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!ds(t)&&a.pending.push(o)):(t=Ia.loadImage(e,us,us),t.__zrImageSrc=e,ss.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}function us(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;tu||d>f||p>m||h>g)return!1;var _=!(u=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){ec(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n){e!==t&&ec(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Ws.x=Ks.x=t.x,Ws.y=qs.y=t.y,Gs.x=qs.x=t.x+t.width,Gs.y=Ks.y=t.y+t.height,Ws.transform(n),qs.transform(n),Gs.transform(n),Ks.transform(n),e.x=zs(Ws.x,Gs.x,Ks.x,qs.x),e.y=zs(Ws.y,Gs.y,Ks.y,qs.y);var s=Bs(Ws.x,Gs.x,Ks.x,qs.x),c=Bs(Ws.y,Gs.y,Ks.y,qs.y);e.width=s-e.x,e.height=c-e.y},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=ps(e||[]),gs(e,e,Cs(oc,-t.x,-t.y)),vs(e,e,Cs(oc,r,i)),gs(e,e,Cs(oc,n.x,n.y)),e},e}(),Qs=Z.create,$s=Z.set,ec=Z.copy,tc=Z.calculateTransform,nc=Z.applyTransform,rc=Z.contain,ic=new Z(0,0,0,0),ac=new Z(0,0,0,0),oc=[];function sc(e,t,n,r,i,a,o,s){var c=Vs(t-n),l=Vs(r-e),u=zs(c,l),d=Hs[i],f=Hs[1-i],p=Us[i];t=l||!Js.bidirectional)&&(Ys[d]=-l,Ys[f]=0,Js.useDir&&Js.calcDirMTV())))}function cc(){var e=0,t=new Rs,n=new Rs,r={minTv:new Rs,maxTv:new Rs,useDir:!1,dirMinTv:new Rs,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=Bs(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=r.minTv,o=r.dirMinTv,s=a.y*a.y+a.x*a.x,c=Math.sin(e),l=Math.cos(e),u=c*a.y+l*a.x;if(i(u)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(n.x=s*l/u,n.y=s*c/u,i(n.x)&&i(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()=pc)){e||=`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=Ia.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?fc=pc:i>2&&fc++,t}}var fc=0,pc=5;function mc(e,t){return e.asciiWidthMapTried||=(e.asciiWidthMap=dc(e.font),!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function hc(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=Ia.measureText(t,e.font).width,n.put(t,r)),r}function gc(e,t,n,r){var i=hc(lc(t),e),a=bc(t);return new Z(vc(0,i,n),yc(0,a,r),i,a)}function _c(e,t,n,r){var i=((e||``)+``).split(` -`);if(i.length===1)return gc(i[0],t,n,r);for(var a=new Z(0,0,0,0),o=0;o=0?parseFloat(e)/100*t:parseFloat(e):e}function Sc(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=xc(r[0],n.width),l+=xc(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`}return e||={},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var Cc=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function wc(e,t,n,r,i,a){if(!n){e.text=``,e.isTruncated=!1;return}var o=(t+``).split(` -`);a=Tc(n,r,i,a);for(var s=!1,c={},l=0,u=o.length;l=s;l++)c-=s;var u=hc(o,n);return u>c&&(n=``,u=0),c=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=c,i.containerWidth=e,i}function Ec(e,t,n){var r=n.containerWidth,i=n.contentWidth,a=n.fontMeasureInfo;if(!r){e.textLine=``,e.isTruncated=!1;return}var o=hc(a,t);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=n.maxIterations){t+=n.ellipsis;break}var c=s===0?Dc(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,c),o=hc(a,t)}t===``&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function Dc(e,t,n){for(var r=0,i=0,a=e.length;ig&&p){var y=Math.floor(g/f);m||=_.length>y,_=_.slice(0,y),v=_.length*f}if(i&&u&&h!=null)for(var b=Tc(h,l,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),x={},S=0;S<_.length;S++)Ec(x,_[S],b),_[S]=x.textLine,m||=x.isTruncated;for(var C=g,w=0,T=lc(l),S=0;S<_.length;S++)w=Math.max(hc(T,_[S]),w);h??=w;var E=h;return C+=c,E+=s,{lines:_,height:g,outerWidth:E,outerHeight:C,lineHeight:f,calculatedLineHeight:d,contentWidth:w,contentHeight:v,width:h,isTruncated:m}}var kc=function(){function e(){}return e}(),Ac=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),jc=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function Mc(e,t,n,r,i){var a=new jc,o=Vc(e);if(!o)return a;var s=t.padding,c=s?s[1]+s[3]:0,l=s?s[0]+s[2]:0,u=t.width;u==null&&n!=null&&(u=n-c);var d=t.height;d==null&&r!=null&&(d=r-l);for(var f=t.overflow,p=(f===`break`||f===`breakAll`)&&u!=null?{width:u,accumWidth:0,breakAll:f===`breakAll`}:null,m=Cc.lastIndex=0,h;(h=Cc.exec(o))!=null;){var g=h.index;g>m&&Nc(a,o.substring(m,g),t,p),Nc(a,h[2],t,p,h[1]),m=Cc.lastIndex}md){var ne=a.lines.length;O>0?(T.tokens=T.tokens.slice(0,O),C(T,D,E),a.lines=a.lines.slice(0,w+1)):a.lines=a.lines.slice(0,w),a.isTruncated=a.isTruncated||a.lines.length0&&m+r.accumWidth>r.width&&(u=t.split(` -`),l=!0),r.accumWidth=m}else{var h=Lc(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=h.accumWidth+p,d=h.linesWidths,u=h.lines}}u||=t.split(` -`);for(var g=lc(c),_=0;_=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Fc=ao(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{});function Ic(e){return!Pc(e)||!!Fc[e]}function Lc(e,t,n,r,i){for(var a=[],o=[],s=``,c=``,l=0,u=0,d=lc(t),f=0;fn:i+u+m>n){u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m));continue}u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p)}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function Rc(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;Z.set(zc,vc(n,o,i),yc(r,s,a),o,s),Z.intersect(t,zc,null,Bc);var c=Bc.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=vc(c.x,c.width,i,!0),e.baseY=yc(c.y,c.height,a,!0)}}var zc=new Z(0,0,0,0),Bc={outIntersectRect:{},clamp:!0};function Vc(e){return e==null?e=``:e+=``}function Hc(e){var t=Vc(e.text),n=e.font;return Uc(e,hc(lc(n),t),bc(n),null)}function Uc(e,t,n,r){var i=new Z(vc(e.x||0,t,e.textAlign),yc(e.y||0,n,e.textBaseline),t,n),a=r??(Wc(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Wc(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}var Gc=ps,Kc=5e-5;function qc(e){return e>Kc||e<-Kc}var Jc=[],Yc=[],Xc=fs(),Zc=Math.abs,Qc=function(){function e(){}return e.prototype.getLocalTransform=function(e){return $c(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return qc(this.rotation)||qc(this.x)||qc(this.y)||qc(this.scaleX-1)||qc(this.scaleY-1)||qc(this.skewX)||qc(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(Gc(n),this.invTransform=null);return}n||=fs(),t?this.getLocalTransform(n):Gc(n),e&&(t?hs(n,e,n):ms(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||fs(),ys(this.invTransform,n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Jc);var n=Jc[0]<0?-1:1,r=Jc[1]<0?-1:1,i=((Jc[0]-n)*t+n)/Jc[0]||0,a=((Jc[1]-r)*t+r)/Jc[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||fs(),hs(Yc,e.invTransform,t),t=Yc);var n=this.originX,r=this.originY;(n||r)&&(Xc[4]=n,Xc[5]=r,hs(Yc,t,Xc),Yc[4]-=n,Yc[5]-=r,t=Yc),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Fs(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Fs(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&Zc(e[0]-1)>1e-10&&Zc(e[3]-1)>1e-10?Math.sqrt(Zc(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){nl(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&_s(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),$c=Qc.getLocalTransform;function el(){return new Qc}var tl=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function nl(e,t){return $a(e,t,tl)}var rl={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-rl.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?rl.bounceIn(e*2)*.5:rl.bounceOut(e*2-1)*.5+.5}},il=Math.pow,al=Math.sqrt,ol=1e-8,sl=1e-4,cl=al(3),ll=1/3,ul=bs(),dl=bs(),fl=bs();function pl(e){return e>-ol&&eol||e<-ol}function hl(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function gl(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function _l(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(pl(u)&&pl(d)){if(pl(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(pl(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=al(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-il(-y,ll):il(y,ll),b=b<0?-il(-b,ll):il(b,ll);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*al(u*u*u)),S=Math.acos(x)/3,C=al(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+cl*Math.sin(S)))/(3*o),T=(-s+C*(w-cl*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function vl(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(pl(o)){if(ml(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(pl(u))i[0]=-a/(2*o);else if(u>0){var d=al(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function yl(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function bl(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;ul[0]=c,ul[1]=l;for(var v=0;v<1;v+=.05)dl[0]=hl(e,n,i,o,v),dl[1]=hl(t,r,a,s,v),g=Ps(ul,dl),g=0&&g=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(pl(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=al(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Tl(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function El(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function Dl(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;ul[0]=o,ul[1]=s;for(var f=0;f<1;f+=.05){dl[0]=Sl(e,n,i,f),dl[1]=Sl(t,r,a,f);var p=Ps(ul,dl);p=0&&p=1?1:_l(0,r,a,1,e,s)&&hl(0,i,o,1,s[0])}}}var jl=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Io,this.ondestroy=e.ondestroy||Io,this.onrestart=e.onrestart||Io,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=K(e)?e:rl[e]||Al(e)},e}(),Ml={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Nl(e){return e=Math.round(e),e<0?0:e>255?255:e}function Pl(e){return e=Math.round(e),e<0?0:e>360?360:e}function Fl(e){return e<0?0:e>1?1:e}function Il(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Nl(parseFloat(t)/100*255):Nl(parseInt(t,10))}function Ll(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Fl(parseFloat(t)/100):Fl(parseFloat(t))}function Rl(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function zl(e,t,n){return e+(t-e)*n}function Bl(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Vl(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Hl=new os(20),Ul=null;function Wl(e,t){Ul&&Vl(Ul,t),Ul=Hl.put(e,Ul||t.slice())}function Gl(e,t){if(e){t||=[];var n=Hl.get(e);if(n)return Vl(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in Ml)return Vl(t,Ml[r]),Wl(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){Bl(t,0,0,0,1);return}return Bl(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),Wl(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){Bl(t,0,0,0,1);return}return Bl(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),Wl(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?Bl(t,+l[0],+l[1],+l[2],1):Bl(t,0,0,0,1);u=Ll(l.pop());case`rgb`:if(l.length>=3)return Bl(t,Il(l[0]),Il(l[1]),Il(l[2]),l.length===3?u:Ll(l[3])),Wl(e,t),t;Bl(t,0,0,0,1);return;case`hsla`:if(l.length!==4){Bl(t,0,0,0,1);return}return l[3]=Ll(l[3]),Kl(l,t),Wl(e,t),t;case`hsl`:if(l.length!==3){Bl(t,0,0,0,1);return}return Kl(l,t),Wl(e,t),t;default:return}}Bl(t,0,0,0,1)}}function Kl(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Ll(e[1]),i=Ll(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],Bl(t,Nl(Rl(o,a,n+1/3)*255),Nl(Rl(o,a,n)*255),Nl(Rl(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function ql(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function Jl(e,t){var n=Gl(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return $l(n,n.length===4?`rgba`:`rgb`)}}function Yl(e,t,n){if(t&&t.length&&e>=0&&e<=1){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Nl(zl(o[0],s[0],c)),n[1]=Nl(zl(o[1],s[1],c)),n[2]=Nl(zl(o[2],s[2],c)),n[3]=Fl(zl(o[3],s[3],c)),n}}function Xl(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=Gl(t[i]),s=Gl(t[a]),c=r-i,l=$l([Nl(zl(o[0],s[0],c)),Nl(zl(o[1],s[1],c)),Nl(zl(o[2],s[2],c)),Fl(zl(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function Zl(e,t,n,r){var i=Gl(e);if(e)return i=ql(i),t!=null&&(i[0]=Pl(K(t)?t(i[0]):t)),n!=null&&(i[1]=Ll(K(n)?n(i[1]):n)),r!=null&&(i[2]=Ll(K(r)?r(i[2]):r)),$l(Kl(i),`rgba`)}function Ql(e,t){var n=Gl(e);if(n&&t!=null)return n[3]=Fl(t),$l(n,`rgba`)}function $l(e,t){if(e&&e.length){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function eu(e,t){var n=Gl(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var tu=new os(100);function nu(e){if(q(e)){var t=tu.get(e);return t||(t=Jl(e,-.1),tu.put(e,t)),t}if(vo(e)){var n=H({},e);return n.colorStops=W(e.colorStops,function(e){return{offset:e.offset,color:Jl(e.color,-.1)}}),n}return e}var ru=Math.round;function iu(e){var t;if(!e||e===`transparent`)e=`none`;else if(typeof e==`string`&&e.indexOf(`rgba`)>-1){var n=Gl(e);n&&(e=`rgb(`+n[0]+`,`+n[1]+`,`+n[2]+`)`,t=n[3])}return{color:e,opacity:t??1}}var au=1e-4;function ou(e){return e-au}function su(e){return ru(e*1e3)/1e3}function cu(e){return ru(e*1e4)/1e4}function lu(e){return`matrix(`+su(e[0])+`,`+su(e[1])+`,`+su(e[2])+`,`+su(e[3])+`,`+cu(e[4])+`,`+cu(e[5])+`)`}var uu={left:`start`,right:`end`,center:`middle`,middle:`middle`};function du(e,t,n){return n===`top`?e+=t/2:n===`bottom`&&(e-=t/2),e}function fu(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function pu(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(`,`)}function mu(e){return e&&!!e.image}function hu(e){return e&&!!e.svgElement}function gu(e){return mu(e)||hu(e)}function _u(e){return e.type===`linear`}function vu(e){return e.type===`radial`}function yu(e){return e&&(e.type===`linear`||e.type===`radial`)}function bu(e){return`url(#`+e+`)`}function xu(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Su(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*Lo,i=Y(e.scaleX,1),a=Y(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,c=[];return(t||n)&&c.push(`translate(`+t+`px,`+n+`px)`),r&&c.push(`rotate(`+r+`)`),(i!==1||a!==1)&&c.push(`scale(`+i+`,`+a+`)`),(o||s)&&c.push(`skew(`+ru(o*Lo)+`deg, `+ru(s*Lo)+`deg)`),c.join(` `)}var Cu=(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})(),wu=Array.prototype.slice;function Tu(e,t,n){return(t-e)*n+e}function Eu(e,t,n,r){for(var i=t.length,a=0;ar?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so)r.length=o;else for(var s=a;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Vu,s=t;if(io(t)){var c=Pu(t);o=c,(c===1&&!mo(t[0])||c===2&&!mo(t[0][0]))&&(a=!0)}else if(mo(t)&&!yo(t))o=Fu;else if(q(t)){if(!isNaN(+t))o=Fu;else{var l=Gl(t);l&&(s=l,o=Ru)}}else if(vo(t)){var u=H({},s);u.colorStops=W(t.colorStops,function(e){return{offset:e.offset,color:Gl(e.color)}}),_u(t)?o=zu:vu(t)&&(o=Bu),s=u}i===0?this.valType=o:(o!==this.valType||o===Vu)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=K(n)?n:rl[n]||Al(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=Uu(r),c=Hu(r),l=0;l=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;lt);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Wu:e[s];if((Uu(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(Uu(i))i===Iu?Eu(g,f[r],p[r],h):Du(g,f[r],p[r],h);else if(Hu(i)){var _=f[r],v=p[r],y=i===zu;e[s]={type:y?`linear`:`radial`,x:Tu(_.x,v.x,h),y:Tu(_.y,v.y,h),colorStops:W(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:Tu(e.offset,n.offset,h),color:Nu(Eu([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=Tu(_.x2,v.x2,h),e[s].y2=Tu(_.y2,v.y2,h)):e[s].r=Tu(_.r,v.r,h)}else if(c)Eu(g,f[r],p[r],h),n||(e[s]=Nu(g));else{var b=Tu(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===Fu?e[n]=e[n]+r:t===Ru?(Gl(e[n],Wu),Ou(Wu,Wu,r,1),e[n]=Nu(Wu)):t===Iu?Ou(e[n],e[n],r,1):t===Lu&&ku(e[n],e[n],r,1)},e}(),Ku=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){Za(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,co(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a0&&s.addKeyframe(0,Mu(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Mu(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),qu=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Qu:Zu},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&Gl(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,$l(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},H(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(J(e))for(var n=co(e),r=0;r0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(ed,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===ed;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(to(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){Za(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=this._textContent,l=md(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,gd(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=to(r,e),a=to(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b0}var _d=`__zr_style_`+Math.round(Math.random()*10),vd={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},yd={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};vd[_d]=!0;var bd=[`z`,`z2`,`invisible`],xd=[`invisible`],Sd=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=co(t),r=0;r1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(jd[0]=kd(i)*n+e,jd[1]=Od(i)*r+t,Md[0]=kd(a)*n+e,Md[1]=Od(a)*r+t,l(s,jd,Md),u(c,jd,Md),i%=Ad,i<0&&(i+=Ad),a%=Ad,a<0&&(a+=Ad),i>a&&!o?a+=Ad:ii&&(Nd[0]=kd(p)*n+e,Nd[1]=Od(p)*r+t,l(s,Nd,s),u(c,Nd,c))}var Vd={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Hd=[],Ud=[],Wd=[],Gd=[],Kd=[],qd=[],Jd=Math.min,Yd=Math.max,Xd=Math.cos,Zd=Math.sin,Qd=Math.abs,$d=Math.PI,ef=$d*2,tf=typeof Float32Array<`u`,nf=[];function rf(e){return Math.round(e/$d*1e8)/1e8%2*$d}function af(e,t){var n=rf(e[0]);n<0&&(n+=ef);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=ef?i=n+ef:t&&n-i>=ef?i=n-ef:!t&&n>i?i=n+(ef-rf(n-i)):t&&n0&&(this._ux=Qd(n/Yu/e)||0,this._uy=Qd(n/Yu/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Vd.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=Qd(e-this._xi),r=Qd(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Vd.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Vd.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Vd.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),nf[0]=r,nf[1]=i,af(nf,a),r=nf[0],i=nf[1];var o=i-r;return this.addData(Vd.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=Xd(i)*n+e,this._yi=Zd(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Vd.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Vd.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&tf&&(this.data=new Float32Array(t));for(var n=0;n0&&a))for(var o=0;ol.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){Wd[0]=Wd[1]=Kd[0]=Kd[1]=Number.MAX_VALUE,Gd[0]=Gd[1]=qd[0]=qd[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;an||Qd(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Vd.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=xl(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Vd.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Ol(i,a,y,b,h,g,10),i=h,a=g;break;case Vd.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=Xd(D)*T+C,s=Zd(D)*E+w),m=Yd(T,E)*Jd(ef,Math.abs(O)),i=Xd(k)*T+C,a=Zd(k)*E+w;break;case Vd.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Vd.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x0&&(e.lineTo(y,b),v=0),S){case Vd.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Vd.L:u=n[x++],d=n[x++];var w=Qd(u-c),T=Qd(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Vd.C:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++],M=n[x++],te=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;yl(c,k,j,M,D,Hd),yl(l,A,ee,te,D,Ud),e.bezierCurveTo(Hd[1],Ud[1],Hd[2],Ud[2],Hd[3],Ud[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,ee,M,te),c=M,l=te;break;case Vd.Q:var k=n[x++],A=n[x++],j=n[x++],ee=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;El(c,k,j,D,Hd),El(l,A,ee,D,Ud),e.quadraticCurveTo(Hd[1],Ud[1],Hd[2],Ud[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,ee),c=j,l=ee;break;case Vd.A:var ne=n[x++],N=n[x++],P=n[x++],re=n[x++],ie=n[x++],ae=n[x++],oe=n[x++],se=!n[x++],ce=P>re?P:re,le=Qd(P-re)>.001,F=ie+ae,I=!1;if(f){var E=p[g++];h+E>_&&(F=ie+ae*(_-h)/E,I=!0),h+=E}if(le&&e.ellipse?e.ellipse(ne,N,P,re,oe,ie,F,se):e.arc(ne,N,ce,ie,F,se),I)break lo;C&&(o=Xd(ie)*P+ne,s=Zd(ie)*re+N),c=Xd(F)*P+ne,l=Zd(F)*re+N;break;case Vd.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var L=n[x++],ue=n[x++];if(f){var E=p[g++];if(h+E>_){var de=_-h;e.moveTo(u,d),e.lineTo(u+Jd(de,L),d),de-=L,de>0&&e.lineTo(u+L,d+Jd(de,ue)),de-=ue,de>0&&e.lineTo(u+Yd(L-de,0),d+ue),de-=L,de>0&&e.lineTo(u,d+Yd(ue-de,0));break lo}h+=E}e.rect(u,d,L,ue);break;case Vd.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Vd,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function sf(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||at+d&&u>r+d&&u>a+d&&u>s+d||ue+d&&l>n+d&&l>i+d&&l>o+d||lt+l&&c>r+l&&c>a+l||ce+l&&s>n+l&&s>i+l||sn||u+li&&(i+=ff);var f=Math.atan2(c,s);return f<0&&(f+=ff),f>=r&&f<=i||f+ff>=r&&f+ff<=i}function mf(e,t,n,r,i,a){if(a>t&&a>r||ai?s:0}var hf=of.CMD,gf=Math.PI*2,_f=1e-4;function vf(e,t){return Math.abs(e-t)<_f}var yf=[-1,-1,-1],bf=[-1,-1];function xf(){var e=bf[0];bf[0]=bf[1],bf[1]=e}function Sf(e,t,n,r,i,a,o,s,c,l){if(l>t&&l>r&&l>a&&l>s||l1&&xf(),p=hl(t,r,a,s,bf[0]),f>1&&(m=hl(t,r,a,s,bf[1]))),f===2?gt&&s>r&&s>a||s=0&&l<=1){for(var u=0,d=Sl(t,r,a,l),f=0;fn||s<-n)return 0;var c=Math.sqrt(n*n-s*s);yf[0]=-c,yf[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=gf-1e-4){r=0,i=gf;var u=a?1:-1;return o>=yf[0]+e&&o<=yf[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=gf,i+=gf);for(var f=0,p=0;p<2;p++){var m=yf[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=gf+h),(h>=r&&h<=i||h+gf>=r&&h+gf<=i)&&(h>Math.PI/2&&h1&&(n||(s+=mf(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case hf.M:u=a[m++],d=a[m++],c=u,l=d;break;case hf.L:if(n){if(sf(c,l,a[m],a[m+1],t,r,i))return!0}else s+=mf(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case hf.C:if(n){if(cf(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=Sf(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case hf.Q:if(n){if(lf(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=Cf(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case hf.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=mf(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(pf(_,v,b,x,x+S,C,t,w,i))return!0}else s+=wf(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case hf.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(sf(u,d,f,d,t,r,i)||sf(f,d,f,p,t,r,i)||sf(f,p,u,p,t,r,i)||sf(u,p,u,d,t,r,i))return!0}else s+=mf(f,d,f,p,r,i),s+=mf(u,p,u,d,r,i);break;case hf.Z:if(n){if(sf(c,l,u,d,t,r,i))return!0}else s+=mf(c,l,u,d,r,i);c=u,l=d}}return!n&&!vf(l,d)&&(s+=mf(c,l,u,d,r,i)||0),s!==0}function Ef(e,t,n){return Tf(e,0,!1,t,n)}function Df(e,t,n,r){return Tf(e,t,!0,n,r)}var Of=eo({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},vd),kf={style:eo({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},yd.style)},Af=tl.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),jf=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Zu:t>.2?$u:Qu}if(e)return Qu}return Zu},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(q(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==eu(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new of(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),Df(a,o/s,e,t)))return!0}if(this.hasFill())return Ef(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:H(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return Po(Of,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=H({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=H({},r.shape),H(c,n.shape)):(c=H({},i?this.shape:r.shape),H(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=H({},this.shape);for(var l={},u=co(c),d=0;di&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5),e.closePath()}var zf=Math.round;function Bf(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(zf(r*2)===zf(i*2)&&(e.x1=e.x2=Hf(r,s,!0)),zf(a*2)===zf(o*2)&&(e.y1=e.y2=Hf(a,s,!0)),e):e}}function Vf(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=Hf(r,s,!0),e.y=Hf(i,s,!0),e.width=Math.max(Hf(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Hf(i+o,s,!1)-e.y,o===0?0:1),e):e}}function Hf(e,t,n){if(!t)return e;var r=zf(e*2);return(r+zf(t))%2==0?r/2:(r+(n?1:-1))/2}var Uf=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),Wf={},Gf=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Uf},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=Vf(Wf,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?Rf(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(jf);Gf.prototype.type=`rect`;var Kf={fill:`#000`},qf=2,Jf={},Yf={style:eo({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},yd.style)},Xf=function(e){B(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=Kf,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,T=0;T=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&lp(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=sp(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(Nf),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=op(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=ap(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=qf,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=xo(s.opacity,t.opacity,1),tp(p,s),y&&(p.lineWidth=xo(s.lineWidth,t.lineWidth,g),p.lineDash=Y(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(Uc(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(Gf),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=Y(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(Lf),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=Y(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=xo(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return np(e)&&(t=[e.fontStyle,e.fontWeight,ep(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&To(t)||e.textFont||e.font},t}(Sd),Zf={left:!0,right:1,center:1},Qf={top:1,bottom:1,middle:1},$f=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function ep(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function tp(e,t){for(var n=0;n<$f.length;n++){var r=$f[n],i=t[r];i!=null&&(e[r]=i)}}function np(e){return e.fontSize!=null||e.fontFamily||e.fontWeight}function rp(e){return ip(e),U(e.rich,ip),e}function ip(e){if(e){e.font=Xf.makeFont(e);var t=e.align;t===`middle`&&(t=`center`),e.align=t==null||Zf[t]?t:`left`;var n=e.verticalAlign;n===`center`&&(n=`middle`),e.verticalAlign=n==null||Qf[n]?n:`top`,e.padding&&=Co(e.padding)}}function ap(e,t){return e==null||t<=0||e===`transparent`||e===`none`?null:e.image||e.colorStops?`#000`:e}function op(e){return e==null||e===`none`?null:e.image||e.colorStops?`#000`:e}function sp(e,t,n){return t===`right`?e-n[1]:t===`center`?e+n[3]/2-n[1]/2:e+n[3]}function cp(e){var t=e.text;return t!=null&&(t+=``),t}function lp(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var up=1e-4,dp=20;function fp(e){return e.replace(/^\s+|\s+$/g,``)}var pp=Math.min,mp=Math.max,hp=Math.abs,gp=Math.round,_p=Math.floor,vp=Math.ceil,yp=Math.pow,bp=Math.log,xp=Math.LN10,Sp=Math.PI,Cp=Math.random;function wp(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var Tp=Ep;function Ep(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return Dp(e,t,n)}function Dp(e,t,n){return q(e)?kp(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function Op(e){return q(e)&&kp(e)}function kp(e){return!!fp(e).match(/%$/)}function Ap(e,t,n){return isNaN(t)?n?``+e:+e:(t=pp(mp(0,t),dp),e=(+e).toFixed(t),n?e:+e)}function jp(e){return e.sort(function(e,t){return e-t}),e}function Mp(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(gp(e*t)/t===e)return n}return Np(e)}function Np(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return mp(0,(a<0?0:i-1-a)-r)}function Pp(e,t,n){var r=hp(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=bp(2*hp(n||1)*hp(r))/xp,a=bp(hp(t))/xp,o=mp(0,vp(-i+a));return isFinite(o)||(o=NaN),o}function Fp(e,t){var n=mp(Mp(e),Mp(t)),r=e+t;return n>dp?r:Ap(r,n)}var Ip=yp(2,53)-1;function Lp(e){var t=Sp*2;return(e%t+t)%t}function Rp(e){return e>-up&&e=10&&t++,t}function Up(e,t){var n=Hp(e),r=yp(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,Ap(e,-n)}function Wp(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})();function Rm(){return[1/0,-1/0]}function zm(e,t){Um(t)&&(te[1]&&(e[1]=t))}function Bm(e,t){Um(t)&&te[1]&&(e[1]=t)}function Hm(e,t){Wm(t[0],t[1])&&(t[0]e[1]&&(e[1]=t[1]))}function Um(e){return e!=null&&isFinite(e)}function Wm(e,t){return Um(e)&&Um(t)&&e<=t}function Gm(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function Km(e){Wm(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function qm(){var e=`__ec_once_`+Jm++;return function(t,n){Fo(t,e)||(t[e]=1,n())}}var Jm=qp();function Ym(e,t,n){var r=X(),i=0;U(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function Xm(e){return e.value+``}function Zm(e){return e+``}function Qm(e,t){return Y(t,!0)?e.seriesIndex+2:0}function $m(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function eh(e,t){return{seriesType:e,overallReset:t}}function th(e){return{overallReset:e}}var nh=Dm(),rh=function(e,t,n,r){if(r){var i=nh(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType=`chart`,r.type===`group`&&r.traverse(function(r){var i=nh(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType=`chart`})}},ih=`series`,ah=X([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),oh=`original`,sh=`arrayRows`,ch=`objectRows`,lh=`keyedColumns`,uh=`typedArray`,dh=`unknown`,fh=`column`,ph=`Roam`,mh=[`getDom`,`getZr`,`getWidth`,`getHeight`,`getDevicePixelRatio`,`dispatchAction`,`isSSR`,`isDisposed`,`on`,`off`,`getDataURL`,`getConnectedDataURL`,`getOption`,`getId`,`updateLabelLayout`],hh=function(){function e(e){U(mh,function(t){this[t]=uo(e[t],e)},this)}return e}();function gh(e,t){return t.mainType===`series`?e.getViewOfSeriesModel(t):e.getViewOfComponentModel(t)}var _h=1,vh={},yh=Dm(),bh=Dm(),xh=[`emphasis`,`blur`,`select`],Sh=[`normal`,`emphasis`,`blur`,`select`],Ch=`highlight`,wh=`downplay`,Th=`select`,Eh=`unselect`,Dh=`toggleSelect`,Oh=`selectchanged`;function kh(e){return e!=null&&e!==`none`}function Ah(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function jh(e){Ah(e,`emphasis`,2)}function Mh(e){e.hoverState===2&&Ah(e,`normal`,0)}function Nh(e){Ah(e,`blur`,1)}function Ph(e){e.hoverState===1&&Ah(e,`normal`,0)}function Fh(e){e.selected=!0}function Ih(e){e.selected=!1}function Lh(e,t,n){t(e,n)}function Rh(e,t,n){Lh(e,t,n),e.isGroup&&e.traverse(function(e){Lh(e,t,n)})}function zh(e,t){switch(t){case`emphasis`:e.hoverState=2;break;case`normal`:e.hoverState=0;break;case`blur`:e.hoverState=1;break;case`select`:e.selected=!0}}function Bh(e,t,n,r){for(var i=e.style,a={},o=0;o=0,a=!1;if(e instanceof jf){var o=yh(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(kh(s)||kh(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=H({},r),l=H({},l),l.fill=s):!kh(l.fill)&&kh(s)?(a=!0,r=H({},r),l=H({},l),l.fill=nu(s)):!kh(l.stroke)&&kh(c)&&(a||(r=H({},r),l=H({},l)),l.stroke=nu(c)),r.style=l}}if(r&&r.z2==null){a||(r=H({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function Hh(e,t,n){if(n&&n.z2==null){n=H({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Uh(e,t,n){var r=to(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Bh(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=H({},n),o=H({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Wh(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Vh(this,e,t,n);if(e===`blur`)return Uh(this,e,n);if(e===`select`)return Hh(this,e,n)}return n}function Gh(e){e.stateProxy=Wh;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Wh),n&&(n.stateProxy=Wh)}function Kh(e,t){!eg(e,t)&&!e.__highByOuter&&Rh(e,jh)}function qh(e,t){!eg(e,t)&&!e.__highByOuter&&Rh(e,Mh)}function Jh(e,t){e.__highByOuter|=1<<(t||0),Rh(e,jh)}function Yh(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Rh(e,Mh)}function Xh(e){Rh(e,Nh)}function Zh(e){Rh(e,Ph)}function Qh(e){Rh(e,Fh)}function $h(e){Rh(e,Ih)}function eg(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function tg(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=bh(i),o=gh(e,i),s=t===`series`;!s&&r.push(o),a.isBlured&&(o.group.traverse(function(e){Ph(e)}),s&&n.push(i)),a.isBlured=!1}),U(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function ng(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function dg(e,t,n){vg(e,!0),Rh(e,Gh),mg(e,t,n)}function fg(e){vg(e,!1)}function pg(e,t,n,r){r?fg(e):dg(e,t,n)}function mg(e,t,n){var r=nh(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var hg=[`emphasis`,`blur`,`select`],gg={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function _g(e,t,n,r){n||=`itemStyle`;for(var i=0;i1&&(o*=kg(m),s*=kg(m));var h=(i===a?-1:1)*kg((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+jg(d)*g-Ag(d)*_,y=(t+r)/2+Ag(d)*g+jg(d)*_,b=Fg([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Fg(x,S);if(Pg(x,S)<=-1&&(C=Mg),Pg(x,S)>=1&&(C=0),C<0){var w=Math.round(C/Mg*1e6)/1e6;C=Mg*2+w%2*Mg}u.addData(l,v,y,o,s,b,C,d,a)}var Lg=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Rg=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function zg(e){var t=new of;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=of.CMD,c=e.match(Lg);if(!c)return t;for(var l=0;l=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=to(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=to(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nA*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function u_(e){var t;if(G(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function d_(e,t){var n,r=a_(t.r,0),i=a_(t.r0||0,0),a=r>0;if(a||i>0){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=r_(c-s),p=f>Qg&&f%Qg;if(p>s_&&(f=p),!(r>s_))e.moveTo(l,u);else if(f>Qg-s_)e.moveTo(l+r*e_(s),u+r*$g(s)),e.arc(l,u,r,s,c,!d),i>s_&&(e.moveTo(l+i*e_(c),u+i*$g(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*e_(s),j=r*$g(s),ee=i*e_(c),M=i*$g(c),te=f>s_;if(te){var ne=t.cornerRadius;ne&&(n=u_(ne),m=n[0],h=n[1],g=n[2],_=n[3]);var N=r_(r-i)/2;if(v=o_(N,g),y=o_(N,_),b=o_(N,m),x=o_(N,h),w=S=a_(v,y),T=C=a_(b,x),(S>s_||C>s_)&&(E=r*e_(c),D=r*$g(c),O=i*e_(s),k=i*$g(s),fs_){var le=o_(g,w),F=o_(_,w),I=l_(O,k,A,j,r,le,d),L=l_(E,D,ee,M,r,F,d);e.moveTo(l+I.cx+I.x0,u+I.cy+I.y0),w0&&e.arc(l+I.cx,u+I.cy,le,n_(I.y0,I.x0),n_(I.y1,I.x1),!d),e.arc(l,u,r,n_(I.cy+I.y1,I.cx+I.x1),n_(L.cy+L.y1,L.cx+L.x1),!d),F>0&&e.arc(l+L.cx,u+L.cy,F,n_(L.y1,L.x1),n_(L.y0,L.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>s_)||!te)e.lineTo(l+ee,u+M);else if(T>s_){var le=o_(m,T),F=o_(h,T),I=l_(ee,M,E,D,i,-F,d),L=l_(A,j,O,k,i,-le,d);e.lineTo(l+I.cx+I.x0,u+I.cy+I.y0),T0&&e.arc(l+I.cx,u+I.cy,F,n_(I.y0,I.x0),n_(I.y1,I.x1),!d),e.arc(l,u,i,n_(I.cy+I.y1,I.cx+I.x1),n_(L.cy+L.y1,L.cx+L.x1),d),le>0&&e.arc(l+L.cx,u+L.cy,le,n_(L.y1,L.x1),n_(L.y0,L.x0),!d))}else e.lineTo(l+ee,u+M),e.arc(l,u,i,c,s,d)}e.closePath()}}}var f_=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),p_=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new f_},t.prototype.buildPath=function(e,t){d_(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(jf);p_.prototype.type=`sector`;var m_=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),h_=function(e){B(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new m_},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(jf);h_.prototype.type=`ring`;function g_(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f=2){if(r){var a=g_(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;sz_[1]){if(i=!1,B_.negativeSize||n)return i;var s=L_(z_[0]-R_[1]),c=L_(R_[0]-z_[1]);F_(s,c)>H_.len()&&(s=c||!B_.bidirectional)&&(Rs.scale(V_,o,-c*r),B_.useDir&&B_.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function Y_(e,t,n,r,i,a){J_(`update`,e,t,n,r,i,a)}function X_(e,t,n,r,i,a){J_(`enter`,e,t,n,r,i,a)}function Z_(e){if(!e.__zr)return!0;for(var t=0;tA_,BezierCurve:()=>O_,BoundingRect:()=>Z,Circle:()=>Jg,CompoundPath:()=>j_,Ellipse:()=>Xg,Group:()=>Kg,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>Lf,IncrementalDisplayable:()=>G_,Line:()=>w_,LinearGradient:()=>N_,OrientedBoundingRect:()=>U_,Path:()=>jf,Point:()=>Rs,Polygon:()=>y_,Polyline:()=>x_,RadialGradient:()=>P_,Rect:()=>Gf,Ring:()=>h_,Sector:()=>p_,Text:()=>Xf,WH:()=>av,XY:()=>iv,applyTransform:()=>bv,calcZ2Range:()=>Uv,clipPointsByRect:()=>Tv,clipRectByRect:()=>Ev,createIcon:()=>Dv,decomposeTransform:()=>qv,ensureCopyRect:()=>Bv,ensureCopyTransform:()=>Vv,expandOrShrinkRect:()=>Mv,extendPath:()=>cv,extendShape:()=>ov,getCurrentCanvasPainter:()=>Yv,getShapeClass:()=>uv,getTransform:()=>yv,groupTransition:()=>wv,initProps:()=>X_,isBoundingRectAxisAligned:()=>Rv,isElementRemoved:()=>Z_,lineLineIntersect:()=>kv,linePolygonIntersect:()=>Ov,makeImage:()=>fv,makePath:()=>dv,mergePath:()=>mv,payloadDisableAnimation:()=>Kv,registerShape:()=>lv,removeElement:()=>Q_,removeElementWithFadeOut:()=>ev,resizePath:()=>hv,retrieveZInfo:()=>Hv,setTooltipConfig:()=>Fv,subPixelOptimize:()=>vv,subPixelOptimizeLine:()=>gv,subPixelOptimizeRect:()=>_v,transformDirection:()=>xv,traverseElements:()=>Lv,traverseUpdateZ:()=>Wv,updateProps:()=>Y_}),rv={},iv=[`x`,`y`],av=[`width`,`height`];function ov(e){return jf.extend(e)}var sv=Wg;function cv(e,t){return sv(e,t)}function lv(e,t){rv[e]=t}function uv(e){if(rv.hasOwnProperty(e))return rv[e]}function dv(e,t,n,r){var i=Ug(e,t);return n&&(r===`center`&&(n=pv(n,i.getBoundingRect())),hv(i,n)),i}function fv(e,t,n){var r=new Lf({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(pv(t,i))}}});return r}function pv(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var mv=Gg;function hv(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function gv(e,t){return Bf(e,e,{lineWidth:t}),e}function _v(e,t){return Vf(e,e,t),e}var vv=Hf;function yv(e,t){for(var n=ps([]);e&&e!==t;)hs(n,e.getLocalTransform(),n),e=e.parent;return n}function bv(e,t,n){return t&&!io(t)&&(t=Qc.getLocalTransform(t)),n&&(t=ys([],t)),Fs([],e,t)}function xv(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:hp(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:hp(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=bv(a,t,n),hp(a[0])>hp(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function Sv(e){return!e.isGroup}function Cv(e){return e.shape!=null}function wv(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){Sv(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return Cv(e)&&(t.shape=V(e.shape)),t}var a=r(e);t.traverse(function(e){if(Sv(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),Y_(e,r,n,nh(e).dataIndex)}}})}function Tv(e,t){return W(e,function(e){var n=e[0];n=mp(n,t.x),n=pp(n,t.x+t.width);var r=e[1];return r=mp(r,t.y),r=pp(r,t.y+t.height),[n,r]})}function Ev(e,t){var n=mp(e.x,t.x),r=pp(e.x+e.width,t.x+t.width),i=mp(e.y,t.y),a=pp(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function Dv(e,t,n){var r=H({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),eo(i,n),new Lf(r)):dv(e.replace(`path://`,``),r,n,`center`)}function Ov(e,t,n,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=Av(p,m,u,d)/f;return!(g<0||g>1)}function Av(e,t,n,r){return e*r-n*t}function jv(e){return e<=1e-6&&e>=-1e-6}function Mv(e,t,n,r,i){return t==null?e:(mo(t)?Nv[0]=Nv[1]=Nv[2]=Nv[3]=t:(Nv[0]=t[0],Nv[1]=t[1],Nv[2]=t[2],Nv[3]=t[3]),r&&(Nv[0]=mp(0,Nv[0]),Nv[1]=mp(0,Nv[1]),Nv[2]=mp(0,Nv[2]),Nv[3]=mp(0,Nv[3])),n&&(Nv[0]=-Nv[0],Nv[1]=-Nv[1],Nv[2]=-Nv[2],Nv[3]=-Nv[3]),Pv(e,Nv,`x`,`width`,3,1,i&&i[0]||0),Pv(e,Nv,`y`,`height`,0,2,i&&i[1]||0),e)}var Nv=[0,0,0,0];function Pv(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=mp(0,pp(o,c)),e[r]=0?-t[i]:t[a]>=0?c+t[a]:hp(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function Fv(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=q(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&U(co(c),function(e){Fo(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=nh(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:eo({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Iv(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Lv(e,t){if(e){if(G(e))for(var n=0;nt&&(t=r),rt&&(n=t=0),{min:n,max:t}}function Wv(e,t,n){Gv(e,t,n,-1/0)}function Gv(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f1)for(var o=0;ol&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};Xy=(e={},e[sh+`_`+fh]={pure:!0,appendData:i},e[sh+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[ch]={pure:!0,appendData:i},e[lh]={pure:!0,appendData:function(e){var t=this._data;U(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[oh]={appendData:i},e[uh]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;tt},gte:function(e,t){return e>=t}};(function(){function e(e,t){mo(t)||nm(``),this._opFn=vb[e],this._rvalFloat=Gp(t)}return e.prototype.evaluate=function(e){return mo(e)?this._opFn(e,this._rvalFloat):this._opFn(Gp(e),this._rvalFloat)},e})();var yb=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=mo(e)?e:Gp(e),r=mo(t)?t:Gp(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=q(e),s=q(t);o&&(n=s?e:0),s&&(r=o?t:0)}return nr?-this._resultLT:0},e}();(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Gp(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Gp(e)===this._rvalFloat)}return this._isEQ?t:!t},e})();function bb(e){var t=``,n=-1/0,r=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+=`G`+e.g,n=e.g),e.ge!=null&&(t+=`GE`+e.ge,r=e.ge),e.l!=null&&(t+=`L`+e.l,i=e.l),e.le!=null&&(t+=`LE`+e.le,a=e.le)),{key:t,g:n,ge:r,l:i,le:a}}function xb(e,t){return t>e.g&&t>=e.ge&&t`u`?Array:Uint32Array,Cb=typeof Uint16Array>`u`?Array:Uint16Array,wb=typeof Int32Array>`u`?Array:Int32Array,Tb=typeof Float64Array>`u`?Array:Float64Array,Eb={float:Tb,int:wb,ordinal:Array,number:Array,time:Tb},Db;function Ob(e){return e>65535?Sb:Cb}function kb(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function Ab(e,t,n,r,i){var a=Eb[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;lh[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=W(a,function(e){return e.property}),l=0;lg[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;he[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return sg[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(Ob(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;fc&&(c=l,u=v)}T>0&&To&&(m=o-l);for(var h=0;hp&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);ul-p&&(s=l-p,o.length=s);for(var m=0;mu[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();id&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return _b(e[r],this._dimensions[r])}Db={arrayRows:e,objectRows:function(e,t,n,r){return _b(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return _b(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),Mb=Dm(),Nb={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},Pb=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=Lb(this.source))},e.prototype.getSourceDimensionIndex=function(e){return Y(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Gy(this.source),n=!Rb(e),r=``,i=[],a=0,o=0;a30}var zb=J,Bb=W,Vb=typeof Int32Array>`u`?Array:Int32Array,Hb=`e\0\0`,Ub=-1,Wb=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],Gb=[`_approximateExtent`],Kb,qb,Jb,Yb,Xb,Zb,Qb,$b=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Fb(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),G(i)?i=i.slice():zb(i)&&(i=H({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,zb(t)?H(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){zb(e)?H(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?H(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){rh(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){U(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:Bb(this.dimensions,this._getDimInfo,this),this.hostModel),Xb(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];K(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(So(arguments)))})},e.internalField=function(){Kb=function(e){var t=e._invertedIndicesMap;U(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new Vb(a.categories.length);for(var s=0;s1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function ex(e,t){Iy(e)||(e=Ry(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=X(),a=[],o=tx(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Rb(o),c=r===e.dimensionsDefine,l=c?Lb(e):Ib(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=X(u),f=new wb(o),p=0;p0&&(e.name+=t-1)}),new Pb({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function tx(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return U(t,function(e){var t;J(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function nx(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var rx={},ix={},ax=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n(rx,!0),this._normalMasterList=n(ix,!1);function n(n,r){var i=[];return U(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){U(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){if(e===`matrix`||e===`calendar`){rx[e]=t;return}ix[e]=t},e.get=function(e){return ix[e]||rx[e]},e}();function ox(e){return!!rx[e]}var sx=X();function cx(e){var t=e.getShallow(`coord`,!0),n=1;if(t==null){var r=sx.get(e.type);r&&r.getCoord2&&(n=2,t=r.getCoord2(e))}return{coord:t,from:n}}function lx(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=0;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=1,a||(i=0)):r===`box`&&(i=2,!a&&!ox(n)&&(i=0))}return{coordSysType:n,kind:i}}function ux(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=lx(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==1&&(o=1,s=n),o===0||s!==n)return 0;var c=r(n,t);return c?(o===1?t.coordinateSystem=c:t.boxCoordinateSystem=c,o):0}var dx=function(){function e(e){this.coordSysDims=[],this.axisMap=X(),this.categoryAxisMap=X(),this.coordSysName=e}return e}();function fx(e){var t=e.get(`coordinateSystem`),n=new dx(t),r=px[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var px={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,jm).models[0],a=e.getReferringComponents(`yAxis`,jm).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),mx(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),mx(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,jm).models[0];t.coordSysDims=[`single`],n.set(`single`,i),mx(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,jm).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),mx(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),mx(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();U(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),mx(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,jm).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}};function mx(e){return e.get(`type`)===`category`}function hx(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;gx(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f,p=!0;function m(e){return e.type!==`ordinal`&&e.type!==`time`}if(U(a,function(e,t){q(e)&&(a[t]=e={name:e}),m(e)||(p=!1)}),U(a,function(e,t){c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&m(e)&&(!p||e.coordDim!==`x`&&e.coordDim!==`angle`)&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var h=u.coordDim,g=u.type,_=0;U(a,function(e){e.coordDim===h&&_++});var v={name:d,coordDim:h,coordDimIndex:_,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:_+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,g),y.storeDimIndex=s.ensureCalculationDimension(d,g)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function gx(e){return!Fb(e.schema)}function _x(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function vx(e,t){return _x(e,t)?e.getCalculationInfo(`stackResultDimension`):t}function yx(e,t){var n=e.get(`coordinateSystem`),r=ax.get(n),i;return t&&t.coordSysDims&&(i=W(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=mb(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function bx(e,t,n){var r,i;return n&&U(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function xx(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Ry(e)):(i=r.getSource(),a=i.sourceFormat===oh);var o=fx(t),s=yx(t,o),c=n.useEncodeDefaulter,l=K(c)?c:c?fo(Ay,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=ex(i,u),f=bx(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=hx(t,{schema:d,store:p}),h=new $b(d,t);h.setCalculationInfo(m);var g=f!=null&&Sx(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function Sx(e){if(e.sourceFormat===`original`)return!G(lm(Cx(e.data||[])))}function Cx(e){for(var t=0;t=0&&n.push(e)}),n}}function kx(e,t){return Qa(Qa({},e,!0),t,!0)}var Ax=Math.log(2);function jx(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){U(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function zx(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?Mx(s,o):Mx(o,s))}function Bx(e){return e.nodeName.toUpperCase()===`CANVAS`}var Vx=/([&<>"'])/g,Hx={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Ux(e){return e==null?``:(e+``).replace(Vx,function(e,t){return Hx[t]})}var Wx={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},Gx={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},Kx=`ZH`,qx=`EN`,Jx=qx,Yx={},Xx={},Zx=zo.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||Jx).toUpperCase().indexOf(Kx)>-1?Kx:Jx}():Jx;function Qx(e,t){e=e.toUpperCase(),Xx[e]=new Cy(t),Yx[e]=t}function $x(e){if(q(e)){var t=Yx[e.toUpperCase()]||{};return e===Kx||e===qx?V(t):Qa(V(t),V(Yx[Jx]),!1)}return Qa(V(e),V(Yx[Jx]),!1)}function eS(e){return Xx[e]}function tS(){return Xx[Jx]}Qx(qx,Wx),Qx(Kx,Gx);var nS=null;function rS(){return nS}function iS(e,t){var n=rS(),r=t.breakOption,i=t.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,e)),i}function aS(e){var t=e.brk;return t?t.breaks:[]}function oS(e){var t=e.brk;return t?t.hasBreaks():!1}var sS=1e3,cS=sS*60,lS=cS*60,uS=lS*24,dS=uS*365,fS={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},pS={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},mS=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,hS=`{yyyy}-{MM}-{dd}`,gS={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:hS,hour:hS+` `+pS.hour,minute:hS+` `+pS.minute,second:hS+` `+pS.second,millisecond:mS},_S=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],vS=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function yS(e){return!q(e)&&!K(e)?bS(e):e}function bS(e){e||={};var t={},n=!0;return U(_S,function(t){n&&=e[t]==null}),U(_S,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=_S[s],l=J(a)&&!G(a)?a[c]:a,u=void 0;G(l)?(u=l.slice(),o=u[0]||``):q(l)?(o=l,u=[o]):(o==null?o=pS[r]:fS[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function xS(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function SS(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function CS(e){return e===SS(e)}function wS(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function TS(e,t,n,r){var i=Bp(e),a=i[kS(n)](),o=i[AS(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[jS(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[MS(n)](),d=(u-1)%12+1,f=i[NS(n)](),p=i[PS(n)](),m=i[FS(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof Cy?r:eS(r||Zx)||tS()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,xS(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,xS(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,xS(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,xS(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,xS(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,xS(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,xS(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,xS(m,3)).replace(/{S}/g,m+``)}function ES(e,t,n,r,i){var a=null;if(q(n))a=n;else if(K(n)){var o={time:e.time,level:e.time?e.time.level:0},s=rS();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=DS(e.value,i);a=n[u][u][0]}}return TS(new Date(e.value),a,i,r)}function DS(e,t){var n=Bp(e),r=n[AS(t)]()+1,i=n[jS(t)](),a=n[MS(t)](),o=n[NS(t)](),s=n[PS(t)](),c=n[FS(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function OS(e,t,n){switch(t){case`year`:e[LS(n)](0);case`month`:e[RS(n)](1);case`day`:e[zS(n)](0);case`hour`:e[BS(n)](0);case`minute`:e[VS(n)](0);case`second`:e[HS(n)](0)}return e}function kS(e){return e?`getUTCFullYear`:`getFullYear`}function AS(e){return e?`getUTCMonth`:`getMonth`}function jS(e){return e?`getUTCDate`:`getDate`}function MS(e){return e?`getUTCHours`:`getHours`}function NS(e){return e?`getUTCMinutes`:`getMinutes`}function PS(e){return e?`getUTCSeconds`:`getSeconds`}function FS(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function IS(e){return e?`setUTCFullYear`:`setFullYear`}function LS(e){return e?`setUTCMonth`:`setMonth`}function RS(e){return e?`setUTCDate`:`setDate`}function zS(e){return e?`setUTCHours`:`setHours`}function BS(e){return e?`setUTCMinutes`:`setMinutes`}function VS(e){return e?`setUTCSeconds`:`setSeconds`}function HS(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function US(e){if(!Kp(e))return q(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function WS(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var GS=Co;function KS(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&To(e)?e:`-`}function a(e){return Xp(e)}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?Bp(e):e;if(!isNaN(+c))return TS(c,r,n);if(s)return`-`}if(t===`ordinal`)return po(e)?i(e):mo(e)&&a(e)?e+``:`-`;var l=Gp(e);return a(l)?US(l):po(e)?i(e):typeof e==`boolean`?e+``:`-`}var qS=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],JS=function(e,t){return`{`+e+(t??``)+`}`};function YS(e,t,n){G(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a`:``:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function ZS(e,t){return t||=`transparent`,q(e)?e:J(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var QS=U,$S=[`left`,`right`,`top`,`bottom`,`width`,`height`],eC=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function tC(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var nC=tC;fo(tC,`vertical`),fo(tC,`horizontal`);function rC(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function iC(e,t,n){n=GS(n||0);var r=t.width,i=t.height,a=Tp(e.left,r),o=Tp(e.top,i),s=Tp(e.right,r),c=Tp(e.bottom,i),l=Tp(e.width,r),u=Tp(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new Z((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}function aC(e,t,n){var r=e.getShallow(`preserveAspect`,!0);if(!r)return t;var i=t.width/t.height;if(Math.abs(Math.atan(n)-Math.atan(i))<1e-9)return t;var a=e.getShallow(`preserveAspectAlign`,!0),o=e.getShallow(`preserveAspectVerticalAlign`,!0),s={width:t.width,height:t.height},c=r===`cover`;return i>n&&!c||i=u)return a;for(var d=0;d=0;o--)a=Qa(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return Mm(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return rC(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(Cy);Yo(mC,Cy),es(mC),Dx(mC),Ox(mC,hC);function hC(e){var t=[];return U(mC.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=W(t,function(e){return Wo(e).main}),e!==`dataset`&&to(t,`dataset`)<=0&&t.unshift(`dataset`),t}var gC=Dm(),_C=Dm(),vC=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=om(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return xC(this,gC,r,i,e,t,n)},e.prototype.clearColorPalette=function(){SC(this,gC)},e}();function yC(e,t,n,r){return xC(e,_C,om(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function bC(e,t){for(var n=e.length,r=0;rt)return e[r];return e[n-1]}function xC(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:bC(r,o);if(u||=n,u&&u.length){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function SC(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var CC=/\{@(.+?)\}/g,wC=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),a=n.getName(e),o=n.getRawDataItem(e),s=n.getItemVisual(e,`style`),c=s&&s[n.getItemVisual(e,`drawType`)||`fill`],l=s&&s.stroke,u=this.mainType,d=u===`series`,f=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:i,data:o,dataType:t,value:r,color:c,borderColor:l,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:[`seriesName`,`name`,`value`]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,a){t||=`normal`;var o=this.getData(n),s=this.getDataParams(e,n);if(a&&(s.value=a.interpolatedValue),r!=null&&G(s.value)&&(s.value=s.value[r]),i||=o.getItemModel(e).get(t===`normal`?[`label`,`formatter`]:[t,`label`,`formatter`]),K(i))return s.status=t,s.dimensionIndex=r,i(s);if(q(i))return YS(i,s).replace(CC,function(t,n){var r=n.length,i=n;i.charAt(0)===`[`&&i.charAt(r-1)===`]`&&(i=+i.slice(1,r-1));var s=ub(o,e,i);if(a&&G(a.interpolatedValue)){var c=o.getDimensionIndex(i);c>=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return ub(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function TC(e){var t,n;return J(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function EC(e){return new DC(e)}var DC=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f1&&r>0?s:o}};return a;function o(){return t=e?null:a9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(VC(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=go(o)?uh:oh,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=Y(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=Y(u.sourceHeader,d.sourceHeader),m=Y(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Ly(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Ly(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&HC(``);var i,a=[],o=[];return U(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&HC(``),a.push(t),o.push(e._getVersionSign())}),n?i=LC(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[zy(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||n>0&&!e.noHeader;return U(e.blocks,function(e){var n=ew(e);n>=t&&(t=n+ +(r&&(!n||QC(e)&&!e.noHeader)))}),t}return 0}function tw(e,t,n,r){var i=t.noHeader,a=iw(ew(t)),o=[],s=t.blocks||[];wo(!s||G(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(Fo(l,c)){var u=new yb(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}U(s,function(n,i){var s=t.valueFormatter,c=$C(n)(s?H(H({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):aw(r,o.join(``),i?n:a.html);if(i)return d;var f=KS(t.header,`ordinal`,e.useUTC),p=JC(r,e.renderMode).nameStyle,m=qC(r);return e.renderMode===`richText`?cw(e,f,p)+a.richText+d:aw(r,`
`+Ux(f)+`
`+d,n)}function nw(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=G(e)?e:[e],W(e,function(e,t){return KS(e,G(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||Q.color.secondary,i),f=a?``:KS(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.rawDataIndex),h=!s||!a,g=!s&&a,_=JC(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:cw(e,f,v))+(o?``:lw(e,m,h,g,y)):aw(r,(s?``:d)+(a?``:ow(f,!s,v))+(o?``:sw(m,h,g,y)),n)}}function rw(e,t,n,r,i,a){if(e)return $C(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function iw(e){return{html:YC[e],richText:XC[e]}}function aw(e,t,n){var r=`
`,i=`margin: `+n+`px 0 0`,a=qC(e);return`
`+t+r+`
`}function ow(e,t,n){var r=t?`margin-left:2px`:``;return``+Ux(e)+``}function sw(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=G(e)?e:[e],``+W(e,function(e){return Ux(e)}).join(`  `)+``}function cw(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function lw(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(G(t)?t.join(` `):t,a)}function uw(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return ZS(n)}function dw(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var fw=function(){function e(){this.richTextStyles={},this._nextStyleNameId=qp()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=XS({color:t,type:e,renderMode:n,markerId:r});return q(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};G(t)?U(t,function(e){return H(n,e)}):H(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function pw(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=G(s),l=uw(t,n),u,d,f,p;if(o>1||c&&!o){var m=mw(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=ub(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=xm(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return ZC(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[ZC(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!To(y),value:u,valueType:d,rawDataIndex:i.getRawIndex(n)})].concat(f||[])})}function mw(e,t,n,r,i){var a=t.getData(),o=ao(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?U(r,function(e){u(ub(a,n,e),e)}):U(e,u);function u(e,t){var n=a.getDimensionInfo(t);n&&n.otherDims.tooltip!==!1&&(o?l.push(ZC(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var hw=Dm();function gw(e,t){return e.getName(t)||e.getId(t)}var _w=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=EC({count:bw,reset:xw}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(hw(this).sourceManager=new BC(this)).prepareSource();var r=this.getInitialData(e,n);Cw(r,this),this.dataTask.context.data=r,hw(this).dataBeforeProcessed=r,vw(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=lC(this),r=n?dC(e):{},i=this.subType;mC.hasClass(i)&&(i+=`Series`),Qa(e,t.getTheme().get(this.subType)),Qa(e,this.getDefaultOption()),sm(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&uC(e,r,n)},t.prototype.mergeOption=function(e,t){e=Qa(this.option,e,!0),this.fillDataTextStyle(e.data);var n=lC(this);n&&uC(this.option,e,n);var r=hw(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);Cw(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,hw(this).dataBeforeProcessed=i,vw(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!go(e))for(var t=[`show`],n=0;n=0&&u<0)&&(l=v,u=_,d=0),_===u&&(c[d++]=m))}return c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return pw({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(zo.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=vC.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[gw(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(a&&o){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){J(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c0&&this._innerSelect(e,t)}},t.registerClass=function(e){return mC.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(mC);ro(_w,wC),ro(_w,vC),Yo(_w,mC);function vw(e){var t=e.name;xm(e)||(e.name=yw(e)||t)}function yw(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return U(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function bw(e){return e.model.getRawData().count()}function xw(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Sw}function Sw(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Cw(e,t){U(No(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,fo(ww,t))})}function ww(e,t){var n=Tw(e);return n&&n.setOutputEnd((t||this).count()),t}function Tw(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}var Ew=jf.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),Dw={line:w_,rect:Gf,roundRect:Gf,square:Gf,circle:Jg,diamond:jf.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:jf.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:jf.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:Ew},Ow={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},kw={};U(Dw,function(e,t){kw[t]=new e});var Aw=jf.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Sc(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=kw[r];i||=(r=`rect`,kw[r]),Ow[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function jw(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Q.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function Mw(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?fv(e.slice(8),new Z(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?dv(e.slice(7),{},new Z(t,n,r,i),o?`center`:`cover`):new Aw({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=jw,a&&c.setColor(a),c}function Nw(e){return G(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function Pw(e,t){if(e!=null)return G(e)||(e=[e,e]),[Tp(e[0],t[0])||0,Tp(Y(e[1],e[0]),t[1])||0]}var Fw=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e){return xx(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Kg,n=Mw(`line`,0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual(`symbol`),i=this.getData().getVisual(`symbolRotate`),a=r===`none`?`circle`:r,o=e.itemHeight*.8,s=Mw(a,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=(e.iconRotate===`inherit`?i:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),a.indexOf(`empty`)>-1&&(s.style.stroke=s.style.fill,s.style.fill=Q.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1,triggerEvent:!1},t}(_w);function Iw(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=ub(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o=0&&r.push(t[a])}return r.join(` `)}var Rw=function(e){B(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=Mw(e,-1,-1,2,2,null,a);o.attr({z2:Y(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=zw,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Jh(this.childAt(0))},t.prototype.downplay=function(){Yh(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):Y_(f,p,o,n),tv(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,X_(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=ey(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=Pw(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof Lf){var S=a.style;a.useStyle(H({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(H({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;$v(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):Iw(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),pg(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=nh(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Q_(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Q_(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return Nw(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Kg);function zw(e,t){this.parent.drift(e,t)}function Bw(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function Vw(e){return e!=null&&!J(e)&&(e={isIgnore:e}),e||{}}function Hw(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:ey(t),cursorStyle:t.get(`cursor`)}}function Uw(e,t,n,r,i,a,o){var s=new e(t,n,r,i);return s.setPosition(a),t.setItemGraphicEl(n,s),o.add(s),s}var Ww=function(){function e(e){this.group=new Kg,this._SymbolCtor=e||Rw}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=Vw(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=this._seriesScope=Hw(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);Bw(e,i,r,t)&&Uw(a,e,r,s,c,i,n)}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!Bw(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):Y_(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var n=this,r=t.getStore(),i=0,a=r.count();i0?n=r[0]:r[1]<0&&(n=r[1]),n}function qw(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function Jw(e,t){return!isFinite(e)||!isFinite(t)}var Yw=typeof Float32Array<`u`?Float32Array:void 0,Xw=typeof Float64Array<`u`?Float64Array:void 0;function Zw(e){return Qw({ctor:Yw},e).arr}function Qw(e,t){var n=e.arr,r=e.ctor;if(t>Ip&&(t=Ip),!n||e.typed&&n.length=i||h<0)break;if(Jw(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g=r||Jw(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,ee=v-u,M=C-v,te=void 0,ne=void 0;if(s===`x`){te=Math.abs(A),ne=Math.abs(j);var N=E>0?1:-1;p=_-N*te*o,m=v,O=_+N*ne*o,k=v}else if(s===`y`){te=Math.abs(ee),ne=Math.abs(M);var P=D>0?1:-1;p=_,m=v-P*te*o,O=_,k=v+P*ne*o}else te=Math.sqrt(A*A+ee*ee),ne=Math.sqrt(j*j+M*M),T=ne/(ne+te),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=tT(O,nT(S,_)),k=tT(k,nT(C,v)),O=nT(O,tT(S,_)),k=nT(k,tT(C,v)),E=O-_,D=k-v,p=_-E*te/ne,m=v-D*te/ne,p=tT(p,nT(l,_)),m=tT(m,nT(u,v)),p=nT(p,tT(l,_)),m=nT(m,tT(u,v)),E=_-p,D=v-m,O=_+E*ne/te,k=v+D*ne/te}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var iT=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),aT=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new iT},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&Jw(n[i*2-2],n[i*2-1]);i--);for(;r=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?_l(i,u,f,m,e,s):_l(a,d,p,h,e,s);if(v>0)for(var y=0;y=0){var _=o?hl(a,d,p,h,b):hl(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(jf),oT=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(iT),sT=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new oT},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&Jw(n[a*2-2],n[a*2-1]);a--);for(;i=t[0]&&e<=t[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){FT(this._extents,0,e,t)},setExtent2:function(e,t,n){var r=this._extents;r[e]||(r[e]=r[0].slice()),FT(r,e,t,n)},freeze:function(){}};function FT(e,t,n,r){Wm(n,r)&&(e[t][0]=n,e[t][1]=r)}function IT(e){return LT(e)||zT(e)}function LT(e){return e.type===`interval`}function RT(e){return e.type===`time`}function zT(e){return e.type===`log`}function BT(e){return e.type===`ordinal`}function VT(e){var t=Hp(e),n=yp(10,t),r=gp(e/n);return r?r===2?r=3:r===3?r=5:r*=2:r=1,Ap(r*n,-t)}function HT(e){return Mp(e)+2}function UT(e,t){return bp(e)/bp(t)}function WT(e,t,n){var r=n&&n.lookup;if(r){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==r[0]&&c(r[0],!0,!0);for(var s=i;s<=r[1];s+=o)c(s,!1,s===r[0]||s===r[1]);s-o!==r[1]&&c(r[1],!0,!0);function c(e,t,r){n({value:e,offInterval:t},r)}}var YT=function(e){B(t,e);function t(n){var r=e.call(this)||this;r.type=`ordinal`,r.parse=t.parse,DT(r,t.decoratedMethods);var i=n.ordinalMeta;i||=new CT({}),G(i)&&(i=new CT({categories:W(i,function(e){return J(e)?e.value:e})})),r._ordinalMeta=i;var a=ET(null,null,n.extent||[0,i.categories.length-1]);return r._mapper=a.mapper,OT(r,a.mapper),r}return t.parse=function(e){return e==null?e=NaN:q(e)?(e=this._ordinalMeta.getOrdinal(e),e??=NaN):e=gp(e),e},t.prototype.getTicks=function(){var e=[];return JT(this,0,function(t){e.push(t)}),e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=pp(a,t.length);i=0&&e=0&&e=0&&eo[0]&&mi[1]||!isFinite(p)||!isFinite(i[1]))break}else{if(m>f)break;p=pp(p,i[1]),m===f&&(p=i[1])}if(l.push({value:p}),p=Ap(p+n,a),s){var h=s.calcNiceTickMultiple(p,d);h>=0&&(p=Ap(p+h*n,a))}if(l.length>0&&p===l[l.length-1].value)break;if(l.length>u)return[]}var g=l.length?l[l.length-1].value:i[1];return r[1]>g&&l.push({value:e.expandToNicedExtent?Ap(g+n,a):r[1]}),c&&o.pruneTicksByBreak(e.pruneByBreak,l,s.breaks,function(e){return e.value},t.interval,r),c&&e.breakTicks!==`none`&&o.addBreaksToTicks(l,s.breaks,r),l},t.prototype.getMinorTicks=function(e){return XT(this,e,aS(this),this._cfg.interval)},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=Mp(e.value)||0:n===`auto`&&(n=this._cfg.intervalPrecision),US(Ap(e.value,n,!0))},t.type=`interval`,t}(xT);xT.registerClass(ZT);var QT=function(e,t,n,r){for(;n>>1;e[i][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function rE(e){var t=30*uS;return e/=t,e>6?6:e>3?3:e>2?2:1}function iE(e){return e/=lS,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function aE(e,t){return e/=t?cS:sS,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function oE(e){return mp(Up(e,!0),1)}function sE(e,t,n){var r=Math.max(0,to(_S,t)-1);return OS(new Date(e),_S[r],n).getTime()}function cE(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function lE(e,t,n,r,i,a){var o=vS,s=0;function c(e,t,n,i,o,c,l){for(var u=cE(o,e),d=t,f=new Date(d);d3e3));)if(f[o](f[i]()+e),d=f.getTime(),a){var p=a.calcNiceTickMultiple(d,u);p>0&&(f[o](f[i]()+p*e),d=f.getTime())}l.push({value:d,notAdd:d>r[1]})}function l(e,i,a){var o=[],s=!i.length;if(!tE(SS(e),r[0],r[1],n)){s&&(i=[{value:sE(r[0],e,n)},{value:r[1]}]);for(var l=0;l=r[0]&&u<=r[1]&&c(f,u,d,p,m,h,o),e===`year`&&a.length>1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l=r[0]&&v<=r[1]&&f++)}var y=i/t;if(f>y*1.5&&p>y/1.5||(u.push(g),f>y||e===o[m]))break}d=[]}}for(var b=oo(W(u,function(e){return oo(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),x=b.length-1,S=[],m=0;mr[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!D||D.values&&(a=s);var c=eE.length,l=Math.min(QT(eE,a,0,c),c-1),u=eE[l][1],d=eE[Math.max(l-1,0)][0];e.setTimeInterval({approxInterval:a,interval:u,minLevelUnit:d})};xT.registerClass($T);var dE=0,fE=1,pE=2,mE=function(e){B(t,e);function t(n){var r=e.call(this)||this;r.type=`log`,r.parse=ZT.parse,r.base=n.logBase||10;var i=[],a=[],o=r._lookup={from:i,to:a};i[dE]=i[fE]=a[dE]=a[fE]=NaN,DT(r,t.mapperMethods);var s=rS(),c=n.breakOption,l={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(c,r,{noNegative:!0},pE,l),r.powStub=new ZT({breakParsed:l.original}),r.intervalStub=new ZT({breakParsed:l.transformed}),OT(r,r.intervalStub),r}return t.prototype.getTicks=function(e){var t=this.base,n=this.powStub,r=rS(),i=this.intervalStub,a={lookup:{from:i.getExtent(),to:n.getExtent()}};return W(i.getTicks(e||{}),function(e){var i=e.value,o=WT(i,t,a),s;if(r){var c=r.getTicksBreakOutwardTransform(this,e,aS(n),this._lookup);c&&(s=c.vBreak,o=c.tickVal)}return{value:o,break:s}},this)},t.prototype.getMinorTicks=function(e){return XT(this,e,aS(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(e,t){return this.intervalStub.getLabel(e,t)},t.type=`log`,t.mapperMethods={needTransform:function(){return!0},normalize:function(e){return this.intervalStub.normalize(UT(e,this.base))},scale:function(e){return WT(this.intervalStub.scale(e),this.base,null)},transformIn:function(e,t){return e=UT(e,this.base),t&&t.depth===2?e:this.intervalStub.transformIn(e,t)},transformOut:function(e,t){var n=t?t.depth:null;return hE.depth=n,gE.lookup=this._lookup,WT(n===2?e:this.intervalStub.transformOut(e,hE),this.base,gE)},contain:function(e){return this.powStub.contain(e)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){if(!(!Wm(t,n)||t<=0||n<=0)){var r=_E,i=_E;if(e===0){var a=this._lookup;r=a.to,i=a.from}this.powStub.setExtent2(e,r[dE]=t,r[fE]=n);var o=this.base;this.intervalStub.setExtent2(e,i[dE]=UT(t,o),i[fE]=UT(n,o))}},getFilter:function(){return{g:0}},sanitize:function(e,t){return Wm(t[0],t[1])&&Xp(e)&&e<=0&&(e=t[0]),e},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(e,t){return t===null?this.powStub.getExtentUnsafe(e,null):this.intervalStub.getExtentUnsafe(e,t)}},t}(xT);xT.registerClass(mE);var hE={},gE={},_E=[],vE={value:1,category:1,time:1,log:1},yE=Dm();function bE(e){var t=e.get(`type`);return(t==null||!Fo(vE,t)&&!xT.getClass(t))&&(t=`value`),t}function xE(e,t,n){var r=rS(),i;switch(r&&(i=ME(e,t,n)),t){case`category`:return new YT({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Rm()});case`time`:return new $T({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`),breakOption:i});case`log`:return new mE({logBase:e.get(`logBase`),breakOption:i});case`value`:return new ZT({breakOption:i});default:return new((xT.getClass(t))||ZT)({})}}function SE(e,t,n){var r=n?AT(e,null):e.getExtentUnsafe(0,null),i=r[0],a=r[1];return Wm(i,a)?i===t||a===t?2:it?1:3:3}function CE(e){yE(e).noOnMyZero=!0}function wE(e){return yE(e).noOnMyZero}function TE(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=yS(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}if(q(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};if(K(t)){if(e.type===`category`)return function(n,r){return t(EE(e,n),n.value-e.scale.getExtent()[0],null)};var r=rS();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(EE(e,n),i,a)}}return function(t){return e.scale.getLabel(t)}}function EE(e,t){var n=e.scale;return BT(n)?n.getLabel(t):t.value}function DE(e){return e.get(`interval`)??`auto`}function OE(e){return e.type===`category`&&DE(e.getLabelModel())===0}function kE(e,t){var n={};return U(e.mapDimensionsAll(t),function(t){n[vx(e,t)]=!0}),co(n)}function AE(e){return e===`middle`||e===`center`}function jE(e){return e.getShallow(`show`)}function ME(e,t,n){var r=e.get(`breaks`,!0);if(r!=null)return!rS()||!n||!NE(t)?void 0:r}function NE(e){return e!==`category`}function PE(e,t,n,r,i,a){var o=zT(e),s=o?e.intervalStub:e;if(s.setExtent(r[0],r[1]),o){var c=e.powStub,l={depth:2},u=e.transformOut(r[0],l),d=e.transformOut(r[1],l),f=KT(n,r);t[0]&&!f[0]&&(u=i[0]),t[1]&&!f[1]&&(d=i[1]),c.setExtent(u,d)}s.setConfig(a)}function FE(e,t){return BT(e)?e.getRawOrdinalNumber(t.value):t.value}function IE(e,t){return BT(e)&&!!t.get(`boundaryGap`)}function LE(e,t){if(e.length===t.length){for(var n=0;nt){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function WE(e,t,n){var r=e.getVisual(`visualMeta`);if(r&&r.length&&e.count()&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=W(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=UE(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;U(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new N_(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function GE(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!r||i){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&KE(a,t))){var o=t.mapDimension(a.dim),s={};return U(a.getViewLabels(),function(e){e.tick.offInterval||(s[FE(a.scale,e.tick)]=1)}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function KE(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function qE(e){for(var t=e.length/2;t>0&&Jw(e[t*2-2],e[t*2-1]);t--);return t-1}function JE(e,t){return[e[t*2],e[t*2+1]]}function YE(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function XE(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var ee=f.getState(`emphasis`).style;ee.lineWidth=+f.style.lineWidth+1}nh(f).seriesIndex=e.seriesIndex,pg(f,k,A,j);var M=BE(e.get(`smooth`)),te=e.get(`smoothMonotone`);if(f.setShape({smooth:M,smoothMonotone:te,connectNulls:x}),p){var ne=a.getCalculationInfo(`stackedOnSeries`),N=0;p.useStyle(eo(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),ne&&(N=BE(ne.get(`smooth`))),p.setShape({smooth:M,stackedOnSmooth:N,smoothMonotone:te,connectNulls:x}),_g(p,e,`areaStyle`),nh(p).seriesIndex=e.seriesIndex,pg(p,k,A,j)}var P=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=P)}),this._polyline.onHoverStateChange=P,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_;var re=e.get(`triggerEvent`),ie=e.get(`triggerLineEvent`),ae=ie===!0||re===!0||re===`line`,oe=ie===!0||re===!0||re===`area`;this.packEventData(e,f,ae),p&&this.packEventData(e,p,oe)},t.prototype.packEventData=function(e,t,n){nh(t).eventData=n?{componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`,selfType:t===this._polygon?`area`:`line`}:null},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=Em(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(Jw(c,l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new Rw(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else dT.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=Em(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else dT.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;zh(this._polyline,e),t&&zh(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new aT({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new sT({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);K(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=K(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=K(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(XE(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new Xf({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=qE(o);c>=0&&($v(a,ey(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?Iw(i,e):Lw(i,n)},enableTextSetter:!0},QE(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=YE(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=JE(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Lm(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=JE(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=uy(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=eT(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=HE(u.stackedOnCurrent,u.current,n,i,o),d=HE(u.current,null,n,i,o),m=HE(u.stackedOnNext,u.next,n,i,o),p=HE(u.next,null,n,i,o)),zE(d,p)>3e3||c&&zE(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),Y_(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),Y_(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;tt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;q(i)?p=tD[i]:K(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,nD))}}}}}function iD(e){e.registerChartView($E),e.registerSeriesModel(Fw),e.registerLayout(eD(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,rD(`line`))}var aD=Dm(),oD=Dm(),sD={estimate:1,determine:2};function cD(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function lD(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=e.scale;return{labels:W(dD(n,r),function(t,n){return{formattedLabel:TE(e)(t,n),rawLabel:r.getLabel(t),tick:t}})}}return e.type===`category`?fD(e,t):hD(e)}function uD(e,t,n){var r=e.scale,i=e.getTickModel().get(`customValues`);return i?{ticks:dD(i,r)}:e.type===`category`?mD(e,t):{ticks:r.getTicks(n)}}function dD(e,t){var n=t.getExtent(),r=[];return U(e,function(e){e=t.parse(e),e>=n[0]&&e<=n[1]&&r.push(e)}),Ym(r,Zm,null),jp(r),W(r,function(e){return{value:e}})}function fD(e,t){var n=e.getLabelModel(),r=pD(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function pD(e,t,n){var r=_D(e),i=DE(t),a=n.kind===sD.estimate;if(!a){var o=yD(r,i);if(o)return o}var s,c;K(i)?s=ED(e,i,!1):(c=i===`auto`?xD(e,n):i,s=ED(e,c,!1));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return bD(r,i,l),!0}):bD(r,i,l),l}function mD(e,t){var n=gD(e),r=DE(t),i=yD(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),K(r))a=ED(e,r,!0);else if(r===`auto`){var s=pD(e,e.getLabelModel(),cD(sD.determine));o=s.labelCategoryInterval,a=W(s.labels,function(e){return e.tick})}else o=r,a=ED(e,o,!0);return bD(n,r,{ticks:a,tickCategoryInterval:o})}function hD(e){var t=e.scale.getTicks(),n=TE(e);return{labels:W(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tick:t}})}}var gD=vD(`axisTick`),_D=vD(`axisLabel`);function vD(e){return function(t){return oD(t)[e]||(oD(t)[e]={list:[]})}}function yD(e,t){for(var n=0;nu&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=_c(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===sD.estimate?(t.out.noPxChangeTryDetermine.push(uo(CD,null,e,S,c)),S):wD(e,S,c)??S}function CD(e,t,n){return wD(e,t,n)==null}function wD(e,t,n){var r=aD(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function TD(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function ED(e,t,n){var r=TE(e),i=e.scale,a=[],o=K(t);return JT(i,o?0:t,function(e,s){var c=i.getLabel(e);if(o){var l=!!t(e.value,c);if(e.offInterval=!l,!l&&!s)return}a.push(n?e:{formattedLabel:r(e),rawLabel:c,tick:e})}),a}var DD=Dm();function OD(e){DD(e).prepare={}}function kD(e){DD(e).fullUpdate={}}function AD(e){return DD(e).prepare}function jD(e){return DD(e).fullUpdate}var MD=qm(),ND=Dm(),PD=Dm();function FD(e,t){var n=e.model,r=ND(jD(n.ecModel)).keyed,i=r&&r.get(t);return i&&i.get(n.uid)}function ID(e,t){return zD(FD(e,t))}function LD(e,t){var n=[];return RD(e.model.ecModel,function(e){for(var r=0;r0?(t>o&&(o=t),a=!1):t===-2&&(a=!0))}),Xp(n)&&n>0&&Xp(o)?(e.w=r/n*o,e.w2=o):a&&(e.w=r*QD,e.w2=e.w*n/r)}var nO=[0,1],rO=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this.scale;return e=n.normalize(n.parse(e)),wp(e,nO,iO(this),t)},e.prototype.coordToData=function(e,t){var n=wp(e,iO(this),nO,t);return this.scale.scale(n)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=W(uD(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,function(e){return{coord:this.dataToCoord(FE(this.scale,e)),tick:e}},this),r=t.get(`alignWithLabel`),i=aO(this,n,r);return W(n,function(e){return{coord:e.coord,tickValue:e.tick.value,onBand:i}})},e.prototype.getMinorTicksCoords=function(){if(BT(this.scale))return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),W(this.scale.getMinorTicks(e),function(e){return W(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=cD(sD.determine),lD(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){return $D(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(e){return e||=cD(sD.determine),SD(this,e)},e}();function iO(e){var t=e.getExtent();if(e.onBand){var n=(t[1]-t[0])/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function aO(e,t,n){var r=t.length;if(!e.onBand||n||!r)return!1;var i=$D(e).w;if(!i)return!1;U(t,function(e){e.coord-=i/2});var a=e.scale.getExtent(),o=t[r-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}var oO=function(e){B(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(rO),sO=[`label`,`labelLine`,`layoutOption`,`priority`,`defaultAttr`,`marginForce`,`minMarginForce`,`marginDefault`,`suggestIgnore`],cO=1,lO=2,uO=cO|lO;function dO(e,t,n){n||=uO,t?e.dirty|=n:e.dirty&=~n}function fO(e,t){return t||=uO,e.dirty==null||!!(e.dirty&t)}function pO(e){if(e)return fO(e)&&mO(e,e.label,e),e}function mO(e,t,n){var r=t.getComputedTransform();e.transform=Vv(e.transform,r);var i=e.localRect=Bv(e.localRect,t.getBoundingRect()),a=t.style,o=a.margin,s=n&&n.marginForce,c=n&&n.minMarginForce,l=n&&n.marginDefault,u=a.__marginType;u==null&&l&&(o=l,u=fy.textMargin);for(var d=0;d<4;d++)hO[d]=u===fy.minMargin&&c&&c[d]!=null?c[d]:s&&s[d]!=null?s[d]:o?o[d]:0;u===fy.textMargin&&Mv(i,hO,!1,!1);var f=e.rect=Bv(e.rect,i);return r&&f.applyTransform(r),u===fy.minMargin&&Mv(f,hO,!1,!1),e.axisAligned=Rv(r),(e.label=e.label||{}).ignore=t.ignore,dO(e,!1),dO(e,!0,lO),e}var hO=[0,0,0,0];function gO(e,t,n){return e.transform=Vv(e.transform,n),e.localRect=Bv(e.localRect,t),e.rect=Bv(e.rect,t),n&&e.rect.applyTransform(n),e.axisAligned=Rv(n),e.obb=void 0,(e.label=e.label||{}).ignore=!1,e}function _O(e,t){if(e){e.label.x+=t.x,e.label.y+=t.y,e.label.markRedraw();var n=e.transform;n&&(n[4]+=t.x,n[5]+=t.y);var r=e.rect;r&&(r.x+=t.x,r.y+=t.y);var i=e.obb;i&&i.fromBoundingRect(e.localRect,n)}}function vO(e,t){for(var n=0;n.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new Z(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var MO=fs(),NO=new Z(0,0,0,0),PO=function(e,t,n,r,i,a){if(AE(e.nameLocation)){var o=a.stOccupiedRect;o&&FO(gO({},o,a.transGroup.transform),r,i)}else IO(a.labelInfoList,a.dirVec,r,i)};function FO(e,t,n){var r=new Rs;xO(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&_O(t,r)}function IO(e,t,n,r){for(var i=Rs.dot(r,t)>=0,a=0,o=e.length;a0?`top`:`bottom`,i=`center`):Rp(r-TO)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),RO=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],zO={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(Fs(u,u,l),Fs(d,d,l));var p=H({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&oS(r.axis.scale))CO().buildAxisBreakLine(r,i,a,m);else{var h=new w_(H({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));gv(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);q(g)&&(g=[g,g]),(q(_)||mo(_))&&(_=[_,_]);var v=Pw(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];U([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=Mw(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){JO(t,i,s)&&BO(e,t,n,r,i,a,o,sD.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){JO(t,i,s)&&BO(e,t,n,r,i,a,o,sD.determine);var c=KO(e,i,a,r);UO(e,t.labelLayoutList,c),qO(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(tk(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new Rs(0,0),_=new Rs(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=fs();_.transform(_s(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*TO/180);var b,x;AE(u)?b=LO.innerTextLayout(e.rotation,y??e.rotation,d):(b=VO(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=bo(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new Xf({x:g.x,y:g.y,rotation:b.rotation,silent:LO.isLabelSilent(r),style:ty(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(Fv({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=LO.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,nh(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=pO({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:AE(u)?EO[E]:DO[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}};function BO(e,t,n,r,i,a,o,s){XO(t)||YO(e,t,i,s,r,o);var c=t.labelLayoutList;QO(e,r,c,a),rk(r,e.rotation,c);var l=e.optionHideOverlap;HO(r,c,l),l&&bO(oo(c,function(e){return e&&!e.label.ignore})),jO(e,n,r,c)}function VO(e,t,n,r){var i=Lp(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return Rp(i-TO/2)?(o=c?`bottom`:`top`,a=`center`):Rp(i-TO*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=iTO/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function HO(e,t,n){var r=e.axis,i=e.get([`axisLabel`,`customValues`]);if(OE(r))return;function a(e,a,o){var s=pO(t[a]),c=pO(t[o]),l=r.scale;if(s&&c){if(e==null){if(!n&&i)return;var u=OO(s.label).labelInfo.tick;if(RT(l)&&u.notNice||BT(l)&&u.offInterval){WO(s.label);return}}if(e===!1||s.suggestIgnore){WO(s.label);return}if(c.suggestIgnore){WO(c.label);return}var d=.1;if(!n){var f=[0,0,0,0];s=vO({marginForce:f},s),c=vO({marginForce:f},c)}xO(s,c,null,{touchThreshold:d})&&WO(e?c.label:s.label)}}var o=e.get([`axisLabel`,`showMinLabel`]),s=e.get([`axisLabel`,`showMaxLabel`]),c=t.length;a(o,0,1),a(s,c-1,c-2)}function UO(e,t,n){e.showMinorTicks||U(t,function(e){if(e&&e.label.ignore)for(var t=0;t0&&u[1]>0&&!d[0]&&(u[0]=0),u[0]<0&&u[1]<0&&!d[1]&&(u[1]=0));var y=!1;u[0]>u[1]&&(u.reverse(),y=!0);var b=pk(e,t.get(`startValue`,!0)),x=b!=null;!Xp(b)&&r&&(b=e.getDefaultStartValue?e.getDefaultStartValue():0),Xp(b)&&(x||!_||v)&&(bu[1]&&!d[1]&&(u[1]=b,d[1]=!0)),fk(this._i={scale:e,dataMM:l,noZoomEffMM:u,zoomMM:[],fixMM:d,zoomFixMM:[!1,!1],startValue:b,isBlank:g,incl0:v,tggAxInv:y,ctnShp:i},u)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var e=this._i,t=e.zoomMM,n=e.noZoomEffMM,r=e.zoomFixMM,i=e.fixMM,a={fixMM:i,zoomFixMM:r,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=a.effMM;return t[0]!=null&&(o[0]=t[0],i[0]=r[0]=!0),t[1]!=null&&(o[1]=t[1],i[1]=r[1]=!0),fk(e,o),a},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(e,t){this._i.zoomMM[e]=t},e}();function fk(e,t){var n=e.scale,r=e.dataMM;n.sanitize&&(t[0]=n.sanitize(t[0],r),t[1]=n.sanitize(t[1],r),Km(t))}function pk(e,t){return t==null?null:yo(t)?NaN:e.parse(t)}function mk(e,t){var n;if(BT(e))n=[0,0];else{var r=t.get(`boundaryGap`);typeof r==`boolean`&&(r=null),n=G(r)?r:[r,r]}return[hk(n[0]),hk(n[1])]}function hk(e){return xc(typeof e==`boolean`?0:e,1)||0}function gk(e){var t=lk(e.scale);return t.extent||=Rm(),t}function _k(e,t){gk(e).dimIdxInCoord=t.get(e.dim)}function vk(e,t){var n=e.scale,r=e.model,i=e.dim;n.rawExtentInfo||yk(n,e,i,r,t)}function yk(e,t,n,r,i){var a=gk(t),o=a.extent,s=!1;BD(t,function(r){if(r.boxCoordinateSystem){var i=cx(r).coord,c=a.dimIdxInCoord;if(c>=0&&G(i)){var l=i[c];l!=null&&!G(l)&&zm(o,e.parse(l))}}else if(r.coordinateSystem){var u=r.getData();if(u){var d=e.getFilter?e.getFilter():null;U(kE(u,n),function(e){Hm(o,u.getApproximateExtent(e,d))})}r.__requireStartValue&&r.__requireStartValue(t)&&(s=!0)}});var c=Tk(e,t,r);xk(e,new dk(e,r,o,s,c),i),a.extent=null}function bk(e,t){var n=e.scale;xk(n,new dk(n,e.model,t,!1,!1),uk)}function xk(e,t,n){e.rawExtentInfo=t,t.from=n}function Sk(e,t){Ck.set(e,t)}var Ck=X();function wk(e,t,n,r,i){e.rawExtentInfo||bk({scale:e,model:t},i||Rm());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),r&&a.tggAxInv&&n&&!n.get(`legacyMinMaxDontInverseAxis`)&&(r.inverse=!r.inverse),a}function Tk(e,t,n){var r=IE(e,n),i=n.get(`containShape`,!0);if(i==null&&!r&&(i=!0),!i)return!1;var a=!1;return WD(t,function(e){a=!!Ck.get(e)||a}),a}function Ek(e,t,n,r){if(n.ctnShp){var i;if(WD(e,function(t){var n=Ck.get(t);if(n){var a=n(e,r);a&&(i||=[0,0],Bm(i,a[0]),Vm(i,a[1]),CE(e))}}),i){var a=t.getExtent();if(BT(t))e.onBand||t.setExtent2(1,pp(a[0],a[0]+i[0]),mp(a[1],a[1]+i[1]));else{var o=a.slice();n.zoomFixMM[0]||(o[0]=pp(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),n.zoomFixMM[1]||(o[1]=mp(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&t.setExtent2(1,o[0],o[1])}}}}function Dk(){KD(`liPosMinGap`,Ok)}function Ok(e,t,n){var r=X(),i=n.serUids,a=n.liPosMinGap,o,s=t.axis,c=s.scale,l=c.needTransform(),u=c.getFilter?c.getFilter():null,d=bb(u);function f(n){HD(e,t.sers,function(e){var t=e.getRawData(),r=t.getDimensionIndex(t.mapDimension(s.dim));r>=0&&n(r,e,t.getStore())})}var p=0;if(f(function(e,t,n){r.set(t.uid,1),(!i||!i.hasKey(t.uid))&&(o=!0),p+=n.count()}),(!i||i.keys().length!==r.keys().length)&&(o=!0),!o&&a!=null){t.liPosMinGap=a;return}Qw(kk,p);var m=0;f(function(e,t,n){for(var r=0,i=n.count();r0&&v0?-2:-1,n.serUids=r}var kk=Qw({ctor:Xw},50);function Ak(e){return function(t,n){var r=$D(t,{fromStat:{key:e}});if(Xp(r.w2))return[-r.w2/2,r.w2/2]}}function jk(e,t){return e+`|&`+t}function Mk(e){return Dk(),{liPosMinGap:!BT(e.scale)}}function Nk(e,t,n,r){XD(e,{key:t,seriesType:n,coordSysType:r,getMetrics:Mk})}function Pk(e){return e.scale.rawExtentInfo.makeRenderInfo().startValue}var Fk={left:0,right:0,top:0,bottom:0},Ik=[`25%`,`25%`],Lk=`cartesian2d`,Rk=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=dC(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&uC(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&uC(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:Fk,outerBoundsContain:`all`,outerBoundsClampWidth:Ik[0],outerBoundsClampHeight:Ik[1],backgroundColor:Q.color.transparent,borderWidth:1,borderColor:Q.color.neutral30},t}(mC),zk=qm(),Bk=`__ec_stack_`;function Vk(e){return e.get(`stack`)||Bk+e.seriesIndex}function Hk(e,t){var n=Uk(e,t);return n.columnMap=Wk(n),n}function Uk(e,t){var n=jk(t,Lk),r=[],i=$D(e,{fromStat:{key:n},min:1});return VD(e,n,function(e){r.push({barWidth:Tp(e.get(`barWidth`),i.w),barMaxWidth:Tp(e.get(`barMaxWidth`),i.w),barMinWidth:Tp(e.get(`barMinWidth`)||(qk(e)?.5:1),i.w),barGap:e.get(`barGap`),barCategoryGap:e.get(`barCategoryGap`),defaultBarGap:e.get(`defaultBarGap`),stackId:Vk(e)})}),{bandWidthResult:i,seriesInfo:r}}function Wk(e){var t=e.bandWidthResult.w,n=t,r=0,i,a,o=[],s={};U(e.seriesInfo,function(e,t){t||(a=e.defaultBarGap||0);var c=e.stackId;Fo(s,c)||r++;var l=s[c];l||(l=s[c]={width:0,maxWidth:0},o.push(c));var u=e.barWidth;u&&!l.width&&(l.width=u,u=pp(n,u),n-=u);var d=e.barMaxWidth;d&&(l.maxWidth=d);var f=e.barMinWidth;f&&(l.minWidth=f);var p=e.barGap;p!=null&&(a=p);var m=e.barCategoryGap;m!=null&&(i=m)}),i??=mp(35-o.length*4,15)+`%`;var c=Tp(i,t),l=Tp(a,1),u=(n-c)/(r+(r-1)*l);u=mp(u,0),U(o,function(e){var t=s[e],i=t.maxWidth,a=t.minWidth;if(t.width){var o=t.width;i&&(o=pp(o,i)),a&&(o=mp(o,a)),t.width=o,n-=o+l*o,r--}else{var o=u;i&&io&&(o=a),o!==u&&(t.width=o,n-=o+l*o,r--)}}),u=(n-c)/(r+(r-1)*l),u=mp(u,0);var d=0,f;U(o,function(e){var t=s[e];t.width||=u,f=t,d+=t.width*(1+l)}),f&&(d-=f.width*l);var p={},m=-d/2;return U(o,function(e){var n=s[e];p[e]=p[e]||{bandWidth:t,offset:m,width:n.width},m+=n.width*(1+l)}),p}function Gk(e){return{seriesType:e,overallReset:function(t){var n=jk(e,Lk);UD(t,n,function(t){var r=Hk(t,e);VD(t,n,function(e){var t=r.columnMap[Vk(e)];e.getData().setLayout({bandWidth:t.bandWidth,offset:t.offset,size:t.width})})})}}}function Kk(e){return{seriesType:e,plan:cT(),reset:function(e){if(ak(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=_x(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=i.toGlobalCoord(i.dataToCoord(Pk(i))),p=qk(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&Zw(r*3),c=p&&s&&Zw(r*3),l=p&&Zw(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);u&&(T=n.dataToPoint([E,w])[0]),D=T,O=j[1]+_,k=j[0]-T,A=g,hp(k)s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.prototype.__requireStartValue=function(e){return this.getBaseAxis()!==e},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(_w);_w.registerClass(Xk);var Zk=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return xx(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.__preparePipelineContext=function(e,t){var n=$m(this,e,t);return n.progressiveRender&&(n.large=!0),n},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=kx(Xk.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:Q.color.primary,borderWidth:2}},realtimeSort:!1}),t}(Xk),Qk=`\0__throttleOriginMethod`,$k=`\0__throttleRate`,eA=`\0__throttleType`;function tA(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){var e=[...arguments];r=new Date().getTime(),c=this,l=e;var f=u||t,p=u||n;u=null,s=r-(p?i:a)-f,clearTimeout(o),p?o=setTimeout(d,f):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function nA(e,t,n,r){var i=e[t];if(i){var a=i[Qk]||i,o=i[eA];if(i[$k]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=tA(a,n,r===`debounce`),i[Qk]=a,i[eA]=r,i[$k]=n}return i}}function rA(e,t){var n=e[t];n&&n[Qk]&&(n.clear&&n.clear(),e[t]=n[Qk])}var iA=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),aA=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new iA},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-cMath.PI/2&&ua)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){ev(t,e,nh(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(dT),mA={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=dA(t.x,e.x),s=fA(t.x+t.width,i),c=dA(t.y,e.y),l=fA(t.y+t.height,a),u=si?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=fA(t.r,e.r),a=dA(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},hA={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new Gf({shape:H({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?aA:p_,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=oA(wA(i),{isRoundCap:l===aA}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?Y_:X_)(u,{shape:p},a)}return u}};function gA(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function _A(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?Y_:X_)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?Y_:X_)(n,{shape:l},u,i)}function vA(e,t){for(var n=0;n0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function CA(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function wA(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function TA(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;H(u,uA(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?PA(i,a.coordinateSystem):FA(i,a.coordinateSystem),p=ey(r);$v(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:Iw(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,sA(e,h===`outside`?f:h,wA(o),r.get([`label`,`rotate`]))}dy(m,p,a.getRawValue(n),function(e){return Lw(t,e)});var g=r.getModel([`emphasis`]);pg(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),_g(e,r),CA(i)&&(e.style.fill=`none`,e.style.stroke=`none`,U(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function EA(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var DA=function(){function e(){}return e}(),OA=function(e){B(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new DA},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c=0?n:null},30,!1);function jA(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function MA(e,t,n){if(bT(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function NA(e,t,n){return new(e.type===`polar`?p_:Gf)({shape:MA(t,n,e),silent:!0,z2:0})}function PA(e,t){return e.height===0?t.getOtherAxis(t.getBaseAxis()).inverse?`bottom`:`top`:e.height>0?`bottom`:`top`}function FA(e,t){return e.width===0?t.getOtherAxis(t.getBaseAxis()).inverse?`left`:`right`:e.width>=0?`right`:`left`}function IA(e){e.registerChartView(pA),e.registerSeriesModel(Zk),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Gk(`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Kk(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,rD(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})}),Yk(e)}function LA(e,t,n,r,i){var a=e+t;n.isSilent(a)||r.eachComponent({mainType:`series`,subType:`pie`},function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,o=i.selected,s=0;s=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),BA=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),VA=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new BA(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new BA(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new BA(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new BA(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new BA(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new BA(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),HA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,UA=[],WA=zo.browser.firefox&&+zo.browser.version.split(`.`)[0]<39;function GA(e,t,n,r){return n||={},r?KA(e,t,n):WA&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?KA(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function KA(e,t,n){if(zo.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(Bx(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}if(Lx(UA,e,r,i)){n.zrX=UA[0],n.zrY=UA[1];return}}n.zrX=n.zrY=0}function qA(e){return e||window.event}function JA(e,t,n){if(t=qA(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&GA(e,i,t,n)}else{GA(e,t,t,n);var a=YA(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&HA.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function YA(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function XA(e,t,n,r){e.addEventListener(t,n,r)}function ZA(e,t,n,r){e.removeEventListener(t,n,r)}var QA=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function $A(e){return e.which===2||e.which===3}var ej=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a1&&r&&r.length>1){var a=tj(r)/tj(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=nj(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}},ij=`silent`;function aj(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:oj}}function oj(){QA(this.event)}var sj=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(qu),cj=function(){function e(e,t){this.x=e,this.y=t}return e}(),lj=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],uj=new Z(0,0,0,0),dj=function(e){B(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new cj(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new sj,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new VA(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(U(lj,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=mj(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new cj(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new cj(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=aj(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new cj(e,t);if(pj(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new Z(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(uj.copy(u.getBoundingRect()),u.transform&&uj.applyTransform(u.transform),uj.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function fj(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||ij}return!1}function pj(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=fj(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==ij)){t.target=o;break}}}function mj(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var hj=32,gj=7;function _j(e){for(var t=0;e>=hj;)t|=e&1,e>>=1;return e+t}function vj(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function yj(e,t,n){for(n--;t>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function xj(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function Sj(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function Cj(e,t){var n=gj,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]=gj||m>=gj);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-xj(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c=gj||g>=gj);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;cs&&(c=s),bj(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var Tj=!1;function Ej(){Tj||(Tj=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function Dj(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Oj=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Dj}return e.prototype.traverse=function(e,t){for(var n=0;n=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),kj=zo.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};function Aj(){return new Date().getTime()}var jj=function(e){B(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Aj()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(kj(t),!e._paused&&e.update())}kj(t)},t.prototype.start=function(){this._running||(this._time=Aj(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=Aj(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=Aj()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new Ku(e,t.loop);return this.addAnimator(n),n},t}(qu),Mj=300,Nj=zo.domSupported,Pj=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:W(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),Fj={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},Ij=!1;function Lj(e){var t=e.pointerType;return t===`pen`||t===`touch`}function Rj(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function zj(e){e&&(e.zrByTouch=!0)}function Bj(e,t){return JA(e.dom,new Hj(e,t),!0)}function Vj(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var Hj=function(){function e(e,t){this.stopPropagation=Io,this.stopImmediatePropagation=Io,this.preventDefault=Io,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),Uj={mousedown:function(e){e=JA(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=JA(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=JA(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=JA(this.dom,e);var t=e.toElement||e.relatedTarget;Vj(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){Ij=!0,e=JA(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){Ij||(e=JA(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=JA(this.dom,e),zj(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),Uj.mousemove.call(this,e),Uj.mousedown.call(this,e)},touchmove:function(e){e=JA(this.dom,e),zj(e),this.handler.processGesture(e,`change`),Uj.mousemove.call(this,e)},touchend:function(e){e=JA(this.dom,e),zj(e),this.handler.processGesture(e,`end`),Uj.mouseup.call(this,e),+new Date-this.__lastTouchMoment0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t=0;o--)r[o]&&!Sm(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[_M],e},t.prototype.setTheme=function(e){this._theme=new Cy(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i=t:n===`max`?e<=t:e===t}function AM(e,t){return e.join(`,`)===t.join(`,`)}var jM=U,MM=J,NM=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function PM(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=NM.length;n0?e[n-1].seriesModel:null)}),rN(e))})}function rN(e){U(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=Fp(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var iN=function(){function e(){this.group=new Kg,this.uid=Ex(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();qo(iN),es(iN);var aN=Dm(),oN={itemStyle:ts(by,!0),lineStyle:ts(_y,!0)},sN={lineStyle:`stroke`,itemStyle:`fill`};function cN(e,t){return e.visualStyleMapper||oN[t]||(console.warn(`Unknown style type '`+t+`'.`),oN.itemStyle)}function lN(e,t){return e.visualDrawType||sN[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var uN={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=cN(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=lN(e,r),c=a[s],l=K(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||K(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||K(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=H({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},dN=new Cy,fN={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=cN(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){dN.option=n[r];var o=i(dN);H(e.ensureUniqueItemVisual(t,`style`),o),dN.option.decal&&(e.setItemVisual(t,`decal`,dN.option.decal),dN.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},pN={performRawSeries:!0,overallReset:function(e){var t=X();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=e.type+`-`+e.getColorBy();aN(e).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(e){if(!e.isColorBySeries()){var t=e.getRawData(),n={},r=e.getData(),i=aN(e).scope,a=lN(e,e.visualStyleAccessPath||`itemStyle`);r.each(function(e){var t=r.getRawIndex(e);n[t]=e}),t.each(function(o){var s=n[o];if(r.getItemVisual(s,`colorFromPalette`)){var c=r.ensureUniqueItemVisual(s,`style`),l=t.getName(o)||o+``,u=t.count();c[a]=e.getColorFromPalette(l,i,u)}})}})}},mN=Math.PI;function hN(e,t){t||={},eo(t,{text:`loading`,textColor:Q.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:Q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Kg,r=new Gf({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new Xf({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Gf({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new A_({shape:{startAngle:-mN/2,endAngle:-mN/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:mN*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:mN*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var gN=function(){function e(e,t,n,r){this._stageTaskMap=X(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid);e.pipelineContext=n.context=e.__preparePipelineContext?e.__preparePipelineContext(t,n):$m(e,t,n)},e.prototype.restorePipelines=function(e,t){var n=this,r=n._pipelineMap=X();t.eachSeries(function(t){var i=e.painter.type===`canvas`&&t.getProgressive(),a=t.uid;r.set(a,{id:a,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(t,t.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;U(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});wo(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;U(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=X(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||EC({plan:xN,reset:SN,count:TN}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||EC({reset:_N});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=X(),c=e.seriesType,l=e.getTargetSeries,u=e.dirtyOnOverallProgress,d=!1;wo(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):U(n.getSeries(),f);function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,EC({reset:vN,onDirty:bN})));n.context={model:e,dirtyOnOverallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return K(e)&&(e={overallReset:e,seriesType:EN(e)}),e.uid=Ex(`stageHandler`),t&&(e.visualType=t),e},e}();function _N(e){e.overallReset(e.ecModel,e.api,e.payload)}function vN(e){return e.dirtyOnOverallProgress&&yN}function yN(){this.agent.dirty(),this.getDownstream().dirty()}function bN(){this.agent&&this.agent.dirty()}function xN(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function SN(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=om(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?W(t,function(e,t){return wN(t)}):CN}var CN=wN(0);function wN(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),IN=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],LN=IN.concat([`symbolKeepAspect`]),RN={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&$N(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function nP(e,t,n){for(var r=t.type===`radial`?tP(e,t,n):eP(e,t,n),i=t.colorStops,a=0;a0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:mo(e)?[e]:G(e)?e:null}function sP(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&oP(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=W(n,function(e){return e/i}),r/=i)}return[n,r]}var cP=new of(!0);function lP(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function uP(e){return typeof e==`string`&&e!==`none`}function dP(e){var t=e.fill;return t!=null&&t!==`none`}function fP(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function pP(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function mP(e,t,n){var r=ls(t.image,t.__image,n);if(ds(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Lo),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function hP(e,t,n,r,i){var a,o=lP(n),s=dP(n),c=n.strokePercent,l=c<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var d=t.path||cP,f=t.__dirty;if(!r){var p=n.fill,m=n.stroke,h=s&&!!p.colorStops,g=o&&!!m.colorStops,_=s&&!!p.image,v=o&&!!m.image,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0;(h||g)&&(C=t.getBoundingRect()),h&&(y=f?nP(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(b=f?nP(e,m,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),_&&(x=f||!t.__canvasFillPattern?mP(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(S=f||!t.__canvasStrokePattern?mP(e,m,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),h?e.fillStyle=y:_&&(x?e.fillStyle=x:s=!1),g?e.strokeStyle=b:v&&(S?e.strokeStyle=S:o=!1)}var w=t.getGlobalScale();d.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,E;e.setLineDash&&n.lineDash&&(a=sP(t),T=a[0],E=a[1]);var D=!0;(u||f&4)&&(d.setDPR(e.dpr),l?d.setContext(null):(d.setContext(e),D=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),D&&d.rebuildPath(e,l?c:1),T&&(e.setLineDash(T),e.lineDashOffset=E),r?(i.batchFill=s,i.batchStroke=o):n.strokeFirst?(o&&pP(e,n),s&&fP(e,n)):(s&&fP(e,n),o&&pP(e,n)),T&&e.setLineDash([])}function gP(e,t,n){var r=t.__image=ls(n.image,t.__image,t,t.onload);if(r&&ds(r)){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function _P(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=sP(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(lP(n)&&e.strokeText(i,n.x,n.y),dP(n)&&e.fillText(i,n.x,n.y)):(dP(n)&&e.fillText(i,n.x,n.y),lP(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var vP=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],yP=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function bP(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){jP(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?vd.opacity:o}(r||t.blend!==n.blend)&&(a||=(jP(e,i),!0),e.globalCompositeOperation=t.blend||vd.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[dF]){if(this._disposed){this.id;return}var r,i,a;if(J(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[dF]=!0,UF(this),!this._model||t){var o=new EM(this._api),s=this._theme,c=this._model=new yM;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},ZF);var l={seriesTransition:a,optionChanged:!0};if(n)this[pF]={silent:r,updateParams:l},this[dF]=!1,this.getZr().wakeUp();else{try{TF(this),OF.update.call(this,null,l)}catch(e){throw this[pF]=null,this[dF]=!1,e}this._ssr||this._zr.flush(),this[pF]=null,this[dF]=!1,MF.call(this,r),NF.call(this,r)}}},t.prototype.setTheme=function(e,t){if(!this[dF]){if(this._disposed){this.id;return}var n=this._model;if(n){var r=t&&t.silent,i=null;this[pF]&&(r??=this[pF].silent,i=this[pF].updateParams,this[pF]=null),this[dF]=!0,UF(this);try{this._updateTheme(e),n.setTheme(this._theme),TF(this),OF.update.call(this,{type:`setTheme`},i)}catch(e){throw this[dF]=!1,e}this[dF]=!1,MF.call(this,r),NF.call(this,r)}}},t.prototype._updateTheme=function(e){q(e)&&(e=$F[e]),e&&(e=V(e),e&&eN(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||zo.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return U(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;U(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return U(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(nI[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();U(tI,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(V(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=Ia.createCanvas(),h=nM(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return U(u,function(e){var t=e.left-o,n=e.top-s;g+=``+e.dom+``}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}return e.connectedBackgroundColor&&h.add(new Gf({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),U(u,function(e){var t=new Lf({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t,n){return kF(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return kF(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return kF(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return U(km(n,e),function(e,n){n.indexOf(`Models`)>=0&&U(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=km(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?VN(i,t):BN(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;U(KF,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&UN(i,function(e){var t=nh(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=H({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;U(YF,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),RA(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&Pm(this.getDom(),iI,``);var e=this,t=e._api,n=e._model;U(e._componentsViews,function(e){e.dispose(n,t)}),U(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete tI[e.id]},t.prototype.resize=function(e){if(!this[dF]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[pF]&&(r??=this[pF].silent,n=!0,this[pF]=null),this[dF]=!0,UF(this);try{n&&TF(this),OF.update.call(this,{type:`resize`,animation:H({duration:0},e&&e.animation)})}catch(e){throw this[dF]=!1,e}this[dF]=!1,MF.call(this,r),NF.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(J(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),eI[e]){var n=eI[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=H({},e);return t.type=JF[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(J(t)||(t={silent:!!t}),qF[e.type]&&this._model){if(this[dF]){this._pendingActions.push(e);return}var n=t.silent;jF.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&zo.browser.weChat&&this._throttledZrFlush(),MF.call(this,n),NF.call(this,n)}},t.prototype.updateLabelLayout=function(){WN.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){TF=function(e){OD(e._model);var t=e._scheduler;t.restorePipelines(e._zr,e._model),t.prepareStageTasks(),EF(e,!0),EF(e,!1),t.plan()},EF=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;cY(t.get(`hoverLayerThreshold`),dM.hoverLayerThreshold)&&!zo.node&&!zo.worker;(e._usingTHL||a)&&(t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){var t=e.states.emphasis;t&&t.hoverLayer!==2&&(t.hoverLayer=+!!a)})}}),e._usingTHL=a)}}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=Hv(e);t.eachRendered(function(e){return Wv(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!Z_(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(Z_(e))return;if(e instanceof jf&&Cg(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}zF=function(e){return new(function(t){B(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Jh(t,n),VF(e)},n.prototype.leaveEmphasis=function(t,n){Yh(t,n),VF(e)},n.prototype.enterBlur=function(t){Xh(t),VF(e)},n.prototype.leaveBlur=function(t){Zh(t),VF(e)},n.prototype.enterSelect=function(t){Qh(t),VF(e)},n.prototype.leaveSelect=function(t){$h(t),VF(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getECUpdateCycleVersion=function(){return e[fF]},n.prototype.usingTHL=function(){return e._usingTHL},n}(hh))(e)},BF=function(e){function t(e,t){for(var n=0;n=0)){_I.push(n);var o=gN.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function yI(e,t){eI[e]=t}function bI(e,t,n){var r=qN(`registerMap`);r&&r(e,t,n)}var xI=IC;gI(nF,uN),gI(aF,fN),gI(aF,pN),gI(nF,RN),gI(aF,zN),gI(lF,GP),cI(eN),lI(YP,tN),yI(`default`,hN),pI({type:Ch,event:Ch,update:Ch},Io),pI({type:wh,event:wh,update:wh},Io),pI({type:Th,event:Oh,update:Th,action:Io,refineEvent:SI,publishNonRefinedEvent:!0}),pI({type:Eh,event:Oh,update:Eh,action:Io,refineEvent:SI,publishNonRefinedEvent:!0}),pI({type:Dh,event:Oh,update:Dh,action:Io,refineEvent:SI,publishNonRefinedEvent:!0});function SI(e,t,n,r){return{eventContent:{selected:ug(n),isFromClick:t.isFromClick||!1}}}sI(`default`,{}),sI(`dark`,PN);var CI=[],wI={registerPreprocessor:cI,registerProcessor:lI,registerPostInit:uI,registerPostUpdate:dI,registerUpdateLifecycle:fI,registerAction:pI,registerCoordinateSystem:mI,registerLayout:hI,registerVisual:gI,registerTransform:xI,registerLoading:yI,registerMap:bI,registerImpl:KN,PRIORITY:uF,ComponentModel:mC,ComponentView:iN,SeriesModel:_w,ChartView:dT,registerComponentModel:function(e){mC.registerClass(e)},registerComponentView:function(e){iN.registerClass(e)},registerSeriesModel:function(e){_w.registerClass(e)},registerChartView:function(e){dT.registerClass(e)},registerCustomSeries:function(e,t){YN(e,t)},registerSubTypeDefaulter:function(e,t){mC.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){rM(e,t)}};function TI(e){if(G(e)){U(e,function(e){TI(e)});return}to(CI,e)>=0||(CI.push(e),K(e)&&(e={install:e}),e.install(wI))}var EI=function(){function e(){}return e.prototype.needIncludeZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),DI=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`grid`,jm).models[0]},t.type=`cartesian2dAxis`,t}(mC);ro(DI,EI);var OI={show:!0,z:0,inverse:!1,name:``,nameLocation:`end`,nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:`...`,placeholder:`.`},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:`auto`,onZeroAxisIndex:null,lineStyle:{color:Q.color.axisLine,width:1,type:`solid`},symbol:[`none`,`none`],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:Q.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:Q.color.axisSplitLine,width:1,type:`solid`}},splitArea:{show:!1,areaStyle:{color:[Q.color.backgroundTint,Q.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:Q.color.neutral00,borderColor:Q.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:`auto`}},kI=Qa({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:`auto`,show:`auto`},axisLabel:{interval:`auto`}},OI),AI=Qa({boundaryGap:[0,0],axisLine:{show:`auto`},axisTick:{show:`auto`},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:Q.color.axisMinorSplitLine,width:1}}},OI),jI={category:kI,value:AI,time:Qa({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:`bold`}}},splitLine:{show:!1}},AI),log:eo({logBase:10},AI)};function MI(e,t,n,r){U(vE,function(i,a){var o=Qa(Qa({},jI[a],!0),r,!0),s=function(e){B(n,e);function n(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t+`Axis.`+a,n}return n.prototype.mergeDefaultAndTheme=function(e,t){var n=lC(this),r=n?dC(e):{};Qa(e,t.getTheme().get(a+`Axis`)),Qa(e,this.getDefaultOption()),e.type=NI(e),n&&uC(e,r,n)},n.prototype.optionUpdated=function(){this.option.type===`category`&&(this.__ordinalMeta=CT.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if(t.type===`category`)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.updateAxisBreaks=function(e){var t=CO();return t?t.updateModelAxisBreak(this,e):{breaks:[]}},n.type=t+`Axis.`+a,n.defaultOption=o,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+`Axis`,NI)}function NI(e){return e.type||(e.data?`category`:`value`)}var PI=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return W(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),oo(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),FI=[`x`,`y`];function II(e){return(e.type===`interval`||e.type===`time`)&&!oS(e)}var LI=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=Lk,t.dimensions=FI,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(II(e)&&II(t)){var n=AT(e,null),r=AT(t,null),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(o&&s){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=ys([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new Z(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return Fs(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return Fs(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new Z(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(PI);function RI(e,t){var n=e.scale,r=e.model,i=wk(n,r,r.ecModel,e,null),a=zT(n),o=zT(t)?t.intervalStub:t,s=a?n.intervalStub:n,c=n.base,l=o.getTicks(),u=o.getTicks({expandToNicedExtent:!0}),d=l.length-1,f,p,m;if(d===1)f=p=0,m=1;else if(d===2){var h=hp(l[0].value-l[1].value),g=hp(l[1].value-l[2].value);f=p=0,h===g?m=2:(m=1,h=C[1])return!0})):b[1]?(T=C[1],A(function(){if(te(),k=Ap(O-E*m,D),j(),w<=C[0])return!0})):A(function(){k=Ap(vp(C[0]/E)*E,D),O=Ap(_p(C[1]/E)*E,D);var e=gp((O-k)/E);if(e<=m){var t=m-e,n=void 0,r=i.incl0||a;if(r&&C[0]===0)n=[0,t];else if(r&&C[1]===0)n=[t,0];else{var o=_p(t/2);n=t%2==0?[o,o]:w+T=C[1])return!0}})}PE(n,b,S,[w,T],x,{interval:E,intervalCount:m,intervalPrecision:D,niceExtent:[k,O]})}function zI(e,t){var n=zT(e),r=n?e.intervalStub:e,i=t.fixMinMax||[],a=n?e.getExtent():null,o=r.getExtent(),s=GT(o,i,t.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var c=n?VI(r,t):BI(r,t),l=c.intervalPrecision,u=c.interval,d=t.userInterval;d!=null&&(c.interval=d,c.intervalPrecision=HT(d)),i[0]||(s[0]=Ap(_p(s[0]/u)*u,l)),i[1]||(s[1]=Ap(vp(s[1]/u)*u,l)),d!=null&&(c.niceExtent=s.slice()),PE(e,i,o,s,a,c)}function BI(e,t){var n=qT(t.splitNumber,5),r=MT(e),i=t.minInterval,a=t.maxInterval,o=Up(r/n,!0);i!=null&&oa&&(o=a);var s=HT(o),c=e.getExtent(),l=[Ap(vp(c[0]/o)*o,s),Ap(_p(c[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:l}}function VI(e,t){var n=qT(t.splitNumber,10),r=e.getExtent(),i=MT(e),a=mp(Vp(i),1);n/i*a<=.5&&(a*=10);var o=HT(a),s=[Ap(vp(r[0]/a)*a,o),Ap(_p(r[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:s}}function HI(e){var t=e.scale,n=e.model,r=n.axis,i=n.ecModel;UI(t,n,r,i,null)}function UI(e,t,n,r,i){var a=wk(e,t,r,n,i),o=LT(e)||RT(e);WI(e,{splitNumber:t.get(`splitNumber`),fixMinMax:a.fixMM,userInterval:t.get(`interval`),minInterval:o?t.get(`minInterval`):null,maxInterval:o?t.get(`maxInterval`):null,rawExtentResult:a}),n&&r&&Ek(n,e,a,r)}function WI(e,t){GI[e.type](e,t)}var GI={interval:zI,log:zI,time:uE,ordinal:Io},KI=[[3,1],[0,2]],qI=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=FI,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;U(this._axesList,function(e){vk(e,1);var t=e.scale;BT(t)&&t.setSortInfo(e.model.get(`categorySortInfo`))});function r(e){for(var t=co(e),n=[],r=t.length-1;r>=0;r--){var i=e[+t[r]];i.__alignTo?n.push(i):HI(i)}U(n,function(e){QI(e,e.__alignTo)?HI(e):RI(e,e.__alignTo.scale)})}r(n.x),r(n.y);var i={};U(n.x,function(e){YI(n,`y`,e,i)}),U(n.y,function(e){YI(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=sC(e,t),i=this._rect=iC(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(eL(a,i),!n){var c=iL(i,o,a,s,t),l=void 0;if(s)nL?(nL(this._axesList,i),eL(a,i)):l=rL(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=oL(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=rL(d,f,p,i,a,c,r))}aL(i,a,sD.determine,null,l,r),U(this._coordsList,function(e){e.calcAffineTransform()})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}J(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r=0;i--){var a=e[+t[i]];IT(a.scale)&&ME(a.model,a.type,!0)==null&&(a.model.get(`alignTicks`)&&a.model.get(`interval`)==null?r.push(a):n=a)}n||=r.pop(),n&&U(r,function(e){e.__alignTo=n})}function QI(e,t){return oS(e.scale)||oS(t.scale)||t.scale.getTicks().length<2}function $I(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function eL(e,t){U(e.x,function(e){return tL(e,t.x,t.width)}),U(e.y,function(e){return tL(e,t.y,t.height)})}function tL(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),$I(e,t)}var nL;function rL(e,t,n,r,i,a,o){aL(r,i,sD.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=so(s,function(e){return e>0})==null;return Mv(r,s,!0,!0,n),eL(i,r),c;function l(e){U(i[iv[e]],function(t){if(jE(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i0&&!yo(t)&&t>1e-4&&(e/=t),e}}function iL(e,t,n,r,i){var a=new AO(sL);return U(n,function(n){return U(n,function(n){if(jE(n.model)){var o=!r;n.axisBuilder=sk(e,t,n.model,i,a,o)}})}),a}function aL(e,t,n,r,i,a){var o=n===sD.determine;U(t,function(t){return U(t,function(t){jE(t.model)&&(ck(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[iv[1-t]]=e[av[t]]<=a.refContainer[av[t]]*.5?0:1-t==1?2:1}U(t,function(e,t){return U(e,function(e){jE(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function oL(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=iC(e.get(`outerBounds`,!0)||Fk,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||to([`all`,`axisLabel`],a)<0?`all`:a,s=[Dp(Y(e.get(`outerBoundsClampWidth`,!0),Ik[0]),t.width),Dp(Y(e.get(`outerBoundsClampHeight`,!0),Ik[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var sL=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;PO(e,t,n,r,i,a),AE(e.nameLocation)||U(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&IO(e.labelInfoList,e.dirVec,r,i)})};function cL(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return lL(n,e,t),n.seriesInvolved&&dL(n,e),n}function lL(e,t,n){var r=t.getComponent(`tooltip`),i=t.getComponent(`axisPointer`),a=i.get(`link`,!0)||[],o=[];U(n.getCoordinateSystems(),function(n){if(!n.axisPointerEnabled)return;var s=vL(n.model),c=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var l=n.model.getModel(`tooltip`,r);if(U(n.getAxes(),fo(p,!1,null)),n.getTooltipAxes&&r&&l.get(`show`)){var u=l.get(`trigger`)===`axis`,d=l.get([`axisPointer`,`type`])===`cross`,f=n.getTooltipAxes(l.get([`axisPointer`,`axis`]));(u||d)&&U(f.baseAxes,fo(p,!d||`cross`,u)),d&&U(f.otherAxes,fo(p,`cross`,!1))}function p(r,s,u){var d=u.model.getModel(`axisPointer`,i),f=d.get(`show`);if(f&&(f!==`auto`||r||_L(d))){s??=d.get(`triggerTooltip`),d=r?uL(u,l,i,t,r,s):d;var p=d.get(`snap`),m=d.get(`triggerEmphasis`),h=vL(u.model),g=s||p||u.type===`category`,_=e.axesInfo[h]={key:h,axis:u,coordSys:n,axisPointerModel:d,triggerTooltip:s,triggerEmphasis:m,involveSeries:g,snap:p,useHandle:_L(d),seriesModels:[],linkGroup:null};c[h]=_,e.seriesInvolved=e.seriesInvolved||g;var v=fL(a,u);if(v!=null){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[h]=_,y.mapper=a[v].mapper,_.linkGroup=y}}}})}function uL(e,t,n,r,i,a){var o=t.getModel(`axisPointer`),s=[`type`,`snap`,`lineStyle`,`shadowStyle`,`label`,`animation`,`animationDurationUpdate`,`animationEasingUpdate`,`z`],c={};U(s,function(e){c[e]=V(o.get(e))}),c.snap=e.type!==`category`&&!!a,o.get(`type`)===`cross`&&(c.type=`line`);var l=c.label||={};if(l.show??=!1,i===`cross`&&(l.show=o.get([`label`,`show`])??!0,!a)){var u=c.lineStyle=o.get(`crossStyle`);u&&eo(l,u.textStyle)}return e.model.getModel(`axisPointer`,new Cy(c,n,r))}function dL(e,t){t.eachSeries(function(t){var n=t.coordinateSystem,r=t.get([`tooltip`,`trigger`],!0),i=t.get([`tooltip`,`show`],!0);n&&n.model&&r!==`none`&&r!==!1&&r!==`item`&&i!==!1&&t.get([`axisPointer`,`show`],!0)!==!1&&U(e.coordSysAxesInfo[vL(n.model)],function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),e.seriesDataCount??=0,e.seriesDataCount+=t.getData().count())})})}function fL(e,t){for(var n=t.model,r=t.dim,i=0;i=0||e===t}function mL(e){var t=hL(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=_L(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent();(o==null||o>c[1])&&(o=c[1]),o3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(NL(this._zr,`globalPan`)||LL(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(QA(r.event),r.__ecRoamConsumed=!0,WL(e,t,n,r,i))},t}(qu);function LL(e){return e.__ecRoamConsumed}var RL=Dm();function zL(e){var t=RL(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function BL(e,t,n,r){for(var i=zL(e).roam,a=i[t]=i[t]||[],o=0;o1e-6;IR[0]=o?(i[0]-r.x)/a:i[0],IR[1]=o?(i[1]-r.y)/a:i[1],Fs(IR,IR,e.mtRawInv);var s=MR(e,IR);LR(t,s,a),U(n,function(e){e!==t&&LR(e,s.slice(),a)})}var IR=[];function LR(e,t,n){var r=e.option;r.center=t,r.zoom=n}function RR(e,t){if(t){var n=t.min||0,r=t.max||1/0;e=Math.max(Math.min(r,e),n)}return e}function zR(e,t){var n=t.getShallow(`nodeScaleRatio`,!0)||1,r=KL(e);return((r.zoom-1)*n+1)/(r.trans[2].scaleX||1)}function BR(e,t,n,r,i,a,o,s){if(!DR(e)){n.disable();return}n.enable(Y(e.get(`roam`),o),{api:t,zInfo:{component:e},triggerInfo:{roamTrigger:e.get(`roamTrigger`),isInSelf:r,isInClip:function(e,t,n){return!i||i.contain(t,n)}}});function c(n){var r=e.mainType,i=Kv(eo({type:HR(r,e.subType,ph)},n));s&&(i.componentType=r),i[r+`Id`]=e.id,t.dispatchAction(i)}n.off(`pan`).off(`zoom`).on(`pan`,function(e){a&&a(`pan`),c({dx:e.dx,dy:e.dy})}).on(`zoom`,function(e){a&&a(`zoom`),c({zoom:e.scale,originX:e.originX,originY:e.originY})})}new Z(0,0,0,0);function VR(e,t,n){var r=HR(t,n,ph);e.registerAction({type:r,event:r,update:`none`},function(e,r,i){r.eachComponent(Nm(e,t,n),function(t){ER(e,t),OR(e,t,r,i)})})}function HR(e,t,n){return(e===`series`?t===`map`?`geo`:t:e)+n}function UR(e){return e.zoom!=null}function WR(e,t,n,r,i,a,o){var s=new JL(null,PR(e.ecModel,t));return aR(s,n,r,i,a),o?oR(s,o.x,o.y,o.width,o.height):oR(s,n,r,i,a),iR(s,e),s}var GR=Dm();function KR(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:`data`}),e.datas=e.mainData=null,$R(t,n,e),U(n,function(n){U(t.TRANSFERABLE_METHODS,function(t){n.wrapMethod(t,fo(qR,e))})}),t.wrapMethod(`cloneShallow`,fo(YR,e)),U(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,fo(JR,e))}),wo(n[t.dataType]===t)}function qR(e,t){if(QR(this)){var n=H({},GR(this).datas);n[this.dataType]=t,$R(t,n,e)}else ez(t,this.dataType,GR(this).mainData,e);return t}function JR(e,t){return e.struct&&e.struct.update(),t}function YR(e,t){return U(GR(t).datas,function(n,r){n!==t&&ez(n.cloneShallow(),r,t,e)}),t}function XR(e){var t=GR(this).mainData;return e==null||t==null?t:GR(t).datas[e]}function ZR(){var e=GR(this).mainData;return e==null?[{data:e}]:W(co(GR(e).datas),function(t){return{type:t,data:GR(e).datas[t]}})}function QR(e){return GR(e).mainData===e}function $R(e,t,n){GR(e).datas={},U(t,function(t,r){ez(t,r,e,n)})}function ez(e,t,n,r){GR(n).datas[t]=e,GR(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=XR,e.getLinkedDataAll=ZR}var tz=U,nz=J,rz=-1,iz=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=V(t);this.type=r,this.mappingMethod=n,this._normalizeData=gz[n];var a=e.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],n===`piecewise`?(sz(i),az(i)):n===`category`?i.categories?oz(i):sz(i,!0):(wo(n!==`linear`||i.dataExtent),sz(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return uo(this._normalizeData,this)},e.listVisualTypes=function(){return co(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){J(e)?U(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,a=G(t)?[]:J(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var o=n.call(r,e,t);i?a=o:a[t]=o}),a},e.retrieveVisuals=function(t){var n={},r;return t&&tz(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(n[i]=t[i],r=!0)}),r?n:null},e.prepareVisualTypes=function(e){if(G(e))e=e.slice();else if(nz(e)){var t=[];tz(e,function(e,n){t.push(n)}),e=t}else return[];return e.sort(function(e,t){return t===`color`&&e!==`color`&&e.indexOf(`color`)===0?1:-1}),e},e.dependsOn=function(e,t){return t===`color`?!!(e&&e.indexOf(t)===0):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,a=0,o=t.length;a=0;a--)r[a]??(delete n[t[a]],t.pop())}function sz(e,t){var n=e.visual,r=[];J(n)?tz(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),hz(e,r)}function cz(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:pz([0,1])}}function lz(e){var t=this.option.visual;return t[Math.round(wp(e,[0,1],[0,t.length-1],!0))]||{}}function uz(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function dz(e){var t=this.option.visual;return t[this.option.loop&&e!==rz?e%t.length:e]}function fz(){return this.option.visual[0]}function pz(e){return{linear:function(t){return wp(t,e,this.option.visual,!0)},category:dz,piecewise:function(t,n){var r=mz.call(this,n);return r??=wp(t,e,this.option.visual,!0),r},fixed:fz}}function mz(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[iz.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function hz(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=W(t,function(e){return Gl(e)||[0,0,0,1]})),t}var gz={linear:function(e){return wp(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=iz.findPieceIndex(e,t,!0);if(n!=null)return wp(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??rz},fixed:Io};function _z(e,t,n){return e?t<=n:t=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof bz||(t=this._nodesMap[vz(t)]),t){for(var i=n===`out`?`outEdges`:n===`in`?`inEdges`:`edges`,a=0;a=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i=0&&!e.hasKey(p)&&(e.set(p,!0),a.push(f.node1))}for(s=0;s=0&&!e.hasKey(v)&&(e.set(v,!0),o.push(_.node2))}}}return{edge:e.keys(),node:t.keys()}},e}(),xz=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=n??-1}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=X(),t=X();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i=0&&!e.hasKey(u)&&(e.set(u,!0),n.push(l.node1))}for(i=0;i=0&&!e.hasKey(m)&&(e.set(m,!0),r.push(p.node2))}return{edge:e.keys(),node:t.keys()}},e}();function Sz(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||`value`),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}ro(bz,Sz(`hostGraph`,`data`)),ro(xz,Sz(`hostGraph`,`edgeData`));function Cz(e,t,n,r,i){for(var a=new yz(r),o=0;o `+f)),l++)}var p=n.get(`coordinateSystem`),m;if(p===`cartesian2d`||p===`polar`||p===`matrix`)m=xx(e,n);else{var h=ax.get(p),g=h&&h.dimensions||[];to(g,`value`)<0&&g.concat([`value`]);var _=ex(e,{coordDimensions:g,encodeDefine:n.getEncode()}).dimensions;m=new $b(_,n),m.initData(e)}var v=new $b([`value`],n);return v.initData(c,s),i&&i(m,v),KR({mainData:m,struct:a,structAttr:`graph`,datas:{node:m,edge:v},datasAttr:{node:`data`,edge:`edgeData`}}),a.update(),a}var wz=`-->`,Tz=function(e){return e.get(`autoCurveness`)||null},Ez=function(e,t){var n=Tz(e),r=20,i=[];if(mo(n))r=n;else if(G(n)){e.__curvenessList=n;return}t>r&&(r=t);var a=r%2?r+2:r+3;i=[];for(var o=0;o `),value:i.value,noValue:i.value==null})}return pw({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=W(this.option.categories||[],function(e){return e.value==null?H({value:0},e):e}),t=new $b([`value`],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get(`layout`)===`force`&&this.get([`force`,`layoutAnimation`]))},t.prototype.__ownRoamView=function(){var e=this.coordinateSystem;return xR(e)&&e},t.type=`series.`+Fz,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={z:2,coordinateSystem:`view`,legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:`center`,top:`center`,symbol:`circle`,symbolSize:10,edgeSymbol:[`none`,`none`],edgeSymbolSize:10,edgeLabel:{position:`middle`,distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:`{b}`},itemStyle:{},lineStyle:{color:Q.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:Q.color.primary}}},t}(_w);function Lz(e){return e instanceof Array||(e=[e,e]),e}var Rz=eh(Fz,zz);function zz(e){e.eachSeriesByType(Fz,function(e){var t=e.getGraph(),n=e.getEdgeData(),r=Lz(e.get(`edgeSymbol`)),i=Lz(e.get(`edgeSymbolSize`));n.setVisual(`fromSymbol`,r&&r[0]),n.setVisual(`toSymbol`,r&&r[1]),n.setVisual(`fromSymbolSize`,i&&i[0]),n.setVisual(`toSymbolSize`,i&&i[1]),n.setVisual(`style`,e.getModel(`lineStyle`).getLineStyle()),n.each(function(e){var r=n.getItemModel(e),i=t.getEdgeByIndex(e),a=Lz(r.getShallow(`symbol`,!0)),o=Lz(r.getShallow(`symbolSize`,!0)),s=r.getModel(`lineStyle`).getLineStyle(),c=n.ensureUniqueItemVisual(e,`style`);switch(H(c,s),c.stroke){case`source`:var l=i.node1.getVisual(`style`);c.stroke=l&&l.fill;break;case`target`:var l=i.node2.getVisual(`style`);c.stroke=l&&l.fill}a[0]&&i.setVisual(`fromSymbol`,a[0]),a[1]&&i.setVisual(`toSymbol`,a[1]),o[0]&&i.setVisual(`fromSymbolSize`,o[0]),o[1]&&i.setVisual(`toSymbolSize`,o[1])})})}function Bz(e){var t=e.coordinateSystem;if(!(t&&t.type!==`view`)){var n=e.getGraph();n.eachNode(function(e){var t=e.getModel();e.setLayout([+t.get(`x`),+t.get(`y`)])}),Vz(n,e)}}function Vz(e,t){e.eachEdge(function(e,n){var r=xo(e.getModel().get([`lineStyle`,`curveness`]),-Pz(e,t,n,!0),0),i=Ss(e.node1.getLayout()),a=Ss(e.node2.getLayout()),o=[i,a];+r&&o.push([(i[0]+a[0])/2-(i[1]-a[1])*r,(i[1]+a[1])/2-(a[0]-i[0])*r]),e.setLayout(o)})}var Hz=eh(Fz,Uz);function Uz(e,t){e.eachSeriesByType(Fz,function(e){var t=e.get(`layout`),n=e.coordinateSystem;if(n&&n.type!==`view`){var r=e.getData(),i=[];U(n.dimensions,function(e){i=i.concat(r.mapDimensionsAll(e))});for(var a=0;a0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0].8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Kg),_B=function(){function e(e){this.group=new Kg,this._LineCtor=e||gB}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=yB(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=yB(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!vB(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i0}function yB(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:ey(t)}}function bB(e){return isNaN(e[0])||isNaN(e[1])}function xB(e){return e&&!bB(e[0])&&!bB(e[1])}var SB=[],CB=[],wB=[],TB=Sl,EB=Ps,DB=Math.abs;function OB(e,t,n){for(var r=e[0],i=e[1],a=e[2],o=1/0,s,c=n*n,l=.1,u=.1;u<=.9;u+=.1){SB[0]=TB(r[0],i[0],a[0],u),SB[1]=TB(r[1],i[1],a[1],u);var d=DB(EB(SB,t)-c);d=0?s+=l:s-=l:m>=0?s-=l:s+=l}return s}function kB(e,t){var n=[],r=El,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(e,s){var c=e.getLayout(),l=e.getVisual(`fromSymbol`),u=e.getVisual(`toSymbol`);c.__original||(c.__original=[Ss(c[0]),Ss(c[1])],c[2]&&c.__original.push(Ss(c[2])));var d=c.__original;if(c[2]!=null){if(xs(i[0],d[0]),xs(i[1],d[2]),xs(i[2],d[1]),l&&l!==`none`){var f=Gz(e.node1),p=OB(i,d[0],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(u&&u!==`none`){var f=Gz(e.node2),p=OB(i,d[1],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}xs(c[0],i[0]),xs(c[1],i[2]),xs(c[2],i[1])}else{if(xs(a[0],d[0]),xs(a[1],d[1]),Es(o,a[1],a[0]),As(o,o),l&&l!==`none`){var f=Gz(e.node1);Ts(a[0],a[0],o,f*t)}if(u&&u!==`none`){var f=Gz(e.node2);Ts(a[1],a[1],o,-f*t)}xs(c[0],a[0]),xs(c[1],a[1])}})}var AB=Dm();function jB(e){if(e)return AB(e).bridge}var MB=function(e){B(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=Fz,t}return t.prototype.init=function(e,t){var n=new Ww,r=new _B,i=this.group,a=new Kg;this._controller=new IL(t.getZr()),a.add(n.group),a.add(r.group),i.add(a),this._symbolDraw=n,this._lineDraw=r,this._mainGroup=a,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=DR(e),a=!1;this._model=e,this._api=n,this._active=!0;var o=this._mainGroup,s=this._getThumbnailInfo();s&&s.bridge.reset(n);var c=this._symbolDraw,l=this._lineDraw;i&&SR(o,2,i,this._firstRender?null:e),kB(e.getGraph(),Wz(e));var u=e.getData();c.updateData(u);var d=e.getEdgeData();l.updateData(d),this._updateNodeAndLinkScale(),i&&BR(e,n,this._controller,function(t,n,r){return e.coordinateSystem.containPoint([n,r])},null),clearTimeout(this._layoutTimeout);var f=e.forceLayout,p=e.get([`force`,`layoutAnimation`]);f&&(a=!0,this._startForceLayoutIteration(f,n,p));var m=e.get(`layout`);u.graph.eachNode(function(t){var i=t.dataIndex,a=t.getGraphicEl(),o=t.getModel();if(a){a.off(`drag`).off(`dragend`);var s=o.get(`draggable`);s&&a.on(`drag`,function(o){switch(m){case`force`:f.warmUp(),!r._layouting&&r._startForceLayoutIteration(f,n,p),f.setFixed(i),u.setItemLayout(i,[a.x,a.y]);break;case`circular`:u.setItemLayout(i,[a.x,a.y]),t.setLayout({fixed:!0},!0),Jz(e,`symbolSize`,t,[o.offsetX,o.offsetY]),r.updateLayout(e);break;default:u.setItemLayout(i,[a.x,a.y]),Vz(e.getGraph(),e),r.updateLayout(e)}}).on(`dragend`,function(){f&&f.setUnfixed(i)}),a.setDraggable(s,!!o.get(`cursor`)),o.get([`emphasis`,`focus`])===`adjacency`&&(nh(a).focus=t.getAdjacentDataIndices())}}),u.graph.eachEdge(function(e){var t=e.getGraphicEl(),n=e.getModel().get([`emphasis`,`focus`]);t&&n===`adjacency`&&(nh(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var h=e.get(`layout`)===`circular`&&e.get([`circular`,`rotateLabel`]),g=u.getLayout(`cx`),_=u.getLayout(`cy`);u.graph.eachNode(function(e){Xz(e,h,g,_)}),this._firstRender=!1,a||this._renderThumbnail(e,n,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},t.prototype._startForceLayoutIteration=function(e,t,n){var r=this,i=!1;(function a(){e.step(function(e){r.updateLayout(r._model),(e||!i)&&(i=!0,r._renderThumbnail(r._model,t,r._symbolDraw,r._lineDraw)),(r._layouting=!e)&&(n?r._layoutTimeout=setTimeout(a,16):a())})})()},t.prototype.__updateOnOwnRoam=function(e,t,n){var r=DR(t);this._active&&r&&(SR(this._mainGroup,2,r,null),UR(e)&&(this._updateNodeAndLinkScale(),kB(t.getGraph(),Wz(t)),this._lineDraw.updateLayout(),n.updateLabelLayout()),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=Wz(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(n)})},t.prototype.updateLayout=function(e){this._active&&(kB(e.getGraph(),Wz(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var e=this._model,t=e.coordinateSystem;if(t.type===`view`){var n=jB(e);if(n)return{bridge:n,coordSys:t}}},t.prototype._updateThumbnailWindow=function(){var e=this._getThumbnailInfo();e&&e.bridge.updateWindow(XL(null,e.coordSys),this._api)},t.prototype._renderThumbnail=function(e,t,n,r){var i=this._getThumbnailInfo();if(i){var a=new Kg,o=n.group.children(),s=r.group.children(),c=new Kg,l=new Kg;a.add(l),a.add(c);for(var u=0;ua&&(t[1-r]=Fp(t[r],d.sign*a)),t}function zB(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function BB(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var VB=Dm(),HB=V,UB=uo,WB=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Kg,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=fo(GB,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}YB(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&$D(r).w>o)return!0;if(a){var s=hL(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=VB(e).pointerEl=new nv[i.type](HB(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=VB(e).labelEl=new Xf(HB(t.label));e.add(i),qB(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=VB(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=VB(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),qB(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=Dv(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){QA(e.event)},onmousedown:UB(this._onHandleDragMove,this,0,0),drift:UB(this._onHandleDragMove,this),ondragend:UB(this._onHandleDragEnd,this)}),n.add(r)),YB(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);G(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,nA(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){GB(this._axisPointerModel,!t&&this._moveAnimation,this._handle,JB(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(JB(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(JB(r)),VB(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),rA(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function GB(e,t,n,r){KB(VB(n).lastProp,r)||(VB(n).lastProp=r,t?Y_(n,r,e):(n.stopAnimation(),n.attr(r)))}function KB(e,t){if(J(e)&&J(t)){var n=!0;return U(t,function(t,r){n&&=KB(e[r],t)}),!!n}return e===t}function qB(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function JB(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function YB(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function XB(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function ZB(e,t,n,r,i){var a=$B(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=GS(o.get(`padding`)||0),c=o.getFont(),l=_c(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),QB(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:ty(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function QB(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function $B(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:EE(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};U(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),q(o)?a=o.replace(`{value}`,a):K(o)&&(a=o(s))}return a}function eV(e,t,n){var r=fs();return _s(r,r,n.rotation),gs(r,r,n.position),bv([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function tV(e,t,n,r,i,a){var o=LO.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),ZB(t,r,i,a,{position:eV(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function nV(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function rV(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function iV(e,t,n){return $D(e,{fromStat:{sers:W(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function aV(e,t,n){return[mp(pp(t[0],t[1]),e-n/2),pp(e+n/2,mp(t[0],t[1]))]}var oV=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=sV(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=XB(r),f=cV[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}tV(t,e,ik(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=ik(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=eV(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=sV(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=pp(o[1],l[c]),l[c]=mp(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(WB);function sV(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var cV={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:nV([t,r[0]],[t,r[1]],lV(e))}},shadow:function(e,t,n,r,i,a){var o=iV(e,i,a),s=r[1]-r[0],c=aV(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:rV([l,r[0]],[u-l,s],lV(e))}}};function lV(e){return e.dim===`x`?0:1}var uV=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:Q.color.border,width:1,type:`dashed`},shadowStyle:{color:Q.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:Q.color.neutral00,padding:[5,7,5,7],backgroundColor:Q.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:Q.color.accent40,throttle:40}},t}(mC),dV=Dm(),fV=U;function pV(e,t,n){if(!zo.node){var r=t.getZr();dV(r).records||(dV(r).records={}),mV(r,t);var i=dV(r).records[e]||(dV(r).records[e]={});i.handler=n}}function mV(e,t){if(dV(e).initialized)return;dV(e).initialized=!0,n(`click`,fo(_V,`click`)),n(`mousemove`,fo(_V,`mousemove`)),n(`mousewheel`,fo(_V,`mousewheel`)),n(`globalout`,gV);function n(n,r){e.on(n,function(n){var i=vV(t);fV(dV(e).records,function(e){e&&r(e,n,i.dispatchAction)}),hV(i.pendings,t)})}}function hV(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function gV(e,t,n){e.handler(`leave`,null,n)}function _V(e,t,n,r){t.handler(e,n,r)}function vV(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function yV(e,t){if(!zo.node){var n=t.getZr();(dV(n).records||{})[e]&&(dV(n).records[e]=null)}}var bV=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;pV(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){yV(`axisPointer`,t)},t.prototype.dispose=function(e,t){yV(`axisPointer`,t)},t.type=`axisPointer`,t}(iN);function xV(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=Em(a,e);if(o==null||o<0||G(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(W(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var SV=Dm();function CV(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||uo(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){NV(i)&&(i=xV({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=NV(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||NV(i),f={},p={},m={list:[],map:{}},h={showPointer:fo(EV,p),showTooltip:fo(DV,m)};U(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);U(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=jV(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&wV(e,o,h,!1,f)}})});var g={};return U(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&U(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,MV(t),MV(e)))),g[e.key]=a}})}),U(g,function(e,t){wV(u[t],e,h,!0,f)}),OV(p,u,f),kV(m,i,e,o),AV(u,o,n),f}}function wV(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=TV(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&H(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function TV(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return U(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(Xp(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),U(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function EV(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function DV(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=vL(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function OV(e,t,n){var r=n.axesInfo=[];U(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function kV(e,t,n,r){if(NV(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function AV(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=SV(r)[i]||{},o=SV(r)[i]={};U(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&U(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}U(a,function(e,t){!o[t]&&c.push(l(e))}),U(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function jV(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function MV(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function NV(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function PV(e){bL.registerAxisPointerClass(`CartesianAxisPointer`,oV),e.registerComponentModel(uV),e.registerComponentView(bV),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!G(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=cL(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},CV)}function FV(e){TI(jL),TI(PV)}function IV(e,t){var n=GS(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new Gf({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var LV=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click|mousewheel`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:Q.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:Q.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:Q.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:Q.color.tertiary,fontSize:14}},t}(mC);function RV(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function zV(e){if(zo.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`
`}function YV(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(zo.transformSupported?``+GV+i:`,left`+i+`,top`+i)),WV+`:`+a}function XV(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!zo.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=zo.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+GV+`:`+o+`;`:[[`top`,0],[`left`,0],[BV,o]]}function ZV(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=Y(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),U([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function QV(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=dw(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(YV(a,n,r)),o&&i.push(`background-color:`+o),U([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=WS(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(ZV(d)),f!=null&&i.push(`padding:`+GS(f).join(`px `)+`px`),i.join(`;`)+`;`}function $V(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&Fx(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var eH=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,zo.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(q(i)?document.querySelector(i):_o(i)?i:K(i)&&i(e.getDom()));$V(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;JA(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=UV(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=KV+QV(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+XV(i[0],i[1],!0)+(`border-color:`+ZS(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(q(i)&&n.get(`trigger`)===`item`&&!RV(n)&&(o=JV(n,r,i)),q(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,G(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(e.get(`trigger`)!==`axis`&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!zo.node&&n.getDom()){var i=cH(r,n);this._ticket=``;var a=r.dataByCoordSys,o=pH(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=aH;c.x=r.x,c.y=r.y,c.update(),nh(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=xV(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(cH(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&sH([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(nh(n).ssrType===`legend`)return;this._lastDataByCoordSys=null,this._cbParamsList=null;var i,a;UN(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||(nh(e).dataIndex==null?nh(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=uo(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=sH([t.tooltipOption],r),o=this._renderMode,s=[],c=ZC(`section`,{blocks:[],noHeader:!0}),l=[],u=new fw;U(e,function(e){U(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value,a=t.axis,d=a.scale.parse(i);if(t&&i!=null){var f=$B(i,a,n,e.seriesDataIndices,e.valueLabelOpt),p=ZC(`section`,{header:f,noHeader:!To(f),sortBlocks:!0,blocks:[]});c.blocks.push(p),U(e.seriesDataIndices,function(i){var a=n.getSeriesByIndex(i.seriesIndex),c=i.dataIndexInside,m=a.getDataParams(c);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=EE(t.axis,{value:d}),m.axisValueLabel=f,m.marker=u.makeTooltipMarker(`item`,ZS(m.color),o);var h=TC(a.formatTooltip(c,!0,null)),g=h.frag;if(g){var _=sH([a],r).get(`valueFormatter`);p.blocks.push(_?H({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=rw(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?` - -`:`
`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=nh(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=sH([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new fw;h.marker=g.makeTooltipMarker(`item`,ZS(h.color),d);var _=TC(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?rw(y?H({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=nh(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(q(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=V(a),a.content=Ux(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=sH(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new fw;this._showOrMove(d,function(){var n=V(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,e.get(`showContent`)&&e.get(`show`)){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u){if(q(u)){var p=e.ecModel.get(`useUTC`),m=G(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=TS(m.axisValue,d,p)),d=YS(d,n,!0)}else if(K(u)){var g=uo(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||G(t))return{color:r||i};if(!G(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),K(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),G(t))n=Tp(t[0],s),r=Tp(t[1],c);else if(J(t)){var p=t;p.width=l[0],p.height=l[1];var m=iC(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(q(t)&&o){var h=dH(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=lH(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=fH(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=fH(d)?l[1]/2:d===`bottom`?l[1]:0),RV(e)){var h=uH(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&U(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&U(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&U(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&U(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){!zo.node&&t.getDom()&&(rA(this,`_updatePosition`),this._tooltipContent.dispose(),yV(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(iN);function sH(e,t,n){var r=t.ecModel,i;n?(i=new Cy(n,r,r),i=new Cy(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof Cy&&(o=o.get(`tooltip`,!0)),q(o)&&(o={formatter:o}),o&&(i=new Cy(o,i,r)))}return i}function cH(e,t){return e.dispatchAction||uo(t.dispatchAction,t)}function lH(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function uH(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function dH(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function fH(e){return e===`center`||e===`middle`}function pH(e,t,n){var r=Am(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=Mm(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=nh(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function mH(e){TI(PV),e.registerComponentModel(LV),e.registerComponentView(oH),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},Io),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},Io)}var hH=U;function gH(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function _H(e,t,n){var r={};return hH(t,function(t){var a=r[t]=i();hH(e[t],function(e,r){if(iz.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new iz(i),r===`opacity`&&(i=V(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new iz(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function vH(e,t,n){var r;U(n,function(e){t.hasOwnProperty(e)&&gH(t[e])&&(r=!0)}),r&&U(n,function(n){t.hasOwnProperty(n)&&gH(t[n])?e[n]=V(t[n]):delete e[n]})}function yH(e,t,n,r){var i={};return U(e,function(e){i[e]=iz.prepareVisualTypes(t[e])}),{progress:function(e,a){var o;r!=null&&(o=a.getDimensionIndex(r));function s(e){return BN(a,l,e)}function c(e,t){HN(a,l,e,t)}for(var l,u=a.getStore();(l=e.next())!=null;){var d=a.getRawDataItem(l);if(!(d&&d.visualMap===!1))for(var f=r==null?l:u.get(o,l),p=n(f),m=t[p],h=i[p],g=0,_=h.length;g<_;g++){var v=h[g];m[v]&&m[v].applyVisual(f,s,c)}}}}}var bH=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},xH=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),G(t)&&U(t,function(e,r){q(e)&&(e={type:e}),t[r]=Qa(e,bH(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Q.size.m,align:`auto`,backgroundColor:Q.color.transparent,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Q.color.disabled,inactiveBorderColor:Q.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Q.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Q.color.tertiary,borderWidth:1,borderColor:Q.color.border},emphasis:{selectorLabel:{show:!0,color:Q.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(mC),SH=fo,CH=U,wH=Kg,TH=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new wH),this.group.add(this._selectorGroup=new wH),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=sC(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=iC(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=iC(eo({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=IV(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=X(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),CH(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===` -`)){var p=new wH;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,SH(OH,f,null,r,d)).on(`mouseover`,SH(kH,m.name,null,r,d)).on(`mouseout`,SH(AH,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=nh(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Gl(h.fill);_&&_[3]===0&&(_[3]=.2,h=H(H({},h),{fill:$l(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,SH(OH,null,f,r,d)).on(`mouseover`,SH(kH,null,f,r,d)).on(`mouseout`,SH(AH,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=nh(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};nh(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();CH(e,function(e){var r=e.type,i=new Xf({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),$v(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),dg(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=EH(c,r,o,s,d,m,u),y=new wH,b=r.getModel(`textStyle`);if(K(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(DH({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;q(w)&&w?T=w.replace(`{name}`,t??``):K(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Xf({style:ty(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Gf({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Fv({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),dg(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();nC(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){nC(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(iN);function EH(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),CH(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:zP(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function DH(e){var t=e.icon||`roundRect`,n=Mw(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function OH(e,t,n,r){AH(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),kH(e,t,n,r)}function kH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function AH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function jH(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),MH(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){U(i,function(t,n){e[t?`select`:`unSelect`](n)}),MH(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function MH(e,t){var n=t||{};return U(e.getData(),function(t){var r=t.get(`name`);if(r!==` -`&&r!==``){var i=e.isSelected(r);n[r]=Fo(n,r)?n[r]&&i:i}}),n}function NH(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,fo(jH,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,fo(jH,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,fo(jH,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,fo(jH,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,fo(jH,`unSelect`))}var PH=th(FH);function FH(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;nn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=Y(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Gf({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Y_(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;U([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,q(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=BH[i],o=VH[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(TH);function UH(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function WH(e){TI(IH),e.registerComponentModel(LH),e.registerComponentView(HH),UH(e)}function GH(e){TI(IH),TI(WH)}var KH={get:function(e,t,n){var r=V((qH[e]||{})[t]);return n&&G(r)?r[r.length-1]:r}},qH={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},JH=iz.mapVisual,YH=iz.eachVisual,XH=G,ZH=U,QH=jp,$H=wp,eU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&vH(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=uo(e,this),this.controllerVisuals=_H(this.option.controller,t,e),this.targetVisuals=_H(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return ZH(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Mm(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return W(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){U(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],G(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(q(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(K(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=QH([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=so(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Qa(r,n),Qa(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){XH(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},ZH(r,function(e,t){if(iz.isValidType(t)){var n=KH.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;ZH(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&V(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&V(n)||(a?s[0]:[s[0],s[0]])),c.symbol=JH(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;YH(l,function(e){e>u&&(u=e)}),c.symbolSize=JH(l,function(e){return $H(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(mC),tU=[20,140],nU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=tU[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=tU[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):G(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),U(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=jp((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=rU(this,`outOfRange`,this.getExtent()),n=rU(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Kg(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);lU([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=cU(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=bv(n.handleLabelPoints[l],yv(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=cU(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=bv(c.indicatorLabelPoint,yv(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||_U(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Tm(u,d);this._dispatchHighDown(`downplay`,sU(f[0],n)),this._dispatchHighDown(`highlight`,sU(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(UN(e.target,function(e){var n=nh(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function SU(e,t,n,r){for(var i=t.targetVisuals[r],a=iz.prepareVisualTypes(i),o={color:VN(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(yU,bU),U(xU,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(wU))}function OU(e){e.registerComponentModel(nU),e.registerComponentView(mU),DU(e)}var kU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],AU[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=V(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=W(this._pieceList,function(e){return e=V(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=iz.listVisualTypes(),i=this.isCategory();U(t.pieces,function(e){U(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),U(n,function(e,n){var r=!1;U(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&U(this.stateList,function(e){(t[e]||(t[e]={}))[n]=KH.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,U(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;U(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=V(e)},t.prototype.getValueState=function(e){var t=iz.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){iz.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return U(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=kx(eU.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(eU),AU={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function jU(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var MU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=bo(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),U(o.viewPieceList,function(o){var s=o.piece,u=new Kg;u.onclick=uo(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new Xf({style:ty(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:Y(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),nC(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:sU(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return oU(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Kg,o=this.visualMapModel.textStyleModel;a.add(new Xf({style:ty(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=W(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=Mw(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=V(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,U(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(iU);function NU(e){e.registerComponentModel(kU),e.registerComponentView(MU),DU(e)}function PU(e){TI(OU),TI(NU)}var FU={label:{enabled:!0},decal:{show:!1}},IU=Dm(),LU=Dm(),RU=th(zU);function zU(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=LU(e).scope||(LU(e).scope={}),i=V(FU);Qa(i.label,e.getLocaleModel().get(`aria`),!1),Qa(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=X();e.eachSeries(function(e){e.isColorBySeries()||(IU(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(K(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=yC(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=IU(t).scope;n.each(function(e){var t=n.getRawIndex(e);s[t]=e});var l=o.count();o.each(function(e){var r=s[e],i=o.getName(e)||e+``,a=yC(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?H(H({},t),e):t;return n.dirty=!0,n}})}}function o(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=eo(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var o=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(o,d),p;if(!(o<1)){var m=c();p=m?s(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=o>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=s(g,{seriesCount:o}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=s(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:l(e.subType)});var i=e.getData();if(i.count()>u){var c=a.get([`data`,`partialData`]);n+=s(c,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_=GU:-c>=GU),f=c>0?c%GU:c%GU+GU,p=!1;p=d?!0:!ou(u)&&f>=WU==!!l;var m=e+n*UU(a),h=t+r*HU(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*KU);if(d){var _=1/this._p,v=(l?1:-1)*(GU-_);this._add(`A`,n,r,g,1,+l,e+n*UU(a+v),t+r*HU(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*UU(o),b=t+r*HU(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d`}function lW(e){return``}function uW(e,t){t||={};var n=t.newline?` -`:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return cW(i,a)+(i===`style`?o||``:Ux(o))+(t?``+n+W(t,function(e){return r(e)}).join(n)+n:``)+lW(i)}return r(e)}function dW(e,t,n){n||={};var r=n.newline?` -`:``,i=` {`+r,a=r+`}`,o=W(co(e),function(t){return t+i+W(co(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(co(t),function(e){return`@keyframes `+e+i+W(co(t[e]),function(n){return n+i+W(co(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function fW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function pW(e,t,n,r){return sW(`svg`,`root`,{width:e,height:t,xmlns:tW,"xmlns:xlink":nW,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var mW=0;function hW(){return mW++}var gW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},_W=`transform-origin`;function vW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new qU;return i.reset(xu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function yW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[_W]=n+`px `+r+`px`)}var bW={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function xW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function SW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=fW(n.zrId);t.animation=!0,wW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=co(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=xW(i,n);return a.replace(o,s)}}function CW(e){return q(e)?gW[e]?`cubic-bezier(`+gW[e]+`)`:Al(e)?e:``:``}function wW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof j_){var s=SW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return xW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+hW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function TW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};EW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=nu(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),EW(r,t,n,!0)}}}function EW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+hW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var DW=Math.round;function OW(e){return e&&q(e.src)}function kW(e){return e&&K(e.toDataURL)}function AW(e,t,n,r){eW(function(i,a){var o=i===`fill`||i===`stroke`;o&&yu(a)?GW(t,e,i,r):o&&gu(a)?KW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),WW(n,e,r)}function jW(e,t){var n=aM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[aW+`silent`]=`true`))}function MW(e){return ou(e[0]-1)&&ou(e[1])&&ou(e[2])&&ou(e[3]-1)}function NW(e){return ou(e[4])&&ou(e[5])}function PW(e,t,n){if(t&&!(NW(t)&&MW(t))){var r=n?10:1e4;e.transform=MW(t)?`translate(`+DW(t[4]*r)/r+` `+DW(t[5]*r)/r+`)`:lu(t)}}function FW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;wo(f,g),wo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ls(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=sW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Su(i);x&&(o.patternTransform=x);var S=sW(`pattern`,``,o,[d]),C=uW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=sW(`pattern`,T,o,[d])),t[n]=bu(T)}}function qW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=sW(`clipPath`,a,o,[BW(e,n)])}t[`clip-path`]=bu(a)}function JW(e){return document.createTextNode(e)}function YW(e,t,n){e.insertBefore(t,n)}function XW(e,t){e.removeChild(t)}function ZW(e,t){e.appendChild(t)}function QW(e){return e.parentNode}function $W(e){return e.nextSibling}function eG(e,t){e.textContent=t}var tG=58,nG=120,rG=sW(``,``);function iG(e){return e===void 0}function aG(e){return e!==void 0}function oG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function sG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function cG(e){var t,n=e.children,r=e.tag;if(aG(r)){var i=e.elm=oW(r);if(dG(rG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,lG(e,m,n,i,c)):uG(e,t,r,a))}function pG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(dG(e,t),iG(t.text)?aG(r)&&aG(i)?r!==i&&fG(n,r,i):aG(i)?(aG(e.text)&&eG(n,``),lG(n,null,i,0,i.length-1)):aG(r)?uG(n,r,0,r.length-1):aG(e.text)&&eG(n,``):e.text!==t.text&&(aG(r)&&uG(n,r,0,r.length-1),eG(n,t.text)))}function mG(e,t){if(sG(e,t))pG(e,t);else{var n=e.elm,r=QW(n);cG(t),r!==null&&(YW(r,t.elm,$W(n)),uG(r,[e],0,0))}return t}var hG=0,gG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=_G(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+hG++,this._oldVNode=pW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=oW(`svg`);dG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,mG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return UW(e,fW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=fW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=vG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=sW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(co(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(sW(`defs`,`defs`,{},c)),e.animation){var l=dW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=sW(`style`,`stl`,{},[],l);a.push(u)}}return pW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},uW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=aI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function xG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function SG(e){return Ve[e?`dark`:`light`]}function CG(e){let t=e?5:7;return{ok:Ie[t],warn:He[t],bad:We[t],info:Ue[t]}}function wG(e,t){let n=Ae[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function TG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function EG(e,t){let n=CG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:SG(t).muted}function DG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(le,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(se,{mt:4,children:i})]})}function OG({health:e,label:t}){return(0,z.jsx)(ye,{color:xG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function kG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Dn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function AG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(se,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(jn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(re,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}TI([iD]);function jG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(bG,{option:r,height:28,label:n})}var MG={unhealthy:0,degraded:1,healthy:2};function NG({widget:e,filters:t}){let n=Sa(`overview`,ya(t,e.config,[`service`]));if(n.isError)return(0,z.jsx)(AG,{retry:()=>void n.refetch()});let r=[...n.data?.data.services??[]].sort((e,t)=>(MG[e.health]??3)-(MG[t.health]??3)||t.error_rate-e.error_rate);return n.data&&r.length===0?(0,z.jsx)(kG,{text:`No recent activity`}):(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(F,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:!0,children:[(0,z.jsx)(F.Thead,{children:(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Th,{children:`Service`}),(0,z.jsx)(F.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(F.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(F.Tbody,{children:r.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{children:(0,z.jsx)(OG,{health:e.health,label:e.service})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ea(e.error_rate)})})]},e.service))})]})})}function PG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=_a(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(N,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(re,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(Pe,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var FG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`,`service`]};function IG(e){return Object.hasOwn(FG,e)?FG[e]:void 0}function LG(e){return(IG(e)?.length??0)>0}function RG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:va(t.config,`service`),severity:va(t.config,`severity`),search:va(t.config,`search`),trace_id:va(t.config,`trace_id`)})},[e,t.config]);let s=IG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(L,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(N,{children:[s.includes(`service`)&&(0,z.jsx)(an,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(an,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(xe,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(xe,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(re,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(re,{type:`submit`,children:`Save`})]})]})})})}TI([IA]);function zG({widget:e,filters:t,dark:n}){let r=Sa(`logs`,ya(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=SG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>EG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Oa(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(kG,{text:`No matching logs in this window`}):(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{h:72,children:(0,z.jsx)(bG,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Oa(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ye,{size:`xs`,color:TG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(F.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function BG({widget:e,filters:t,dark:n}){let r=ya(t,e.config,[`service`]),i=Sa(`overview`,r),a=Sa(`performance`,r);if(i.isError)return(0,z.jsx)(AG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=CG(n),u=o?.health===`unknown`,d=o?u?`No data`:o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Health`,value:d,color:o?xG(o.health):void 0,hint:o?u?`Nothing reported in this window`:`${Ta.format(o.service_count)} services`:void 0}),(0,z.jsx)(DG,{label:`Error rate`,value:o&&!u?Ea(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o&&!u?`${Ta.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(jG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&!u&&(0,z.jsxs)(se,{children:[(0,z.jsxs)(nn.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(nn.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(nn.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(nn.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(VG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(VG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(VG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function VG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(se,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}TI([iD]);function HG({widget:e,filters:t,dark:n}){let r=Sa(`performance`,ya(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=SG(n),t=i.provenance.window;return{color:[wG(`operations`,n),CG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Oa(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>Da(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(kG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{style:{flex:1,minHeight:120},children:(0,z.jsx)(bG,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsxs)(F.Td,{children:[(0,z.jsx)(ye,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Ta.format(e.calls),` calls`]})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}TI([LB]);function UG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=Sa(`topology`,ya(t,e.config,[`service`])),a=i.data?.data,o=(0,R.useMemo)(()=>{if(!a)return null;let e=SG(n),t=CG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...a.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:a.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,a]);return i.isError?(0,z.jsx)(AG,{retry:()=>void i.refetch()}):a&&a.nodes.length===0?(0,z.jsx)(kG,{text:`No service relationships in this window`}):(0,z.jsxs)(N,{gap:4,h:`100%`,children:[o&&(0,z.jsx)(bG,{option:o,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),a&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[a.nodes.length,` services · `,a.edges.length,` `,a.edges.length===1?`route`:`routes`]})]})}function WG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function GG({widget:e,filters:t,dark:n}){let r=Sa(`trace`,ya(t,e.config,[`trace_id`,`service`]));if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(kG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Duration`,value:i?Da(i.duration_ms):`—`}),(0,z.jsx)(DG,{label:`Spans`,value:i?Ta.format(i.spans.length):`—`}),(0,z.jsx)(DG,{label:`Services`,value:i?Ta.format(i.services.length):`—`}),(0,z.jsx)(DG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(KG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,WG(i.trace_id)]}),(0,z.jsx)(qG,{value:i.trace_id})]})]})}function KG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(N,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(se,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Re,{label:`${e.service} · ${e.operation} · ${Da(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(se,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(se,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:wG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:Da(e.duration_ms)})]},e.span_id)})})}function qG({value:e}){let{state:t,copy:n}=I();return(0,z.jsx)(Re,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Se,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(te,{size:12})})})}var JG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},YG={overview:BG,topology:UG,activity:NG,assistant:PG,performance:HG,trace:GG,logs:zG};function XG(){return(0,z.jsx)(kG,{text:`This view type is not supported by this version`})}function ZG(e){return Object.hasOwn(YG,e)?YG[e]:XG}function QG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=ZG(t.type);return(0,z.jsxs)(le,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(N,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(Le,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(Se,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ge,{size:18,weight:`bold`})})}),(0,z.jsxs)(Le.Dropdown,{children:[LG(t.type)&&(0,z.jsx)(Le.Item,{leftSection:(0,z.jsx)(kn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(Le.Item,{color:`bad`,leftSection:(0,z.jsx)(Fe,{size:15}),onClick:r,children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(l,{...e})})]}),(0,z.jsx)(RG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i})]})}var $G=la(sa),eK=`fanout.dashboard-id`,tK={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function nK(e){return Object.hasOwn(pa,e)?pa[e]:void 0}function rK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=fe(),a=ve(`light`)===`dark`,o=Je({queryKey:Me,queryFn:()=>Ne(`/api/dashboards`),refetchInterval:3e4}),[s,c]=(0,R.useState)(()=>e||localStorage.getItem(eK)||``),l=gn({mutationFn:async e=>{if(!u.data)throw Error(`No dashboard selected`);let t=await Be(`/api/dashboards/${encodeURIComponent(u.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:u.data.name,description:u.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${s}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:Me})},onError:e=>console.error(`Dashboard save failed`,e)}),u=Je({queryKey:[`dashboard`,s],queryFn:()=>Ne(`/api/dashboards/${encodeURIComponent(s)}`),enabled:!!s,refetchInterval:l.isPending||l.isError?!1:3e4}),[d,f]=(0,R.useState)(tK),[p,m]=(0,R.useState)(`lg`),h=Sa(`overview`,ya(d.filters),!!u.data),g=(0,R.useMemo)(()=>(h.data?.data.services??[]).map(e=>e.service),[h.data]),y=wa();(0,R.useEffect)(()=>{e&&e!==s&&(c(e),localStorage.setItem(eK,e))},[e,s]),(0,R.useEffect)(()=>{let t=o.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&s&&t.some(e=>e.id===s)){r?.(s,!0);return}S((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,o.data,s]),(0,R.useEffect)(()=>{l.isPending||l.isError||u.data?.state&&f(u.data.state)},[u.data?.updated_at,l.isPending,l.isError]),(0,R.useEffect)(()=>{l.reset()},[s]);let b=(0,R.useMemo)(()=>{let e=new Map(d.widgets.map(e=>[e.id,e.type])),t=d.layout.map(t=>{let n=nK(e.get(t.i)??`overview`)??pa.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:da(t,6),xs:da(t,2),xxs:da(t,1)}},[d.layout,d.widgets]);function S(e,t=!1){c(e),localStorage.setItem(eK,e),r?.(e,t)}function C(e){f(e),l.mutate(e)}function w(e){let t=ze(),n=pa[e],r=ha(d.layout,n.w,n.h,12,n.minW);C({...d,widgets:[...d.widgets,{id:t,type:e,title:JG[e],enabled:!0}],layout:[...d.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function T(e){C({...d,widgets:d.widgets.filter(t=>t.id!==e),layout:d.layout.filter(t=>t.i!==e)})}function E(e,t){C({...d,widgets:d.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(o.isLoading||s&&u.isLoading)return(0,z.jsx)(iK,{label:`Loading your dashboard…`});if(o.isError||u.isError)return(0,z.jsx)(iK,{label:`Your dashboard is unavailable. Try refreshing.`});let D=u.data;return D?(0,z.jsxs)(se,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(N,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(se,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:D.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:D.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(it,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(an,{"aria-label":`Window`,value:d.filters.window,onChange:e=>e&&C({...d,filters:{...d.filters,window:e}}),data:ga,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(xe,{"aria-label":`Namespace`,value:d.filters.namespace,onChange:e=>f({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),onBlur:e=>C({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[y&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(y))]}),(0,z.jsxs)(Le,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(re,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(ke,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(Tn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(Le.Dropdown,{children:fa.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(Le.Item,{onClick:()=>w(e),children:JG[e]},e))})]}),t&&(0,z.jsx)(re,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(Cn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),l.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(jn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(re,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>l.mutate(d),children:`Retry save`})]})}),(0,z.jsx)($G,{className:`dashboard-grid`,layouts:b,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:m,onDragStop:e=>{p===`lg`&&C({...d,layout:[...e]})},onResizeStop:e=>{p===`lg`&&C({...d,layout:[...e]})},children:d.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(QG,{widget:e,filters:d.filters,dark:a,services:g,agentAvailable:t,onOpenChat:n,onRemove:()=>T(e.id),onConfigure:t=>E(e.id,t)})},e.id))})]}):(0,z.jsx)(iK,{label:`Preparing your dashboard…`})}function iK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}export{rK as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-BPYRZzG3.js b/internal/ui/dist/assets/dashboards._dashboardId-BPYRZzG3.js new file mode 100644 index 000000000..795025eb6 --- /dev/null +++ b/internal/ui/dist/assets/dashboards._dashboardId-BPYRZzG3.js @@ -0,0 +1 @@ +import{pt as e}from"./brand-CCB4_HD8.js";import{l as t}from"./auth-d1anOsyP.js";import{a as n}from"./preload-helper-qpfFvVn3.js";import{t as r}from"./dashboard-BxZStHQX.js";import{t as i}from"./index-Ba6HLUAb.js";var a=e();function o(){let{dashboardId:e}=i.useParams(),o=i.useSearch(),s=t(),{agentAvailable:c,openChat:l}=n();return(0,a.jsx)(r,{dashboardID:e,agentAvailable:c,onOpenChat:l,onDashboardChange:(e,t)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:o,replace:t}),urlFilters:o,onFiltersChange:t=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{window:t.window,namespace:t.namespace||void 0},replace:!0})})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js b/internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js deleted file mode 100644 index a3c2ff7ef..000000000 --- a/internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js +++ /dev/null @@ -1 +0,0 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-qOWEIeHc.js";import{q as n,s as r,u as i}from"./index-DSdcpqnK.js";var a=e();function o(){let{dashboardId:e}=r.useParams(),o=n(),{agentAvailable:s,openChat:c}=i();return(0,a.jsx)(t,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-CtpFH5E-.js b/internal/ui/dist/assets/dashboards.index-CtpFH5E-.js new file mode 100644 index 000000000..2737bda34 --- /dev/null +++ b/internal/ui/dist/assets/dashboards.index-CtpFH5E-.js @@ -0,0 +1 @@ +import{pt as e}from"./brand-CCB4_HD8.js";import{l as t}from"./auth-d1anOsyP.js";import{a as n}from"./preload-helper-qpfFvVn3.js";import{t as r}from"./dashboard-BxZStHQX.js";import{n as i}from"./index-Ba6HLUAb.js";var a=e();function o(){let e=i.useSearch(),o=t(),{agentAvailable:s,openChat:c}=n();return(0,a.jsx)(r,{agentAvailable:s,onOpenChat:c,onDashboardChange:t=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:e,replace:!0}),urlFilters:e})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js b/internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js deleted file mode 100644 index 25a03e85c..000000000 --- a/internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js +++ /dev/null @@ -1 +0,0 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-qOWEIeHc.js";import{q as n,u as r}from"./index-DSdcpqnK.js";var i=e();function a(){let e=n(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(t,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-Ba6HLUAb.js b/internal/ui/dist/assets/index-Ba6HLUAb.js new file mode 100644 index 000000000..77c0a28b5 --- /dev/null +++ b/internal/ui/dist/assets/index-Ba6HLUAb.js @@ -0,0 +1,17 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-4U_e7tED.js","assets/brand-CCB4_HD8.js","assets/auth-d1anOsyP.js","assets/chat.index-CtOVI6Uj.js","assets/chat-Cxa6DFwb.js","assets/preload-helper-qpfFvVn3.js","assets/copy-Bx9ZWqiL.js","assets/chat._threadId-CtOVI6Uj.js","assets/dashboards.index-CtpFH5E-.js","assets/dashboard-BxZStHQX.js","assets/tokens-DbmTV7qX.js","assets/use-computed-color-scheme-CeR2KQyq.js","assets/dashboards._dashboardId-BPYRZzG3.js"])))=>i.map(i=>d[i]); +import{$ as e,B as t,C as n,F as r,G as i,I as a,J as o,L as s,M as c,N as l,O as u,P as d,S as f,U as p,V as m,W as h,Y as g,_,a as v,b as y,d as b,dt as x,f as ee,ft as S,gt as te,h as ne,ht as re,it as ie,j as ae,k as oe,l as se,lt as ce,mt as le,nt as ue,ot as de,pt as C,q as fe,s as pe,st as me,t as he,tt as ge,u as _e,ut as w,vt as ve,x as ye,xt as be}from"./brand-CCB4_HD8.js";import{a as xe,c as Se,d as Ce,h as we,i as Te,l as Ee,n as De,o as Oe,r as ke,t as Ae,u as je}from"./auth-d1anOsyP.js";import{A as Me,At as Ne,B as Pe,Bt as Fe,C as Ie,Ct as Le,D as Re,Dt as ze,E as Be,Et as Ve,F as He,Ft as Ue,Gt as We,H as Ge,Ht as Ke,I as qe,It as Je,J as Ye,Jt as Xe,Kt as Ze,L as Qe,Lt as $e,M as et,Mt as tt,N as nt,Nt as rt,Ot as it,P as at,Pt as ot,Q as st,R as ct,Rt as lt,S as ut,St as dt,T as ft,Tt as pt,U as mt,Ut as ht,V as gt,Vt as _t,W as vt,Wt as yt,X as bt,Xt as xt,Y as St,Yt as Ct,Z as wt,_ as Tt,_t as Et,a as Dt,at as Ot,b as kt,bt as At,ct as jt,dt as Mt,et as Nt,ft as Pt,gt as Ft,h as It,ht as Lt,i as Rt,it as zt,j as Bt,jt as Vt,k as Ht,kt as Ut,l as Wt,m as Gt,mt as Kt,n as qt,nt as Jt,o as Yt,ot as Xt,pt as Zt,q as Qt,qt as $t,r as en,rt as tn,s as nn,st as rn,t as an,tt as on,u as sn,v as cn,vt as ln,w as un,wt as dn,x as fn,xt as pn,y as mn,yt as hn,z as gn,zt as _n}from"./tokens-DbmTV7qX.js";import{A as vn,E as yn,a as bn,f as xn,i as Sn,k as Cn,n as wn,o as Tn,r as En,s as Dn,t as On}from"./preload-helper-qpfFvVn3.js";import{n as kn,t as An}from"./use-computed-color-scheme-CeR2KQyq.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var jn=te((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,ee||(ee=!0,ae());else{var t=n(l);t!==null&&ce(x,t.startTime-e)}}}var ee=!1,S=-1,te=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():ee=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,ce(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Mn=te(((e,t)=>{t.exports=jn()})),Nn=te((e=>{var t=Mn(),n=re(),r=le();function i(e){var t=`https://react.dev/errors/`+e;if(1he||(e.current=me[he],me[he]=null,he--)}function w(e,t){he++,me[he]=e.current,e.current=t}var ve=ge(null),ye=ge(null),be=ge(null),xe=ge(null);function Se(e,t){switch(w(be,t),w(ye,e),w(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=ef(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ve),w(ve,e)}function Ce(){_e(ve),_e(ye),_e(be)}function we(e){e.memoizedState!==null&&w(xe,e);var t=ve.current,n=ef(t,e.type);t!==n&&(w(ye,e),w(ve,n))}function Te(e){ye.current===e&&(_e(ve),_e(ye)),xe.current===e&&(_e(xe),sp._currentValue=pe)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Oe(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe(`Lazy`);case 13:return e.child!==t&&t!==null?Oe(`Suspense Fallback`):Oe(`Suspense`);case 19:return Oe(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return Oe(`Activity`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function it(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yt(e.document)}return t}function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ur=Sn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Yt(r)||(r=Wr,`selectionStart`in r&&Hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&Lr(Kr,r)||(Kr=r,r=Ld(Gr,`onSelect`),0>=o,i-=o,Ri=1<<32-Xe(t)+i|n<m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),qi&&Bi(i,m),l;if(d===null){for(;mh?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),qi&&Bi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return qi&&Bi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),qi&&Bi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Va(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ja(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=Ti(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=wi(o.type,o.key,o.props,null,e.mode,c),Ja(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Oi(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Va(o),x(e,r,o,c)}if(de(o))return v(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,qa(o),c);if(o.$$typeof===b)return x(e,r,ha(e,o),c);Ya(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ei(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ka=0;var i=x(e,t,n,r);return Ga=null,i}catch(t){if(t===Fa||t===La)throw t;var a=E(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Za=Xa(!0),Qa=Xa(!1),$a=!1;function eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function to(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function no(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ro(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ul&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=yi(e),vi(e,null,n),t}return hi(e,r,t,n),yi(e)}function io(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function ao(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oo=!1;function so(){if(oo){var e=Ea;if(e!==null)throw e}}function co(e,t,n,r){oo=!1;var i=e.updateQueue;$a=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Kl&p)===p:(r&p)===p){p!==0&&p===Ta&&(oo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:$a=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function lo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function uo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=C.T,s={};C.T=s,Hs(e,!1,t,n);try{var c=i(),l=C.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Vs(e,t,ka(c,r),Su(e)):Vs(e,t,r,Su(e))}catch(n){Vs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{fe.p=a,o!==null&&s.types!==null&&(o.types=s.types),C.T=o}}function js(){}function Ms(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ns(e).queue;As(e,a,t,pe,n===null?js:function(){return Ps(e),n(r)})}function Ns(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ps(e){var t=Ns(e);t.next===null&&(t=e.alternate.memoizedState),Vs(e,t.next.queue,{},Su())}function Fs(){return ma(sp)}function Is(){return Wo().memoizedState}function Ls(){return Wo().memoizedState}function Rs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=no(n);var r=ro(t,e,n);r!==null&&(wu(r,t,n),io(r,t,n)),t={cache:xa()},e.payload=t;return}t=t.return}}function zs(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Us(e)?Ws(t,n):(n=gi(e,t,n,r),n!==null&&(wu(n,e,r),Gs(n,t,r)))}function Bs(e,t,n){Vs(e,t,n,Su())}function Vs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Us(e))Ws(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o))return hi(e,t,i,0),Wl===null&&mi(),!1}catch{}if(n=gi(e,t,i,r),n!==null)return wu(n,e,r),Gs(n,t,r),!0}return!1}function Hs(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Us(e)){if(t)throw Error(i(479))}else t=gi(e,n,r,2),t!==null&&wu(t,e,2)}function Us(e){var t=e.alternate;return e===D||t!==null&&t===D}function Ws(e,t){Ao=ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var Ks={readContext:ma,use:Ko,useCallback:O,useContext:O,useEffect:O,useImperativeHandle:O,useLayoutEffect:O,useInsertionEffect:O,useMemo:O,useReducer:O,useRef:O,useState:O,useDebugValue:O,useDeferredValue:O,useTransition:O,useSyncExternalStore:O,useId:O,useHostTransitionStatus:O,useFormState:O,useActionState:O,useOptimistic:O,useMemoCache:O,useCacheRefresh:O};Ks.useEffectEvent=O;var qs={readContext:ma,use:Ko,useCallback:function(e,t){return k().memoizedState=[e,t===void 0?null:t],e},useContext:ma,useEffect:_s,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),hs(4194308,4,Cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=k();t=t===void 0?null:t;var r=e();if(jo){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=k();if(n!==void 0){var i=n(t);if(jo){Ye(!0);try{n(t)}finally{Ye(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=zs.bind(null,D,e),[r.memoizedState,e]},useRef:function(e){var t=k();return e={current:e},t.memoizedState=e},useState:function(e){e=ns(e);var t=e.queue,n=Bs.bind(null,D,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ts,useDeferredValue:function(e,t){return Os(k(),e,t)},useTransition:function(){var e=ns(!1);return e=As.bind(null,D,e.queue,!0,!1),k().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=D,a=k();if(qi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Wl===null)throw Error(i(349));Kl&127||Zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,_s($o.bind(null,r,o,e),[e]),r.flags|=2048,ps(9,{destroy:void 0},Qo.bind(null,r,o,n,t),null),n},useId:function(){var e=k(),t=Wl.identifierPrefix;if(qi){var n=zi,r=Ri;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Mo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[yt]=t,o[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Kd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=be.current,ea(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Gi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Zi(t,!0)}else e=Qd(e).createTextNode(r),e[yt]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ea(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[yt]=t}else ta(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=na(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Co(t),t):(Co(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ea(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[yt]=t}else ta(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=na(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Co(t),t):(Co(t),null)}return Co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return Ce(),e===null&&Nd(t.stateNode.containerInfo),Hc(t),null;case 10:return ca(t.type),Hc(t),null;case 19:if(_e(wo),r=t.memoizedState,r===null)return Hc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Vc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=To(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ci(n,e),n=n.sibling;return w(wo,wo.current&1|2),qi&&Bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>uu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=To(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!qi)return Hc(t),null}else 2*Re()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Re(),e.sibling=null,n=wo.current,w(wo,a?n&1|2:n&1),qi&&Bi(t,r.treeForkCount),e);case 22:case 23:return Co(t),go(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_e(ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ca(ba),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(Ui(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ca(ba),Ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(Co(t),t.alternate===null)throw Error(i(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(wo),null;case 4:return Ce(),null;case 10:return ca(t.type),null;case 22:case 23:return Co(t),go(),e!==null&&_e(ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ca(ba),null;case 25:return null;default:return null}}function Gc(e,t){switch(Ui(t),t.tag){case 3:ca(ba),Ce();break;case 26:case 27:case 5:Te(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Co(t);break;case 13:Co(t);break;case 19:_e(wo);break;case 10:ca(t.type);break;case 22:case 23:Co(t),go(),e!==null&&_e(ja);break;case 24:ca(ba)}}function Kc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ed(t,t.return,e)}}function qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function B(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{uo(t,n)}catch(t){ed(e,e.return,t)}}}function Jc(e,t,n){n.props=ec(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Yc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ed(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ed(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ed(e,t,n)}else n.current=null}}function Zc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ed(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[bt]=t}catch(t){ed(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pn));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[yt]=e,t[bt]=n}catch(t){ed(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function V(e,t){if(e=e.containerInfo,Xd=hp,e=Vr(e),Hr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},hp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Kd(o,r,n),o[yt]=e,Mt(o),r=o;break a;case`link`:var s=Zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=zr(s,h),v=zr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,C.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Ul&6)throw Error(i(331));var c=Ul;if(Ul|=4,Rl(o.current),Al(o,o.current,s,n),Ul=c,md(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{fe.p=a,C.T=r,Xu(e,t)}}function $u(e,t,n){t=Ai(n,t),t=oc(e.stateNode,t,2),e=ro(e,t,2),e!==null&&(lt(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=Ai(n,e),n=sc(2),r=ro(t,n,2),r!==null&&(cc(n,r,t,e),lt(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Hl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Zl=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wl===e&&(Kl&n)===n&&($l===4||$l===3&&(Kl&62914560)===Kl&&300>Re()-cu?!(Ul&2)&&ju(e,0):nu|=n,iu===Kl&&(iu=0)),pd(e)}function rd(e,t){t===0&&(t=st()),e=_i(e,t),e!==null&&(lt(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),rd(e,n)}function od(e,t){return Pe(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=Kl,a=it(r,r===Wl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,yd(r,a))}r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&rf()&&(e=fd);for(var t=Re(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}pu!==0&&pu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=jt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&U(e,n);var c=o=r.createElement(`link`);Mt(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=jt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0},t),(t=Tf.get(i))&&Yf(e,t),a=n.createElement(`script`),Mt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=jt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Yf(e,t),a=n.createElement(`script`),Mt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=be.current)?Df(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Vf(n.href),n=jt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vf(n.href);var o=jt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tf.set(e,n),o||Wf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Gf(n),n=jt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vf(e){return`href="`+Zt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),Mt(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Zt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,Mt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Mt(r),Kd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=Uf(n),(a=Tf.get(a))&&U(r,a),o=(e.ownerDocument||e).createElement(`link`),Mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,Mt(a),a):(r=n,(a=Tf.get(o))&&(r=f({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jf(r,n.precedence,e));return t.instance}function Jf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function W(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&U(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Nn()}));function Fn(e){return e?.isNotFound===!0}function In(){try{return sessionStorage}catch{return}}var Ln=`tsr-scroll-restoration-v1_3`,Rn=In();function zn(){try{return JSON.parse(Rn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Bn(){try{Rn?.setItem(Ln,JSON.stringify(Vn))}catch{}}var Vn=zn(),Hn=`data-scroll-restoration-id`,Un=e=>e.state.__TSR_key||e.href;function Wn(e){let t=e.getAttribute(Hn);if(t)return`[${Hn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Gn=!1,Kn=`window`;function qn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Jn(e){let t=new Set;for(let n of e){if(n===Kn)continue;let e=qn(n);e&&t.add(e)}return t}function Yn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Un,a=new Set,o=e=>{let t=Vn[e]||={};for(let e of a)e===document?t[Kn]={scrollX,scrollY}:e.isConnected&&(t[Wn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Gn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Gn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Bn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Vn[d];if(e){let t=Vn[u];for(let n in e){if(n===Kn){if(s)continue}else{let e=qn(n);if(!e||s&&o&&(l??=Jn(o),l.has(e)))continue}t||=Vn[u]={},t[n]??=e[n]}}}Gn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Jn(o));let t=e&&i&&c,s=r.restoring?Vn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Kn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=qn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Gn=!1}}))}function Xn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Zn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Qn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Zn(r):Array.isArray(t)?t.push(Zn(r)):n[e]=[t,Zn(r)]}return n}var $n=/^(?:\s|["[{\d-]|fa|nu|tr)/,er=nr(JSON.parse),tr=rr(JSON.stringify,JSON.parse);function nr(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Qn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function rr(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!$n.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Xn(e,r);return t?`?${t}`:``}}function ir(e){return{input:({url:t})=>{for(let n of e)t=or(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=sr(e[n],t);return t}}}function ar(e){let t=Vt(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ut([`/`,t,e.pathname]),e)}}function or(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function sr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function cr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{_t(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var lr=`__TSR_index`,ur=`popstate`,dr=`beforeunload`;function fr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=gr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[lr];i=pr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[lr];i=pr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[lr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function pr(e,t){t||={};let n=_r();return{...t,key:n,__TSR_key:n,[lr]:e}}function mr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>gr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=_r();t.history.replaceState({[lr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(ee._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),ee._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=gr(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),ee.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[lr]-l.state[lr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),ee.notify(u);return}}}l=c(),ee.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},ee=fr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(dr,x,{capture:!0}),t.removeEventListener(ur,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(dr,x,{capture:!0}),t.addEventListener(ur,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return ee._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return ee._ignoreSubscribers||y(`REPLACE`),n},ee}function hr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function gr(e,t){let n=hr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=_r();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[lr]:0,key:a,__TSR_key:a}}}function _r(){return(Math.random()+1).toString(36).substring(7)}function vr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function yr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function br({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function xr(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var Sr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ze(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:mr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=_n(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=cr(this.latestLocation,e),Yn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Vt(a);t&&t!==`/`&&e.push(ar({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ir(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=lt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&$e(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Ke(e).path,external:!1,searchStr:o,search:Ct(t?.search,i),hash:Ke(r.slice(1)).path,state:xt(t?.state,a)}}let o=new URL(i,this.origin),s=or(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Ke(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Ct(t?.search,c),hash:Ke(s.hash.slice(1)).path,state:xt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Ne({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Ue(tt(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=gr(t.href,{});t={...t,to:or(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Or(t.params,o),l=this.routesByPath[tt(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Ze(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:Ke(it({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Tr(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=Er(f,t,u,e._includeValidateSearch),f=Ct(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?We(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?We(t.state,n.state):{};t.state&&(g=xt(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=sr(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=yt(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=ot(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Or(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=tt(this.latestLocation.href)===tt(n.href)&&ht(br(n.state),br(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if($t(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await yi(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(yr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&vr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&$t(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Mr,this.preloadRoute=e=>bi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Je(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ht(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ht(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??tr,parseSearch:e.parseSearch??er,protocolAllowlist:e.protocolAllowlist??Fe}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=rt(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:tt(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Dr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Tr(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=We(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Dr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Ve}function Or(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,We(e,n))}function kr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Ar(e,t){return e.options[t]?.preload?.()}function jr(e,t){let n=Ar(e,`component`),r=Ar(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Mr(e,t,n){let r=()=>t===!1?void 0:t?Ar(e,t):jr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Nr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function Vr(e,t){return e.routesById[t.routeId]}function Hr(e,t,n){return pt(e)?[Lr,e]:Fn(e)?(e.routeId||=n,[Ir,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Fr,e]):[Pr,e]}function Ur(e,t){let n=Hr(t,!0,e.id);if(n[0]!==Fr)return n;try{e.options.onError?.(n[1])}catch(t){n=Hr(t,!0,e.id)}return n}function Wr(e,t,n,r,i){return i[0].signal.aborted?Rr:oi(e,t,n,Ur(n,r),i)}async function Gr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;ie.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return qr(e,r),[i,Wr(e,t,u,a,n)]}if(c.aborted)return[i,Rr];let p=r.paramsError??r.searchError;if(p!==void 0)return qr(e,r),[i,Wr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Xr(e,r,`beforeLoad`,n[0]);let a=await Br(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,Rr];let o=oi(e,t,u,Hr(a,!1,u.id),n);if(o[0]!==Pr)return qr(e,r),[i,o];r.context={...r.context,...a}}catch(a){return qr(e,r),[i,Wr(e,t,u,a,n)]}finally{r.status=h,Xr(e,r,!1,n[0])}}i()}function Kr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function qr(e,t){let n=t._flight;t._flight=void 0,Kr(e,t,n)?.abort()}function Jr(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Kr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Yr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Xr(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Zr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Qr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Rr;if(!i)return[Pr,void 0];let l=n._flight;Xr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Zr(e,t,n,r,s,a,!!o[3]))).then(e=>Hr(e,!1,r.id),e=>Hr(e,!0,r.id)).then(t=>(t[0]!==Pr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Fr&&l[2]?Ur(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],oi(e,t,r,await Br(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return qr(e,n),Rr}finally{Xr(e,n,!1,s)}}function $r(e,t,n){t[0]!==Lr&&(e.status=`success`,e.error=void 0,t[0]===Pr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function ei(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&qr(e,r)}function ti(e,t){return t[0]===Fr||t[0]===Ir?{...e,status:t[0]===Fr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function ni(e,t,n,r,i,a,o){let s=t[1][n],c=Vr(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Zr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Rr)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,qr(e,s),p=Wr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),ee=n>=o?a[7]:void 0,S=c.lazyFn&&c._lazy!==!0?ee:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,Kr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),ee?.()}b||(s.isFetching=!1);let te=(p?Promise.resolve(p):x?Qr(e,t,s,c,g,i,a):Promise.resolve([Pr,s.loaderData])).then(t=>(x&&($r(s,t,l),t[0]===Pr&&(m&&!a[0].signal.aborted&&ei(e,s,u),n>=o&&(s.status=`pending`))),t)),ne=Br(Promise.resolve().then(()=>Mr(c,void 0,S)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,Wr(e,t,c,r,a)]).then(e=>te.then(t=>(x&&!e&&t[0]===Pr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,ee?.()),e)));if(r.push([n,te,ne]),!y)return te.then(e=>ti(s,e));let re={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ie=Qr(e,t,re,c,g,i,a).then(e=>(s.isFetching=!1,$r(re,e,!1),e));return(t[2]??=[]).push([n,ie,ne,re]),ie.then(e=>ti(re,e))}async function ri(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Vr(e,t[n]);try{let e=Mr(i,!1);e&&await Br(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function ii(e,t){t[2]&&=(Jr(e,t[2].map(e=>e[3])),void 0)}async function ai(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Lr)throw[a,t];!i&&t[0]!==Pr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Lr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function oi(e,t,n,r,i,a){for(;r[0]===Lr;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Lr,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Fr,e]:Ur(n,e),a=!0}}return r}async function si(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ir?ri(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Lr)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Pr&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Lr){let n=s[1];if(n[0]!==Lr||n[1].options.reloadDocument||n[2])return ii(e,t),n;c=!0,s=[0,[Fr,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Fr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Vr(e,u);try{await Br(i?Promise.resolve().then(()=>Mr(m,l===Fr?`errorComponent`:`notFoundComponent`)):Promise.all([Mr(m),Mr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return ii(e,t),Rr}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),ii(e,t),Jr(e,o),p()):u.status=`success`}return t}async function ci(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;te._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await ri(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l{for(let t=d;t=Lr&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=si(e,i,u,r[0],ai(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=ai(i[2],void 0,void 0,h.then(e=>zr(e)?0:Nr(n).length,()=>0))),o=await h}catch(t){if(ii(e,i),t===a&&a.aborted)return Rr;throw t}return zr(o)?o:ci(e,o,a,r[6]===n.length?r[6]:0)}function ui(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a0){i[3]=setTimeout(()=>ui(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function di(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function fi(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Nr(t[3]).some(e=>e.id===n[1]))return;let i;try{await Br(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function pi(e,t){e._committed=t,e.stores.setMatches(t)}function mi(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Nr(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,pi(e,n),Jr(e,[...a.values(),...i],[...n,...s.values()]),xr(e,i,n,t)}async function hi(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function gi(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function _i(e,t,n,r,i){let a=n.map(e=>({...e}));Yr(a);for(let t of r)qr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await si(e,o,r,t[0],i)}catch(t){throw Jr(e,a),t}if(zr(s)){Jr(e,a),s[0]===Lr&&e._tx===t&&e._committed===n&&await gi(e,t,s);return}if(await ci(e,s,t[0].signal),e._tx!==t||e._committed!==n){Jr(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),qr(e,n))}pi(e,a),Jr(e,n,a)}async function vi(e,t,n,r,i,a){let o=await li(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(zr(o)){let n=o[0]===Lr&&e._tx===t;if((!n||o[1].options.reloadDocument)&&di(e,t),Jr(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){di(e,t);return}await gi(e,t,o);return}let s=o[1];if(e._tx===t&&await fi(e,t),e._tx!==t){di(e,t),Jr(e,s),ii(e,o);return}let c=t[2],l=yr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await fi(e,t),e._tx!==t){di(e,t),Jr(e,s),ii(e,o);return}let n=await e.startTransition(()=>{di(e,t),mi(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){ii(e,o);return}u?.length&&_i(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function yi(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=yr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await hi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Yr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){Jr(e,m),await hi(e,n);return}e._preflight=void 0;let g,_=()=>vi(e,y,f,()=>ui(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Xr(e,t,!1)}n[0].abort(),Jr(e,n[3],y[3],!0)}if(e._tx!==y){Jr(e,y[3]),y[3]=[],g?.(),await hi(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&ui(e,y),g?.(_()),await v,await hi(e,y)}async function bi(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Yr(a),o=(e._preloads??=new Map).set(i,a),s=await li(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),Jr(e,a)),i.abort()}if(!zr(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Fn(e)||console.error(e);return}}}var T=be(re(),1),E=C(),xi=class extends T.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?T.createElement(this.props.errorComponent??Si,{error:e,reset:this.reset}):this.props.children}};function Si({error:e}){let[t,n]=T.useState(!1);return(0,E.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,E.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,E.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,E.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,E.jsx)(`div`,{children:(0,E.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,E.jsx)(`code`,{children:e.message}):null})}):null]})}var Ci=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Ci||{});function wi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ti(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Ei=[],Di=0,{link:Oi,unlink:ki,propagate:Ai,checkDirty:ji,shallowPropagate:Mi}=wi({update(e){return e._update()},notify(e){Ei[Pi++]=e,e.flags&=~Ci.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ci.Mutable|Ci.Dirty,Ri(e))}}),Ni=0,Pi=0,Fi,Ii=0;function Li(e){try{++Ii,e()}finally{--Ii||zi()}}function Ri(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ki(n,e)}function zi(){if(!(Ii>0)){for(;Ni{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Fi,o=t?.compare??Object.is;if(n)Fi=i,++Di,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Ci.Mutable|Ci.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Fi=a,n&&(i.flags&=~Ci.RecursedCheck),Ri(i)}}};return n?(i.flags=Ci.Mutable|Ci.Dirty,i.get=function(){let e=i.flags;if(e&Ci.Dirty||e&Ci.Pending&&ji(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Mi(e)}}else e&Ci.Pending&&(i.flags=e&~Ci.Pending);return Fi!==void 0&&Oi(i,Fi,Di),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ai(e),Mi(e),zi())}},i}function Vi(e){let t=()=>{let t=Fi;Fi=n,++Di,n.depsTail=void 0,n.flags=Ci.Watching|Ci.RecursedCheck;try{return e()}finally{Fi=t,n.flags&=~Ci.RecursedCheck,Ri(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ci.Watching|Ci.RecursedCheck,notify(){let e=this.flags;e&Ci.Dirty||e&Ci.Pending&&ji(this.deps,this)?t():this.flags=Ci.Watching},stop(){this.flags=Ci.None,this.depsTail=void 0,Ri(this)}};return t(),n}function Hi(e){let t=je(),n=`not-found-${dt(t.stores.location,e=>e.pathname)}-${dt(t.stores.status,e=>e)}`;return(0,E.jsx)(xi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Fn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Fn(t))return e.fallback?.(t);throw t},children:e.children})}function Ui(){return(0,E.jsx)(`p`,{children:`Not Found`})}function Wi(e){return(0,E.jsx)(E.Fragment,{children:e.children})}function Gi(e,t,n){return t.options.notFoundComponent?(0,E.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,E.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,E.jsx)(Ui,{})}function Ki(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,E.jsx)(n,{}):null}var qi=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ji=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Yi=T.memo(function({routeId:e}){let t=je();return(0,E.jsx)(Xi,{router:t,match:dt(t.stores.getMatchStore(e),e=>e)})});function Xi({router:e,match:t}){let n=e.routesById[t.routeId],r=Ki(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Ji(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?T.Suspense:Wi,l=i?xi:Wi,u=o?Hi:Wi;return(0,E.jsxs)(n.isRoot?n.options.shellComponent??Wi:Wi,{children:[(0,E.jsx)(Le.Provider,{value:t.routeId,children:(0,E.jsx)(c,{fallback:r,children:(0,E.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Fn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,E.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return T.createElement(o,e)},children:s?(0,E.jsx)(dn,{fallback:r,children:(0,E.jsx)(Zi,{match:t})}):(0,E.jsx)(Zi,{match:t})})})})}),null]})}var Zi=T.memo(function({match:e}){let t=je(),n=e.routeId,r=t.routesById[n],i=T.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=T.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,E.jsx)(e,{},i):(0,E.jsx)(Qi,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Ji(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Ki(t,r)}if(e.status===`notFound`)return Gi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Qi=T.memo(function(){let e=je(),t=T.useContext(Le),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=dt(a,e=>[!!e._notFound,e.error],qi),i=dt(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Gi(e,e.routesById[t],r);if(!i)return null;let a=(0,E.jsx)(Yi,{routeId:i});return t===`__root__`?(0,E.jsx)(T.Suspense,{fallback:Ki(e),children:a}):a});function $i(e,t){let n=e[1];e.length=0,n?.(t)}function ea({t:e}){let t=je(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{$i(n,!1),n.push(i,a),e(t),T.startTransition(r)}),we(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(tt(r.publicHref)!==tt(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...yr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ta(){let e=je(),t=e.routesById[Ve],n=Ki(e,t),r=e.ssr?Wi:T.Suspense,i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ea,{t:T.useState()[1]}),(0,E.jsx)(r,{fallback:n,children:(0,E.jsx)(na,{})})]});return e.options.InnerWrap?(0,E.jsx)(e.options.InnerWrap,{children:i}):i}function na(){let e=je(),t=e._rendered,n=dt(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;we(()=>{t[0]===n&&$i(t,!0)},[t,n]);let a=i?(0,E.jsx)(Yi,{routeId:i}):null;return(0,E.jsx)(Le.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,E.jsx)(xi,{getResetKey:()=>r,onCatch:void 0,children:a})})}var ra=e=>({createMutableStore:Bi,createReadonlyStore:Bi,batch:Li}),ia=e=>new aa(e),aa=class extends Sr{constructor(e){super(e,ra)}};function oa({router:e,children:t,...n}){Ze(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,E.jsx)(Ce.Provider,{value:e,children:t});return e.options.Wrap?(0,E.jsx)(e.options.Wrap,{children:r}):r}function sa({router:e,...t}){return(0,E.jsx)(oa,{router:e,...t,children:(0,E.jsx)(ta,{})})}function ca(e){let t=je({warn:e?.router===void 0}),n=e?.router||t;return dt(n.stores.__store,pn(e,n))}function la(e,t,n={leading:!1}){let[r,i]=(0,T.useState)(e),a=(0,T.useRef)(!1),o=(0,T.useRef)(null),s=(0,T.useRef)(!1),c=(0,T.useRef)(e);c.current=e;let l=(0,T.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,T.useCallback)(()=>{l(),s.current=!1},[]),d=(0,T.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,T.useEffect)(()=>{a.current&&(l(),!s.current&&n.leading?(s.current=!0,i(e),o.current=window.setTimeout(()=>{s.current=!1},t)):o.current=window.setTimeout(()=>{s.current=!1,i(e)},t))},[e,n.leading,t]),(0,T.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function ua(e=!1,t={}){let[n,r]=(0,T.useState)(e),i=(0,T.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,T.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,T.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}function da(e){return e===`auto`||e===`dark`||e===`light`}function fa({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return da(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&da(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function pa(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function ma({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,T.useRef)(null),[a,o]=(0,T.useState)(()=>e.get(t)),s=r||a,c=(0,T.useCallback)(t=>{r||(pa(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,T.useCallback)(()=>{o(t),pa(t,n),e.clear()},[e.clear,t]);return(0,T.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),ge(()=>{pa(e.get(t),n)},[]),(0,T.useEffect)(()=>{if(r)return pa(r,n),()=>{};r===void 0&&pa(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&pa(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function ha(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function ga(e,t){let n=t?[t]:[`:root`,`:host`],r=ha(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=ha(e.dark),o=ha(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function _a({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=fe(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:m(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=fe(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:p(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:p(e.colors[t][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:m(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function va(e,t,n){S(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var ya=e=>{let t=fe(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:w(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":Mt(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":Mt(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};va(r.variables,e.breakpoints,`breakpoint`),va(r.variables,e.spacing,`spacing`),va(r.variables,e.fontSizes,`font-size`),va(r.variables,e.lineHeights,`line-height`),va(r.variables,e.shadows,`shadow`),va(r.variables,e.radius,`radius`),va(r.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),S(e.colors).forEach(t=>{let n=e.colors[t];if(h(n)){Object.assign(r.light,_a({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,_a({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=Pt(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=Pt(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,_a({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,_a({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return S(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function ba(){let e=l(),n=t(),r=S(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Ft(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:ce(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:ce(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,E.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function xa({theme:e,generator:t}){let n=ya(e),r=t?.(e);return r?x(n,r):n}var Sa=ya(d);function Ca(e){let t={variables:{},light:{},dark:{}};return S(e.variables).forEach(n=>{Sa.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),S(e.light).forEach(n=>{Sa.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),S(e.dark).forEach(n=>{Sa.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function wa(e){return ga({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Ta({cssVariablesSelector:e,deduplicateCssVariables:n}){let r=l(),i=t(),a=xa({theme:r,generator:s()}),o=(e===void 0||e===`:root`||e===`:host`)&&n,c=ga(o?Ca(a):a,e);return c?(0,E.jsx)(`style`,{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${c}${o?``:wa(e)}`}}):null}Ta.displayName=`@mantine/CssVariables`;function Ea({respectReducedMotion:e,getRootElement:t}){ge(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Da({theme:e,children:t,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:s=!0,cssVariablesSelector:l,classNamesPrefix:u=`mantine`,colorSchemeManager:d=fa(),defaultColorScheme:f=`light`,getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:h,stylesTransform:g,env:_,deduplicateInlineStyles:v=!1}){let{colorScheme:y,setColorScheme:b,clearColorScheme:x}=ma({defaultColorScheme:f,forceColorScheme:h,manager:d,getRootElement:p});return Ea({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:p}),(0,E.jsx)(r,{value:{colorScheme:y,setColorScheme:b,clearColorScheme:x,getRootElement:p,classNamesPrefix:u,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:l??`:root`,withStaticClasses:i,stylesTransform:g,env:_,deduplicateInlineStyles:v},children:(0,E.jsxs)(c,{theme:e,children:[s&&(0,E.jsx)(Ta,{cssVariablesSelector:l,deduplicateCssVariables:o}),a&&(0,E.jsx)(ba,{}),t]})})}Da.displayName=`@mantine/core/MantineProvider`;function Oa(e){return e}var[ka,Aa]=vn(`AppShell was not found in tree`),ja={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},Ma=n(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:s,withBorder:c,zIndex:l,mod:u,...d}=ae(`AppShellAside`,null,e),f=Aa();return f.disabled?null:(0,E.jsx)(ye,{component:`aside`,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`aside`,{className:o({[jt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-aside-z-index":`calc(${l??f.zIndex} + 1)`}})});Ma.classes=ja,Ma.displayName=`@mantine/core/AppShellAside`;var Na=n(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:s,withBorder:c,zIndex:l,mod:u,...d}=ae(`AppShellFooter`,null,e),f=Aa();return f.disabled?null:(0,E.jsx)(ye,{component:`footer`,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`footer`,{className:o({[jt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-footer-z-index":(l??f.zIndex)?.toString()}})});Na.classes=ja,Na.displayName=`@mantine/core/AppShellFooter`;var Pa=n(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:s,withBorder:c,zIndex:l,mod:u,...d}=ae(`AppShellHeader`,null,e),f=Aa();return f.disabled?null:(0,E.jsx)(ye,{component:`header`,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`header`,{className:o({[jt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-header-z-index":(l??f.zIndex)?.toString()}})});Pa.classes=ja,Pa.displayName=`@mantine/core/AppShellHeader`;var Fa=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`AppShellMain`,null,e);return(0,E.jsx)(ye,{component:`main`,...Aa().getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});Fa.classes=ja,Fa.displayName=`@mantine/core/AppShellMain`;var Ia=n(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=ae(`AppShellNavbar`,null,e),d=Aa();return d.disabled?null:(0,E.jsx)(ye,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}})});Ia.classes=ja,Ia.displayName=`@mantine/core/AppShellNavbar`;var La=f(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=ae(`AppShellSection`,null,e),l=Aa();return(0,E.jsx)(ye,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});La.classes=ja,La.displayName=`@mantine/core/AppShellSection`;function Ra(e){return typeof e==`object`?e.base:e}function za(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function Ba(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Va({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`)),za(o)){let t=w(Ra(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(Ba(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=w(o.base),e[`--app-shell-aside-offset`]=w(o.base)),S(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=w(o[e]),t[e][`--app-shell-aside-offset`]=w(o[e]))})),r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}if(r?.collapsed?.mobile){let e=Lt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function Ha({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),za(i)){let t=w(Ra(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}Ba(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=w(i.base),a&&(e[`--app-shell-footer-offset`]=w(i.base))),S(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=w(i[e]),a&&(t[e][`--app-shell-footer-offset`]=w(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function Ua({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),za(i)){let t=w(Ra(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}Ba(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=w(i.base),a&&(e[`--app-shell-header-offset`]=w(i.base))),S(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=w(i[e]),a&&(t[e][`--app-shell-header-offset`]=w(i[e])))})),n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`))}function Wa({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`)),za(o)){let t=w(Ra(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(Ba(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=w(o.base),e[`--app-shell-navbar-offset`]=w(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=w(o.base))),S(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=w(o[e]),t[e][`--app-shell-navbar-offset`]=w(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=w(o[e])))})),r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`)}if(r?.collapsed?.mobile){let e=Lt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function Ga(e){return Number(e)===0?`0px`:me(e)}function Ka({padding:e,baseStyles:t,minMediaStyles:n}){za(e)&&(t[`--app-shell-padding`]=Ga(Ra(e))),Ba(e)&&(e.base&&(t[`--app-shell-padding`]=Ga(e.base)),S(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=Ga(e[t]))}))}function qa({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),Wa({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),Va({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),Ua({baseStyles:l,minMediaStyles:s,header:t,mode:o}),Ha({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),Ka({baseStyles:l,minMediaStyles:s,padding:i});let u=Kt(S(s),a.breakpoints).map(e=>({query:`(min-width: ${ce(e.px)})`,styles:s[e.value]})),d=Kt(S(c),a.breakpoints).map(e=>({query:`(max-width: ${ce(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function Ja({navbar:e,header:t,aside:n,footer:r,padding:i,mode:o,selector:s}){let c=l(),d=a(),{media:f,baseStyles:p}=qa({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:o});return(0,E.jsx)(u,{media:f,styles:p,selector:s||d.cssVariablesSelector})}function Ya({transitionDuration:e,disabled:t}){let[n,r]=(0,T.useState)(!0),i=(0,T.useRef)(-1),a=(0,T.useRef)(-1);return Zt(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,T.startTransition)(()=>{r(!1)}),200)}),ge(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,T.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var Xa={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:Cn(`app`),mode:`fixed`},Za=g((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),Qa=n(t=>{let n=ae(`AppShell`,Xa,t),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,navbar:l,withBorder:u,padding:d,transitionDuration:f,transitionTimingFunction:p,header:m,zIndex:h,layout:g,disabled:_,aside:v,footer:y,offsetScrollbars:b=!0,mode:x,mod:ee,attributes:S,id:te,...ne}=n,re=oe({name:`AppShell`,classes:ja,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:S,vars:c,varsResolver:Za}),ie=Ya({disabled:_,transitionDuration:f}),se=e(te);return(0,E.jsxs)(ka,{value:{getStyles:re,withBorder:u,zIndex:h,disabled:_,offsetScrollbars:b,mode:x},children:[(0,E.jsx)(Ja,{navbar:l,header:m,aside:v,footer:y,padding:d,mode:x,selector:x===`static`?`#${se}`:void 0}),(0,E.jsx)(ye,{...re(`root`),id:se,mod:[{resizing:ie,layout:g,disabled:_,mode:x},ee],...ne})]})});Qa.classes=ja,Qa.varsResolver=Za,Qa.displayName=`@mantine/core/AppShell`,Qa.Navbar=Ia,Qa.Header=Pa,Qa.Main=Fa,Qa.Aside=Ma,Qa.Footer=Na,Qa.Section=La;var $a={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},eo=(0,T.createContext)({withinGroup:!1}),to=g((e,{spacing:t})=>({group:{"--ag-spacing":me(t)}})),no=n(e=>{let t=ae(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=oe({name:`AvatarGroup`,classes:$a,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:to,rootSelector:`group`});return(0,E.jsx)(eo,{value:{withinGroup:!0},children:(0,E.jsx)(ye,{...d(`group`),...u})})});no.classes=$a,no.varsResolver=to,no.displayName=`@mantine/core/AvatarGroup`;function ro(e){return(0,E.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,E.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function io(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var co=g((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?oo(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":de(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:ie(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),lo=f(e=>{let t=ae(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:_,allowedInitialsColors:v,attributes:y,...b}=t,x=(0,T.use)(eo),[ee,S]=(0,T.useState)(!c),te=oe({name:`Avatar`,props:t,classes:$a,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:co});return(0,T.useEffect)(()=>S(!c),[c]),(0,E.jsx)(ye,{...te(`root`),mod:[{"within-group":x.withinGroup},g],...b,children:ee||!c?(0,E.jsx)(`span`,{...te(`placeholder`),title:l,children:m||typeof _==`string`&&so(_)||(0,E.jsx)(ro,{})}):(0,E.jsx)(`img`,{...p,...te(`image`),src:c,alt:l,onError:e=>{S(!0),p?.onError?.(e)}})})});lo.classes=$a,lo.varsResolver=co,lo.displayName=`@mantine/core/Avatar`,lo.Group=no;var uo={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},fo=g((e,{color:t,size:n,lineSize:r,transitionDuration:a,transitionTimingFunction:o})=>({root:{"--burger-color":t?i(t,e):void 0,"--burger-size":de(n,`burger-size`),"--burger-line-size":r?w(r):void 0,"--burger-transition-duration":a===void 0?void 0:`${a}ms`,"--burger-transition-timing-function":o}})),po=n(e=>{let t=ae(`Burger`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,opened:c,children:l,transitionDuration:u,transitionTimingFunction:d,lineSize:f,attributes:p,...m}=t,h=oe({name:`Burger`,classes:uo,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:fo});return(0,E.jsxs)(y,{...h(`root`),...m,children:[(0,E.jsx)(ye,{mod:[`reduce-motion`,{opened:c}],...h(`burger`)}),l]})});po.classes=uo,po.varsResolver=fo,po.displayName=`@mantine/core/Burger`;var[mo,ho]=vn(`Drawer component was not found in tree`),go={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},_o=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`DrawerBody`,null,e);return(0,E.jsx)(Xt,{...ho().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});_o.classes=go,_o.displayName=`@mantine/core/DrawerBody`;var vo=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`DrawerCloseButton`,null,e);return(0,E.jsx)(Ot,{...ho().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});vo.classes=go,vo.displayName=`@mantine/core/DrawerCloseButton`;var yo=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,radius:s,__hidden:c,...l}=ae(`DrawerContent`,null,e),u=ho(),d=u.scrollAreaComponent||Nt;return(0,E.jsx)(zt,{...u.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:u.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...l,radius:s||u.radius||0,"data-hidden":c||void 0,children:(0,E.jsx)(d,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:o})})});yo.classes=go,yo.displayName=`@mantine/core/DrawerContent`;var bo=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`DrawerHeader`,null,e);return(0,E.jsx)(tn,{...ho().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});bo.classes=go,bo.displayName=`@mantine/core/DrawerHeader`;var xo=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`DrawerOverlay`,null,e);return(0,E.jsx)(Jt,{...ho().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});xo.classes=go,xo.displayName=`@mantine/core/DrawerOverlay`;function So(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function Co(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var wo={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},To={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},Eo={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Cn(`modal`),position:`left`},D=g((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":de(n,`drawer-size`),"--drawer-flex":Co(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":So(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":w(r)}})),Do=n(e=>{let t=ae(`DrawerRoot`,Eo,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,scrollAreaComponent:c,position:l,transitionProps:u,radius:d,attributes:f,...p}=t,{dir:m}=yn(),h=oe({name:`Drawer`,classes:go,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:D}),g=(m===`rtl`?To:wo)[l];return(0,E.jsx)(mo,{value:{scrollAreaComponent:c,getStyles:h,radius:d},children:(0,E.jsx)(rn,{...h(`root`),transitionProps:{transition:g,...u},"data-offset-scrollbars":c===xn.Autosize||void 0,unstyled:o,...p})})});Do.classes=go,Do.varsResolver=D,Do.displayName=`@mantine/core/DrawerRoot`;var Oo=(0,T.createContext)(null);function ko({children:e}){let[t,n]=(0,T.useState)([]),[r,i]=(0,T.useState)(Cn(`modal`));return(0,E.jsx)(Oo,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}ko.displayName=`@mantine/core/DrawerStack`;var Ao=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=ae(`DrawerTitle`,null,e);return(0,E.jsx)(on,{...ho().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Ao.classes=go,Ao.displayName=`@mantine/core/DrawerTitle`;var jo={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Cn(`modal`),withOverlay:!0,withCloseButton:!0},Mo=n(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,opened:s,stackId:c,zIndex:l,...u}=ae(`Drawer`,jo,e),d=(0,T.use)(Oo),f=!!t||i,p=d&&c?{closeOnEscape:d.currentId===c,trapFocus:d.currentId===c,zIndex:d.getZIndex(c)}:{},m=n===!1?!1:c&&d?d.currentId===c:s;return(0,T.useEffect)(()=>{d&&c&&(s?d.addModal(c,l||Cn(`modal`)):d.removeModal(c))},[s,c,l]),(0,E.jsxs)(Do,{opened:s,zIndex:d&&c?d.getZIndex(c):l,...u,...p,children:[n&&(0,E.jsx)(xo,{visible:m,transitionProps:d&&c?{duration:0}:void 0,...r}),(0,E.jsxs)(yo,{__hidden:d&&c&&s?c!==d.currentId:!1,children:[f&&(0,E.jsxs)(bo,{children:[t&&(0,E.jsx)(Ao,{children:t}),i&&(0,E.jsx)(vo,{...a})]}),(0,E.jsx)(_o,{children:o})]})]})});Mo.classes=go,Mo.displayName=`@mantine/core/Drawer`,Mo.Root=Do,Mo.Overlay=xo,Mo.Content=yo,Mo.Body=_o,Mo.Header=bo,Mo.Title=Ao,Mo.CloseButton=vo,Mo.Stack=ko;var No={root:`m_dc6f14e2`},Po=g((e,{size:t})=>({root:{"--kbd-fz":de(t,`kbd-fz`)}})),Fo=n(e=>{let t=ae(`Kbd`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,E.jsx)(ye,{component:`kbd`,...oe({name:`Kbd`,classes:No,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c,vars:s,varsResolver:Po})(`root`),...l})});Fo.classes=No,Fo.varsResolver=Po,Fo.displayName=`@mantine/core/Kbd`;var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Io(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+`-`+O[e[t+4]]+O[e[t+5]]+`-`+O[e[t+6]]+O[e[t+7]]+`-`+O[e[t+8]]+O[e[t+9]]+`-`+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}var Lo,Ro=new Uint8Array(16);function zo(){if(!Lo){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Lo=crypto.getRandomValues.bind(crypto)}return Lo(Ro)}var Bo={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Vo(e,t,n){if(Bo.randomUUID&&!t&&!e)return Bo.randomUUID();e||={};let r=e.random??e.rng?.()??zo();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Io(r)}var Ho;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Ho||={});var Uo;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Uo||={});var k=Ho.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Wo=e=>{switch(typeof e){case`undefined`:return k.undefined;case`string`:return k.string;case`number`:return Number.isNaN(e)?k.nan:k.number;case`boolean`:return k.boolean;case`function`:return k.function;case`bigint`:return k.bigint;case`symbol`:return k.symbol;case`object`:return Array.isArray(e)?k.array:e===null?k.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?k.promise:typeof Map<`u`&&e instanceof Map?k.map:typeof Set<`u`&&e instanceof Set?k.set:typeof Date<`u`&&e instanceof Date?k.date:k.object;default:return k.unknown}},A=Ho.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Go=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Go.create=e=>new Go(e);var Ko=(e,t)=>{let n;switch(e.code){case A.invalid_type:n=e.received===k.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case A.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ho.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ho.joinValues(e.keys,`, `)}`;break;case A.invalid_union:n=`Invalid input`;break;case A.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ho.joinValues(e.options)}`;break;case A.invalid_enum_value:n=`Invalid enum value. Expected ${Ho.joinValues(e.options)}, received '${e.received}'`;break;case A.invalid_arguments:n=`Invalid function arguments`;break;case A.invalid_return_type:n=`Invalid function return type`;break;case A.invalid_date:n=`Invalid date`;break;case A.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ho.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case A.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case A.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case A.custom:n=`Invalid input`;break;case A.invalid_intersection_types:n=`Intersection results could not be merged`;break;case A.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case A.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Ho.assertNever(e)}return{message:n}},qo=Ko;function Jo(){return qo}var Yo=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function j(e,t){let n=Jo(),r=Yo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ko?void 0:Ko].filter(e=>!!e)});e.common.issues.push(r)}var Xo=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return M;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return M;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},M=Object.freeze({status:`aborted`}),Zo=e=>({status:`dirty`,value:e}),Qo=e=>({status:`valid`,value:e}),$o=e=>e.status===`aborted`,es=e=>e.status===`dirty`,ts=e=>e.status===`valid`,ns=e=>typeof Promise<`u`&&e instanceof Promise,N;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(N||={});var rs=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},is=(e,t)=>{if(ts(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Go(e.common.issues);return this._error=t,this._error}}};function P(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var F=class{get description(){return this._def.description}_getType(e){return Wo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xo,ctx:{common:e.parent.common,data:e.data,parsedType:Wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ns(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)};return is(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return ts(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>ts(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)},r=this._parse({data:e,path:n.path,parent:n});return is(n,await(ns(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:A.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new sc({schema:this,typeName:I.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return cc.create(this,this._def)}nullable(){return lc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hs.create(this)}promise(){return oc.create(this,this._def)}or(e){return Gs.create([this,e],this._def)}and(e){return Ys.create(this,e,this._def)}transform(e){return new sc({...P(this._def),schema:this,typeName:I.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new uc({...P(this._def),innerType:this,defaultValue:t,typeName:I.ZodDefault})}brand(){return new pc({typeName:I.ZodBranded,type:this,...P(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new dc({...P(this._def),innerType:this,catchValue:t,typeName:I.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return mc.create(this,e)}readonly(){return hc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},as=/^c[^\s-]{8,}$/i,os=/^[0-9a-z]+$/,ss=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ls=/^[a-z0-9_-]{21}$/i,us=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ds=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ps=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ms,hs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_s=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ys=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xs=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Ss=RegExp(`^${xs}$`);function Cs(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function ws(e){return RegExp(`^${Cs(e)}$`)}function Ts(e){let t=`${xs}T${Cs(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Es(e,t){return!((t!==`v4`&&t||!hs.test(e))&&(t!==`v6`&&t||!_s.test(e)))}function Ds(e,t){if(!us.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Os(e,t){return!((t!==`v4`&&t||!gs.test(e))&&(t!==`v6`&&t||!vs.test(e)))}var ks=class e extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.string,received:t.parsedType}),M}let t=new Xo,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:A.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:A.invalid_string,...N.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...N.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...N.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...N.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...N.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...N.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...N.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...N.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...N.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...N.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...N.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...N.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...N.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...N.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...N.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...N.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...N.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...N.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...N.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...N.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...N.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...N.errToObj(t)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew ks({checks:[],typeName:I.ZodString,coerce:e?.coerce??!1,...P(e)});function As(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var js=class e extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.number,received:t.parsedType}),M}let t,n=new Xo;for(let r of this._def.checks)r.kind===`int`?Ho.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),j(t,{code:A.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),j(t,{code:A.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?As(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),j(t,{code:A.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),j(t,{code:A.not_finite,message:r.message}),n.dirty()):Ho.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,N.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,N.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,N.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,N.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:N.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:N.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:N.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:N.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:N.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:N.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&Ho.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew js({checks:[],typeName:I.ZodNumber,coerce:e?.coerce||!1,...P(e)});var Ms=class e extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let t,n=new Xo;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),j(t,{code:A.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),j(t,{code:A.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Ho.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.bigint,received:t.parsedType}),M}gte(e,t){return this.setLimit(`min`,e,!0,N.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,N.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,N.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,N.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:N.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:N.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Ms({checks:[],typeName:I.ZodBigInt,coerce:e?.coerce??!1,...P(e)});var Ns=class extends F{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.boolean,received:t.parsedType}),M}return Qo(e.data)}};Ns.create=e=>new Ns({typeName:I.ZodBoolean,coerce:e?.coerce||!1,...P(e)});var Ps=class e extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.date,received:t.parsedType}),M}if(Number.isNaN(e.data.getTime()))return j(this._getOrReturnCtx(e),{code:A.invalid_date}),M;let t=new Xo,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),j(n,{code:A.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Ho.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:N.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:N.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Ps({checks:[],coerce:e?.coerce||!1,typeName:I.ZodDate,...P(e)});var Fs=class extends F{_parse(e){if(this._getType(e)!==k.symbol){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.symbol,received:t.parsedType}),M}return Qo(e.data)}};Fs.create=e=>new Fs({typeName:I.ZodSymbol,...P(e)});var Is=class extends F{_parse(e){if(this._getType(e)!==k.undefined){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.undefined,received:t.parsedType}),M}return Qo(e.data)}};Is.create=e=>new Is({typeName:I.ZodUndefined,...P(e)});var Ls=class extends F{_parse(e){if(this._getType(e)!==k.null){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.null,received:t.parsedType}),M}return Qo(e.data)}};Ls.create=e=>new Ls({typeName:I.ZodNull,...P(e)});var Rs=class extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Qo(e.data)}};Rs.create=e=>new Rs({typeName:I.ZodAny,...P(e)});var zs=class extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qo(e.data)}};zs.create=e=>new zs({typeName:I.ZodUnknown,...P(e)});var Bs=class extends F{_parse(e){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.never,received:t.parsedType}),M}};Bs.create=e=>new Bs({typeName:I.ZodNever,...P(e)});var Vs=class extends F{_parse(e){if(this._getType(e)!==k.undefined){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.void,received:t.parsedType}),M}return Qo(e.data)}};Vs.create=e=>new Vs({typeName:I.ZodVoid,...P(e)});var Hs=class e extends F{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==k.array)return j(t,{code:A.invalid_type,expected:k.array,received:t.parsedType}),M;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(j(t,{code:A.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new rs(t,e,t.path,n)))).then(e=>Xo.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new rs(t,e,t.path,n)));return Xo.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:N.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:N.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:N.toString(n)}})}nonempty(e){return this.min(1,e)}};Hs.create=(e,t)=>new Hs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...P(t)});function Us(e){if(e instanceof Ws){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=cc.create(Us(r))}return new Ws({...e._def,shape:()=>t})}return e instanceof Hs?new Hs({...e._def,type:Us(e.element)}):e instanceof cc?cc.create(Us(e.unwrap())):e instanceof lc?lc.create(Us(e.unwrap())):e instanceof Xs?Xs.create(e.items.map(e=>Us(e))):e}var Ws=class e extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Ho.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==k.object){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.object,received:t.parsedType}),M}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Bs&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new rs(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Bs){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(j(n,{code:A.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new rs(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Xo.mergeObjectSync(t,e)):Xo.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return N.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:N.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:I.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Ho.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Ho.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Us(this)}partial(t){let n={};for(let e of Ho.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Ho.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof cc;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return rc(Ho.objectKeys(this.shape))}};Ws.create=(e,t)=>new Ws({shape:()=>e,unknownKeys:`strip`,catchall:Bs.create(),typeName:I.ZodObject,...P(t)}),Ws.strictCreate=(e,t)=>new Ws({shape:()=>e,unknownKeys:`strict`,catchall:Bs.create(),typeName:I.ZodObject,...P(t)}),Ws.lazycreate=(e,t)=>new Ws({shape:e,unknownKeys:`strip`,catchall:Bs.create(),typeName:I.ZodObject,...P(t)});var Gs=class extends F{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Go(e.ctx.common.issues));return j(t,{code:A.invalid_union,unionErrors:n}),M}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Go(e));return j(t,{code:A.invalid_union,unionErrors:i}),M}}get options(){return this._def.options}};Gs.create=(e,t)=>new Gs({options:e,typeName:I.ZodUnion,...P(t)});var Ks=e=>e instanceof tc?Ks(e.schema):e instanceof sc?Ks(e.innerType()):e instanceof nc?[e.value]:e instanceof ic?e.options:e instanceof ac?Ho.objectValues(e.enum):e instanceof uc?Ks(e._def.innerType):e instanceof Is?[void 0]:e instanceof Ls?[null]:e instanceof cc?[void 0,...Ks(e.unwrap())]:e instanceof lc?[null,...Ks(e.unwrap())]:e instanceof pc||e instanceof hc?Ks(e.unwrap()):e instanceof dc?Ks(e._def.innerType):[],qs=class e extends F{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.object)return j(t,{code:A.invalid_type,expected:k.object,received:t.parsedType}),M;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(j(t,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),M)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Ks(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:I.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...P(r)})}};function Js(e,t){let n=Wo(e),r=Wo(t);if(e===t)return{valid:!0,data:e};if(n===k.object&&r===k.object){let n=Ho.objectKeys(t),r=Ho.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Js(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===k.array&&r===k.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if($o(e)||$o(r))return M;let i=Js(e.value,r.value);return i.valid?((es(e)||es(r))&&t.dirty(),{status:t.value,value:i.data}):(j(n,{code:A.invalid_intersection_types}),M)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ys.create=(e,t,n)=>new Ys({left:e,right:t,typeName:I.ZodIntersection,...P(n)});var Xs=class e extends F{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return j(n,{code:A.invalid_type,expected:k.array,received:n.parsedType}),M;if(n.data.lengththis._def.items.length&&(j(n,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new rs(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Xo.mergeArray(t,e)):Xo.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Xs.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Xs({items:e,typeName:I.ZodTuple,rest:null,...P(t)})};var Zs=class e extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.object)return j(n,{code:A.invalid_type,expected:k.object,received:n.parsedType}),M;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new rs(n,e,n.path,e)),value:a._parse(new rs(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Xo.mergeObjectAsync(t,r):Xo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof F?new e({keyType:t,valueType:n,typeName:I.ZodRecord,...P(r)}):new e({keyType:ks.create(),valueType:t,typeName:I.ZodRecord,...P(n)})}},Qs=class extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.map)return j(n,{code:A.invalid_type,expected:k.map,received:n.parsedType}),M;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new rs(n,e,n.path,[a,`key`])),value:i._parse(new rs(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return M;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return M;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Qs.create=(e,t,n)=>new Qs({valueType:t,keyType:e,typeName:I.ZodMap,...P(n)});var $s=class e extends F{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return j(n,{code:A.invalid_type,expected:k.set,received:n.parsedType}),M;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(j(n,{code:A.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return M;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new rs(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:N.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:N.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};$s.create=(e,t)=>new $s({valueType:e,minSize:null,maxSize:null,typeName:I.ZodSet,...P(t)});var ec=class e extends F{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.function)return j(t,{code:A.invalid_type,expected:k.function,received:t.parsedType}),M;function n(e,n){return Yo({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jo(),Ko].filter(e=>!!e),issueData:{code:A.invalid_arguments,argumentsError:n}})}function r(e,n){return Yo({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jo(),Ko].filter(e=>!!e),issueData:{code:A.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof oc){let e=this;return Qo(async function(...t){let o=new Go([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return Qo(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Go([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Go([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Xs.create(t).rest(zs.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Xs.create([]).rest(zs.create()),returns:n||zs.create(),typeName:I.ZodFunction,...P(r)})}},tc=class extends F{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};tc.create=(e,t)=>new tc({getter:e,typeName:I.ZodLazy,...P(t)});var nc=class extends F{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return j(t,{received:t.data,code:A.invalid_literal,expected:this._def.value}),M}return{status:`valid`,value:e.data}}get value(){return this._def.value}};nc.create=(e,t)=>new nc({value:e,typeName:I.ZodLiteral,...P(t)});function rc(e,t){return new ic({values:e,typeName:I.ZodEnum,...P(t)})}var ic=class e extends F{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return j(t,{expected:Ho.joinValues(n),received:t.parsedType,code:A.invalid_type}),M}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return j(t,{received:t.data,code:A.invalid_enum_value,options:n}),M}return Qo(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};ic.create=rc;var ac=class extends F{_parse(e){let t=Ho.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){let e=Ho.objectValues(t);return j(n,{expected:Ho.joinValues(e),received:n.parsedType,code:A.invalid_type}),M}if(this._cache||=new Set(Ho.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Ho.objectValues(t);return j(n,{received:n.data,code:A.invalid_enum_value,options:e}),M}return Qo(e.data)}get enum(){return this._def.values}};ac.create=(e,t)=>new ac({values:e,typeName:I.ZodNativeEnum,...P(t)});var oc=class extends F{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==k.promise&&t.common.async===!1?(j(t,{code:A.invalid_type,expected:k.promise,received:t.parsedType}),M):Qo((t.parsedType===k.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};oc.create=(e,t)=>new oc({type:e,typeName:I.ZodPromise,...P(t)});var sc=class extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{j(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return M;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?M:r.status===`dirty`||t.value===`dirty`?Zo(r.value):r});{if(t.value===`aborted`)return M;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?M:r.status===`dirty`||t.value===`dirty`?Zo(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?M:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?M:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ts(e))return M;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>ts(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):M)}Ho.assertNever(r)}};sc.create=(e,t,n)=>new sc({schema:e,typeName:I.ZodEffects,effect:t,...P(n)}),sc.createWithPreprocess=(e,t,n)=>new sc({schema:t,effect:{type:`preprocess`,transform:e},typeName:I.ZodEffects,...P(n)});var cc=class extends F{_parse(e){return this._getType(e)===k.undefined?Qo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cc.create=(e,t)=>new cc({innerType:e,typeName:I.ZodOptional,...P(t)});var lc=class extends F{_parse(e){return this._getType(e)===k.null?Qo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lc.create=(e,t)=>new lc({innerType:e,typeName:I.ZodNullable,...P(t)});var uc=class extends F{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};uc.create=(e,t)=>new uc({innerType:e,typeName:I.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...P(t)});var dc=class extends F{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ns(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};dc.create=(e,t)=>new dc({innerType:e,typeName:I.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...P(t)});var fc=class extends F{_parse(e){if(this._getType(e)!==k.nan){let t=this._getOrReturnCtx(e);return j(t,{code:A.invalid_type,expected:k.nan,received:t.parsedType}),M}return{status:`valid`,value:e.data}}};fc.create=e=>new fc({typeName:I.ZodNaN,...P(e)});var pc=class extends F{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},mc=class e extends F{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?M:e.status===`dirty`?(t.dirty(),Zo(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?M:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:I.ZodPipeline})}},hc=class extends F{_parse(e){let t=this._def.innerType._parse(e),n=e=>(ts(e)&&(e.value=Object.freeze(e.value)),e);return ns(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};hc.create=(e,t)=>new hc({innerType:e,typeName:I.ZodReadonly,...P(t)}),Ws.lazycreate;var I;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(I||={});var L=ks.create,gc=js.create;fc.create,Ms.create;var _c=Ns.create;Ps.create,Fs.create,Is.create,Ls.create;var vc=Rs.create,yc=zs.create;Bs.create,Vs.create;var bc=Hs.create,R=Ws.create;Ws.strictCreate;var xc=Gs.create,Sc=qs.create;Ys.create,Xs.create;var Cc=Zs.create;Qs.create,$s.create,ec.create,tc.create;var z=nc.create,wc=ic.create,Tc=ac.create;oc.create,sc.create,cc.create,lc.create,sc.createWithPreprocess,mc.create;var Ec=Pn(),Dc=Cc(vc()).optional();function Oc(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}var kc=R({name:L(),arguments:L()}),Ac=R({id:L(),type:z(`function`),function:kc,encryptedValue:L().optional(),metadata:Dc}),jc=R({id:L(),role:L(),content:L().optional(),name:L().optional(),encryptedValue:L().optional(),subagentRunId:L().optional(),metadata:Dc}),Mc=R({type:z(`text`),text:L()}),Nc=Sc(`type`,[R({type:z(`data`),value:L(),mimeType:L()}),R({type:z(`url`),value:L(),mimeType:L().optional()})]),Pc=R({type:z(`image`),source:Nc,metadata:yc().optional()}),Fc=R({type:z(`audio`),source:Nc,metadata:yc().optional()}),Ic=R({type:z(`video`),source:Nc,metadata:yc().optional()}),Lc=R({type:z(`document`),source:Nc,metadata:yc().optional()}),Rc=R({type:z(`binary`),mimeType:L(),id:L().optional(),url:L().optional(),data:L().optional(),filename:L().optional()}),zc=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:A.custom,message:`BinaryInputContent requires at least one of id, url, or data.`,path:[`id`]})};Rc.superRefine((e,t)=>{zc(e,t)});var Bc=Sc(`type`,[Mc,Pc,Fc,Ic,Lc,Rc]).superRefine((e,t)=>{e.type===`binary`&&zc(e,t)}),Vc=Sc(`role`,[jc.extend({role:z(`developer`),content:L()}),jc.extend({role:z(`system`),content:L()}),jc.extend({role:z(`assistant`),content:L().optional(),toolCalls:bc(Ac).optional()}),jc.extend({role:z(`user`),content:xc([L(),bc(Bc)])}),R({id:L(),content:L(),role:z(`tool`),toolCallId:L(),error:L().optional(),encryptedValue:L().optional(),subagentRunId:L().optional(),metadata:Dc}),R({id:L(),role:z(`activity`),activityType:L(),content:Cc(vc()),subagentRunId:L().optional(),metadata:Dc}),R({id:L(),role:z(`reasoning`),content:L(),encryptedValue:L().optional(),subagentRunId:L().optional(),metadata:Dc})]);xc([z(`developer`),z(`system`),z(`assistant`),z(`user`),z(`tool`),z(`activity`),z(`reasoning`)]);var Hc=R({description:L(),value:L()}),Uc=R({name:L(),description:L(),parameters:vc(),metadata:Cc(vc()).optional()}),Wc=R({id:L(),reason:L(),message:L().optional(),toolCallId:L().optional(),responseSchema:Cc(vc()).optional(),expiresAt:L().optional(),metadata:Cc(vc()).optional(),subagentRunId:L().optional()}),Gc=R({interruptId:L(),status:wc([`resolved`,`cancelled`]),payload:vc().optional(),metadata:Dc}),Kc=R({threadId:L(),runId:L(),parentRunId:L().optional(),state:vc().transform(e=>e??void 0),messages:bc(Vc),tools:bc(Uc),context:bc(Hc),forwardedProps:vc(),resume:bc(Gc).optional()}),qc=vc(),B=class extends Error{constructor(e){super(e)}},Jc=class extends B{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}},Yc=R({name:L(),description:L().optional()}),Xc=R({name:L().optional(),type:L().optional(),description:L().optional(),version:L().optional(),provider:L().optional(),documentationUrl:L().optional(),metadata:Cc(yc()).optional()}),Zc=R({streaming:_c().optional(),websocket:_c().optional(),httpBinary:_c().optional(),pushNotifications:_c().optional(),resumable:_c().optional()}),Qc=R({supported:_c().optional(),items:bc(Uc).optional(),parallelCalls:_c().optional(),clientProvided:_c().optional()}),$c=R({structuredOutput:_c().optional(),supportedMimeTypes:bc(L()).optional()}),el=R({snapshots:_c().optional(),deltas:_c().optional(),memory:_c().optional(),persistentState:_c().optional()}),tl=R({supported:_c().optional(),delegation:_c().optional(),handoffs:_c().optional(),subAgents:bc(Yc).optional()}),nl=R({supported:_c().optional(),streaming:_c().optional(),encrypted:_c().optional()}),rl=R({image:_c().optional(),audio:_c().optional(),video:_c().optional(),pdf:_c().optional(),file:_c().optional()}),il=R({image:_c().optional(),audio:_c().optional()}),al=R({input:rl.optional(),output:il.optional()}),ol=R({codeExecution:_c().optional(),sandboxed:_c().optional(),maxIterations:gc().optional(),maxExecutionTime:gc().optional()}),sl=R({supported:_c().optional(),approvals:_c().optional(),interventions:_c().optional(),feedback:_c().optional(),interrupts:_c().optional(),approveWithEdits:_c().optional()});R({identity:Xc.optional(),transport:Zc.optional(),tools:Qc.optional(),output:$c.optional(),state:el.optional(),multiAgent:tl.optional(),reasoning:nl.optional(),multimodal:al.optional(),execution:ol.optional(),humanInTheLoop:sl.optional(),custom:Cc(yc()).optional()});var cl=xc([z(`developer`),z(`system`),z(`assistant`),z(`user`)]),V=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({}),ll=R({type:Tc(V),timestamp:gc().optional(),rawEvent:vc().optional(),metadata:Dc}).passthrough(),ul=ll.extend({type:z(V.TEXT_MESSAGE_START),messageId:L(),role:cl.default(`assistant`),name:L().optional(),subagentRunId:L().optional()}),dl=ll.extend({type:z(V.TEXT_MESSAGE_CONTENT),messageId:L(),delta:L(),subagentRunId:L().optional()}),fl=ll.extend({type:z(V.TEXT_MESSAGE_END),messageId:L(),subagentRunId:L().optional()}),pl=ll.extend({type:z(V.TEXT_MESSAGE_CHUNK),messageId:L().optional(),role:cl.optional(),delta:L().optional(),name:L().optional(),subagentRunId:L().optional()}),ml=ll.extend({type:z(V.THINKING_TEXT_MESSAGE_START)}),hl=dl.omit({messageId:!0,type:!0,subagentRunId:!0}).extend({type:z(V.THINKING_TEXT_MESSAGE_CONTENT)}),gl=ll.extend({type:z(V.THINKING_TEXT_MESSAGE_END)}),_l=ll.extend({type:z(V.TOOL_CALL_START),toolCallId:L(),toolCallName:L(),parentMessageId:L().nullable().optional().transform(e=>e??void 0),subagentRunId:L().optional()}),vl=ll.extend({type:z(V.TOOL_CALL_ARGS),toolCallId:L(),delta:L(),subagentRunId:L().optional()}),yl=ll.extend({type:z(V.TOOL_CALL_END),toolCallId:L(),subagentRunId:L().optional()}),bl=ll.extend({messageId:L(),type:z(V.TOOL_CALL_RESULT),toolCallId:L(),content:L(),role:z(`tool`).optional(),subagentRunId:L().optional()}),xl=ll.extend({type:z(V.TOOL_CALL_CHUNK),toolCallId:L().optional(),toolCallName:L().optional(),parentMessageId:L().nullable().optional().transform(e=>e??void 0),delta:L().optional(),subagentRunId:L().optional()}),Sl=ll.extend({type:z(V.THINKING_START),title:L().optional()}),Cl=ll.extend({type:z(V.THINKING_END)}),wl=ll.extend({type:z(V.STATE_SNAPSHOT),snapshot:qc,subagentRunId:L().optional()}),Tl=ll.extend({type:z(V.STATE_DELTA),delta:bc(vc()),subagentRunId:L().optional()}),El=ll.extend({type:z(V.MESSAGES_SNAPSHOT),messages:bc(Vc)}),Dl=ll.extend({type:z(V.ACTIVITY_SNAPSHOT),messageId:L(),activityType:L(),content:Cc(vc()),replace:_c().optional().default(!0),subagentRunId:L().optional()}),Ol=ll.extend({type:z(V.ACTIVITY_DELTA),messageId:L(),activityType:L(),patch:bc(vc()),subagentRunId:L().optional()}),kl=ll.extend({type:z(V.RAW),event:vc(),source:L().optional(),subagentRunId:L().optional()}),Al=ll.extend({type:z(V.CUSTOM),name:L(),value:vc(),subagentRunId:L().optional()}),jl=ll.extend({type:z(V.RUN_STARTED),threadId:L(),runId:L(),parentRunId:L().optional(),input:Kc.optional()}),Ml=Sc(`type`,[R({type:z(`success`)}).strict(),R({type:z(`interrupt`),interrupts:bc(Wc).min(1)}).strict()]),Nl=R({provider:L().optional(),model:L().optional(),inputTokens:gc().int().nonnegative().optional(),outputTokens:gc().int().nonnegative().optional(),totalTokens:gc().int().nonnegative().optional(),reasoningTokens:gc().int().nonnegative().optional(),cachedInputTokens:gc().int().nonnegative().optional()}),Pl=ll.extend({type:z(V.RUN_FINISHED),threadId:L(),runId:L(),result:vc().optional(),outcome:Ml.nullable().optional().transform(e=>e??void 0),usage:bc(Nl).optional()}),Fl=ll.extend({type:z(V.RUN_ERROR),message:L(),code:L().optional(),usage:bc(Nl).optional()}),Il=ll.extend({type:z(V.STEP_STARTED),stepName:L(),subagentRunId:L().optional()}),Ll=ll.extend({type:z(V.STEP_FINISHED),stepName:L(),subagentRunId:L().optional()}),Rl=xc([z(`tool-call`),z(`message`)]),zl=ll.extend({type:z(V.REASONING_START),messageId:L(),subagentRunId:L().optional()}),Bl=ll.extend({type:z(V.REASONING_MESSAGE_START),messageId:L(),role:z(`reasoning`),subagentRunId:L().optional()}),Vl=ll.extend({type:z(V.REASONING_MESSAGE_CONTENT),messageId:L(),delta:L(),subagentRunId:L().optional()}),Hl=ll.extend({type:z(V.REASONING_MESSAGE_END),messageId:L(),subagentRunId:L().optional()}),Ul=ll.extend({type:z(V.REASONING_MESSAGE_CHUNK),messageId:L().optional(),delta:L().optional(),subagentRunId:L().optional()}),Wl=ll.extend({type:z(V.REASONING_END),messageId:L(),subagentRunId:L().optional()}),Gl=ll.extend({type:z(V.REASONING_ENCRYPTED_VALUE),subtype:Rl,entityId:L(),encryptedValue:L(),subagentRunId:L().optional()}),Kl=ll.extend({type:z(V.SUBAGENT_STARTED),subagentRunId:L(),name:L(),description:L().optional(),parentSubagentRunId:L().optional(),parentToolCallId:L().optional(),parentMessageId:L().optional()}),ql=Sc(`type`,[R({type:z(`success`)}).strict(),R({type:z(`suspended`),interruptIds:bc(L()).optional()}).strict()]),Jl=Sc(`type`,[ul,dl,fl,pl,Sl,Cl,ml,hl,gl,_l,vl,yl,xl,bl,wl,Tl,El,Dl,Ol,kl,Al,jl,Pl,Fl,Il,Ll,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ll.extend({type:z(V.SUBAGENT_FINISHED),subagentRunId:L(),result:vc().optional(),outcome:ql.optional()}),ll.extend({type:z(V.SUBAGENT_ERROR),subagentRunId:L(),message:L(),code:L().optional()})]),Yl=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xl=Object.prototype.hasOwnProperty;function Zl(e,t){return Xl.call(e,t)}function Ql(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function tu(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function nu(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function ru(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tsu,_areEquals:()=>_u,applyOperation:()=>fu,applyPatch:()=>pu,applyReducer:()=>mu,deepClone:()=>cu,getValueByPointer:()=>du,validate:()=>gu,validator:()=>hu}),su=au,cu=$l,lu={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=du(n,this.path);r&&=$l(r);var i=fu(n,{op:`remove`,path:this.from}).removed;return fu(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=du(n,this.from);return fu(n,{op:`add`,path:this.path,value:$l(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:_u(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},uu={add:function(e,t,n){return eu(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:lu.move,copy:lu.copy,test:lu.test,_get:lu._get};function du(e,t){if(t==``)return e;var n={op:`_get`,path:t};return fu(e,n),n.value}function fu(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):hu(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=du(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=_u(e,t.value),o.test===!1)throw new su(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new su("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=$l(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:hu;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=nu(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!eu(f))throw new su(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else eu(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new su(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=uu[t.op].call(t,c,f,e);if(o.test===!1)throw new su(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=lu[t.op].call(t,c,f,e);if(o.test===!1)throw new su(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new su('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new su("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new su("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&ru(e.value))throw new su("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new su("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new su(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=gu([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new su(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function gu(e,t,n){try{if(!Array.isArray(e))throw new su(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)pu($l(t),$l(e),n||!0);else{n||=hu;for(var r=0;rku,generate:()=>Du,observe:()=>Eu,unobserve:()=>Tu}),yu=new WeakMap,bu=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),xu=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function Su(e){return yu.get(e)}function Cu(e,t){return e.observers.get(t)}function wu(e,t){e.observers.delete(t.callback)}function Tu(e,t){t.unobserve()}function Eu(e,t){var n=[],r,i=Su(e);if(!i)i=new bu(e),yu.set(e,i);else{var a=Cu(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=$l(e),t){r.callback=t,r.next=null;var o=function(){Du(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){Du(r),clearTimeout(r.next),wu(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new xu(t,r)),r}function Du(e,t){t===void 0&&(t=!1);var n=yu.get(e.object);Ou(n.value,e.object,e.patches,``,t),e.patches.length&&pu(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Ou(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=Ql(t),o=Ql(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(Zl(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?Ou(u,d,n,r+`/`+tu(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+tu(l),value:$l(u)}),n.push({op:`replace`,path:r+`/`+tu(l),value:$l(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+tu(l),value:$l(u)}),n.push({op:`remove`,path:r+`/`+tu(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(s||a.length!=o.length)for(var c=0;c0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Iu(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Lu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Ru?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Bu(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Fu==`function`?Fu(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Vu(e){return typeof e==`function`}function Hu(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Uu=Hu(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(` + `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Wu(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Gu=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=Fu(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Vu(c))try{c()}catch(e){i=e instanceof Uu?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Fu(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Ju(f)}catch(e){i??=[],e instanceof Uu?i=Lu(Lu([],Iu(i)),Iu(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Uu(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Ju(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Wu(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Wu(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),Ku=Gu.EMPTY;function qu(e){return e instanceof Gu||e&&`closed`in e&&Vu(e.remove)&&Vu(e.add)&&Vu(e.unsubscribe)}function Ju(e){Vu(e)?e():e.unsubscribe()}var Yu={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Xu={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Xu.delegate;return r?.setTimeout?r.setTimeout.apply(r,Lu([e,t],Iu(n))):setTimeout.apply(void 0,Lu([e,t],Iu(n)))},clearTimeout:function(e){return(Xu.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Zu(e){Xu.setTimeout(function(){var t=Yu.onUnhandledError;if(t)t(e);else throw e})}function Qu(){}var $u=(function(){return nd(`C`,void 0,void 0)})();function ed(e){return nd(`E`,void 0,e)}function td(e){return nd(`N`,e,void 0)}function nd(e,t,n){return{kind:e,value:t,error:n}}var rd=null;function id(e){if(Yu.useDeprecatedSynchronousErrorHandling){var t=!rd;if(t&&(rd={errorThrown:!1,error:null}),e(),t){var n=rd,r=n.errorThrown,i=n.error;if(rd=null,r)throw i}}else e()}function ad(e){Yu.useDeprecatedSynchronousErrorHandling&&rd&&(rd.errorThrown=!0,rd.error=e)}var od=function(e){Mu(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,qu(t)&&t.add(n)):n.destination=md,n}return t.create=function(e,t,n){return new ud(e,t,n)},t.prototype.next=function(e){this.isStopped?pd(td(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?pd(ed(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?pd($u,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Gu),sd=Function.prototype.bind;function cd(e,t){return sd.call(e,t)}var ld=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){dd(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){dd(e)}else dd(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){dd(e)}},e}(),ud=function(e){Mu(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Vu(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Yu.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&cd(t.next,o),error:t.error&&cd(t.error,o),complete:t.complete&&cd(t.complete,o)}):a=t}return i.destination=new ld(a),i}return t}(od);function dd(e){Yu.useDeprecatedSynchronousErrorHandling?ad(e):Zu(e)}function fd(e){throw e}function pd(e,t){var n=Yu.onStoppedNotification;n&&Xu.setTimeout(function(){return n(e,t)})}var md={closed:!0,next:Qu,error:fd,complete:Qu},hd=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function gd(e){return e}function _d(){return vd([...arguments])}function vd(e){return e.length===0?gd:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var yd=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Sd(e)?e:new ud(e,t,n);return id(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=bd(t),new t(function(t,r){var i=new ud({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[hd]=function(){return this},e.prototype.pipe=function(){return vd([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=bd(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function bd(e){return e??Yu.Promise??Promise}function xd(e){return e&&Vu(e.next)&&Vu(e.error)&&Vu(e.complete)}function Sd(e){return e&&e instanceof od||xd(e)&&qu(e)}function Cd(e){return Vu(e?.lift)}function wd(e){return function(t){if(Cd(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Td(e,t,n,r,i){return new Ed(e,t,n,r,i)}var Ed=function(e){Mu(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(od),Dd=Hu(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Od=function(e){Mu(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new kd(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Dd},t.prototype.next=function(e){var t=this;id(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Fu(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;id(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;id(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?Ku:(this.currentObservers=null,a.push(e),new Gu(function(){t.currentObservers=null,Wu(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new yd;return e.source=this,e},t.create=function(e,t){return new kd(e,t)},t}(yd),kd=function(e){Mu(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??Ku},t}(Od),Ad={now:function(){return(Ad.delegate||Date).now()},delegate:void 0},jd=function(e){Mu(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Ad);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a=0}function kf(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Of(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Of(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Af(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=jf&&(i+=r/jf|0,r%=jf)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Lf(r,i):If(r,i)}function Nf(e,t){let n=If(e,t),r=n.hi&2147483648;r&&(n=Lf(n.lo,n.hi));let i=Pf(n.lo,n.hi);return r?`-`+i:i}function Pf(e,t){if({lo:e,hi:t}=Ff(e,t),t<=2097151)return String(jf*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+Rf(o)+Rf(a)}function Ff(e,t){return{lo:e>>>0,hi:t>>>0}}function If(e,t){return{lo:e|0,hi:t|0}}function Lf(e,t){return t=~t,e?e=~e+1:t+=1,If(e,t)}var Rf=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function zf(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var Bf=Vf();function Vf(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),Gf(i)}return Wf}function qf(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var Jf;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(Jf||={});var U=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?qf(e):Kf().encodeUtf8Into,this.buffer=Zf,this.viewCache=Qf,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||Yf;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(Xf),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-Xf,n=ep(t);return n>Xf&&(this.ensureCapacity(n-Xf),this.buffer.copyWithin(e+n,e+Xf,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(np(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(tp(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=$f){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=ep(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=ep(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return rp(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return np(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return tp(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return tp(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=Bf.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=Bf.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=Bf.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=Bf.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=Bf.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},Yf=128,Xf=1,Zf=new Uint8Array,Qf=new DataView(Zf.buffer),$f=32;function ep(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var W=class{constructor(e,t=Kf().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Af,this.uint32=zf,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case Jf.Varint:for(;this.buf[this.pos++]&128;);break;case Jf.Bit64:this.pos+=4;case Jf.Bit32:this.pos+=4;break;case Jf.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Jf.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===Jf.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),Bf.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),Bf.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,Bf.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Bf.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Bf.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=$f){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function tp(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function np(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function rp(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ip=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function ap(){return{fields:{}}}var op={encode(e,t=new U){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&cp.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=ap();for(;n.pos>>3){case 1:{if(e!==10)break;let t=cp.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return op.fromPartial(e??{})},fromPartial(e){let t=ap();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=ap();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function sp(){return{key:``,value:void 0}}var cp={encode(e,t=new U){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&G.encode(G.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=sp();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cp.fromPartial(e??{})},fromPartial(e){let t=sp();return t.key=e.key??``,t.value=e.value??void 0,t}};function lp(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var G={encode(e,t=new U){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&op.encode(op.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&dp.encode(dp.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=lp();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=op.unwrap(op.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=dp.unwrap(dp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=lp();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=lp();if(e===null)t.nullValue=ip.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function up(){return{values:[]}}var dp={encode(e,t=new U){for(let n of e.values)G.encode(G.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=up();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(G.unwrap(G.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return dp.fromPartial(e??{})},fromPartial(e){let t=up();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=up();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},fp=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function pp(){return{op:0,path:``,from:void 0,value:void 0}}var mp={encode(e,t=new U){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&G.encode(G.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=pp();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mp.fromPartial(e??{})},fromPartial(e){let t=pp();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function hp(){return{id:``,type:``,function:void 0,metadata:void 0}}var gp={encode(e,t=new U){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&vp.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&op.encode(op.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=hp();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=vp.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=op.unwrap(op.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gp.fromPartial(e??{})},fromPartial(e){let t=hp();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?vp.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t}};function _p(){return{name:``,arguments:``}}var vp={encode(e,t=new U){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=_p();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vp.fromPartial(e??{})},fromPartial(e){let t=_p();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function yp(){return{value:``,mimeType:``}}var bp={encode(e,t=new U){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=yp();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bp.fromPartial(e??{})},fromPartial(e){let t=yp();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function xp(){return{value:``,mimeType:void 0}}var Sp={encode(e,t=new U){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=xp();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sp.fromPartial(e??{})},fromPartial(e){let t=xp();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function Cp(){return{data:void 0,url:void 0}}var wp={encode(e,t=new U){return e.data!==void 0&&bp.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Sp.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Cp();for(;n.pos>>3){case 1:if(e!==10)break;i.data=bp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=Sp.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wp.fromPartial(e??{})},fromPartial(e){let t=Cp();return t.data=e.data!==void 0&&e.data!==null?bp.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Sp.fromPartial(e.url):void 0,t}};function Tp(){return{text:``}}var Ep={encode(e,t=new U){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Tp();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ep.fromPartial(e??{})},fromPartial(e){let t=Tp();return t.text=e.text??``,t}};function Dp(){return{source:void 0,metadata:void 0}}var Op={encode(e,t=new U){return e.source!==void 0&&wp.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&G.encode(G.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Dp();for(;n.pos>>3){case 1:if(e!==10)break;i.source=wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Op.fromPartial(e??{})},fromPartial(e){let t=Dp();return t.source=e.source!==void 0&&e.source!==null?wp.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function kp(){return{source:void 0,metadata:void 0}}var Ap={encode(e,t=new U){return e.source!==void 0&&wp.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&G.encode(G.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=kp();for(;n.pos>>3){case 1:if(e!==10)break;i.source=wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ap.fromPartial(e??{})},fromPartial(e){let t=kp();return t.source=e.source!==void 0&&e.source!==null?wp.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function jp(){return{source:void 0,metadata:void 0}}var Mp={encode(e,t=new U){return e.source!==void 0&&wp.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&G.encode(G.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=jp();for(;n.pos>>3){case 1:if(e!==10)break;i.source=wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mp.fromPartial(e??{})},fromPartial(e){let t=jp();return t.source=e.source!==void 0&&e.source!==null?wp.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function Np(){return{source:void 0,metadata:void 0}}var Pp={encode(e,t=new U){return e.source!==void 0&&wp.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&G.encode(G.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Np();for(;n.pos>>3){case 1:if(e!==10)break;i.source=wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=G.unwrap(G.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pp.fromPartial(e??{})},fromPartial(e){let t=Np();return t.source=e.source!==void 0&&e.source!==null?wp.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function Fp(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Ip={encode(e,t=new U){return e.text!==void 0&&Ep.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Op.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Ap.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&Mp.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Pp.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Fp();for(;n.pos>>3){case 1:if(e!==10)break;i.text=Ep.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Op.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=Ap.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=Mp.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=Pp.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ip.fromPartial(e??{})},fromPartial(e){let t=Fp();return t.text=e.text!==void 0&&e.text!==null?Ep.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Op.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Ap.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?Mp.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Pp.fromPartial(e.document):void 0,t}};function Lp(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0}}var Rp={encode(e,t=new U){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)gp.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)Ip.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&op.encode(op.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Lp();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(gp.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(Ip.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=op.unwrap(op.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rp.fromPartial(e??{})},fromPartial(e){let t=Lp();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>gp.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>Ip.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function zp(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var Bp={encode(e,t=new U){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&G.encode(G.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&G.encode(G.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=zp();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=G.unwrap(G.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=G.unwrap(G.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Bp.fromPartial(e??{})},fromPartial(e){let t=zp();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},Vp=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Hp(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var K={encode(e,t=new U){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&G.encode(G.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&op.encode(op.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Hp();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=Fm(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=G.unwrap(G.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=op.unwrap(op.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return K.fromPartial(e??{})},fromPartial(e){let t=Hp();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function Up(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var Wp={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Up();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wp.fromPartial(e??{})},fromPartial(e){let t=Up();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Gp(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var Kp={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Gp();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kp.fromPartial(e??{})},fromPartial(e){let t=Gp();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function qp(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var Jp={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=qp();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jp.fromPartial(e??{})},fromPartial(e){let t=qp();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Yp(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var Xp={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Yp();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xp.fromPartial(e??{})},fromPartial(e){let t=Yp();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Zp(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var Qp={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Zp();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qp.fromPartial(e??{})},fromPartial(e){let t=Zp();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function $p(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var em={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=$p();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return em.fromPartial(e??{})},fromPartial(e){let t=$p();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function tm(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var nm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&G.encode(G.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=tm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=G.unwrap(G.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nm.fromPartial(e??{})},fromPartial(e){let t=tm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function rm(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var im={encode(e,t=new U){e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)mp.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=rm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(mp.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return im.fromPartial(e??{})},fromPartial(e){let t=rm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>mp.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function am(){return{baseEvent:void 0,messages:[]}}var om={encode(e,t=new U){e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)Rp.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=am();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(Rp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return om.fromPartial(e??{})},fromPartial(e){let t=am();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>Rp.fromPartial(e))||[],t}};function sm(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var cm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&G.encode(G.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=sm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=G.unwrap(G.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cm.fromPartial(e??{})},fromPartial(e){let t=sm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function lm(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var um={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&G.encode(G.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=lm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=G.unwrap(G.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return um.fromPartial(e??{})},fromPartial(e){let t=lm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function dm(){return{baseEvent:void 0,threadId:``,runId:``}}var fm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=dm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fm.fromPartial(e??{})},fromPartial(e){let t=dm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function pm(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var mm={encode(e,t=new U){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=pm();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=Fm(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=Fm(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=Fm(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=Fm(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=Fm(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mm.fromPartial(e??{})},fromPartial(e){let t=pm();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function hm(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var gm={encode(e,t=new U){e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&G.encode(G.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Bp.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)mm.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=hm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=G.unwrap(G.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(Bp.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(mm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gm.fromPartial(e??{})},fromPartial(e){let t=hm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>Bp.fromPartial(e))||[],t.usage=e.usage?.map(e=>mm.fromPartial(e))||[],t}};function _m(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var vm={encode(e,t=new U){e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)mm.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=_m();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(mm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vm.fromPartial(e??{})},fromPartial(e){let t=_m();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>mm.fromPartial(e))||[],t}};function ym(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var bm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=ym();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bm.fromPartial(e??{})},fromPartial(e){let t=ym();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function xm(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var Sm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=xm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sm.fromPartial(e??{})},fromPartial(e){let t=xm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Cm(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var wm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Cm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wm.fromPartial(e??{})},fromPartial(e){let t=Cm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Tm(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var Em={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Tm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Em.fromPartial(e??{})},fromPartial(e){let t=Tm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Dm(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var Om={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Dm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Om.fromPartial(e??{})},fromPartial(e){let t=Dm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function km(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var Am={encode(e,t=new U){e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&G.encode(G.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=km();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=G.unwrap(G.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Am.fromPartial(e??{})},fromPartial(e){let t=km();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function jm(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var Mm={encode(e,t=new U){return e.baseEvent!==void 0&&K.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=jm();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=K.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mm.fromPartial(e??{})},fromPartial(e){let t=jm();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?K.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function Nm(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0}}var Pm={encode(e,t=new U){return e.textMessageStart!==void 0&&Wp.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Kp.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Jp.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Xp.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Qp.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&em.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&nm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&im.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&om.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&cm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&um.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&fm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&gm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&vm.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&bm.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Sm.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&wm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Em.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&Om.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&Am.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&Mm.encode(e.subagentError,t.uint32(170).fork()).join(),t},decode(e,t){let n=e instanceof W?e:new W(e),r=t===void 0?n.len:n.pos+t,i=Nm();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=Wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Kp.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=Jp.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=Xp.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=Qp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=em.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=nm.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=im.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=om.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=cm.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=um.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=fm.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=gm.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=vm.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=bm.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=Sm.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=wm.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=Em.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=Om.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=Am.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=Mm.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pm.fromPartial(e??{})},fromPartial(e){let t=Nm();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Wp.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Kp.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Jp.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Xp.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Qp.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?em.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?nm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?im.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?om.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?cm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?um.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?fm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?gm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?vm.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?bm.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Sm.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?wm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Em.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?Om.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?Am.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?Mm.fromPartial(e.subagentError):void 0,t}};function Fm(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,Lm=e=>{let t=Im(e);if(t){if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}}},Rm=e=>{let t=Im(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:Lm(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:Lm(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:Lm(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:Lm(e.source),metadata:e.metadata}}}};function zm(e){let t=Pm.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=Vp[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,n.baseEvent.metadata!==void 0&&(n.metadata=n.baseEvent.metadata),delete n.baseEvent,n.type===V.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>Rm(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===V.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if(n.type===V.SUBAGENT_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interruptIds)?e.interruptIds:[];delete e.interruptIds,t===`suspended`?e.outcome={type:`suspended`,...r.length>0&&{interruptIds:r}}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===V.RUN_FINISHED||n.type===V.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===V.STATE_DELTA)for(let e of n.delta)e.op=fp[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),Jl.parse(n)}var Bm;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Bm||={});var Vm;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Vm||={});var q=Bm.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Hm=e=>{switch(typeof e){case`undefined`:return q.undefined;case`string`:return q.string;case`number`:return Number.isNaN(e)?q.nan:q.number;case`boolean`:return q.boolean;case`function`:return q.function;case`bigint`:return q.bigint;case`symbol`:return q.symbol;case`object`:return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?q.promise:typeof Map<`u`&&e instanceof Map?q.map:typeof Set<`u`&&e instanceof Set?q.set:typeof Date<`u`&&e instanceof Date?q.date:q.object;default:return q.unknown}},J=Bm.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Um=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Um.create=e=>new Um(e);var Wm=(e,t)=>{let n;switch(e.code){case J.invalid_type:n=e.received===q.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bm.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bm.joinValues(e.keys,`, `)}`;break;case J.invalid_union:n=`Invalid input`;break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bm.joinValues(e.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Bm.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:n=`Invalid function arguments`;break;case J.invalid_return_type:n=`Invalid function return type`;break;case J.invalid_date:n=`Invalid date`;break;case J.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bm.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case J.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case J.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case J.custom:n=`Invalid input`;break;case J.invalid_intersection_types:n=`Intersection results could not be merged`;break;case J.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Bm.assertNever(e)}return{message:n}},Gm=Wm;function Km(){return Gm}var qm=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Y(e,t){let n=Km(),r=qm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wm?void 0:Wm].filter(e=>!!e)});e.common.issues.push(r)}var Jm=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return X;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return X;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},X=Object.freeze({status:`aborted`}),Ym=e=>({status:`dirty`,value:e}),Xm=e=>({status:`valid`,value:e}),Zm=e=>e.status===`aborted`,Qm=e=>e.status===`dirty`,$m=e=>e.status===`valid`,eh=e=>typeof Promise<`u`&&e instanceof Promise,Z;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Z||={});var th=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},nh=(e,t)=>{if($m(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Um(e.common.issues);return this._error=t,this._error}}};function Q(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var rh=class{get description(){return this._def.description}_getType(e){return Hm(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Hm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Jm,ctx:{common:e.parent.common,data:e.data,parsedType:Hm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(eh(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hm(e)};return nh(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hm(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return $m(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>$m(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hm(e)},r=this._parse({data:e,path:n.path,parent:n});return nh(n,await(eh(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:J.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new og({schema:this,typeName:$.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return sg.create(this,this._def)}nullable(){return cg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vh.create(this)}promise(){return ag.create(this,this._def)}or(e){return Wh.create([this,e],this._def)}and(e){return Jh.create(this,e,this._def)}transform(e){return new og({...Q(this._def),schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new lg({...Q(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new fg({typeName:$.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new ug({...Q(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pg.create(this,e)}readonly(){return mg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ih=/^c[^\s-]{8,}$/i,ah=/^[0-9a-z]+$/,oh=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sh=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ch=/^[a-z0-9_-]{21}$/i,lh=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fh=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ph,mh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_h=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vh=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yh=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bh=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,xh=RegExp(`^${bh}$`);function Sh(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ch(e){return RegExp(`^${Sh(e)}$`)}function wh(e){let t=`${bh}T${Sh(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Th(e,t){return!((t!==`v4`&&t||!mh.test(e))&&(t!==`v6`&&t||!gh.test(e)))}function Eh(e,t){if(!lh.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Dh(e,t){return!((t!==`v4`&&t||!hh.test(e))&&(t!==`v6`&&t||!_h.test(e)))}var Oh=class e extends rh{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.string,received:t.parsedType}),X}let t=new Jm,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),Y(n,{code:J.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:J.invalid_string,...Z.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Z.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Z.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Z.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Z.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Z.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Z.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Z.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Z.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Z.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Z.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Z.errToObj(t)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Oh({checks:[],typeName:$.ZodString,coerce:e?.coerce??!1,...Q(e)});function kh(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ah=class e extends rh{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.number,received:t.parsedType}),X}let t,n=new Jm;for(let r of this._def.checks)r.kind===`int`?Bm.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Y(t,{code:J.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Y(t,{code:J.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?kh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Y(t,{code:J.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Y(t,{code:J.not_finite,message:r.message}),n.dirty()):Bm.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Z.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Z.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Z.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Z.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Z.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Z.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Z.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Z.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Z.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Z.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&Bm.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew Ah({checks:[],typeName:$.ZodNumber,coerce:e?.coerce||!1,...Q(e)});var jh=class e extends rh{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let t,n=new Jm;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Y(t,{code:J.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Y(t,{code:J.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Bm.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.bigint,received:t.parsedType}),X}gte(e,t){return this.setLimit(`min`,e,!0,Z.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Z.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Z.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Z.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Z.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Z.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew jh({checks:[],typeName:$.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});var Mh=class extends rh{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.boolean,received:t.parsedType}),X}return Xm(e.data)}};Mh.create=e=>new Mh({typeName:$.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});var Nh=class e extends rh{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.date,received:t.parsedType}),X}if(Number.isNaN(e.data.getTime()))return Y(this._getOrReturnCtx(e),{code:J.invalid_date}),X;let t=new Jm,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),Y(n,{code:J.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Bm.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Z.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Z.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Nh({checks:[],coerce:e?.coerce||!1,typeName:$.ZodDate,...Q(e)});var Ph=class extends rh{_parse(e){if(this._getType(e)!==q.symbol){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.symbol,received:t.parsedType}),X}return Xm(e.data)}};Ph.create=e=>new Ph({typeName:$.ZodSymbol,...Q(e)});var Fh=class extends rh{_parse(e){if(this._getType(e)!==q.undefined){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.undefined,received:t.parsedType}),X}return Xm(e.data)}};Fh.create=e=>new Fh({typeName:$.ZodUndefined,...Q(e)});var Ih=class extends rh{_parse(e){if(this._getType(e)!==q.null){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.null,received:t.parsedType}),X}return Xm(e.data)}};Ih.create=e=>new Ih({typeName:$.ZodNull,...Q(e)});var Lh=class extends rh{constructor(){super(...arguments),this._any=!0}_parse(e){return Xm(e.data)}};Lh.create=e=>new Lh({typeName:$.ZodAny,...Q(e)});var Rh=class extends rh{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Xm(e.data)}};Rh.create=e=>new Rh({typeName:$.ZodUnknown,...Q(e)});var zh=class extends rh{_parse(e){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.never,received:t.parsedType}),X}};zh.create=e=>new zh({typeName:$.ZodNever,...Q(e)});var Bh=class extends rh{_parse(e){if(this._getType(e)!==q.undefined){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.void,received:t.parsedType}),X}return Xm(e.data)}};Bh.create=e=>new Bh({typeName:$.ZodVoid,...Q(e)});var Vh=class e extends rh{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==q.array)return Y(t,{code:J.invalid_type,expected:q.array,received:t.parsedType}),X;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(Y(t,{code:J.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new th(t,e,t.path,n)))).then(e=>Jm.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new th(t,e,t.path,n)));return Jm.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Z.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Z.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Z.toString(n)}})}nonempty(e){return this.min(1,e)}};Vh.create=(e,t)=>new Vh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...Q(t)});function Hh(e){if(e instanceof Uh){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=sg.create(Hh(r))}return new Uh({...e._def,shape:()=>t})}return e instanceof Vh?new Vh({...e._def,type:Hh(e.element)}):e instanceof sg?sg.create(Hh(e.unwrap())):e instanceof cg?cg.create(Hh(e.unwrap())):e instanceof Yh?Yh.create(e.items.map(e=>Hh(e))):e}var Uh=class e extends rh{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Bm.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==q.object){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.object,received:t.parsedType}),X}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof zh&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new th(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof zh){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Y(n,{code:J.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new th(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Jm.mergeObjectSync(t,e)):Jm.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Z.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Z.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Bm.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Bm.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Hh(this)}partial(t){let n={};for(let e of Bm.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Bm.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof sg;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return ng(Bm.objectKeys(this.shape))}};Uh.create=(e,t)=>new Uh({shape:()=>e,unknownKeys:`strip`,catchall:zh.create(),typeName:$.ZodObject,...Q(t)}),Uh.strictCreate=(e,t)=>new Uh({shape:()=>e,unknownKeys:`strict`,catchall:zh.create(),typeName:$.ZodObject,...Q(t)}),Uh.lazycreate=(e,t)=>new Uh({shape:e,unknownKeys:`strip`,catchall:zh.create(),typeName:$.ZodObject,...Q(t)});var Wh=class extends rh{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Um(e.ctx.common.issues));return Y(t,{code:J.invalid_union,unionErrors:n}),X}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Um(e));return Y(t,{code:J.invalid_union,unionErrors:i}),X}}get options(){return this._def.options}};Wh.create=(e,t)=>new Wh({options:e,typeName:$.ZodUnion,...Q(t)});var Gh=e=>e instanceof eg?Gh(e.schema):e instanceof og?Gh(e.innerType()):e instanceof tg?[e.value]:e instanceof rg?e.options:e instanceof ig?Bm.objectValues(e.enum):e instanceof lg?Gh(e._def.innerType):e instanceof Fh?[void 0]:e instanceof Ih?[null]:e instanceof sg?[void 0,...Gh(e.unwrap())]:e instanceof cg?[null,...Gh(e.unwrap())]:e instanceof fg||e instanceof mg?Gh(e.unwrap()):e instanceof ug?Gh(e._def.innerType):[],Kh=class e extends rh{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==q.object)return Y(t,{code:J.invalid_type,expected:q.object,received:t.parsedType}),X;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Y(t,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Gh(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Q(r)})}};function qh(e,t){let n=Hm(e),r=Hm(t);if(e===t)return{valid:!0,data:e};if(n===q.object&&r===q.object){let n=Bm.objectKeys(t),r=Bm.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=qh(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===q.array&&r===q.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(Zm(e)||Zm(r))return X;let i=qh(e.value,r.value);return i.valid?((Qm(e)||Qm(r))&&t.dirty(),{status:t.value,value:i.data}):(Y(n,{code:J.invalid_intersection_types}),X)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Jh.create=(e,t,n)=>new Jh({left:e,right:t,typeName:$.ZodIntersection,...Q(n)});var Yh=class e extends rh{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return Y(n,{code:J.invalid_type,expected:q.array,received:n.parsedType}),X;if(n.data.lengththis._def.items.length&&(Y(n,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new th(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Jm.mergeArray(t,e)):Jm.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Yh.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Yh({items:e,typeName:$.ZodTuple,rest:null,...Q(t)})};var Xh=class e extends rh{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return Y(n,{code:J.invalid_type,expected:q.object,received:n.parsedType}),X;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new th(n,e,n.path,e)),value:a._parse(new th(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Jm.mergeObjectAsync(t,r):Jm.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof rh?new e({keyType:t,valueType:n,typeName:$.ZodRecord,...Q(r)}):new e({keyType:Oh.create(),valueType:t,typeName:$.ZodRecord,...Q(n)})}},Zh=class extends rh{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.map)return Y(n,{code:J.invalid_type,expected:q.map,received:n.parsedType}),X;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new th(n,e,n.path,[a,`key`])),value:i._parse(new th(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return X;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return X;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Zh.create=(e,t,n)=>new Zh({valueType:t,keyType:e,typeName:$.ZodMap,...Q(n)});var Qh=class e extends rh{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return Y(n,{code:J.invalid_type,expected:q.set,received:n.parsedType}),X;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(Y(n,{code:J.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return X;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new th(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Z.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Z.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Qh.create=(e,t)=>new Qh({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet,...Q(t)});var $h=class e extends rh{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==q.function)return Y(t,{code:J.invalid_type,expected:q.function,received:t.parsedType}),X;function n(e,n){return qm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Km(),Wm].filter(e=>!!e),issueData:{code:J.invalid_arguments,argumentsError:n}})}function r(e,n){return qm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Km(),Wm].filter(e=>!!e),issueData:{code:J.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ag){let e=this;return Xm(async function(...t){let o=new Um([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return Xm(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Um([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Um([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Yh.create(t).rest(Rh.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Yh.create([]).rest(Rh.create()),returns:n||Rh.create(),typeName:$.ZodFunction,...Q(r)})}},eg=class extends rh{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};eg.create=(e,t)=>new eg({getter:e,typeName:$.ZodLazy,...Q(t)});var tg=class extends rh{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Y(t,{received:t.data,code:J.invalid_literal,expected:this._def.value}),X}return{status:`valid`,value:e.data}}get value(){return this._def.value}};tg.create=(e,t)=>new tg({value:e,typeName:$.ZodLiteral,...Q(t)});function ng(e,t){return new rg({values:e,typeName:$.ZodEnum,...Q(t)})}var rg=class e extends rh{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Y(t,{expected:Bm.joinValues(n),received:t.parsedType,code:J.invalid_type}),X}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Y(t,{received:t.data,code:J.invalid_enum_value,options:n}),X}return Xm(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};rg.create=ng;var ig=class extends rh{_parse(e){let t=Bm.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let e=Bm.objectValues(t);return Y(n,{expected:Bm.joinValues(e),received:n.parsedType,code:J.invalid_type}),X}if(this._cache||=new Set(Bm.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Bm.objectValues(t);return Y(n,{received:n.data,code:J.invalid_enum_value,options:e}),X}return Xm(e.data)}get enum(){return this._def.values}};ig.create=(e,t)=>new ig({values:e,typeName:$.ZodNativeEnum,...Q(t)});var ag=class extends rh{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==q.promise&&t.common.async===!1?(Y(t,{code:J.invalid_type,expected:q.promise,received:t.parsedType}),X):Xm((t.parsedType===q.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ag.create=(e,t)=>new ag({type:e,typeName:$.ZodPromise,...Q(t)});var og=class extends rh{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Y(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return X;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?X:r.status===`dirty`||t.value===`dirty`?Ym(r.value):r});{if(t.value===`aborted`)return X;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?X:r.status===`dirty`||t.value===`dirty`?Ym(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?X:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?X:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$m(e))return X;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>$m(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):X)}Bm.assertNever(r)}};og.create=(e,t,n)=>new og({schema:e,typeName:$.ZodEffects,effect:t,...Q(n)}),og.createWithPreprocess=(e,t,n)=>new og({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects,...Q(n)});var sg=class extends rh{_parse(e){return this._getType(e)===q.undefined?Xm(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sg.create=(e,t)=>new sg({innerType:e,typeName:$.ZodOptional,...Q(t)});var cg=class extends rh{_parse(e){return this._getType(e)===q.null?Xm(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cg.create=(e,t)=>new cg({innerType:e,typeName:$.ZodNullable,...Q(t)});var lg=class extends rh{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};lg.create=(e,t)=>new lg({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Q(t)});var ug=class extends rh{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return eh(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Um(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Um(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ug.create=(e,t)=>new ug({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Q(t)});var dg=class extends rh{_parse(e){if(this._getType(e)!==q.nan){let t=this._getOrReturnCtx(e);return Y(t,{code:J.invalid_type,expected:q.nan,received:t.parsedType}),X}return{status:`valid`,value:e.data}}};dg.create=e=>new dg({typeName:$.ZodNaN,...Q(e)});var fg=class extends rh{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},pg=class e extends rh{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?X:e.status===`dirty`?(t.dirty(),Ym(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?X:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:$.ZodPipeline})}},mg=class extends rh{_parse(e){let t=this._def.innerType._parse(e),n=e=>($m(e)&&(e.value=Object.freeze(e.value)),e);return eh(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};mg.create=(e,t)=>new mg({innerType:e,typeName:$.ZodReadonly,...Q(t)}),Uh.lazycreate;var $;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})($||={});var hg=Oh.create;Ah.create,dg.create,jh.create;var gg=Mh.create;Nh.create,Ph.create,Fh.create,Ih.create;var _g=Lh.create;Rh.create,zh.create,Bh.create,Vh.create;var vg=Uh.create;Uh.strictCreate,Wh.create;var yg=Kh.create;Jh.create,Yh.create,Xh.create,Zh.create,Qh.create,$h.create,eg.create;var bg=tg.create,xg=rg.create;ig.create,ag.create,og.create,sg.create,cg.create,og.createWithPreprocess,pg.create;var Sg=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Cg=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(Sg);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},wg=e=>e===`*`||e===`x`||e===`X`,Tg=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Eg=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],Dg=(e,t)=>{if(wg(e)||wg(t))return 0;let[n,r]=Eg(Tg(e),Tg(t));return n>r?1:n{for(let n=0;n{let n=Cg(e),r=Cg(t),i=n.pop(),a=r.pop(),o=Og(n,r);return o===0?i&&a?Og(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},Ag=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function jg(){return Vo()}function Mg(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&Mg(t);return e}var Ng=524288;function Pg(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function Fg(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!Pg(t,n,Ng),c=s?Ag(t):t,l=s?Ag(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(Mg(c),Mg(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=Ag(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=Ag(e.state),d=!0,n=!0),s&&n&&Pg(c,l,Ng)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?Ag(c):c}:{},...d?{state:Object.isFrozen(l)?Ag(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function Ig(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function Lg(e){if(e instanceof Rg)return e;if(e===!0)return new Rg(Ig(!0))}var Rg=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function zg(e){return e.enabled?new Rg(e):void 0}function Bg(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function Vg(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Oc(e.metadata,Ag(t.metadata)),!0)}var Hg=(e,t,n,r,i)=>{let a=Lg(i),o=Ag(n.messages),s=Ag(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=Ag(c);return c={},e.messages!==void 0||e.state!==void 0?ff(e):Md};return t.pipe(Sf(async t=>{let i=await Fg(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return u();switch(t.type){case V.TEXT_MESSAGE_START:{let i=await Fg(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),u();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=Vg(s,t);(!a||c)&&l({messages:o})}return u()}case V.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),u();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let d=await Fg(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,Vg(c,t),l({messages:o})),u()}case V.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let c=await Fg(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&Vg(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case V.TOOL_CALL_START:{let i=await Fg(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t,a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(Vg(a,t)||r)&&l({messages:o}),u()}let s=new Set(o.map(e=>e.id)),c=Bg(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let d={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(d),Vg(d,t),l({messages:o})}return u()}case V.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await Fg(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=kf(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,Vg(d,t),l({messages:o})),u()}case V.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),u();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u();let d=await Fg(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return l(d),d.stopPropagation!==!0&&Vg(c,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()}case V.TOOL_CALL_RESULT:{let i=await Fg(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u,subagentRunId:d}=t,f={id:i,toolCallId:a,role:u||`tool`,content:c,...d!=null&&{subagentRunId:d}};Vg(f,t);let p=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(p===-1)o.push(f);else{let e=p+1;for(;e{t.onNewMessage?.({message:f,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case V.STATE_SNAPSHOT:{let i=await Fg(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case V.STATE_DELTA:{let i=await Fg(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Au.applyPatch(s,e,!0,!1).newDocument,l({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return u()}case V.MESSAGES_SNAPSHOT:{let i=await Fg(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=n.some(e=>e.role===`activity`),a=n.some(e=>e.role===`reasoning`),s=e=>e.role===`activity`&&!i||e.role===`reasoning`&&!a;o=o.filter(e=>s(e)||r.has(e.id)).map(e=>s(e)?e:r.get(e.id));let c=new Set(o.map(e=>e.id));for(let e of n)c.has(e.id)||o.push(e);l({messages:o})}return u()}case V.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await Fg(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:Ag(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,u;a===-1?(o.push(t),c=t,u=t):d?(f&&(o[a]={...d,activityType:i.activityType,content:Ag(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),u=o[a]):f&&(o[a]=t,c=t,u=t),Vg(u,i),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case V.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await Fg(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{Vg(d,i)&&l({messages:o});let e=Ag(d.content??{}),t=Au.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:Ag(t),activityType:i.activityType},l({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return u()}case V.RAW:return l(await Fg(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.CUSTOM:return l(await Fg(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.RUN_STARTED:{let i=await Fg(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}l({messages:o})}}return u()}case V.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await Fg(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),u()}case V.RUN_ERROR:return l(await Fg(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.STEP_STARTED:return l(await Fg(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.STEP_FINISHED:return l(await Fg(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case V.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case V.THINKING_START:return u();case V.THINKING_END:return u();case V.THINKING_TEXT_MESSAGE_START:return u();case V.THINKING_TEXT_MESSAGE_CONTENT:return u();case V.THINKING_TEXT_MESSAGE_END:return u();case V.REASONING_START:return l(await Fg(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.REASONING_MESSAGE_START:{let i=await Fg(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e),i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=Vg(i,t);(!r||a)&&l({messages:o})}return u()}case V.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await Fg(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,Vg(c,t),l({messages:o})),u()}case V.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u();let c=await Fg(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&Vg(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case V.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case V.REASONING_END:return l(await Fg(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await Fg(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}case V.SUBAGENT_STARTED:return l(await Fg(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.SUBAGENT_FINISHED:return l(await Fg(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case V.SUBAGENT_ERROR:return l(await Fg(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u()}return t.type,u()}),vf(),r.length>0?Cf({}):e=>e)},Ug=e=>t=>{let n=Lg(e),r=new Set,i=new Set,a=new Set,o={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},s=!1,c=!1,l=!1,u=new Map,d=e=>{let t=u.get(e);return t||(t=new Map,u.set(e,t)),t},f=()=>{for(let e of u.values())if(e.size>0)return!0;return!1},p=new Map,m=new Set,h=!1,g=!1,_=!1,v=()=>{r.clear(),i.clear(),a.clear(),o.message.clear(),o.toolCall.clear(),o.activity.clear(),o.reasoning.clear(),u.clear(),p.clear(),m.clear(),h=!1,g=!1,s=!1,c=!1,_=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new B(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?o.reasoning:e.role===`activity`?o.activity:o.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!o.toolCall.has(n.id))&&o.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new B(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(_f(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),c&&t!==V.RUN_STARTED)return H(()=>new B(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(s&&t!==V.RUN_ERROR&&t!==V.RUN_STARTED)return H(()=>new B(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!l){if(l=!0,t!==V.RUN_STARTED&&t!==V.RUN_ERROR)return H(()=>new B(`First event must be 'RUN_STARTED'`))}else if(t===V.RUN_STARTED){if(_&&!s&&!c)return H(()=>new B(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(s||c)&&v()}if(e.subagentRunId===null)return H(()=>new B(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===V.SUBAGENT_STARTED||t===V.SUBAGENT_FINISHED||t===V.SUBAGENT_ERROR){let n=t===V.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===V.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return H(()=>new B(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return H(()=>new B(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return H(()=>new B(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return H(()=>new B(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===V.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return H(()=>new B(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case V.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return H(()=>new B(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=o.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return H(()=>r)}return r.add(n),i||o.message.set(n,{subagentRunId:e.subagentRunId}),ff(e)}case V.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return H(()=>new B(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?H(()=>i):ff(e)}case V.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return H(()=>new B(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?H(()=>i):(r.delete(n),ff(e))}case V.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return H(()=>new B(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,s;if(r!==void 0){let e=o.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return H(()=>new B(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));s=e}}let c=o.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return H(()=>e);if(a===void 0&&s&&s.subagentRunId!==c.subagentRunId)return H(()=>new B(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${s.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||o.toolCall.set(n,a===void 0?s??{subagentRunId:void 0}:{subagentRunId:a}),ff(e)}case V.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return H(()=>new B(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?H(()=>r):ff(e)}case V.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return H(()=>new B(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?H(()=>r):(i.delete(n),ff(e))}case V.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return d(n).has(t)?H(()=>new B(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(d(n).set(t,!0),ff(e))}case V.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!d(n).has(t)){let e,r=!1;for(let[i,a]of u)if(i!==n&&a.has(t)){e=i,r=!0;break}return H(r?()=>new B(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new B(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return d(n).delete(t),ff(e)}case V.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!o.activity.has(t)||e.replace!==!1)&&o.activity.set(t,{subagentRunId:e.subagentRunId}),ff(e)}case V.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&o.message.set(t,{subagentRunId:e.subagentRunId}),ff(e)}case V.REASONING_START:case V.REASONING_MESSAGE_START:{let n=e.messageId,r=o.reasoning.get(n);if(r){let i=b(t,e.subagentRunId,r,`reasoning message`,n);if(i)return H(()=>i)}return a.add(n),r||o.reasoning.set(n,{subagentRunId:e.subagentRunId}),ff(e)}case V.REASONING_MESSAGE_CONTENT:case V.REASONING_MESSAGE_END:case V.REASONING_END:{let n=e.messageId,r=b(t,e.subagentRunId,o.reasoning.get(n),`reasoning message`,n);return r?H(()=>r):(t===V.REASONING_END&&a.delete(n),ff(e))}case V.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?o.toolCall.get(n):r===`message`?o.message.get(n)??o.reasoning.get(n):o.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,s=b(t,e.subagentRunId,i,a,n);return s?H(()=>s):ff(e)}case V.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,o.activity.get(n),`activity`,n);return r?H(()=>r):ff(e)}case V.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return H(()=>new B(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return H(()=>new B(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return p.has(t)?H(()=>new B(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):m.has(t)?H(()=>new B(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!p.has(n)&&!m.has(n)?H(()=>new B(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(p.set(t,!0),ff(e))}case V.SUBAGENT_FINISHED:case V.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return H(()=>new B(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===V.SUBAGENT_ERROR&&typeof e.message!=`string`)return H(()=>new B(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return p.has(n)?(p.delete(n),m.add(n),ff(e)):H(()=>new B(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case V.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return H(()=>t)}return ff(e);case V.RUN_STARTED:_=!0;{let t=y((e.input??{}).messages,!1);if(t)return H(()=>t)}return ff(e);case V.RUN_FINISHED:if(f()){let e=[];for(let[t,n]of u)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return H(()=>new B(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return H(()=>new B(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return H(()=>new B(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(p.size>0){let e=Array.from(p.keys()).join(`, `);return H(()=>new B(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return s=!0,ff(e);case V.RUN_ERROR:return c=!0,ff(e);case V.CUSTOM:return ff(e);case V.THINKING_TEXT_MESSAGE_START:return h?g?H(()=>new B(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(g=!0,ff(e)):H(()=>new B(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case V.THINKING_TEXT_MESSAGE_CONTENT:return g?ff(e):H(()=>new B(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case V.THINKING_TEXT_MESSAGE_END:return g?(g=!1,ff(e)):H(()=>new B(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case V.THINKING_START:return h?H(()=>new B(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(h=!0,ff(e));case V.THINKING_END:return h?(h=!1,ff(e)):H(()=>new B(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return ff(e)}}))},Wg=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),Gg=e=>yf(()=>df(e())).pipe(Tf(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return df(e.text()).pipe(_f(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,H(()=>i)}))}let t={type:Wg.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new yd(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:Wg.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):H(()=>Error(`Failed to getReader() from response`))})),Kg=(e,t)=>{let n=Lg(t),r=new Od,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==Wg.HEADERS&&e.type===Wg.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e)}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` +`),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` +`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},qg=e=>{let t=new Od,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==Wg.HEADERS&&e.type===Wg.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=Lg(t),r=new Od,i=new jd,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===Wg.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?qg(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):Kg(i,n).subscribe({next:e=>{try{let t=Jl.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:V.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},Yg=xg([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),Xg=xg([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);yg(`type`,[vg({type:bg(Yg.enum.TextMessageStart),messageId:hg(),parentMessageId:hg().optional(),role:hg().optional()}),vg({type:bg(Yg.enum.TextMessageContent),messageId:hg(),content:hg()}),vg({type:bg(Yg.enum.TextMessageEnd),messageId:hg()}),vg({type:bg(Yg.enum.ActionExecutionStart),actionExecutionId:hg(),actionName:hg(),parentMessageId:hg().optional()}),vg({type:bg(Yg.enum.ActionExecutionArgs),actionExecutionId:hg(),args:hg()}),vg({type:bg(Yg.enum.ActionExecutionEnd),actionExecutionId:hg()}),vg({type:bg(Yg.enum.ActionExecutionResult),actionName:hg(),actionExecutionId:hg(),result:hg()}),vg({type:bg(Yg.enum.AgentStateMessage),threadId:hg(),agentName:hg(),nodeName:hg(),runId:hg(),active:gg(),role:hg(),state:hg(),running:gg()}),vg({type:bg(Yg.enum.MetaEvent),name:Xg,value:_g()}),vg({type:bg(Yg.enum.RunError),message:hg(),code:hg().optional()})]),vg({id:hg(),role:hg(),content:hg(),parentMessageId:hg().optional()}),vg({id:hg(),name:hg(),arguments:_g(),parentMessageId:hg().optional()}),vg({id:hg(),result:_g(),actionExecutionId:hg(),actionName:hg()});var Zg=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` +`)},Qg=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(_f(r=>{switch(r.type){case V.TEXT_MESSAGE_START:{let e=r;return[{type:Yg.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case V.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:Yg.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case V.TEXT_MESSAGE_END:{let e=r;return[{type:Yg.enum.TextMessageEnd,messageId:e.messageId}]}case V.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:Yg.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case V.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(kf(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:Yg.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case V.TOOL_CALL_END:{let e=r;return[{type:Yg.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case V.TOOL_CALL_RESULT:{let e=r;return[{type:Yg.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case V.RAW:return[];case V.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:Yg.enum.MetaEvent,name:e.name,value:e.value}]}case V.STATE_SNAPSHOT:return f(r.snapshot),[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case V.STATE_DELTA:{let c=r,l=Au.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case V.MESSAGES_SNAPSHOT:return c=r.messages,[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case V.RUN_STARTED:return[];case V.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:$g(c)}:{}}),active:!1}];case V.RUN_ERROR:{let e=r;return[{type:Yg.enum.RunError,message:e.message,code:e.code}]}case V.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case V.STEP_FINISHED:return u=[],l=null,[{type:Yg.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function $g(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=Zg(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var e_=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,t_=e=>e===`tool`?`toolCallId`:`messageId`,n_=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},r_=e=>t=>{let n=Lg(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:V.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:V.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:V.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&e_(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${t_(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(_f(e=>{switch(e.type){case V.TEXT_MESSAGE_START:case V.TEXT_MESSAGE_CONTENT:case V.TEXT_MESSAGE_END:case V.TOOL_CALL_START:case V.TOOL_CALL_ARGS:case V.TOOL_CALL_END:case V.TOOL_CALL_RESULT:case V.STATE_SNAPSHOT:case V.STATE_DELTA:case V.CUSTOM:case V.STEP_STARTED:case V.STEP_FINISHED:case V.THINKING_START:case V.THINKING_END:case V.THINKING_TEXT_MESSAGE_START:case V.THINKING_TEXT_MESSAGE_CONTENT:case V.THINKING_TEXT_MESSAGE_END:case V.REASONING_START:case V.REASONING_MESSAGE_START:case V.REASONING_MESSAGE_CONTENT:case V.REASONING_MESSAGE_END:case V.REASONING_END:return[...i(e.subagentRunId??void 0),e];case V.RUN_STARTED:case V.RUN_FINISHED:case V.RUN_ERROR:case V.MESSAGES_SNAPSHOT:return[...a(),e];case V.RAW:case V.ACTIVITY_SNAPSHOT:case V.ACTIVITY_DELTA:case V.REASONING_ENCRYPTED_VALUE:case V.SUBAGENT_STARTED:return[e];case V.SUBAGENT_FINISHED:case V.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case V.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=n_({type:V.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=n_({type:V.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:V.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case V.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=n_({type:V.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=n_({type:V.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:V.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case V.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=n_({type:V.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=n_({type:V.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:V.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),wf(()=>{a()}))};function i_(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var a_=class{runNext(e,t){return t.run(e).pipe(r_(!1))}runNextWithState(e,t){let n=Ag(e.messages||[]),r=Ag(e.state||{}),i=new jd;return Hg(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Sf(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:Ag(n),state:Ag(r)})))}},o_=class extends a_{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function s_(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var c_=class extends a_{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(s_)};return this.runNext(i,t)}},l_=`THINKING_START`,u_=`THINKING_END`,d_=`THINKING_TEXT_MESSAGE_START`,f_=`THINKING_TEXT_MESSAGE_CONTENT`,p_=`THINKING_TEXT_MESSAGE_END`,m_=class extends a_{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(hf(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case l_:{this.currentReasoningId=jg();let{title:t,...n}=e;return this.warnAboutTransformation(l_,V.REASONING_START),{...n,type:V.REASONING_START,messageId:this.currentReasoningId}}case d_:return this.currentMessageId=jg(),this.warnAboutTransformation(d_,V.REASONING_MESSAGE_START),{...e,type:V.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case f_:{let{delta:t,...n}=e;return this.warnAboutTransformation(f_,V.REASONING_MESSAGE_CONTENT),{...n,type:V.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??jg(),delta:t}}case p_:{let t=this.currentMessageId??jg();return this.warnAboutTransformation(p_,V.REASONING_MESSAGE_END),{...e,type:V.REASONING_MESSAGE_END,messageId:t}}case u_:{let t=this.currentReasoningId??jg();return this.warnAboutTransformation(u_,V.REASONING_END),{...e,type:V.REASONING_END,messageId:t}}default:return e}}};function h_(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function g_(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function __(e){let t=h_(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function v_(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>g_(e)?__(e):e);return{...e,content:n}}var y_=class extends a_{run(e,t){let n={...e,messages:e.messages.map(v_)};return this.runNext(n,t)}},b_=`SUBAGENT_STARTED`,x_=`SUBAGENT_FINISHED`,S_=`SUBAGENT_ERROR`;function C_(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function w_(e){return e.map(e=>C_(e))}var T_=class extends a_{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>C_(e))};return this.runNext(n,t).pipe(Df(e=>{let t=e.type;(t===b_||t===x_||t===S_)&&this.warnDroppedLifecycleEvent(t)}),bf(e=>{let t=e.type;return t!==b_&&t!==x_&&t!==S_}),hf(e=>{let t=C_(e);if(t.type===V.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:w_(e.messages)}}if(t.type===V.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>C_(e))}}}if(t.type===V.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:w_(e.input.messages)}}}return t}))}},E_=`0.0.59`,D_=class{get maxVersion(){return E_}get debug(){return this._debug}set debug(e){this._debug=Ig(e),this._debugLogger=zg(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?zg(Ig(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??Vo(),this.messages=Ag(r??[]),this.state=Ag(i??{}),this._debug=Ig(a),this._debugLogger=zg(this._debug),kg(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new c_),kg(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new m_),kg(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new y_),kg(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new T_)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new o_(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Vo();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Od;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await mf(_d(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),r_(this.debugLogger),Ug(this.debugLogger),e=>e.pipe(Ef(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),xf(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),wf(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(ff(null)));let s=Ag(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Jc}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Vo();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Od;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await mf(_d(()=>yf(()=>this.connect(n)),r_(this.debugLogger),Ug(this.debugLogger),e=>e.pipe(Ef(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),xf(e=>(this.isRunning=!1,e instanceof Jc?Md:this.onError(n,e,a))),wf(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(ff(null)),{defaultValue:void 0});let s=Ag(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return Hg(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Df(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Ag(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||Vo(),tools:Ag(e?.tools??[]),context:Ag(e?.context??[]),forwardedProps:Ag(e?.forwardedProps??{}),state:Ag(this.state),messages:n,...e?.resume===void 0?{}:{resume:Ag(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new B(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(i_(e))throw new B(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await Fg(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return df(Fg(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(hf(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await Fg(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ag(this.messages),e.state=Ag(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=Ag(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=Ag(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=Ag(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Vo();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(r_(this.debugLogger),Ug(this.debugLogger),Qg(this.threadId,t.runId,this.agentId),e=>e.pipe(hf(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function O_(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var k_=class extends D_{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(O_(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=Ag(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return Jg(Gg(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=Ag(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},A_=class extends Ht{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Bt(t,n.data),hasPreviousPage:et(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},j_=class extends qe{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Re({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=M_(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=M_(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=M_(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=M_(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){at.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pe(t,e))}findAll(e={}){return this.getAll().filter(t=>Pe(e,t))}notify(e){at.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return at.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ge))))}};function M_(e){return e.options.scope?.id}var N_=class extends qe{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??gn(r,t),a=this.get(i);return a||(a=new Me({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){at.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>gt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>gt(e,t)):t}notify(e){at.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){at.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){at.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},P_=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new N_,this.#t=e.mutationCache||new j_,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=He.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=nt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Qe(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return at.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;at.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return at.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=at.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ge).catch(Ge)}invalidateQueries(e,t={}){return at.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=at.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ge)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ge)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(vt(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(vt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ge).catch(Ge)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ge).catch(Ge)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return nt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ct(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{mt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ct(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{mt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=gn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Qt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function F_(e,t){return Be(e,A_,t)}var I_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),L_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),R_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),z_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),B_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),V_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),H_=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),U_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:I_}));U_.displayName=`GithubLogoIcon`;var W_=U_,G_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:L_}));G_.displayName=`GlobeHemisphereWestIcon`;var K_=G_,q_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:R_}));q_.displayName=`MagnifyingGlassIcon`;var J_=q_,Y_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:z_}));Y_.displayName=`MoonIcon`;var X_=Y_,Z_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:B_}));Z_.displayName=`PencilSimpleIcon`;var Q_=Z_,$_=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:V_}));$_.displayName=`SignOutIcon`;var ev=$_,tv=T.forwardRef((e,t)=>T.createElement(v,{ref:t,...e,weights:H_}));tv.displayName=`SunIcon`;var nv=tv;async function rv(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await Te(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function iv({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=St(),[f,p]=(0,T.useState)(``),[m]=la(f.trim(),250),[h,g]=(0,T.useState)(null),[v,x]=(0,T.useState)(null),[S,te]=(0,T.useState)(``),[re,ie]=(0,T.useState)(``),[ae,oe]=(0,T.useState)(!1),ce=(0,T.useRef)(null);(0,T.useImperativeHandle)(u,()=>({focusSearch:()=>ce.current?.focus()}),[]),(0,T.useEffect)(()=>{r&&requestAnimationFrame(()=>ce.current?.focus())},[r]);let le=F_({queryKey:[...kt,m],queryFn:({pageParam:e})=>rv(m,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),ue=ft({queryKey:cn,queryFn:()=>mn(`/api/dashboards`),refetchInterval:3e4}),de=(0,T.useMemo)(()=>le.data?.pages.flatMap(e=>e.threads)??[],[le.data]),C=(0,T.useMemo)(()=>uv(de),[de]),fe=Gt(`overview`,It({window:`1h`,namespace:``}),!!m&&!!l),me=(0,T.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(fe.data?.data.services??[]).map(e=>e.service).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[fe.data,m]),he=(0,T.useMemo)(()=>{let e=ue.data?.dashboards??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[ue.data,m]);function ge(e){ie(``),te(e.title),g(e)}async function w(){if(h&&S.trim()){oe(!0),ie(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(h.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:S.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:kt}),g(null)}catch(e){ie(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{oe(!1)}}}async function ve(){if(v){oe(!0),ie(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(v.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.threadId;x(null),await d.invalidateQueries({queryKey:kt}),o(t)}catch(e){ie(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{oe(!1)}}}return(0,E.jsxs)(pe,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,E.jsx)(_e,{leftSection:(0,E.jsx)(Ie,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,E.jsx)(xn,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,E.jsxs)(pe,{gap:`lg`,pb:`sm`,children:[e&&(0,E.jsxs)(pe,{gap:4,children:[(0,E.jsx)(av,{children:`Chats`}),le.isLoading&&(0,E.jsx)(se,{py:`md`,children:(0,E.jsx)(_,{size:`xs`})}),le.isError&&(0,E.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!le.isLoading&&!le.isError&&de.length===0&&(0,E.jsx)(b,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),C.map(e=>(0,E.jsxs)(pe,{gap:2,children:[C.length>1&&(0,E.jsx)(b,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,E.jsx)(ov,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>ge(e),onDelete:()=>{ie(``),x(e)}},e.threadId))]},e.label)),le.hasNextPage&&(0,E.jsx)(_e,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:le.isFetchingNextPage,onClick:()=>void le.fetchNextPage(),children:`See all`})]}),me.length>0&&l&&(0,E.jsxs)(pe,{gap:4,children:[(0,E.jsx)(av,{children:`Services`}),me.map(e=>(0,E.jsx)(y,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,E.jsx)(b,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,E.jsxs)(pe,{gap:4,children:[(0,E.jsx)(av,{children:`Dashboards`}),ue.isLoading&&(0,E.jsx)(se,{py:`md`,children:(0,E.jsx)(_,{size:`xs`})}),ue.isError&&(0,E.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!ue.isLoading&&!ue.isError&&m&&he.length===0&&(0,E.jsx)(b,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),he.map(e=>{let t=e.id===n;return(0,E.jsx)(y,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,E.jsxs)(ne,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(b,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,E.jsx)(st,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,E.jsx)(_e,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,E.jsx)(ut,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,E.jsx)(Oe,{ref:ce,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,E.jsx)(J_,{size:15}),rightSection:(0,E.jsx)(Fo,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,E.jsx)(bt,{opened:h!==null,onClose:()=>!ae&&g(null),title:`Rename chat`,centered:!0,children:(0,E.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),w()},children:(0,E.jsxs)(pe,{children:[(0,E.jsx)(Oe,{label:`Name`,value:S,onChange:e=>te(e.currentTarget.value),maxLength:120,autoFocus:!0}),re&&(0,E.jsx)(ee,{color:`bad`,children:re}),(0,E.jsxs)(ne,{justify:`flex-end`,children:[(0,E.jsx)(_e,{variant:`default`,onClick:()=>g(null),disabled:ae,children:`Cancel`}),(0,E.jsx)(_e,{type:`submit`,loading:ae,disabled:!S.trim(),children:`Save`})]})]})})}),(0,E.jsx)(bt,{opened:v!==null,onClose:()=>!ae&&x(null),title:`Delete chat?`,centered:!0,children:(0,E.jsxs)(pe,{children:[(0,E.jsxs)(b,{size:`sm`,children:[`This permanently removes `,(0,E.jsx)(b,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),re&&(0,E.jsx)(ee,{color:`bad`,children:re}),(0,E.jsxs)(ne,{justify:`flex-end`,children:[(0,E.jsx)(_e,{variant:`default`,onClick:()=>x(null),disabled:ae,children:`Cancel`}),(0,E.jsx)(_e,{color:`bad`,loading:ae,onClick:()=>void ve(),children:`Delete`})]})]})})]})}function av({children:e}){return(0,E.jsx)(b,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function ov({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,E.jsx)(ye,{"data-active":t||void 0,className:`rail-row`,children:(0,E.jsxs)(ne,{gap:2,wrap:`nowrap`,children:[(0,E.jsx)(y,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,E.jsxs)(pe,{gap:0,children:[(0,E.jsx)(b,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,E.jsx)(b,{c:`dimmed`,size:`xs`,children:dv(e.updatedAt)})]})}),(0,E.jsxs)(wt,{position:`bottom-end`,withinPortal:!0,children:[(0,E.jsx)(wt.Target,{children:(0,E.jsx)(Dn,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,E.jsx)(un,{size:18,weight:`bold`})})}),(0,E.jsxs)(wt.Dropdown,{children:[(0,E.jsx)(wt.Item,{leftSection:(0,E.jsx)(Q_,{size:15}),onClick:r,children:`Rename`}),(0,E.jsx)(wt.Item,{color:`bad`,leftSection:(0,E.jsx)(fn,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function sv(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function cv(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var lv=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function uv(e){let t=cv(new Date),n=new Map;for(let r of e){let e=Math.floor((t-cv(sv(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return lv.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function dv(e){let t=sv(e),n=cv(new Date);return Math.floor((n-cv(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function fv({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=bn(),s=Ee(),c=ca({select:e=>e.location.pathname}),{dashboardId:l}=At({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=ua(!1),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(``),_=(0,T.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,T.useRef)(v);y.current=v,(0,T.useEffect)(()=>{f.close()},[c]),(0,T.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Sn),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,E.jsxs)(Qa,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,E.jsx)(Qa.Header,{children:(0,E.jsxs)(ne,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,E.jsxs)(ne,{gap:`sm`,wrap:`nowrap`,children:[(0,E.jsx)(po,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,E.jsx)(he,{size:`small`})]}),(0,E.jsxs)(ne,{gap:`xs`,wrap:`nowrap`,children:[(0,E.jsx)(pv,{}),(0,E.jsx)(mv,{onError:g})]})]})}),(0,E.jsx)(Qa.Navbar,{p:`sm`,children:(0,E.jsx)(iv,{ref:_,...b})}),(0,E.jsx)(Mo,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,E.jsx)(he,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,E.jsx)(iv,{...b,autoFocusSearch:d&&p})}),(0,E.jsxs)(Qa.Main,{children:[h&&(0,E.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function pv(){let{setColorScheme:e}=kn(),t=An(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,E.jsx)(Tn,{label:`Switch to ${n} theme`,children:(0,E.jsx)(Dn,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,E.jsx)(nv,{size:17,weight:`bold`}):(0,E.jsx)(X_,{size:17,weight:`bold`})})})}function mv({onError:e}){let t=ke(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,E.jsxs)(wt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,E.jsx)(wt.Target,{children:(0,E.jsx)(Dn,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,E.jsx)(lo,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,E.jsxs)(wt.Dropdown,{children:[(0,E.jsx)(wt.Label,{children:t.email||`Signed in`}),(0,E.jsx)(wt.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,E.jsx)(W_,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,E.jsx)(wt.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,E.jsx)(K_,{size:15}),children:`LabStack`}),(0,E.jsx)(wt.Divider,{}),(0,E.jsx)(wt.Item,{leftSection:(0,E.jsx)(ev,{size:15}),onClick:()=>void xe().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function hv(){let{agent_available:e}=De(),t=Ee(),n=St(),{threadId:r}=At({strict:!1}),[i,a]=(0,T.useState)(Tt),o=(0,T.useRef)(new Set),s=r??i,[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)({}),[f,p]=(0,T.useState)(``),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(``),[b,x]=(0,T.useState)(``),[ee,S]=(0,T.useState)(``),[te,ne]=(0,T.useState)(0),re=(0,T.useRef)(``),ie=(0,T.useRef)(null),ae=(0,T.useRef)(null),oe=(0,T.useRef)(0),se=(0,T.useMemo)(()=>new k_({url:`/api/agent`,threadId:s,fetch:(e,t)=>Te(e,t)}),[s]),ce=!e||f===s;function le(){oe.current=0,y(``)}(0,T.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),le(),S(``),!e){p(s);return}!r||o.current.has(s)?(se.setMessages([]),p(s)):Te(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}se.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(re.current=``,S(`This chat could not be restored. Start a new chat or try again.`))});let i=se.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),S(``)},onToolCallStartEvent:({event:e})=>{oe.current+=1,y(En(e.toolCallName))},onToolCallEndEvent:()=>{oe.current=Math.max(0,oe.current-1),oe.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),le(),o.current.delete(s),n.invalidateQueries({queryKey:kt})},onRunFailed:e=>{console.error(`Agent run failed`,e),S(`Fanout could not complete this analysis.`),_(!1),le(),o.current.delete(s),n.invalidateQueries({queryKey:kt})}});return()=>{t=!1,i.unsubscribe(),se.abortRun()}},[se,e,n,te,s]),(0,T.useEffect)(()=>{ie.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,T.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>ae.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>ae.current?.focus()))),e.key===`Escape`&&n===ae.current&&(x(``),ae.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ue(){_(!0),S(``);try{await se.runAgent()}catch(e){console.error(`Agent run failed`,e),S(`Fanout could not complete this analysis.`),_(!1),le(),o.current.delete(s)}}async function de(n){let i=n.trim();if(!e||!i||g||!ce||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Tt(),role:`user`,content:i};se.addMessage(a),l([...se.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await ue()}(0,T.useEffect)(()=>{let e=re.current;ce&&r&&e&&(re.current=``,de(e))},[ce,r,s]);function C(e){e.preventDefault(),de(b)}function fe(){se.abortRun(),_(!1),le(),o.current.delete(s)}function pe(){!g&&se.messages.some(e=>e.role===`user`)&&ue()}function me(n){if(!e)return;let r=Tt();o.current.add(r),re.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function he(){se.abortRun(),re.current=``,a(Tt()),t({to:`/chat`})}function ge(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function _e(){ne(e=>e+1)}return(0,E.jsx)(wn.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ce,running:g,activity:v,input:b,setInput:x,error:ee,bottomRef:ie,inputRef:ae,send:de,submit:C,stop:fe,retry:pe,reloadThread:_e,openChat:me,newThread:he,selectThread:ge},children:(0,E.jsx)(fv,{children:(0,E.jsx)(Qi,{})})})}function gv(){let e=(0,T.useMemo)(()=>new P_,[]);return(0,E.jsx)(Ye,{client:e,children:(0,E.jsx)(Ae,{children:(0,E.jsx)(hv,{})})})}var _v=hn({component:gv,notFoundComponent:()=>(0,E.jsx)(Se,{to:`/`,replace:!0})}),vv=ln(`/`)({component:Et(()=>On(()=>import(`./routes-4U_e7tED.js`),__vite__mapDeps([0,1,2])),`component`)}),yv=ln(`/chat/`)({component:Et(()=>On(()=>import(`./chat.index-CtOVI6Uj.js`),__vite__mapDeps([3,4,1,5,6])),`component`)}),bv=ln(`/chat/$threadId`)({component:Et(()=>On(()=>import(`./chat._threadId-CtOVI6Uj.js`),__vite__mapDeps([7,4,1,5,6])),`component`)}),xv=ln(`/dashboards/`)({component:Et(()=>On(()=>import(`./dashboards.index-CtpFH5E-.js`),__vite__mapDeps([8,1,2,5,9,10,11,6])),`component`),validateSearch:sn}),Sv=ln(`/dashboards/$dashboardId`)({component:Et(()=>On(()=>import(`./dashboards._dashboardId-BPYRZzG3.js`),__vite__mapDeps([12,1,2,5,9,10,11,6])),`component`),validateSearch:sn}),Cv=vv.update({id:`/`,path:`/`,getParentRoute:()=>_v}),wv=yv.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>_v}),Tv=bv.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>_v}),Ev=xv.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>_v}),Dv={IndexRoute:Cv,ChatThreadIdRoute:Tv,DashboardsDashboardIdRoute:Sv.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>_v}),ChatIndexRoute:wv,DashboardsIndexRoute:Ev},Ov=ia({routeTree:_v._addFileChildren(Dv)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),kv={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:an,brand:en,ok:nn,warn:Wt,bad:qt,info:Yt},defaultRadius:`md`,fontFamily:Dt.body,fontFamilyMonospace:Dt.display,headings:{fontFamily:Dt.body,fontWeight:`600`},cursorType:`pointer`},Av=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":Rt.light.muted},dark:{}}),jv=Oa(kv);(0,Ec.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(T.StrictMode,{children:(0,E.jsx)(Da,{theme:jv,defaultColorScheme:`auto`,cssVariablesResolver:Av,children:(0,E.jsx)(sa,{router:Ov})})}));export{xv as n,Sv as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-DSdcpqnK.js b/internal/ui/dist/assets/index-DSdcpqnK.js deleted file mode 100644 index 21c145fee..000000000 --- a/internal/ui/dist/assets/index-DSdcpqnK.js +++ /dev/null @@ -1,57 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-C2A3xwKL.js","assets/brand-CCB4_HD8.js","assets/chat.index-u0MOvyAV.js","assets/chat-XnnwteRX.js","assets/copy-DGK5qe2D.js","assets/chat._threadId-u0MOvyAV.js","assets/dashboards.index-D-Z1PEHh.js","assets/dashboard-qOWEIeHc.js","assets/dashboards._dashboardId-DCQxYJDK.js"])))=>i.map(i=>d[i]); -import{$ as e,A as t,B as n,C as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,S as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,at as T,b as E,c as D,d as O,dt as k,et as A,f as ee,ft as j,g as M,gt as N,h as te,ht as ne,i as re,it as ie,j as P,k as ae,l as oe,lt as se,m as ce,mt as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as F,st as ve,t as ye,tt as be,u as xe,ut as I,v as Se,vt as Ce,x as we,xt as Te,y as Ee,z as De}from"./brand-CCB4_HD8.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Oe=N((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ke=N(((e,t)=>{t.exports=Oe()})),Ae=N((e=>{var t=ke(),n=ne(),r=le();function i(e){var t=`https://react.dev/errors/`+e;if(1ie||(e.current=re[ie],re[ie]=null,ie--)}function oe(e,t){ie++,re[ie]=e.current,e.current=t}var se=P(null),ce=P(null),ue=P(null),de=P(null);function fe(e,t){switch(oe(ue,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function pe(){ae(se),ae(ce),ae(ue)}function me(e){e.memoizedState!==null&&oe(de,e);var t=se.current,n=rf(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function he(e){ce.current===e&&(ae(se),ae(ce)),de.current===e&&(ae(de),pp._currentValue=te)}var ge,_e;function F(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?F(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return F(e.type);case 16:return F(`Lazy`);case 13:return e.child!==t&&t!==null?F(`Suspense Fallback`):F(`Suspense`);case 19:return F(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return F(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var I=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,L=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ke(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,R=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),R&&wr(R,r)||(R=r,r=Bd(Mr,`onSelect`),0>=o,i-=o,Ei=1<<32-Re(t)+i|n<m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Fi&&Oi(i,m),l;if(d===null){for(;mh?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Fi&&Oi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Fi&&Oi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Fi&&Oi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ka(o),x(e,r,o,c)}if(j(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Fa(o),c);if(o.$$typeof===b)return x(e,r,ra(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=x(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Yl&p)===p:(r&p)===p){p!==0&&p===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Va=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ru|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=M.T,s={};M.T=s,zs(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,_a(c,r),Tu(e)):Rs(e,t,r,Tu(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},Tu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=As(e).queue;Ds(e,a,t,te,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},Tu())}function Ms(){return na(pp)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Du(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=Tu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ni(e,t,n,r),n!==null&&(Du(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,Tu())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ti(e,t,i,0),ql===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Du(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:wd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Du(t,e,2)}function Bs(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Us={readContext:na,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:na,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Is.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,a=Po();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ql===null)throw Error(i(349));Yl&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=ql.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Yd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Kd(e.nodeValue,n)),e||zi(t,!0)}else e=tf(e).createTextNode(r),e[st]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return pe(),e===null&&Id(t.stateNode.containerInfo),Uc(t),null;case 10:return Xi(t.type),Uc(t),null;case 19:if(ae(fo),r=t.memoizedState,r===null)return Uc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Hc(r,!1);else{if(nu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return oe(fo,fo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>pu&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Uc(t),null}else 2*Ee()-r.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=fo.current,oe(fo,a?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),Uc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Gc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(fo),null;case 4:return pe(),null;case 10:return Xi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&ae(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function Kc(e,t){switch(ji(t),t.tag){case 3:Xi(ca),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:ae(fo);break;case 10:Xi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&ae(ya);break;case 24:Xi(ca)}}function qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){rd(t,t.return,e)}}function Jc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){rd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){rd(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){rd(e,e.return,t)}}}function Xc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){rd(e,t,n)}}function Zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){rd(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){rd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){rd(e,t,n)}else n.current=null}}function $c(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){rd(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Xd(r,e.type,n,t),r[ct]=t}catch(t){rd(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pf(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&pf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&pf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&pf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Yd(t,r,n),t[st]=e,t[ct]=n}catch(t){rd(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,ul=null;function dl(e,t){if(e=e.containerInfo,$d=Sp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(ef={focusedElem:e,selectionRange:n},Sp=!1,ul=t;ul!==null;)if(t=ul,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ul=e;else for(;ul!==null;){switch(t=ul,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Yd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=np(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,M.T=null,n=xu,xu=null;var o=_u,s=yu;if(gu=0,vu=_u=null,yu=0,Kl&6)throw Error(i(331));var c=Kl;if(Kl|=4,Vl(o.current),Nl(o,o.current,s,n),Kl=c,_d(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{N.p=a,M.T=r,$u(e,t)}}function nd(e,t,n){t=vi(n,t),t=rc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Ze(e,2),gd(e))}function rd(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hu===null||!hu.has(r))){e=vi(n,e),n=ic(2),r=Ga(t,n,2),r!==null&&(ac(n,r,t,e),Ze(r,2),gd(r));break}}t=t.return}}function id(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(eu=!0,i.add(n),e=ad.bind(null,e,t,n),t.then(e,e))}function ad(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(Yl&n)===n&&(nu===4||nu===3&&(Yl&62914560)===Yl&&300>Ee()-du?!(Kl&2)&&Pu(e,0):au|=n,su===Yl&&(su=0)),gd(e)}function od(e,t){t===0&&(t=Ye()),e=ri(e,t),e!==null&&(Ze(e,t),gd(e))}function sd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),od(e,n)}function cd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),od(e,n)}function ld(e,t){return Se(e,t)}var ud=null,dd=null,fd=!1,pd=!1,md=!1,hd=0;function gd(e){e!==dd&&e.next===null&&(dd===null?ud=dd=e:dd=dd.next=e),pd=!0,fd||(fd=!0,Cd())}function _d(e,t){if(!md&&pd){md=!0;do for(var n=!1,r=ud;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Sd(r,a))}else a=Yl,a=Ke(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,Sd(r,a))}r=r.next}while(n);md=!1}}function vd(){yd()}function yd(){pd=fd=!1;var e=0;hd!==0&&sf()&&(e=hd);for(var t=Ee(),n=null,r=ud;r!==null;){var i=r.next,a=bd(r,t);a===0?(r.next=null,n===null?ud=i:n.next=i,i===null&&(dd=n)):(n=r,(e!==0||a&3)&&(pd=!0)),r=i}gu!==0&&gu!==5||_d(e,!1),hd!==0&&(hd=0)}function bd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Zd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function If(e,t,n){var r=Ff;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Af.has(i)||(Af.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Yd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Lf(e){Mf.D(e),If(`dns-prefetch`,e,null)}function Rf(e,t){Mf.C(e,t),If(`preconnect`,e,t)}function zf(e,t,n){Mf.L(e,t,n);var r=Ff;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Gf(e);break;case`script`:a=Yf(e)}kf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),kf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Kf(a))||t===`script`&&r.querySelector(Xf(a))||(t=r.createElement(`link`),Yd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Bf(e,t){Mf.m(e,t);var n=Ff;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Yf(e)}if(!kf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),kf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xf(a)))return}r=n.createElement(`link`),Yd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Vf(e,t,n){Mf.S(e,t,n);var r=Ff;if(r&&e){var i=yt(r).hoistableStyles,a=Gf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Kf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=kf.get(a))&&$f(e,n);var c=o=r.createElement(`link`);bt(c),Yd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hf(e,t){Mf.X(e,t);var n=Ff;if(n&&e){var r=yt(n).hoistableScripts,i=Yf(e),a=r.get(i);a||(a=n.querySelector(Xf(i)),a||(e=f({src:e,async:!0},t),(t=kf.get(i))&&ep(e,t),a=n.createElement(`script`),bt(a),Yd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t){Mf.M(e,t);var n=Ff;if(n&&e){var r=yt(n).hoistableScripts,i=Yf(e),a=r.get(i);a||(a=n.querySelector(Xf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=kf.get(i))&&ep(e,t),a=n.createElement(`script`),bt(a),Yd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wf(e,t,n,r){var a=(a=ue.current)?jf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Gf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Kf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),kf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},kf.set(e,n),o||Jf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Yf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gf(e){return`href="`+zt(e)+`"`}function Kf(e){return`link[rel="stylesheet"][`+e+`]`}function qf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Jf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Yd(t,`link`,n),bt(t),e.head.appendChild(t))}function Yf(e){return`[src="`+zt(e)+`"]`}function Xf(e){return`script[async]`+e}function Zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Yd(r,`style`,a),Qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gf(n.href);var o=e.querySelector(Kf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=qf(n),(a=kf.get(a))&&$f(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Yd(o,`link`,r),t.state.loading|=4,Qf(o,n.precedence,e),t.instance=o;case`script`:return o=Yf(n.src),(a=e.querySelector(Xf(o)))?(t.instance=a,bt(a),a):(r=n,(a=kf.get(o))&&(r=f({},n),ep(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Yd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qf(r,n.precedence,e));return t.instance}function Qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function ip(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ap(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function op(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gf(r.href),a=t.querySelector(Kf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=qf(r),(i=kf.get(i))&&$f(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Yd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var sp=0;function cp(e,t){return e.stylesheets&&e.count===0&&dp(e,e.stylesheets),0sp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function lp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var up=null;function dp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,up=new Map,t.forEach(fp,e),up=null,lp.call(e))}function fp(e,t){if(!(t.state.loading&4)){var n=up.get(e);if(n)var r=n.get(null);else{n=new Map,up.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ae()})),L=Te(ne(),1),Me=L.use,Ne=L.useLayoutEffect;function Pe(e,t,n){L.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function Fe(e){let t=L.useRef(null);return L.useImperativeHandle(e,()=>t.current,[]),t}function Ie(e){return e[e.length-1]}function Le(e,t){return typeof e==`function`?e(t):e}var Re=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;function Be(e){for(let t in e)if(Re.call(e,t))return!0;return!1}var Ve=()=>Object.create(null),He=(e,t)=>Ue(e,t,Ve);function Ue(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=qe(e)&&qe(i);if(!a&&!(Ge(e)&&Ge(i)))return i;let o=a?e:We(e);if(!o)return i;let s=a?i:We(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!Je(e[o],t[o],n)))return!1;return i===a}return!1}function Ye(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var Xe=/[\x00-\x1f\x7f"<>`{}]/g;function Ze(e){return e.replace(Xe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Qe(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Ze(t)}var $e=[`http:`,`https:`,`mailto:`,`tel:`];function et(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function tt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Qe(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Qe(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function nt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function rt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var ot=4,st=5;function ct(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=ft(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=dt(r);e.kind=st,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=dt(r);e.kind=ot,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)lt(e,t,r,c,i,a,o,s)}function ut(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function dt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ft(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function pt(e,t){let n=dt(`/`),r=new Uint16Array(6),i=[];for(let t of e)lt(!1,r,t,1,n,0,i);for(let e of i)e.sort(ut);t.masksTree=n,t.flatCache=at(1e3)}function mt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=yt(e,t.masksTree);return t.flatCache.set(e,r),r}function ht(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=dt(`/`),lt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),yt(r,o,n)}function gt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=yt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=xt(a.route)),t.matchCache.set(r,a),a}function _t(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function vt(e,t=!1,n){let r=dt(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;lt(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&it(),o[e.id]=e,c!==0&&e.path){let t=_t(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(ut);return{processedTree:{segmentTree:r,singleCache:at(1e3),matchCache:at(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function yt(e,t,n=!1){let r=e.split(`/`),i=Ct(e,r,t,n);if(!i)return null;let[a]=bt(e,r,i);return{route:i.node.route,rawParams:a}}function bt(e,t,n){let r=St(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ot)>(e.node.kind===ot)||t.node.kind===ot==(e.node.kind===ot)&&t.node.depth>e.node.depth)))}function Ot(e){return kt(e.filter(e=>e!==void 0).join(`/`))}function kt(e){return e.replace(/\/{2,}/g,`/`)}function At(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function jt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Mt(e){return jt(At(e))}function Nt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Pt(e,t,n){return Nt(e,n)===Nt(t,n)}function Ft({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=kt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=kt(e)),o=e.split(`/`);o.length>1&&Ie(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Ie(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?kt(s):s)||`/`;return a&&r&&r.set(a,c),c}function It(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Lt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>zt(e,n)).join(`/`):zt(r,n):r}function Rt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;se.state.__TSR_key||e.href;function Yt(e){let t=e.getAttribute(qt);if(t)return`[${qt}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Xt=!1,Zt=`window`;function Qt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function $t(e){let t=new Set;for(let n of e){if(n===Zt)continue;let e=Qt(n);e&&t.add(e)}return t}function en(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Jt,a=new Set,o=e=>{let t=Kt[e]||={};for(let e of a)e===document?t[Zt]={scrollX,scrollY}:e.isConnected&&(t[Yt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Xt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Xt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Gt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Kt[d];if(e){let t=Kt[u];for(let n in e){if(n===Zt){if(s)continue}else{let e=Qt(n);if(!e||s&&o&&(l??=$t(o),l.has(e)))continue}t||=Kt[u]={},t[n]??=e[n]}}}Xt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=$t(o));let t=e&&i&&c,s=r.restoring?Kt[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Zt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Qt(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Xt=!1}}))}function tn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function nn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function rn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=nn(r):Array.isArray(t)?t.push(nn(r)):n[e]=[t,nn(r)]}return n}var an=/^(?:\s|["[{\d-]|fa|nu|tr)/,on=cn(JSON.parse),sn=ln(JSON.stringify,JSON.parse);function cn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=rn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ln(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!an.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=tn(e,r);return t?`?${t}`:``}}var un=`__root__`;function dn(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function fn(e){return e instanceof Response&&!!e.options}function pn(e){return{input:({url:t})=>{for(let n of e)t=hn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=gn(e[n],t);return t}}}function mn(e){let t=Mt(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ot([`/`,t,e.pathname]),e)}}function hn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function gn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function _n(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{rt(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var vn=`__TSR_index`,yn=`popstate`,bn=`beforeunload`;function xn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Tn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[vn];i=Sn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[vn];i=Sn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[vn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Sn(e,t){t||={};let n=En();return{...t,key:n,__TSR_key:n,[vn]:e}}function Cn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Tn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=En();t.history.replaceState({[vn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=Tn(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[vn]-l.state[vn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=xn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(bn,x,{capture:!0}),t.removeEventListener(yn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(bn,x,{capture:!0}),t.addEventListener(yn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function wn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Tn(e,t){let n=wn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=En();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[vn]:0,key:a,__TSR_key:a}}}function En(){return(Math.random()+1).toString(36).substring(7)}function Dn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function On(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function kn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function An(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var jn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=It(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Cn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=at(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=_n(this.latestLocation,e),en(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Mt(a);t&&t!==`/`&&e.push(mn({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:pn(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=vt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&pt(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:tt(e).path,external:!1,searchStr:o,search:He(t?.search,i),hash:tt(r.slice(1)).path,state:Ue(t?.state,a)}}let o=new URL(i,this.origin),s=hn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:tt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:He(t?.search,c),hash:tt(s.hash.slice(1)).path,state:Ue(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Ft({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=gt(jt(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=Tn(t.href,{});t={...t,to:hn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Ln(t.params,o),l=this.routesByPath[jt(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Be(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:tt(Rt({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Pn(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=Fn(f,t,u,e._includeValidateSearch),f=He(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?Le(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?Le(t.state,n.state):{};t.state&&(g=Ue(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=gn(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=nt(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=mt(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Ln(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=jt(this.latestLocation.href)===jt(n.href)&&Je(kn(n.state),kn(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(et(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Or(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(On(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Dn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&et(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Vn,this.preloadRoute=e=>kr(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=ht(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Je(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Je(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??sn,parseSearch:e.parseSearch??on,protocolAllowlist:e.protocolAllowlist??$e}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=xt(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:jt(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?In(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Pn(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Le(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function In(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return un}function Ln(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Le(e,n))}function Rn(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function zn(e,t){return e.options[t]?.preload?.()}function Bn(e,t){let n=zn(e,`component`),r=zn(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Vn(e,t,n){let r=()=>t===!1?void 0:t?zn(e,t):Bn(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Hn(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function Xn(e,t){return e.routesById[t.routeId]}function Zn(e,t,n){return fn(e)?[Kn,e]:Bt(e)?(e.routeId||=n,[Gn,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Wn,e]):[Un,e]}function Qn(e,t){let n=Zn(t,!0,e.id);if(n[0]!==Wn)return n;try{e.options.onError?.(n[1])}catch(t){n=Zn(t,!0,e.id)}return n}function $n(e,t,n,r,i){return i[0].signal.aborted?qn:hr(e,t,n,Qn(n,r),i)}async function er(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;ie.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return nr(e,r),[i,$n(e,t,u,a,n)]}if(c.aborted)return[i,qn];let p=r.paramsError??r.searchError;if(p!==void 0)return nr(e,r),[i,$n(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{ar(e,r,`beforeLoad`,n[0]);let a=await Yn(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,qn];let o=hr(e,t,u,Zn(a,!1,u.id),n);if(o[0]!==Un)return nr(e,r),[i,o];r.context={...r.context,...a}}catch(a){return nr(e,r),[i,$n(e,t,u,a,n)]}finally{r.status=h,ar(e,r,!1,n[0])}}i()}function tr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function nr(e,t){let n=t._flight;t._flight=void 0,tr(e,t,n)?.abort()}function rr(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=tr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function ir(e){for(let t of e){let e=t._flight;e&&e[2]++}}function ar(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function or(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function sr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return qn;if(!i)return[Un,void 0];let l=n._flight;ar(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(or(e,t,n,r,s,a,!!o[3]))).then(e=>Zn(e,!1,r.id),e=>Zn(e,!0,r.id)).then(t=>(t[0]!==Un&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Wn&&l[2]?Qn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],hr(e,t,r,await Yn(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return nr(e,n),qn}finally{ar(e,n,!1,s)}}function cr(e,t,n){t[0]!==Kn&&(e.status=`success`,e.error=void 0,t[0]===Un?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function lr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&nr(e,r)}function ur(e,t){return t[0]===Wn||t[0]===Gn?{...e,status:t[0]===Wn?`error`:`notFound`,error:t[1],_flight:void 0}:e}function dr(e,t,n,r,i,a,o){let s=t[1][n],c=Xn(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(or(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=qn)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,nr(e,s),p=$n(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,tr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?sr(e,t,s,c,g,i,a):Promise.resolve([Un,s.loaderData])).then(t=>(x&&(cr(s,t,l),t[0]===Un&&(m&&!a[0].signal.aborted&&lr(e,s,u),n>=o&&(s.status=`pending`))),t)),T=Yn(Promise.resolve().then(()=>Vn(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,$n(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===Un&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>ur(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=sr(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,cr(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>ur(E,e))}async function fr(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Xn(e,t[n]);try{let e=Vn(i,!1);e&&await Yn(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function pr(e,t){t[2]&&=(rr(e,t[2].map(e=>e[3])),void 0)}async function mr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Kn)throw[a,t];!i&&t[0]!==Un&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Kn)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function hr(e,t,n,r,i,a){for(;r[0]===Kn;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Kn,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Wn,e]:Qn(n,e),a=!0}}return r}async function gr(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Gn?fr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Kn)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Un&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Kn){let n=s[1];if(n[0]!==Kn||n[1].options.reloadDocument||n[2])return pr(e,t),n;c=!0,s=[0,[Wn,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Wn?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Xn(e,u);try{await Yn(i?Promise.resolve().then(()=>Vn(m,l===Wn?`errorComponent`:`notFoundComponent`)):Promise.all([Vn(m),Vn(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return pr(e,t),qn}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),pr(e,t),rr(e,o),p()):u.status=`success`}return t}async function _r(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;te._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await fr(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l{for(let t=d;t=Kn&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=gr(e,i,u,r[0],mr(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=mr(i[2],void 0,void 0,h.then(e=>Jn(e)?0:Hn(n).length,()=>0))),o=await h}catch(t){if(pr(e,i),t===a&&a.aborted)return qn;throw t}return Jn(o)?o:_r(e,o,a,r[6]===n.length?r[6]:0)}function yr(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a0){i[3]=setTimeout(()=>yr(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function br(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function xr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Hn(t[3]).some(e=>e.id===n[1]))return;let i;try{await Yn(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Sr(e,t){e._committed=t,e.stores.setMatches(t)}function Cr(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Hn(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,Sr(e,n),rr(e,[...a.values(),...i],[...n,...s.values()]),An(e,i,n,t)}async function wr(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function Tr(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Er(e,t,n,r,i){let a=n.map(e=>({...e}));ir(a);for(let t of r)nr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await gr(e,o,r,t[0],i)}catch(t){throw rr(e,a),t}if(Jn(s)){rr(e,a),s[0]===Kn&&e._tx===t&&e._committed===n&&await Tr(e,t,s);return}if(await _r(e,s,t[0].signal),e._tx!==t||e._committed!==n){rr(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),nr(e,n))}Sr(e,a),rr(e,n,a)}async function Dr(e,t,n,r,i,a){let o=await vr(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Jn(o)){let n=o[0]===Kn&&e._tx===t;if((!n||o[1].options.reloadDocument)&&br(e,t),rr(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){br(e,t);return}await Tr(e,t,o);return}let s=o[1];if(e._tx===t&&await xr(e,t),e._tx!==t){br(e,t),rr(e,s),pr(e,o);return}let c=t[2],l=On(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await xr(e,t),e._tx!==t){br(e,t),rr(e,s),pr(e,o);return}let n=await e.startTransition(()=>{br(e,t),Cr(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){pr(e,o);return}u?.length&&Er(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Or(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=On(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await wr(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});ir(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){rr(e,m),await wr(e,n);return}e._preflight=void 0;let g,_=()=>Dr(e,y,f,()=>yr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&ar(e,t,!1)}n[0].abort(),rr(e,n[3],y[3],!0)}if(e._tx!==y){rr(e,y[3]),y[3]=[],g?.(),await wr(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&yr(e,y),g?.(_()),await v,await wr(e,y)}async function kr(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),ir(a),o=(e._preloads??=new Map).set(i,a),s=await vr(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),rr(e,a)),i.abort()}if(!Jn(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Bt(e)||console.error(e);return}}}var Ar=`Error preloading route! ☝️`,jr=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=un:this.parentRoute||it();let r=n?un:t?.path;r&&r!==`/`&&(r=At(r));let i=t?.id||r,a=n?un:Ot([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ot([`/`,a]));let o=a===`__root__`?`/`:Ot([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=jt(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>dn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Mr=class extends jr{constructor(e){super(e)}},R=me(),Nr=class extends L.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?L.createElement(this.props.errorComponent??Pr,{error:e,reset:this.reset}):this.props.children}};function Pr({error:e}){let[t,n]=L.useState(!1);return(0,R.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,R.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,R.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,R.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,R.jsx)(`div`,{children:(0,R.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,R.jsx)(`code`,{children:e.message}):null})}):null]})}function Fr({children:e,fallback:t=null}){return(0,R.jsx)(L.Fragment,{children:Ir()?e:t})}function Ir(){return L.useSyncExternalStore(Lr,()=>!0,()=>!1)}function Lr(){return()=>{}}var Rr=L.createContext(null);function zr(e){return L.useContext(Rr)}var Br=L.createContext(void 0),Vr=L.createContext(void 0),Hr=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Hr||{});function Ur({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Wr(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Gr=[],Kr=0,{link:qr,unlink:Jr,propagate:Yr,checkDirty:Xr,shallowPropagate:Zr}=Ur({update(e){return e._update()},notify(e){Gr[$r++]=e,e.flags&=~Hr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Hr.Mutable|Hr.Dirty,ri(e))}}),Qr=0,$r=0,ei,ti=0;function ni(e){try{++ti,e()}finally{--ti||ii()}}function ri(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Jr(n,e)}function ii(){if(!(ti>0)){for(;Qr<$r;){let e=Gr[Qr];Gr[Qr++]=void 0,e.notify()}Qr=0,$r=0}}function ai(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Hr.None:Hr.Mutable,get(){return ei!==void 0&&qr(i,ei,Kr),i._snapshot},subscribe(e){let t=Wr(e),n={current:!1},r=oi(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ei,o=t?.compare??Object.is;if(n)ei=i,++Kr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Hr.Mutable|Hr.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{ei=a,n&&(i.flags&=~Hr.RecursedCheck),ri(i)}}};return n?(i.flags=Hr.Mutable|Hr.Dirty,i.get=function(){let e=i.flags;if(e&Hr.Dirty||e&Hr.Pending&&Xr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Zr(e)}}else e&Hr.Pending&&(i.flags=e&~Hr.Pending);return ei!==void 0&&qr(i,ei,Kr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Yr(e),Zr(e),ii())}},i}function oi(e){let t=()=>{let t=ei;ei=n,++Kr,n.depsTail=void 0,n.flags=Hr.Watching|Hr.RecursedCheck;try{return e()}finally{ei=t,n.flags&=~Hr.RecursedCheck,ri(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Hr.Watching|Hr.RecursedCheck,notify(){let e=this.flags;e&Hr.Dirty||e&Hr.Pending&&Xr(this.deps,this)?t():this.flags=Hr.Watching},stop(){this.flags=Hr.None,this.depsTail=void 0,ri(this)}};return t(),n}var si=N((e=>{var t=ne();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ci=N(((e,t)=>{t.exports=si()})),li=N((e=>{var t=ne(),n=ci();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ui=N(((e,t)=>{t.exports=li()}))();function di(e,t){return e===t}function fi(e,t,n=di){let r=(0,L.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,L.useCallback)(()=>e?.get(),[e]);return(0,ui.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var pi={};function mi(e,t){let n=L.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ue(n.current,i):i}}function hi(e){let t=zr(),n=L.useContext(e.from?Vr:Br),r=e.from??n,i=t.stores.getMatchStore(r),a=mi(e,t),o=fi(i,e=>e?a(e):pi);if(o!==pi)return o;(e.shouldThrow??!0)&&it()}function gi(e){return hi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function _i(e){let{select:t,...n}=e;return hi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function vi(e){return hi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function yi(e){return hi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function bi(e){let t=zr();return L.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function xi(e){let t=zr(),n=bi(),r=L.useRef(null);return Ne(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Si(e){return hi({...e,select:t=>e.select?e.select(t.context):t.context})}function Ci(e){let t=L.useRef(e);return Je(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function wi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ti(e,t,n){if(e?.external)return et(e.href,n)?void 0:e.href;if(!Ii(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),et(t,n)?void 0:t}catch{}}function Ei(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Pt(e.pathname,t.pathname,r))return!1}else{let n=Nt(e.pathname,r),i=Nt(t.pathname,r);if(!n.startsWith(i)||n.length!==i.length&&n[i.length]!==`/`)return!1}return(n?.includeSearch??!0)&&!Je(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Di(e,t){let n=zr(),r=Fe(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:ee,mask:j,reloadDocument:M,unsafeRelative:N,from:te,_fromLocation:ne,...re}=e,ie=Ir(),P=Ci(e.search),ae=Ci(e.params),oe=Ci(o),se=L.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,P,ae,e.state,e.mask,e.unsafeRelative]),ce=L.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...se}),r=Fi(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,v),i=Ti(r,s,n.protocolAllowlist);return[r?.href,i,Ei(e,t,oe,n.basepath,ie,i!==void 0)]},[oe,v,ie,se,n,s]),[le,ue,de]=fi(n.stores.location,ce,wi),fe=de?Le(i,{})??ki:Oi,pe=de?Oi:Le(a,{})??Oi,me=[b,fe.className,pe.className].filter(Boolean).join(` `),he=(y||fe.style||pe.style)&&{...y,...fe.style,...pe.style},ge=L.useRef(!1),_e=e.reloadDocument||ue||v?!1:c??n.options.defaultPreload,F=l??n.options.defaultPreloadDelay??0,ve=L.useCallback(()=>{n.preloadRoute(se).catch(e=>{console.warn(e),console.warn(Ar)})},[n,se]),ye=L.useCallback(e=>{if(!e){Ni(r);return}if(!(e.isIntersecting??_e===`intent`)){e.isIntersecting===!1&&Ni(r);return}if(!F){ve();return}Mi.has(r)||Mi.set(r,setTimeout(()=>{Mi.delete(r),ve()},F))},[ve,r,_e,F]);Pe(r,ye,_e!==`viewport`),L.useEffect(()=>{ge.current||_e===`render`&&(ve(),ge.current=!0)},[ve,_e]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;!v&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...se,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D}))};if(ue)return{...re,ref:r,href:ue,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let xe=()=>{_e===`intent`&&ve()},I=()=>{_e===`intent`&&Ni(r)};return{...re,...fe,...pe,href:le,ref:r,onClick:Pi([x,be]),onBlur:Pi([S,I]),onFocus:Pi([C,ye]),onMouseEnter:Pi([w,ye]),onMouseLeave:Pi([T,I]),onTouchStart:Pi([E,xe]),disabled:!!v,target:_,...he&&{style:he},...me&&{className:me},...v&&Ai,...de&&ji}}var Oi={},ki={className:`active`},Ai={role:`link`,"aria-disabled":!0},ji={"data-status":`active`,"aria-current":`page`},Mi=new WeakMap,Ni=e=>{clearTimeout(Mi.get(e)),Mi.delete(e)},Pi=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Fi(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ii(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Li=L.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Di(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return L.createElement(`a`,t,o)}return L.createElement(n,a,o)}),Ri=class extends jr{constructor(e){super(e),this.useMatch=e=>hi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Si({...e,from:this.id}),this.useSearch=e=>yi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>_i({...e,from:this.id}),this.useLoaderData=e=>gi({...e,from:this.id}),this.useNavigate=()=>bi({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Li,{ref:t,from:this.fullPath,...e}))}};function zi(e){return new Ri(e)}var Bi=class extends Mr{constructor(e){super(e),this.useMatch=e=>hi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Si({...e,from:this.id}),this.useSearch=e=>yi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>_i({...e,from:this.id}),this.useLoaderData=e=>gi({...e,from:this.id}),this.useNavigate=()=>bi({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Li,{ref:t,from:this.fullPath,...e}))}};function Vi(e){return new Bi(e)}function Hi(e){return e=>{let t=zi(e);return t.isRoot=!1,t}}function Ui(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(Ye(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(Me)Me(a());else throw a()}return L.createElement(r,e)};return o.preload=a,o}function Wi(e){let t=zr(),n=`not-found-${fi(t.stores.location,e=>e.pathname)}-${fi(t.stores.status,e=>e)}`;return(0,R.jsx)(Nr,{getResetKey:()=>n,onCatch:(t,n)=>{if(Bt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Bt(t))return e.fallback?.(t);throw t},children:e.children})}function Gi(){return(0,R.jsx)(`p`,{children:`Not Found`})}function Ki(e){return(0,R.jsx)(R.Fragment,{children:e.children})}function qi(e,t,n){return t.options.notFoundComponent?(0,R.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,R.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,R.jsx)(Gi,{})}function Ji(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,R.jsx)(n,{}):null}var Yi=(e,t)=>e[0]===t[0]&&e[1]===t[1],Xi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Zi=L.memo(function({routeId:e}){let t=zr();return(0,R.jsx)(Qi,{router:t,match:fi(t.stores.getMatchStore(e),e=>e)})});function Qi({router:e,match:t}){let n=e.routesById[t.routeId],r=Ji(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Xi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?L.Suspense:Ki,l=i?Nr:Ki,u=o?Wi:Ki;return(0,R.jsxs)(n.isRoot?n.options.shellComponent??Ki:Ki,{children:[(0,R.jsx)(Br.Provider,{value:t.routeId,children:(0,R.jsx)(c,{fallback:r,children:(0,R.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Bt(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,R.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return L.createElement(o,e)},children:s?(0,R.jsx)(Fr,{fallback:r,children:(0,R.jsx)($i,{match:t})}):(0,R.jsx)($i,{match:t})})})})}),null]})}var $i=L.memo(function({match:e}){let t=zr(),n=e.routeId,r=t.routesById[n],i=L.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=L.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,R.jsx)(e,{},i):(0,R.jsx)(ea,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Xi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Ji(t,r)}if(e.status===`notFound`)return qi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ea=L.memo(function(){let e=zr(),t=L.useContext(Br),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=fi(a,e=>[!!e._notFound,e.error],Yi),i=fi(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return qi(e,e.routesById[t],r);if(!i)return null;let a=(0,R.jsx)(Zi,{routeId:i});return t===`__root__`?(0,R.jsx)(L.Suspense,{fallback:Ji(e),children:a}):a});function ta(e,t){let n=e[1];e.length=0,n?.(t)}function na({t:e}){let t=zr(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ta(n,!1),n.push(i,a),e(t),L.startTransition(r)}),Ne(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(jt(r.publicHref)!==jt(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...On(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ra(){let e=zr(),t=e.routesById[un],n=Ji(e,t),r=e.ssr?Ki:L.Suspense,i=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(na,{t:L.useState()[1]}),(0,R.jsx)(r,{fallback:n,children:(0,R.jsx)(ia,{})})]});return e.options.InnerWrap?(0,R.jsx)(e.options.InnerWrap,{children:i}):i}function ia(){let e=zr(),t=e._rendered,n=fi(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Ne(()=>{t[0]===n&&ta(t,!0)},[t,n]);let a=i?(0,R.jsx)(Zi,{routeId:i}):null;return(0,R.jsx)(Br.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,R.jsx)(Nr,{getResetKey:()=>r,onCatch:void 0,children:a})})}var aa=e=>({createMutableStore:ai,createReadonlyStore:ai,batch:ni}),oa=e=>new sa(e),sa=class extends jn{constructor(e){super(e,aa)}};function ca({router:e,children:t,...n}){Be(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,R.jsx)(Rr.Provider,{value:e,children:t});return e.options.Wrap?(0,R.jsx)(e.options.Wrap,{children:r}):r}function la({router:e,...t}){return(0,R.jsx)(ca,{router:e,...t,children:(0,R.jsx)(ra,{})})}function ua(e){let t=zr({warn:e?.router===void 0}),n=e?.router||t;return fi(n.stores.__store,mi(e,n))}function da(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function fa(e){let t=da(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function pa(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==L.Fragment}function ma(e){let t=(0,L.createContext)(null);return[t,()=>{let n=(0,L.use)(t);if(n===null)throw Error(e);return n}]}function ha(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function ga(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function _a(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(ha(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>va(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=_a(l,c,r),d=ga(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[_a(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[ga(c.length,c,!1)]?.focus()}}}var ba={app:100,modal:200,popover:300,overlay:400,max:9999};function xa(e){return ba[e]}var Sa=()=>{};function Ca(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Sa:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function wa(e,t){return n=>{e?.(n),t?.(n)}}function Ta(e,t){return e in t?fa(t[e]):fa(e)}function Ea(e,t){let n=e.map(e=>({value:e,px:Ta(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Da(e,t,n){return n?Array.from(ha(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function Oa(e){let t=(0,L.useRef)(e);return(0,L.useEffect)(()=>{t.current=e}),(0,L.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function ka(e,t){let{delay:n,flushOnUnmount:r,leading:i,maxWait:a}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1,maxWait:void 0}:t,o=Oa(e),s=(0,L.useRef)(0),c=(0,L.useRef)(0),l=(0,L.useRef)(null),u=(0,L.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(s.current),l.current=t;let r=e._isFirstCall;e._isFirstCall=!1;function u(){window.clearTimeout(s.current),window.clearTimeout(c.current),s.current=0,c.current=0,e._isFirstCall=!0,e._hasPendingCallback=!1}function d(){a!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(s.current!==0){let e=l.current;u(),o(...e)}},a))}if(i&&r){o(...t),e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}if(i&&!r){e._hasPendingCallback=!0,e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}e._hasPendingCallback=!0;let f=()=>{s.current!==0&&(u(),o(...t))};e.flush=f,e.cancel=()=>{u()},s.current=window.setTimeout(f,n),d()},{flush:()=>{},cancel:()=>{},isPending:()=>e._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return e},[o,n,i,a]);return(0,L.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}var Aa=[`mousedown`,`touchstart`];function ja(e,t,n,r=!0){let i=(0,L.useRef)(null),a=t||Aa,o=(0,L.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let a=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!a.includes(e))&&e(t):i.current&&!a.includes(i.current)&&e(t)}),s=a.join(`,`);return(0,L.useEffect)(()=>{if(!r)return;let e=s.split(`,`);return e.forEach(e=>document.addEventListener(e,o)),()=>{e.forEach(e=>document.removeEventListener(e,o))}},[s,r]),i}function Ma(e,t){return ue(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}function Na(e,t,n={leading:!1}){let[r,i]=(0,L.useState)(e),a=(0,L.useRef)(!1),o=(0,L.useRef)(null),s=(0,L.useRef)(!1),c=(0,L.useRef)(e);c.current=e;let l=(0,L.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,L.useCallback)(()=>{l(),s.current=!1},[]),d=(0,L.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,L.useEffect)(()=>{a.current&&(l(),!s.current&&n.leading?(s.current=!0,i(e),o.current=window.setTimeout(()=>{s.current=!1},t)):o.current=window.setTimeout(()=>{s.current=!1,i(e)},t))},[e,n.leading,t]),(0,L.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function Pa({opened:e,shouldReturnFocus:t=!0}){let n=(0,L.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return A(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};if(document.addEventListener(`keydown`,a),e)n.current=document.activeElement;else if(t){let e=document.activeElement;i=window.setTimeout(()=>{let t=document.activeElement;(t===null||t===document.body||t===e)&&r()},10)}return()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var Fa=/input|select|textarea|button|object/,Ia=`a, input, select, textarea, button, object, [tabindex]`;function La(e){return e.style.display===`none`}function Ra(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(La(t))return!1;t=t.parentNode}return!0}function za(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Ba(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(za(e));return(Fa.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Ra(e)}function Va(e){let t=za(e);return(Number.isNaN(t)||t>=0)&&Ba(e)}function Ha(e){return Array.from(e.querySelectorAll(Ia)).filter(Va)}function Ua(e,t){let n=Ha(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Wa(e=!0){let t=(0,L.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Ia));t=n.find(Va)||n.find(Ba)||null,!t&&Ba(e)&&(t=e)}t?t.focus({preventScroll:!0}):console.warn(`[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node`,e)},r=(0,L.useCallback)(r=>{if(e){if(r===null){t.current=null;return}t.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn(`[@mantine/hooks/use-focus-trap] Ref node is not part of the dom`,r)}),t.current=r)}},[e]);return(0,L.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&Ua(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function Ga(e,t,n){let r=(0,L.useEffectEvent)(t);(0,L.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}function Ka({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,L.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}function qa(e=!1,t={}){let[n,r]=(0,L.useState)(e),i=(0,L.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,L.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,L.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}var Ja=[`mouse`,`touch`],Ya=10;function Xa(e,t={}){let{threshold:n=400,events:r=Ja,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,L.useRef)(!1),l=(0,L.useRef)(!1),u=(0,L.useRef)(-1),d=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>window.clearTimeout(u.current),[]),(0,L.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Ya:i===!1?0:i,p=t=>{($a(t)||Qa(t))&&(a&&a(t),d.current=Za(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{($a(e)||Qa(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Za(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,r.join(`,`)])}function Za(e){if(Qa(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Qa(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function $a(e){return e.nativeEvent instanceof MouseEvent}function eo(e){return e?.props?.ref}function to(e){let t=L.Children.toArray(e);return t.length!==1||!pa(t[0])?null:t[0]}function no(e){return e===`auto`||e===`dark`||e===`light`}function ro({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return no(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&no(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function io({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&l({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function ao(e,t,n){return io({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function oo(e,t){let n=e.colors[e.primaryColor];return y(n)?e.autoContrast?ao(n,e,t):`var(--mantine-color-white)`:io({color:n[he(e,t)],theme:e,autoContrast:null})}function so(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function co({keepTransitions:e}={}){let t=(0,L.useRef)(Sa),r=(0,L.useRef)(-1),a=(0,L.use)(i),o=(0,L.useRef)(n()?.());if(!a)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let s=n=>{a.setColorScheme(n),t.current=e?()=>{}:so(o.current),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{t.current?.()},10)},c=()=>{a.clearColorScheme(),t.current=e?()=>{}:so(o.current),window.clearTimeout(r.current),r.current=window.setTimeout(()=>{t.current?.()},10)},l=Ma(`light`,{getInitialValueInEffect:!1}),u=a.colorScheme===`auto`?l:a.colorScheme,d=(0,L.useCallback)(()=>s(u===`light`?`dark`:`light`),[s,u]);return(0,L.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(r.current)},[]),{colorScheme:a.colorScheme,setColorScheme:s,clearColorScheme:c,toggleColorScheme:d}}function lo(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function uo({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,L.useRef)(null),[a,o]=(0,L.useState)(()=>e.get(t)),s=r||a,c=(0,L.useCallback)(t=>{r||(lo(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,L.useCallback)(()=>{o(t),lo(t,n),e.clear()},[e.clear,t]);return(0,L.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),be(()=>{lo(e.get(t),n)},[]),(0,L.useEffect)(()=>{if(r)return lo(r,n),()=>{};r===void 0&&lo(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&lo(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function fo(e,t={getInitialValueInEffect:!0}){let n=Ma(e,t),{colorScheme:r}=co();return r===`auto`?n:r}function po(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function mo(e,t){let n=t?[t]:[`:root`,`:host`],r=po(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=po(e.dark),o=po(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function ho({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=he(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:v(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=he(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:_(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:_(e.colors[t][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:v(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function go(e,t,n){j(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var _o=e=>{let t=he(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:I(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":oo(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":oo(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};go(r.variables,e.breakpoints,`breakpoint`),go(r.variables,e.spacing,`spacing`),go(r.variables,e.fontSizes,`font-size`),go(r.variables,e.lineHeights,`line-height`),go(r.variables,e.shadows,`shadow`),go(r.variables,e.radius,`radius`),go(r.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),j(e.colors).forEach(t=>{let n=e.colors[t];if(y(n)){Object.assign(r.light,ho({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,ho({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=ao(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=ao(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,ho({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,ho({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return j(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function vo(){let e=f(),t=n(),r=j(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=fa(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:se(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:se(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,R.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:r}})}function yo({theme:e,generator:t}){let n=_o(e),r=t?.(e);return r?k(n,r):n}var bo=_o(m);function xo(e){let t={variables:{},light:{},dark:{}};return j(e.variables).forEach(n=>{bo.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),j(e.light).forEach(n=>{bo.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),j(e.dark).forEach(n=>{bo.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function So(e){return mo({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Co({cssVariablesSelector:e,deduplicateCssVariables:t}){let r=f(),i=n(),a=yo({theme:r,generator:u()}),o=(e===void 0||e===`:root`||e===`:host`)&&t,s=mo(o?xo(a):a,e);return s?(0,R.jsx)(`style`,{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${s}${o?``:So(e)}`}}):null}Co.displayName=`@mantine/CssVariables`;function wo({respectReducedMotion:e,getRootElement:t}){be(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function To({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:s=!0,cssVariablesSelector:c,classNamesPrefix:l=`mantine`,colorSchemeManager:u=ro(),defaultColorScheme:f=`light`,getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:h,stylesTransform:g,env:_,deduplicateInlineStyles:v=!1}){let{colorScheme:y,setColorScheme:b,clearColorScheme:x}=uo({defaultColorScheme:f,forceColorScheme:h,manager:u,getRootElement:p});return wo({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:p}),(0,R.jsx)(i,{value:{colorScheme:y,setColorScheme:b,clearColorScheme:x,getRootElement:p,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:c??`:root`,withStaticClasses:r,stylesTransform:g,env:_,deduplicateInlineStyles:v},children:(0,R.jsxs)(d,{theme:e,children:[s&&(0,R.jsx)(Co,{cssVariablesSelector:c,deduplicateCssVariables:o}),a&&(0,R.jsx)(vo,{}),t]})})}To.displayName=`@mantine/core/MantineProvider`;function Eo(e){return e}function Do(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Do(n,t)}),{}):typeof e==`function`?e(t):e??{}}var Oo=(0,L.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function ko(){return(0,L.use)(Oo)}var[Ao,jo]=ma(`ScrollArea.Root component was not found in tree`);function Mo(e,t){let n=(0,L.useEffectEvent)(t);be(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e])}function No(e){let{style:t,...n}=e,r=jo(),[i,a]=(0,L.useState)(0),[o,s]=(0,L.useState)(0),c=!!(i&&o);return Mo(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),Mo(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,R.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function Po(e){let t=jo(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,R.jsx)(No,{...e}):null}var Fo={scrollHideDelay:1e3,type:`hover`};function Io(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:a,...o}=P(`ScrollAreaRoot`,Fo,e),[s,c]=(0,L.useState)(null),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(0),[b,x]=(0,L.useState)(0),[S,C]=(0,L.useState)(!1),[w,T]=(0,L.useState)(!1),E=h(a,c);return(0,R.jsx)(Ao,{value:{type:t,scrollHideDelay:n,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,getStyles:i},children:(0,R.jsx)(we,{...o,ref:E,__vars:{"--sa-corner-width":r===`xy`?`${v}px`:`0px`,"--sa-corner-height":r===`xy`?`${b}px`:`0px`}})})}Io.displayName=`@mantine/core/ScrollAreaRoot`;function Lo(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Ro(e){let t=Lo(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zo(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Bo(e,[t,n]){return Math.min(n,Math.max(t,e))}function Vo(e,t,n=`ltr`){let r=Ro(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Bo(e,n===`ltr`?[0,o]:[o*-1,0]);return zo([0,o],[0,s])(c)}function Ho(e,t,n,r=`ltr`){let i=Ro(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return zo([c,l],d)(e)}function Uo(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[Ko,qo]=ma(`ScrollAreaScrollbar was not found in tree`);function Jo(e){let{sizes:t,hasThumb:n,onThumbChange:r,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:o,onDragScroll:s,onWheelScroll:c,onResize:l,ref:u,...d}=e,f=jo(),[p,m]=(0,L.useState)(null),g=h(u,m),_=(0,L.useRef)(null),v=(0,L.useRef)(``),{viewport:y}=f,b=t.content-t.viewport,x=(0,L.useEffectEvent)(c),S=Oa(o),C=ka(l,10),w=e=>{if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;s({x:t,y:n})}};return(0,L.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,p,b]),(0,L.useEffect)(S,[t,S]),Mo(p,C),Mo(f.content,C),(0,R.jsx)(Ko,{value:{scrollbar:p,hasThumb:n,onThumbChange:Oa(r),onThumbPointerUp:Oa(i),onThumbPositionChange:S,onThumbPointerDown:Oa(a)},children:(0,R.jsx)(`div`,{...d,ref:g,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:Go(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,w(e))}),onPointerMove:Go(e.onPointerMove,w),onPointerUp:Go(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=v.current,_.current=null}})})}var Yo=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=jo(),[s,c]=(0,L.useState)(),l=(0,L.useRef)(null),u=h(i,l,o.onScrollbarXChange);return(0,L.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,R.jsx)(Jo,{"data-orientation":`horizontal`,...a,ref:u,sizes:t,style:{...r,"--sa-thumb-width":`${Ro(t)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Uo(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Wo(s.paddingLeft),paddingEnd:Wo(s.paddingRight)}})}})};Yo.displayName=`@mantine/core/ScrollAreaScrollbarX`;function Xo(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=jo(),[s,c]=(0,L.useState)(),l=(0,L.useRef)(null),u=h(i,l,o.onScrollbarYChange);return(0,L.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,R.jsx)(Jo,{...a,"data-orientation":`vertical`,ref:u,sizes:t,style:{"--sa-thumb-height":`${Ro(t)}px`,...r},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Uo(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Wo(s.paddingTop),paddingEnd:Wo(s.paddingBottom)}})}})}Xo.displayName=`@mantine/core/ScrollAreaScrollbarY`;function Zo(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=ko(),i=jo(),a=(0,L.useRef)(null),o=(0,L.useRef)(0),[s,c]=(0,L.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Lo(s.viewport,s.content),u={...n,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:e=>{o.current=e}},d=(e,t)=>Ho(e,o.current,s,t);return t===`horizontal`?(0,R.jsx)(Yo,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Vo(e,s,r);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,r))}}):t===`vertical`?(0,R.jsx)(Xo,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Vo(e,s);s.scrollbar.size===0?a.current.style.setProperty(`--thumb-opacity`,`0`):a.current.style.setProperty(`--thumb-opacity`,`1`),a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}Zo.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function Qo(e){let t=jo(),{forceMount:n,...r}=e,[i,a]=(0,L.useState)(!1),o=e.orientation===`horizontal`,s=ka(()=>{if(t.viewport){let e=t.viewport.offsetWidth{let{scrollArea:e}=r,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},i=()=>{t=window.setTimeout(()=>a(!1),r.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,i),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,i)}}},[r.scrollArea,r.scrollHideDelay]),t||i?(0,R.jsx)(Qo,{"data-state":i?`visible`:`hidden`,...n}):null}$o.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function es(e){let{forceMount:t,...n}=e,r=jo(),i=e.orientation===`horizontal`,[a,o]=(0,L.useState)(`hidden`),s=ka(()=>o(`idle`),100);return(0,L.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,L.useEffect)(()=>{let{viewport:e}=r,t=i?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(o(`scrolling`),s()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[r.viewport,i,s]),t||a!==`hidden`?(0,R.jsx)(Zo,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:Go(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:Go(e.onPointerLeave,()=>o(`idle`))}):null}function ts(e){let{forceMount:t,...n}=e,r=jo(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,L.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,R.jsx)($o,{...n,forceMount:t}):r.type===`scroll`?(0,R.jsx)(es,{...n,forceMount:t}):r.type===`auto`?(0,R.jsx)(Qo,{...n,forceMount:t}):r.type===`always`?(0,R.jsx)(Zo,{...n}):null}ts.displayName=`@mantine/core/ScrollAreaScrollbar`;function ns(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function rs(e){let{style:t,ref:n,...r}=e,i=jo(),a=qo(),{onThumbPositionChange:o}=a,s=h(n,a.onThumbChange),c=(0,L.useRef)(void 0),l=ka(()=>{c.current&&=(c.current(),void 0)},100);return(0,L.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ns(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,R.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:Go(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:Go(e.onPointerUp,a.onThumbPointerUp)})}rs.displayName=`@mantine/core/ScrollAreaThumb`;function is(e){let{forceMount:t,...n}=e,r=qo();return t||r.hasThumb?(0,R.jsx)(rs,{...n}):null}is.displayName=`@mantine/core/ScrollAreaThumb`;function as({children:e,style:t,ref:n,onWheel:r,...i}){let a=jo(),o=h(n,a.onViewportChange),s=e=>{if(r?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,R.jsx)(we,{...i,ref:o,onWheel:s,"data-scrollarea-viewport":!0,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,R.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})}as.displayName=`@mantine/core/ScrollAreaViewport`;var os={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function ss(){return typeof window<`u`}function cs(e){return ds(e)?(e.nodeName||``).toLowerCase():`#document`}function ls(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function us(e){return((ds(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ds(e){return ss()?e instanceof Node||e instanceof ls(e).Node:!1}function fs(e){return ss()?e instanceof Element||e instanceof ls(e).Element:!1}function ps(e){return ss()?e instanceof HTMLElement||e instanceof ls(e).HTMLElement:!1}function ms(e){return!ss()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ls(e).ShadowRoot}function hs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function gs(e){return/^(table|td|th)$/.test(cs(e))}function _s(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var vs=/transform|translate|scale|rotate|perspective|filter/,ys=/paint|layout|strict|content/,bs=e=>!!e&&e!==`none`,xs;function Ss(e){let t=fs(e)?Es(e):e;return bs(t.transform)||bs(t.translate)||bs(t.scale)||bs(t.rotate)||bs(t.perspective)||!ws()&&(bs(t.backdropFilter)||bs(t.filter))||vs.test(t.willChange||``)||ys.test(t.contain||``)}function Cs(e){let t=Os(e);for(;ps(t)&&!Ts(t);){if(Ss(t))return t;if(_s(t))return null;t=Os(t)}return null}function ws(){return xs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xs}function Ts(e){return/^(html|body|#document)$/.test(cs(e))}function Es(e){return ls(e).getComputedStyle(e)}function Ds(e){return fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Os(e){if(cs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ms(e)&&e.host||us(e);return ms(t)?t.host:t}function ks(e){let t=Os(e);return Ts(t)?(e.ownerDocument||e).body:ps(t)&&hs(t)?t:ks(t)}function As(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ks(e),i=r===e.ownerDocument?.body,a=ls(r);if(i){let e=js(a);return t.concat(a,a.visualViewport||[],hs(r)?r:[],e&&n?As(e):[])}return t.concat(r,As(r,[],n))}function js(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ms=[`top`,`right`,`bottom`,`left`],Ns=Math.min,Ps=Math.max,Fs=Math.round,Is=Math.floor,Ls=e=>({x:e,y:e}),Rs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function zs(e,t,n){return Ps(e,Ns(t,n))}function Bs(e,t){return typeof e==`function`?e(t):e}function Vs(e){return e.split(`-`)[0]}function Hs(e){return e.split(`-`)[1]}function Us(e){return e===`x`?`y`:`x`}function Ws(e){return e===`y`?`height`:`width`}function Gs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ks(e){return Us(Gs(e))}function qs(e,t,n){n===void 0&&(n=!1);let r=Hs(e),i=Ks(e),a=Ws(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=nc(o)),[o,nc(o)]}function Js(e){let t=nc(e);return[Ys(e),t,Ys(t)]}function Ys(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xs=[`left`,`right`],Zs=[`right`,`left`],Qs=[`top`,`bottom`],$s=[`bottom`,`top`];function ec(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zs:Xs:t?Xs:Zs;case`left`:case`right`:return t?Qs:$s;default:return[]}}function tc(e,t,n,r){let i=Hs(e),a=ec(Vs(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ys)))),a}function nc(e){let t=Vs(e);return Rs[t]+e.slice(t.length)}function rc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ic(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:rc(e)}function ac(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function oc(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function sc(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function cc(){return/apple/i.test(navigator.vendor)}function lc(){return oc().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function uc(){return sc().includes(`jsdom/`)}var dc=`data-floating-ui-focusable`,fc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function pc(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function mc(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ms(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function hc(e){return`composedPath`in e?e.composedPath()[0]:e.target}function gc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function _c(e){return e.matches(`html,body`)}function vc(e){return e?.ownerDocument||document}function yc(e){return ps(e)&&e.matches(fc)}function bc(e){if(!e||uc())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function xc(e){return e?e.hasAttribute(dc)?e:e.querySelector(`[`+dc+`]`)||e:null}function Sc(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Sc(e,t.id,n)])}function Cc(e){return`nativeEvent`in e}function wc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Tc=typeof document<`u`?L.useLayoutEffect:function(){},Ec={...L};function Dc(e){let t=L.useRef(e);return Tc(()=>{t.current=e}),t}var Oc=Ec.useInsertionEffect||(e=>e());function kc(e){let t=L.useRef(()=>{});return Oc(()=>{t.current=e}),L.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ac(e,t,n){let{reference:r,floating:i}=e,a=Gs(t),o=Ks(t),s=Ws(o),c=Vs(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Hs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function jc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Bs(t,e),p=ic(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ac(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ac(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Mc=50,Nc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ac(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Bs(e,t)||{};if(l==null)return{};let d=ic(u),f={x:n,y:r},p=Ks(i),m=Ws(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ns(d[_],T),D=Ns(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=zs(E,k,O),ee=!c.arrow&&Hs(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Gs(t)||T.every(e=>Gs(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Gs(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ic(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lc(e){return Ms.some(t=>e[t]>=0)}var Rc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Bs(e,t);switch(i){case`referenceHidden`:{let e=Ic(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Lc(e)}}}case`escaped`:{let e=Ic(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Lc(e)}}}default:return{}}}}};function zc(e){let t=Ns(...e.map(e=>e.left)),n=Ns(...e.map(e=>e.top)),r=Ps(...e.map(e=>e.right)),i=Ps(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Bc(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;er.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>ac(zc(e)))}var Vc=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Bs(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Bc(u),f=ac(zc(u)),p=ic(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&ce.top-p.top&&l=2){if(Gs(n)===`y`){let e=d[0],t=d[d.length-1],r=Vs(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return ac({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Vs(n)===`left`,t=Ps(...d.map(e=>e.right)),r=Ns(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return ac({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Hc=new Set([`left`,`top`]);async function Uc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Vs(n),s=Hs(n),c=Gs(n)===`y`,l=Hc.has(o)?-1:1,u=a&&c?-1:1,d=Bs(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Wc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Uc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Gc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Gs(i),p=Us(f),m=u[p],h=u[f],g=(e,t)=>zs(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Kc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Bs(e,t),u={x:n,y:r},d=Gs(i),f=Us(d),p=u[f],m=u[d],h=Bs(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Hc.has(Vs(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},qc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Bs(e,t),c=await i.detectOverflow(t,s),l=Vs(n),u=Hs(n),d=Gs(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ns(p-c[m],g),y=Ns(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ps(c.left,c.right):S=p-2*Ps(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Jc(e){let t=Es(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ps(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fs(n)!==a||Fs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Yc(e){return fs(e)?e:e.contextElement}function Xc(e){let t=Yc(e);if(!ps(t))return Ls(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jc(t),o=(a?Fs(n.width):n.width)/r,s=(a?Fs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zc=Ls(0);function Qc(e){let t=ls(e);return!ws()||!t.visualViewport?Zc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $c(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ls(e)}function el(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Yc(e),o=Ls(1);t&&(r?fs(r)&&(o=Xc(r)):o=Xc(e));let s=$c(a,n,r)?Qc(a):Ls(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ls(a),t=fs(r)?ls(r):r,n=e,i=js(n);for(;i&&t!==n;){let e=Xc(i),t=i.getBoundingClientRect(),r=Es(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ls(i),i=js(n)}}return ac({width:u,height:d,x:c,y:l})}function tl(e,t){let n=Ds(e).scrollLeft;return t?t.left+n:el(us(e)).left+n}function nl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-tl(e,n),y:n.top+t.scrollTop}}function rl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=us(r),s=t?_s(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ls(1),u=Ls(0),d=ps(r);if((d||!a)&&((cs(r)!==`body`||hs(o))&&(c=Ds(r)),d)){let e=el(r);l=Xc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?nl(o,c):Ls(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function il(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function al(e){let t=Ds(e),n=e.ownerDocument.body,r=Ps(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ps(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+tl(e),o=-t.scrollTop;return Es(n).direction===`rtl`&&(a+=Ps(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ol=25;function sl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ls(e),a=us(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ws()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(tl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ol&&(s-=o)}return{width:s,height:c,x:l,y:u}}function cl(e,t){let n=el(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ll(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=sl(e,n,t);else if(t===`document`)r=al(us(e));else if(fs(t))r=cl(t,n);else{let n=Qc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ac(r)}function ul(e,t){let n=t.get(e);if(n)return n;let r=As(e,[],!1).filter(e=>fs(e)&&cs(e)!==`body`),i=null,a=Es(e).position===`fixed`,o=a?Os(e):e;for(;fs(o)&&!Ts(o);){let e=Es(o),t=Ss(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Os(o)}return t.set(e,r),r}function dl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_s(t)?[]:ul(t,this._c):[].concat(n),r],o=ll(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ls(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Sl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Yc(e),u=i||a?[...l?As(l):[],...t?As(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?xl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?el(e):null;c&&g();function g(){let t=el(e);h&&!bl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Cl=Wc,wl=Gc,Tl=Fc,El=qc,Dl=Rc,Ol=Pc,kl=Vc,Al=Kc,jl=(e,t,n)=>{let r=new Map,i=n??{},a={...yl,...i.platform,_c:r};return Nc(e,t,{...i,platform:a})},Ml=Te(le(),1),Nl=typeof document<`u`?L.useLayoutEffect:function(){};function Pl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Pl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Il(e,t){let n=Fl(e);return Math.round(t*n)/n}function Ll(e){let t=L.useRef(e);return Nl(()=>{t.current=e}),t}function Rl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=L.useState(r);Pl(f,r)||p(r);let[m,h]=L.useState(null),[g,_]=L.useState(null),v=L.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=L.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=L.useRef(null),C=L.useRef(null),w=L.useRef(u),T=c!=null,E=Ll(c),D=Ll(i),O=Ll(l),k=L.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),jl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Pl(w.current,t)&&(w.current=t,Ml.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Nl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=L.useRef(!1);Nl(()=>(A.current=!0,()=>{A.current=!1}),[]),Nl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=L.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=L.useMemo(()=>({reference:b,floating:x}),[b,x]),M=L.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Il(j.floating,u.x),r=Il(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fl(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:M}),[u,k,ee,j,M])}var zl=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ol({element:r.current,padding:i}).fn(n):r?Ol({element:r,padding:i}).fn(n):{}}}},Bl=(e,t)=>{let n=Cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vl=(e,t)=>{let n=wl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hl=(e,t)=>({fn:Al(e).fn,options:[e,t]}),Ul=(e,t)=>{let n=Tl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wl=(e,t)=>{let n=El(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gl=(e,t)=>{let n=Dl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kl=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ql=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Jl(e){let t=L.useRef(void 0),n=L.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return L.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Yl=`data-floating-ui-focusable`,Xl=`active`,Zl=`selected`,Ql=`ArrowLeft`,$l=`ArrowRight`,eu=`ArrowUp`,tu=`ArrowDown`,nu=[Ql,$l],ru=[eu,tu];[...nu,...ru];var iu={...L},au=!1,ou=0,su=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ou++;function cu(){let[e,t]=L.useState(()=>au?su():void 0);return Tc(()=>{e??t(su())},[]),L.useEffect(()=>{au=!0},[]),e}var lu=iu.useId||cu;function uu(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var du=L.createContext(null),fu=L.createContext(null),pu=()=>L.useContext(du)?.id||null,mu=()=>L.useContext(fu);function hu(e){return`data-floating-ui-`+e}function gu(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var _u=hu(`safe-polygon`);function vu(e,t,n){if(n&&!wc(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function yu(e){return typeof e==`function`?e():e}function bu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=mu(),m=pu(),h=Dc(l),g=Dc(c),_=Dc(n),v=Dc(d),y=L.useRef(),b=L.useRef(-1),x=L.useRef(),S=L.useRef(-1),C=L.useRef(!0),w=L.useRef(!1),T=L.useRef(()=>{}),E=L.useRef(!1),D=kc(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});L.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(gu(b),gu(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),L.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=vc(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=L.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=vu(g.current,`close`,y.current);i&&!x.current?(gu(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(gu(b),r(!1,e,n))},[g,r]),k=kc(()=>{T.current(),x.current=void 0}),A=kc(()=>{if(w.current){let e=vc(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(_u),w.current=!1}}),ee=kc(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);L.useEffect(()=>{if(!s)return;function e(e){if(gu(b),C.current=!1,u&&!wc(y.current)||yu(v.current)>0&&!vu(g.current,`open`))return;let t=vu(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(ee()){A();return}T.current();let t=vc(o.floating);if(gu(S),E.current=!1,h.current&&i.current.floatingContext){n||gu(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),ee()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!mc(o.floating,e.relatedTarget))&&O(e)}function a(e){ee()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),ee()||O(e)}})(e))}function c(){gu(b)}function l(e){ee()||O(e,!1)}if(fs(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,O,k,A,r,n,_,p,g,h,i,ee,v]),Tc(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(fs(o.domReference)&&e){var t;let n=vc(o.floating).body;n.setAttribute(_u,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,D]),Tc(()=>{n||(y.current=void 0,E.current=!1,k(),A())},[n,k,A]),L.useEffect(()=>()=>{k(),gu(b),gu(S),A()},[s,o.domReference,k,A]);let j=L.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}(!u||wc(y.current))&&(n||yu(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(gu(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,yu(v.current)))))}}},[u,r,n,_,v]);return L.useMemo(()=>s?{reference:j}:{},[s,j])}var xu=()=>{},Su=L.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:xu,setState:xu,isInstantPhase:!1}),Cu=()=>L.useContext(Su);function wu(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=L.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=L.useRef(null),s=L.useCallback(e=>{a({currentId:e})},[]);return Tc(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,R.jsx)(Su.Provider,{value:L.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Tu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Cu(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Tc(()=>{o&&l&&(f({delay:{open:1,close:vu(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Tc(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Tc(()=>{o&&u!==xu&&n&&u(s)},[o,n,u,s]),c}function Eu(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ms(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Du(e){return`composedPath`in e?e.composedPath()[0]:e.target}var Ou={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},ku={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Au=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function ju(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=mu(),g=kc(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=L.useRef(!1),{escapeKey:y,outsidePress:b}=Au(p),{escapeKey:x,outsidePress:S}=Au(m),C=L.useRef(!1),w=kc(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Sc(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Cc(e)?e.nativeEvent:e,`escape-key`)}),T=kc(e=>{var t;let n=()=>{var t;w(e),(t=hc(e))==null||t.removeEventListener(`keydown`,n)};(t=hc(e))==null||t.addEventListener(`keydown`,n)}),E=kc(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=hc(e),s=`[`+hu(`inert`)+`]`,c=vc(i.floating).querySelectorAll(s),u=fs(o)?o:null;for(;u&&!Ts(u);){let e=Os(u);if(Ts(e)||!fs(e))break;u=e}if(c.length&&fs(o)&&!_c(o)&&!mc(o,i.floating)&&Array.from(c).every(e=>!mc(u,e)))return;if(ps(o)&&k){let t=Ts(o),n=Es(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Sc(h.nodesRef.current,d).some(t=>gc(e,t.context?.elements.floating));if(gc(e,i.floating)||gc(e,i.domReference)||f)return;let p=h?Sc(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),D=kc(e=>{var t;let n=()=>{var t;E(e),(t=hc(e))==null||t.removeEventListener(l,n)};(t=hc(e))==null||t.addEventListener(l,n)});L.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},ws()?5:0)}let d=vc(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?D:E,S);let p=[];return f&&(fs(i.domReference)&&(p=As(i.domReference)),fs(i.floating)&&(p=p.concat(As(i.floating))),!fs(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(As(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?D:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,D]),L.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let O=L.useMemo(()=>({onKeyDown:w,...u&&{[Ou[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),k=L.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[ku[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return L.useMemo(()=>o?{reference:O,floating:k}:{},[o,O,k])}function Mu(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=lu(),a=L.useRef({}),[o]=L.useState(()=>uu()),s=pu()!=null,[c,l]=L.useState(r.reference),u=kc((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=L.useMemo(()=>({setPositionReference:l}),[]),f=L.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return L.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Nu(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Mu({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=L.useState(null),[l,u]=L.useState(null),d=o?.domReference||s,f=L.useRef(null),p=mu();Tc(()=>{d&&(f.current=d)},[d]);let m=Rl({...n,elements:{...o,...l&&{reference:l}}}),h=L.useCallback(e=>{let t=fs(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=L.useCallback(e=>{(fs(e)||e===null)&&(f.current=e,c(e)),(fs(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!fs(e))&&m.refs.setReference(e)},[m.refs]),_=L.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=L.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=L.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Tc(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),L.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Pu(){return lc()&&cc()}function Fu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=L.useRef(!1),u=L.useRef(-1),d=L.useRef(!0);L.useEffect(()=>{if(!s)return;let e=ls(o.domReference);function t(){!n&&ps(o.domReference)&&o.domReference===pc(vc(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Pu()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Pu()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),L.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),L.useEffect(()=>()=>{gu(u)},[]);let f=L.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=hc(e.nativeEvent);if(c&&fs(t)){if(Pu()&&!e.relatedTarget){if(!d.current&&!yc(t))return}else if(!bc(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=fs(t)&&t.hasAttribute(hu(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=pc(o.domReference?o.domReference.ownerDocument:document);(t||e!==o.domReference)&&(mc(a.current.floatingContext?.refs.floating.current,e)||mc(o.domReference,e)||i||r(!1,n,`focus`))})}}),[a,o.domReference,r,c]);return L.useMemo(()=>s?{reference:f}:{},[s,f])}function Iu(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Xl]:t,[Zl]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Yl]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Xl,Zl].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Lu(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=L.useCallback(t=>Iu(t,e,`reference`),t),a=L.useCallback(t=>Iu(t,e,`floating`),n),o=L.useCallback(t=>Iu(t,e,`item`),r);return L.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Ru=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function zu(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=lu(),c=r.domReference?.id||s,l=L.useMemo(()=>xc(r.floating)?.id||i,[r.floating,i]),u=Ru.get(o)??o,d=pu()!=null,f=L.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=L.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=L.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return L.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Bu(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Bu(e,t.id,n)])}function Vu(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Hu(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Uu(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){gu(i),u()}if(gu(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Du(e),v=e.type===`mouseleave`,y=Eu(c.floating,_),b=Eu(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Hu(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,ee=(O?x:S).top,j=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&fs(e.relatedTarget)&&Eu(c.floating,e.relatedTarget)||f&&Bu(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let M=[];switch(C){case`top`:M=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:M=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:M=[[S.right-1,j],[S.right-1,ee],[x.left+1,ee],[x.left+1,j]];break;case`right`:M=[[x.right-1,j],[x.right-1,ee],[S.left+1,ee],[S.left+1,j]]}function N(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Vu([m,h],M)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Vu([m,h],N([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var Wu={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},Gu=x((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":I(t),"--scrollarea-over-scroll-behavior":i}}}),Ku=r(e=>{let t=P(`ScrollArea`,Wu,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,scrollbarSize:s,vars:c,type:l,scrollHideDelay:u,viewportProps:d,viewportRef:f,onScrollPositionChange:p,children:m,offsetScrollbars:h,scrollbars:g,onBottomReached:_,onTopReached:v,onLeftReached:y,onRightReached:b,overscrollBehavior:x,startScrollPosition:S,verticalScrollbarPosition:C,attributes:w,...T}=t,[E,D]=(0,L.useState)(!1),[O,k]=(0,L.useState)(!1),[A,ee]=(0,L.useState)(!1),j=(0,L.useRef)(!0),M=(0,L.useRef)(!1),N=(0,L.useRef)(!0),te=(0,L.useRef)(!1),ne=ae({name:`ScrollArea`,props:t,classes:os,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:w,vars:c,varsResolver:Gu}),re=(0,L.useRef)(null),[ie,oe]=(0,L.useState)(null),se=Jl([f,re,(0,L.useCallback)(e=>{oe(t=>t===e?t:e)},[])]);return Mo(h===`present`?ie:null,()=>{let e=re.current;e&&(k(e.scrollHeight>e.clientHeight),ee(e.scrollWidth>e.clientWidth))}),be(()=>{S&&re.current&&re.current.scrollTo({left:S.x??0,top:S.y??0})},[]),(0,R.jsxs)(Io,{getStyles:ne,type:l===`never`?`always`:l,scrollHideDelay:u,scrollbars:g,...ne(`root`),...T,children:[(0,R.jsx)(as,{...d,...ne(`viewport`,{style:d?.style}),ref:se,"data-offset-scrollbars":h===!0?`xy`:h||void 0,"data-scrollbars":g||void 0,"data-vertical-scrollbar-position":C||void 0,"data-horizontal-hidden":h===`present`&&!A?`true`:void 0,"data-vertical-hidden":h===`present`&&!O?`true`:void 0,onScroll:e=>{d?.onScroll?.(e),p?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollLeft:i,scrollWidth:a,clientWidth:o}=e.currentTarget,s=t-(n-r)>=-.8,c=t===0;s&&!M.current&&_?.(),c&&!j.current&&v?.(),M.current=s,j.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!te.current&&b?.(),u&&!N.current&&y?.(),te.current=l,N.current=u},children:m}),(g===`xy`||g===`x`)&&(0,R.jsx)(ts,{...ne(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!A||void 0,forceMount:!0,onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:(0,R.jsx)(is,{...ne(`thumb`)})}),(g===`xy`||g===`y`)&&(0,R.jsx)(ts,{...ne(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!O||void 0,forceMount:!0,onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:(0,R.jsx)(is,{...ne(`thumb`)})}),(0,R.jsx)(Po,{...ne(`corner`),"data-vertical-scrollbar-position":C||void 0,"data-hovered":E||void 0,"data-hidden":l===`never`||void 0})]})});Ku.displayName=`@mantine/core/ScrollArea`;var qu=r(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:a,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,scrollbars:h,style:g,vars:_,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,onOverflowChange:S,...C}=P(`ScrollAreaAutosize`,Wu,e),w=(0,L.useRef)(null),[T,E]=(0,L.useState)(null),D=Jl([u,w,(0,L.useCallback)(e=>{E(t=>t===e?t:e)},[])]),O=(0,L.useRef)(!1),k=(0,L.useRef)(!1),A=(0,L.useEffectEvent)(()=>{let e=w.current;if(!e||!S)return;let t=e.scrollHeight>e.clientHeight;t!==O.current&&(k.current?S(t):(k.current=!0,t&&S(!0)),O.current=t)});return Mo(S?T:null,A),(0,R.jsx)(we,{...C,variant:p,style:[{display:`flex`,overflow:`hidden`},g],children:(0,R.jsx)(we,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...h===`y`&&{minWidth:0},...h===`x`&&{minHeight:0},...h===`xy`&&{minWidth:0,minHeight:0},...h===!1&&{minWidth:0,minHeight:0}},children:(0,R.jsx)(Ku,{classNames:n,styles:r,scrollHideDelay:a,scrollbarSize:i,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:D,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,vars:_,scrollbars:h,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,"data-autosize":`true`,children:t})})})});Ku.classes=os,Ku.varsResolver=Gu,qu.displayName=`@mantine/core/ScrollAreaAutosize`,qu.classes=os,Ku.Autosize=qu;var Ju={root:`m_515a97f8`},Yu=r(e=>{let t=P(`VisuallyHidden`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,R.jsx)(we,{component:`span`,...ae({name:`VisuallyHidden`,classes:Ju,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c})(`root`),...l})});Yu.classes=Ju,Yu.displayName=`@mantine/core/VisuallyHidden`;function Xu(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function Zu(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var Qu={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function $u({position:e,arrowSize:t,dir:n}){let[r,i]=e.split(`-`);if(!i)return;let a={width:t,height:t,position:`absolute`};if(r===`bottom`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,top:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(100% 0%, 0% 100%, 100% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`}}if(r===`top`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,bottom:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(0% 0%, 100% 0%, 0% 100%)`}}if(r===`left`)return{...a,right:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 0% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`};if(r===`right`)return{...a,left:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(100% 0%, 0% 100%, 100% 100%)`}}function ed({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=$u({position:e,arrowSize:t,dir:s});if(n)return n}let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[Qu[c]]:r},d=-t/2;return c===`left`?{...u,...Xu(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Xu(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...Zu(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...Zu(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function td({position:e,dir:t}){let[n,r]=e.split(`-`);if(!r)return;let i=r===`start`&&t===`ltr`||r===`end`&&t===`rtl`;if(n===`bottom`)return i?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n===`top`)return i?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n===`left`)return r===`start`?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n===`right`)return r===`start`?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function nd({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=ko();return a?(0,R.jsx)(`div`,{role:`presentation`,...l,style:{...c,...ed({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}nd.displayName=`@mantine/core/FloatingArrow`;function rd(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}function id({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,L.useRef)(-1),a=(0,L.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,L.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var ad={root:`m_9814e45f`},od={zIndex:xa(`modal`)},sd=x((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&o(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${I(i)})`:void 0,"--overlay-radius":a===void 0?void 0:ie(a),"--overlay-z-index":s?.toString()}})),cd=g(e=>{let t=P(`Overlay`,od,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fixed:c,center:l,children:u,radius:d,zIndex:f,gradient:p,blur:m,color:h,backgroundOpacity:g,mod:_,attributes:v,...y}=t;return(0,R.jsx)(we,{...ae({name:`Overlay`,props:t,classes:ad,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:sd})(`root`),mod:[{center:l,fixed:c},_],...y,children:u})});cd.classes=ad,cd.varsResolver=sd,cd.displayName=`@mantine/core/Overlay`;function ld(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function ud({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||ld(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=ld(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return ld(n)}var dd={reuseTargetNode:!0},fd=r(e=>{let{children:t,target:n,reuseTargetNode:r,ref:i,...a}=P(`Portal`,dd,e),[o,s]=(0,L.useState)(!1),c=(0,L.useRef)(null);return be(()=>(s(!0),c.current=ud({target:n,reuseTargetNode:r,...a}),S(i,c.current),!n&&!r&&c.current&&document.body.appendChild(c.current),()=>{!n&&!r&&c.current&&document.body.removeChild(c.current)}),[n]),!o||!c.current?null:(0,Ml.createPortal)((0,R.jsx)(R.Fragment,{children:t}),c.current)});fd.displayName=`@mantine/core/Portal`;var pd=r(({withinPortal:e=!0,children:t,...n})=>De()===`test`||!e?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(fd,{...n,children:t}));pd.displayName=`@mantine/core/OptionalPortal`;var md={duration:100,transition:`fade`};function hd(e,t){return{...md,...t,...e}}var[gd,_d]=ma(`Popover component was not found in the tree`);function vd({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,L.useRef)(!1),s=(0,L.useRef)(!1),c=(0,L.useRef)(null),l=(0,L.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=wa(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=wa(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=Xa(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:wa(e.onTouchStart,p.onTouchStart),onTouchEnd:wa(e.onTouchEnd,p.onTouchEnd),onTouchCancel:wa(e.onTouchCancel,p.onTouchCancel),onTouchMove:wa(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function yd(e){let{children:t,disabled:n,longPressDelay:r}=P(`PopoverContextMenu`,null,e),i=to(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=_d();return(0,L.cloneElement)(i,vd({childProps:i.props,disabled:n||a.disabled,opened:a.opened,longPressDelay:r,setReference:a.reference,open:()=>{a.opened||a.onToggle()}}))}yd.displayName=`@mantine/core/PopoverContextMenu`;function bd({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=h(Wa(t),r),a=to(e);return a?(0,L.cloneElement)(a,{[n]:i}):e}function xd(e){return(0,R.jsx)(Yu,{tabIndex:-1,"data-autofocus":!0,...e})}bd.displayName=`@mantine/core/FocusTrap`,xd.displayName=`@mantine/core/FocusTrapInitialFocus`,bd.InitialFocus=xd;var Sd={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Cd=r(e=>{let t=P(`PopoverDropdown`,null,e),{className:n,style:r,vars:i,children:a,onKeyDownCapture:o,variant:s,classNames:c,styles:l,ref:u,...d}=t,f=_d(),{dir:p}=ko(),m=f.arrowPosition===`merge`&&f.withArrow?td({position:f.placement,dir:p}):void 0,g=Pa({opened:f.opened,shouldReturnFocus:f.returnFocus}),_=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},v=h(u,f.floating);return f.disabled?null:(0,R.jsx)(pd,{...f.portalProps,withinPortal:f.withinPortal,children:(0,R.jsx)(Se,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,keepMountedMode:f.keepMountedMode,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,R.jsx)(bd,{active:f.trapFocus&&f.opened,innerRef:v,children:(0,R.jsxs)(we,{..._,...d,variant:s,onKeyDownCapture:Ca(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:g,onKeyDown:o}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:n,props:t,classNames:c,styles:l,style:[{...e,...m,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:I(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles?.dropdown,l?.dropdown,r]}),children:[a,(0,R.jsx)(nd,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:t,classNames:c,styles:l})})]})})})})});Cd.classes=Sd,Cd.displayName=`@mantine/core/PopoverDropdown`;var wd={refProp:`ref`,popupType:`dialog`},Td=r(e=>{let{children:t,refProp:n,popupType:r,ref:i,...a}=P(`PopoverTarget`,wd,e),o=to(t);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,l=_d(),u=h(l.reference,eo(o),i),d=l.withRoles?{"aria-haspopup":r,"aria-expanded":l.opened,"aria-controls":l.opened?l.getDropdownId():void 0,id:l.getTargetId()}:{},f=o.props;return(0,L.cloneElement)(o,{...s,...d,...l.targetProps,className:c(l.targetProps.className,s.className,f.className),[n]:u,...l.controlled?null:{onClick:e=>{l.onToggle(),f.onClick?.(e)}}})});Td.displayName=`@mantine/core/PopoverTarget`;function Ed(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Dd(e,t,n,r){let i=Ed(e.middlewares),a=[Bl(e.offset),Gl()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(Ul(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(Vl(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:Hl(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?Kl():Kl(i.inline)),a.push(ql({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(Wl({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function Od(e){let[t,n]=Ka({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,L.useRef)(t),[i,a]=(0,L.useState)(null),o=e.preventPositionChangeWhenVisible!==!1,s=(0,L.useRef)(t);t!==s.current&&(s.current=t,t&&i!==null&&a(null));let c=(0,L.useCallback)(()=>a(null),[]),l=()=>{t&&!e.disabled&&n(!1)},u=()=>{e.disabled||n(!t)},d=Nu({open:t,strategy:e.strategy,placement:o?i??e.position:e.position,middleware:Dd(e,()=>d,o&&i!==null,o),whileElementsMounted:e.keepMounted?void 0:Sl});(0,L.useEffect)(()=>{if(!e.keepMounted)return;let n=d.refs.reference.current,r=d.refs.floating.current;if(t&&n&&r)return Sl(n,r,d.update)},[e.keepMounted,t,d.update,d.elements.reference,d.elements.floating]);let f=(0,L.useRef)(!1);be(()=>{if(!t){f.current=!1;return}if(!o||i!==null)return;let e=d.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!f.current){f.current=!0,d.update();return}d.isPositioned&&a(d.placement)}},[o,t,d.isPositioned,d.placement,i,d.update]);let p=(0,L.useRef)(d.placement);return be(()=>{p.current!==d.placement&&(p.current=d.placement,e.onPositionChange?.(d.placement))},[d.placement]),A(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:d,controlled:typeof e.opened==`boolean`,opened:t,onClose:l,onToggle:u,resetLockedPlacement:c}}var kd={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:xa(`popover`),__staticSelector:`Popover`,width:`max-content`},Ad=x((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:ie(t),"--popover-shadow":T(n)}}));function jd(n){let r=P(`Popover`,kd,n),{children:i,position:a,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:f,middlewares:p,withArrow:m,arrowSize:h,arrowOffset:g,arrowRadius:_,arrowPosition:v,unstyled:y,classNames:b,styles:x,closeOnClickOutside:S,withinPortal:C,portalProps:w,closeOnEscape:T,clickOutsideEvents:E,trapFocus:D,onClose:O,onDismiss:k,onOpen:A,onChange:ee,zIndex:j,radius:M,shadow:N,id:te,defaultOpened:ne,__staticSelector:re,withRoles:ie,disabled:oe,returnFocus:se,variant:ce,keepMounted:le,keepMountedMode:ue,vars:de,floatingStrategy:fe,withOverlay:pe,overlayProps:me,hideDetached:he,attributes:ge,preventPositionChangeWhenVisible:_e,...F}=r,ve=ae({name:re,props:r,classes:Sd,classNames:b,styles:x,unstyled:y,attributes:ge,rootSelector:`dropdown`,vars:de,varsResolver:Ad}),{resolvedStyles:ye}=t({classNames:b,styles:x,props:r}),be=(0,L.useRef)(null),[xe,I]=(0,L.useState)(null),[Ce,we]=(0,L.useState)(null),{dir:Te}=ko(),Ee=De(),Oe=e(te),ke=Od({middlewares:p,width:f,position:rd(Te,a),offset:typeof o==`number`?o+(m?h/2:0):o,arrowRef:be,arrowOffset:g,onPositionChange:s,opened:c,defaultOpened:ne,onChange:ee,onOpen:A,onClose:O,onDismiss:k,strategy:fe,disabled:oe,preventPositionChangeWhenVisible:_e,keepMounted:le});ja(()=>{S&&(ke.onClose(),k?.())},E,[xe,Ce]);let Ae=(0,L.useCallback)(e=>{I(e),ke.floating.refs.setReference(e)},[ke.floating.refs.setReference]),je=(0,L.useCallback)(e=>{we(e),ke.floating.refs.setFloating(e)},[ke.floating.refs.setFloating]),Me=(0,L.useCallback)(()=>{l?.onExited?.(),u?.(),ke.resetLockedPlacement()},[l?.onExited,u,ke.resetLockedPlacement]),Ne=(0,L.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,R.jsxs)(gd,{value:{returnFocus:se,disabled:oe,controlled:ke.controlled,reference:Ae,floating:je,x:ke.floating.x,y:ke.floating.y,arrowX:ke.floating?.middlewareData?.arrow?.x,arrowY:ke.floating?.middlewareData?.arrow?.y,opened:ke.opened,arrowRef:be,transitionProps:{...l,onExited:Me,onEntered:Ne},width:f,withArrow:m,arrowSize:h,arrowOffset:g,arrowRadius:_,arrowPosition:v,placement:ke.floating.placement,trapFocus:D,withinPortal:C,portalProps:w,zIndex:j,radius:M,shadow:N,closeOnEscape:T,onDismiss:k,onClose:ke.onClose,onToggle:ke.onToggle,getTargetId:()=>Oe,getDropdownId:()=>`${Oe}-dropdown`,withRoles:ie,targetProps:F,__staticSelector:re,classNames:b,styles:x,unstyled:y,variant:ce,keepMounted:le,keepMountedMode:ue,getStyles:ve,resolvedStyles:ye,floatingStrategy:fe,referenceHidden:he&&Ee!==`test`?ke.floating.middlewareData.hide?.referenceHidden:!1},children:[i,pe&&(0,R.jsx)(Se,{transition:`fade`,mounted:ke.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,R.jsx)(pd,{withinPortal:C,children:(0,R.jsx)(cd,{...me,...ve(`overlay`,{className:me?.className,style:[e,me?.style]})})})})]})}jd.Target=Td,jd.Dropdown=Cd,jd.ContextMenu=yd,jd.varsResolver=Ad,jd.displayName=`@mantine/core/Popover`,jd.extend=e=>e,jd.withProps=e=>{let t=t=>(0,R.jsx)(jd,{...e,...t});return t.extend=jd.extend,t.displayName=`WithProps(${jd.displayName})`,t};var Md={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},Nd={orientation:`horizontal`},Pd=x((e,{borderWidth:t})=>({group:{"--ai-border-width":I(t)}})),Fd=r(e=>{let t=P(`ActionIconGroup`,Nd,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:c,borderWidth:l,variant:u,mod:d,attributes:f,...p}=t;return(0,R.jsx)(we,{...ae({name:`ActionIconGroup`,props:t,classes:Md,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:Pd,rootSelector:`group`})(`group`),variant:u,mod:[{"data-orientation":s},d],role:`group`,...p})});Fd.classes=Md,Fd.varsResolver=Pd,Fd.displayName=`@mantine/core/ActionIconGroup`;var Id=x((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":fe(o,`section-height`),"--section-padding-x":fe(o,`section-padding-x`),"--section-fz":_e(o),"--section-radius":t===void 0?void 0:ie(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Ld=r(e=>{let t=P(`ActionIconGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,variant:c,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t;return(0,R.jsx)(we,{...ae({name:`ActionIconGroupSection`,props:t,classes:Md,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Id,rootSelector:`groupSection`})(`groupSection`),variant:c,...p})});Ld.classes=Md,Ld.varsResolver=Id,Ld.displayName=`@mantine/core/ActionIconGroupSection`;var Rd=x((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":fe(t,`ai-size`),"--ai-radius":n===void 0?void 0:ie(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),zd=g(e=>{let t=P(`ActionIcon`,null,e),{className:n,unstyled:r,variant:i,classNames:a,styles:o,style:s,loading:c,loaderProps:l,size:u,color:d,radius:f,__staticSelector:p,gradient:m,vars:h,children:g,disabled:_,"data-disabled":v,autoContrast:y,mod:b,attributes:x,...S}=t,w=ae({name:[`ActionIcon`,p],props:t,className:n,style:s,classes:Md,classNames:a,styles:o,unstyled:r,attributes:x,vars:h,varsResolver:Rd});return(0,R.jsxs)(E,{...w(`root`,{active:!_&&!c&&!v}),"aria-busy":c||void 0,...S,unstyled:r,variant:i,size:u,disabled:_||c,mod:[{loading:c,disabled:_||v},b],children:[typeof c==`boolean`&&(0,R.jsx)(Se,{mounted:c,transition:`slide-down`,duration:150,children:e=>(0,R.jsx)(we,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(C,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...l})})}),(0,R.jsx)(we,{component:`span`,mod:{loading:c},...w(`icon`),children:g})]})});zd.classes=Md,zd.varsResolver=Rd,zd.displayName=`@mantine/core/ActionIcon`,zd.Group=Fd,zd.GroupSection=Ld;var[Bd,Vd]=ma(`ModalBase component was not found in tree`);function Hd({opened:e,transitionDuration:t}){let[n,r]=(0,L.useState)(e),i=(0,L.useRef)(-1),a=b()?0:t;return(0,L.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function Ud({id:t,transitionProps:n,opened:r,trapFocus:i,closeOnEscape:a,onClose:o,returnFocus:s}){let c=e(t),[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(!1),p=Hd({opened:r,transitionDuration:typeof n?.duration==`number`?n?.duration:200});return Ga(`keydown`,e=>{e.key===`Escape`&&a&&!e.isComposing&&r&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&o()},{capture:!0}),Pa({opened:r,shouldReturnFocus:i&&s}),{_id:c,titleMounted:l,bodyMounted:d,shouldLockScroll:p,setTitleMounted:u,setBodyMounted:f}}var Wd=function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`)return bf;var t=Sf(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wf=yf(),Tf=`data-scroll-locked`,Ef=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` - .${Yd} { - overflow: hidden ${r}; - padding-right: ${s}px ${r}; - } - body[${Tf}] { - overflow: hidden ${r}; - overscroll-behavior: contain; - ${[t&&`position: relative ${r};`,n===`margin`&&` - padding-left: ${i}px; - padding-top: ${a}px; - padding-right: ${o}px; - margin-left:0; - margin-top:0; - margin-right: ${s}px ${r}; - `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} - } - - .${qd} { - right: ${s}px ${r}; - } - - .${Jd} { - margin-right: ${s}px ${r}; - } - - .${qd} .${qd} { - right: 0 ${r}; - } - - .${Jd} .${Jd} { - margin-right: 0 ${r}; - } - - body[${Tf}] { - ${Xd}: ${s}px; - } -`},Df=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Of=function(){L.useEffect(function(){return document.body.setAttribute(Tf,(Df()+1).toString()),function(){var e=Df()-1;e<=0?document.body.removeAttribute(Tf):document.body.setAttribute(Tf,e.toString())}},[])},kf=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Of();var a=L.useMemo(function(){return Cf(i)},[i]);return L.createElement(wf,{styles:Ef(a,!t,i,n?``:`!important`)})},Af=!1;if(typeof window<`u`)try{var jf=Object.defineProperty({},"passive",{get:function(){return Af=!0,!0}});window.addEventListener(`test`,jf,jf),window.removeEventListener(`test`,jf,jf)}catch{Af=!1}var Mf=Af?{passive:!1}:!1,Nf=function(e){return e.tagName===`TEXTAREA`},Pf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Nf(e)&&n[t]===`visible`)},Ff=function(e){return Pf(e,`overflowY`)},If=function(e){return Pf(e,`overflowX`)},Lf=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Bf(e,r)){var i=Vf(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Rf=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},zf=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Bf=function(e,t){return e===`v`?Ff(t):If(t)},Vf=function(e,t){return e===`v`?Rf(t):zf(t)},Hf=function(e,t){return e===`h`&&t===`rtl`?-1:1},Uf=function(e,t,n,r,i){var a=Hf(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Vf(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Bf(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Wf=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gf=function(e){return[e.deltaX,e.deltaY]},Kf=function(e){return e&&`current`in e?e.current:e},qf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jf=function(e){return` - .block-interactivity-${e} {pointer-events: none;} - .allow-interactivity-${e} {pointer-events: all;} -`},Yf=0,Xf=[];function Zf(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),i=L.useState(Yf++)[0],a=L.useState(yf)[0],o=L.useRef(e);L.useEffect(function(){o.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Kd([e.lockRef.current],(e.shards||[]).map(Kf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=L.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Wf(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Lf(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Lf(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Uf(h,t,e,h===`h`?s:c,!0)},[]),c=L.useCallback(function(e){var n=e;if(Xf.length&&Xf[Xf.length-1]===a){var r=`deltaY`in n?Gf(n):Wf(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&qf(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Kf).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=L.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Qf(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=L.useCallback(function(e){n.current=Wf(e),r.current=void 0},[]),d=L.useCallback(function(t){l(t.type,Gf(t),t.target,s(t,e.lockRef.current))},[]),f=L.useCallback(function(t){l(t.type,Wf(t),t.target,s(t,e.lockRef.current))},[]);L.useEffect(function(){return Xf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Mf),document.addEventListener(`touchmove`,c,Mf),document.addEventListener(`touchstart`,u,Mf),function(){Xf=Xf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Mf),document.removeEventListener(`touchmove`,c,Mf),document.removeEventListener(`touchstart`,u,Mf)}},[]);var p=e.removeScrollBar,m=e.inert;return L.createElement(L.Fragment,null,m?L.createElement(a,{styles:Jf(i)}):null,p?L.createElement(kf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var $f=lf(uf,Zf),ep=L.forwardRef(function(e,t){return L.createElement(ff,Wd({},e,{ref:t,sideCar:$f}))});ep.classNames=ff.classNames;function tp({keepMounted:e,keepMountedMode:t=`activity`,opened:n,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:s,trapFocus:c,closeOnEscape:l,returnFocus:u,closeOnClickOutside:d,withinPortal:f,portalProps:p,lockScroll:m,children:h,zIndex:g,shadow:_,padding:v,__vars:y,unstyled:b,removeScrollProps:x,...S}){let{_id:C,titleMounted:w,bodyMounted:E,shouldLockScroll:D,setTitleMounted:O,setBodyMounted:k}=Ud({id:i,transitionProps:a,opened:n,trapFocus:c,closeOnEscape:l,onClose:r,returnFocus:u}),{key:A,...ee}=x||{};return(0,R.jsx)(pd,{...p,withinPortal:f,children:(0,R.jsx)(Bd,{value:{opened:n,onClose:r,closeOnClickOutside:d,onExitTransitionEnd:o,onEnterTransitionEnd:s,transitionProps:{...a,keepMounted:e,keepMountedMode:t},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:E,setTitleMounted:O,setBodyMounted:k,trapFocus:c,closeOnEscape:l,zIndex:g,unstyled:b},children:(0,R.jsx)(ep,{enabled:D&&m,...ee,children:(0,R.jsx)(we,{...S,id:C,__vars:{...y,"--mb-z-index":(g||xa(`modal`)).toString(),"--mb-shadow":T(_),"--mb-padding":ve(v)},children:h})},A)})})}tp.displayName=`@mantine/core/ModalBase`;function np(){let e=Vd();return(0,L.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var rp={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function ip({className:e,...t}){let n=np(),r=Vd();return(0,R.jsx)(we,{id:n,className:c({[rp.body]:!r.unstyled},e),...t})}ip.displayName=`@mantine/core/ModalBaseBody`;function ap({className:e,onClick:t,...n}){let r=Vd();return(0,R.jsx)(M,{...n,onClick:e=>{r.onClose(),t?.(e)},className:c({[rp.close]:!r.unstyled},e),unstyled:r.unstyled})}ap.displayName=`@mantine/core/ModalBaseCloseButton`;function op({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,ref:a,...o}){let s=Vd();return(0,R.jsx)(Se,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,R.jsx)(`div`,{...n,className:c({[rp.inner]:!s.unstyled},n.className),children:(0,R.jsx)(bd,{active:s.opened&&s.trapFocus,innerRef:a,children:(0,R.jsx)(Ee,{...o,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":s.bodyMounted?s.getBodyId():void 0,"aria-labelledby":s.titleMounted?s.getTitleId():void 0,style:[i,e],className:c({[rp.content]:!s.unstyled},t),unstyled:s.unstyled,children:o.children})})})})}op.displayName=`@mantine/core/ModalBaseContent`;function sp({className:e,...t}){let n=Vd();return(0,R.jsx)(we,{component:`header`,className:c({[rp.header]:!n.unstyled},e),...t})}sp.displayName=`@mantine/core/ModalBaseHeader`;var cp={duration:200,timingFunction:`ease`,transition:`fade`};function lp(e){let t=Vd();return{...cp,...t.transitionProps,...e}}function up({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=Vd(),o=lp(t);return(0,R.jsx)(Se,{mounted:r===void 0?a.opened:r,...o,transition:`fade`,children:t=>(0,R.jsx)(cd,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}up.displayName=`@mantine/core/ModalBaseOverlay`;function dp(){let e=Vd();return(0,L.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function fp({className:e,...t}){let n=dp(),r=Vd();return(0,R.jsx)(we,{component:`h2`,className:c({[rp.title]:!r.unstyled},e),id:n,...t})}fp.displayName=`@mantine/core/ModalBaseTitle`;function pp({children:e}){return(0,R.jsx)(R.Fragment,{children:e})}function mp({style:e,size:t=16,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:I(t),height:I(t),display:`block`},...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}mp.displayName=`@mantine/core/AccordionChevron`;var[hp,gp]=ma(`AppShell was not found in tree`),_p={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},vp=r(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:l,mod:u,...d}=P(`AppShellAside`,null,e),f=gp();return f.disabled?null:(0,R.jsx)(we,{component:`aside`,mod:[{"with-border":s??f.withBorder},u],...f.getStyles(`aside`,{className:c({[ep.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-aside-z-index":`calc(${l??f.zIndex} + 1)`}})});vp.classes=_p,vp.displayName=`@mantine/core/AppShellAside`;var yp=r(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:l,mod:u,...d}=P(`AppShellFooter`,null,e),f=gp();return f.disabled?null:(0,R.jsx)(we,{component:`footer`,mod:[{"with-border":s??f.withBorder},u],...f.getStyles(`footer`,{className:c({[ep.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-footer-z-index":(l??f.zIndex)?.toString()}})});yp.classes=_p,yp.displayName=`@mantine/core/AppShellFooter`;var bp=r(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:l,mod:u,...d}=P(`AppShellHeader`,null,e),f=gp();return f.disabled?null:(0,R.jsx)(we,{component:`header`,mod:[{"with-border":s??f.withBorder},u],...f.getStyles(`header`,{className:c({[ep.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r}),...d,__vars:{"--app-shell-header-z-index":(l??f.zIndex)?.toString()}})});bp.classes=_p,bp.displayName=`@mantine/core/AppShellHeader`;var xp=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`AppShellMain`,null,e);return(0,R.jsx)(we,{component:`main`,...gp().getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});xp.classes=_p,xp.displayName=`@mantine/core/AppShellMain`;var Sp=r(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=P(`AppShellNavbar`,null,e),d=gp();return d.disabled?null:(0,R.jsx)(we,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}})});Sp.classes=_p,Sp.displayName=`@mantine/core/AppShellNavbar`;var Cp=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=P(`AppShellSection`,null,e),l=gp();return(0,R.jsx)(we,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});Cp.classes=_p,Cp.displayName=`@mantine/core/AppShellSection`;function wp(e){return typeof e==`object`?e.base:e}function Tp(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function Ep(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Dp({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`)),Tp(o)){let t=I(wp(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(Ep(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=I(o.base),e[`--app-shell-aside-offset`]=I(o.base)),j(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=I(o[e]),t[e][`--app-shell-aside-offset`]=I(o[e]))})),r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}if(r?.collapsed?.mobile){let e=Ta(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function Op({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),Tp(i)){let t=I(wp(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}Ep(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=I(i.base),a&&(e[`--app-shell-footer-offset`]=I(i.base))),j(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=I(i[e]),a&&(t[e][`--app-shell-footer-offset`]=I(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function kp({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),Tp(i)){let t=I(wp(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}Ep(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=I(i.base),a&&(e[`--app-shell-header-offset`]=I(i.base))),j(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=I(i[e]),a&&(t[e][`--app-shell-header-offset`]=I(i[e])))})),n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`))}function Ap({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`)),Tp(o)){let t=I(wp(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(Ep(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=I(o.base),e[`--app-shell-navbar-offset`]=I(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=I(o.base))),j(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=I(o[e]),t[e][`--app-shell-navbar-offset`]=I(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=I(o[e])))})),r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`)}if(r?.collapsed?.mobile){let e=Ta(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function jp(e){return Number(e)===0?`0px`:ve(e)}function Mp({padding:e,baseStyles:t,minMediaStyles:n}){Tp(e)&&(t[`--app-shell-padding`]=jp(wp(e))),Ep(e)&&(e.base&&(t[`--app-shell-padding`]=jp(e.base)),j(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=jp(e[t]))}))}function Np({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),Ap({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),Dp({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),kp({baseStyles:l,minMediaStyles:s,header:t,mode:o}),Op({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),Mp({baseStyles:l,minMediaStyles:s,padding:i});let u=Ea(j(s),a.breakpoints).map(e=>({query:`(min-width: ${se(e.px)})`,styles:s[e.value]})),d=Ea(j(c),a.breakpoints).map(e=>({query:`(max-width: ${se(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function Pp({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let c=f(),l=s(),{media:u,baseStyles:d}=Np({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a});return(0,R.jsx)(p,{media:u,styles:d,selector:o||l.cssVariablesSelector})}function Fp({transitionDuration:e,disabled:t}){let[n,r]=(0,L.useState)(!0),i=(0,L.useRef)(-1),a=(0,L.useRef)(-1);return Ga(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,L.startTransition)(()=>{r(!1)}),200)}),be(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,L.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var Ip={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:xa(`app`),mode:`fixed`},Lp=x((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),Rp=r(t=>{let n=P(`AppShell`,Ip,t),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,navbar:l,withBorder:u,padding:d,transitionDuration:f,transitionTimingFunction:p,header:m,zIndex:h,layout:g,disabled:_,aside:v,footer:y,offsetScrollbars:b=!0,mode:x,mod:S,attributes:C,id:w,...T}=n,E=ae({name:`AppShell`,classes:_p,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:C,vars:c,varsResolver:Lp}),D=Fp({disabled:_,transitionDuration:f}),O=e(w);return(0,R.jsxs)(hp,{value:{getStyles:E,withBorder:u,zIndex:h,disabled:_,offsetScrollbars:b,mode:x},children:[(0,R.jsx)(Pp,{navbar:l,header:m,aside:v,footer:y,padding:d,mode:x,selector:x===`static`?`#${O}`:void 0}),(0,R.jsx)(we,{...E(`root`),id:O,mod:[{resizing:D,layout:g,disabled:_,mode:x},S],...T})]})});Rp.classes=_p,Rp.varsResolver=Lp,Rp.displayName=`@mantine/core/AppShell`,Rp.Navbar=Sp,Rp.Header=bp,Rp.Main=xp,Rp.Aside=vp,Rp.Footer=yp,Rp.Section=Cp;function zp({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:I(e),height:I(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Bp={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},Vp=(0,L.createContext)({withinGroup:!1}),Hp=x((e,{spacing:t})=>({group:{"--ag-spacing":ve(t)}})),Up=r(e=>{let t=P(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=ae({name:`AvatarGroup`,classes:Bp,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:Hp,rootSelector:`group`});return(0,R.jsx)(Vp,{value:{withinGroup:!0},children:(0,R.jsx)(we,{...d(`group`),...u})})});Up.classes=Bp,Up.varsResolver=Hp,Up.displayName=`@mantine/core/AvatarGroup`;function Wp(e){return(0,R.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function Gp(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var Yp=x((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?qp(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":fe(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:ie(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),Xp=g(e=>{let t=P(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:_,allowedInitialsColors:v,attributes:y,...b}=t,x=(0,L.use)(Vp),[S,C]=(0,L.useState)(!c),w=ae({name:`Avatar`,props:t,classes:Bp,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:Yp});return(0,L.useEffect)(()=>C(!c),[c]),(0,R.jsx)(we,{...w(`root`),mod:[{"within-group":x.withinGroup},g],...b,children:S||!c?(0,R.jsx)(`span`,{...w(`placeholder`),title:l,children:m||typeof _==`string`&&Jp(_)||(0,R.jsx)(Wp,{})}):(0,R.jsx)(`img`,{...p,...w(`image`),src:c,alt:l,onError:e=>{C(!0),p?.onError?.(e)}})})});Xp.classes=Bp,Xp.varsResolver=Yp,Xp.displayName=`@mantine/core/Avatar`,Xp.Group=Up;var Zp={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},Qp=x((e,{radius:t,color:n,gradient:r,variant:i,size:o,autoContrast:s,circle:c})=>{let l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--badge-height":fe(o,`badge-height`),"--badge-padding-x":fe(o,`badge-padding-x`),"--badge-fz":fe(o,`badge-fz`),"--badge-radius":c||t===void 0?void 0:ie(t),"--badge-bg":n||i?l.background:void 0,"--badge-color":n||i?l.color:void 0,"--badge-bd":n||i?l.border:void 0,"--badge-dot-color":i===`dot`?a(n,e):void 0}}}),$p=g(e=>{let t=P(`Badge`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,radius:c,color:l,gradient:u,leftSection:d,rightSection:f,children:p,variant:m,fullWidth:h,autoContrast:g,circle:_,mod:v,attributes:y,...b}=t,x=ae({name:`Badge`,props:t,classes:Zp,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:Qp});return(0,R.jsxs)(we,{variant:m,mod:[{block:h,circle:_,"with-right-section":!!f,"with-left-section":!!d},v],...x(`root`,{variant:m}),...b,children:[d&&(0,R.jsx)(`span`,{...x(`section`),"data-position":`left`,children:d}),(0,R.jsx)(`span`,{...x(`label`),children:p}),f&&(0,R.jsx)(`span`,{...x(`section`),"data-position":`right`,children:f})]})});$p.classes=Zp,$p.varsResolver=Qp,$p.displayName=`@mantine/core/Badge`;var em={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},tm=x((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:o})=>({root:{"--burger-color":t?a(t,e):void 0,"--burger-size":fe(n,`burger-size`),"--burger-line-size":r?I(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":o}})),nm=r(e=>{let t=P(`Burger`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,opened:c,children:l,transitionDuration:u,transitionTimingFunction:d,lineSize:f,attributes:p,...m}=t,h=ae({name:`Burger`,classes:em,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:tm});return(0,R.jsxs)(E,{...h(`root`),...m,children:[(0,R.jsx)(we,{mod:[`reduce-motion`,{opened:c}],...h(`burger`)}),l]})});nm.classes=em,nm.varsResolver=tm,nm.displayName=`@mantine/core/Burger`;var rm={root:`m_b183c0a2`},im=x((e,{color:t})=>({root:{"--code-bg":t?a(t,e):void 0}})),am=r(e=>{let t=P(`Code`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:c,block:l,mod:u,attributes:d,...f}=t,p=ae({name:`Code`,props:t,classes:rm,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:im});return(0,R.jsx)(we,{component:l?`pre`:`code`,mod:[{block:l},u],...p(`root`),...f,dir:`ltr`})});am.classes=rm,am.varsResolver=im,am.displayName=`@mantine/core/Code`;var[om,sm]=ma(`Drawer component was not found in tree`),cm={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},lm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`DrawerBody`,null,e);return(0,R.jsx)(ip,{...sm().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});lm.classes=cm,lm.displayName=`@mantine/core/DrawerBody`;var um=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`DrawerCloseButton`,null,e);return(0,R.jsx)(ap,{...sm().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});um.classes=cm,um.displayName=`@mantine/core/DrawerCloseButton`;var dm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,radius:s,__hidden:c,...l}=P(`DrawerContent`,null,e),u=sm(),d=u.scrollAreaComponent||pp;return(0,R.jsx)(op,{...u.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:u.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...l,radius:s||u.radius||0,"data-hidden":c||void 0,children:(0,R.jsx)(d,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:o})})});dm.classes=cm,dm.displayName=`@mantine/core/DrawerContent`;var fm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`DrawerHeader`,null,e);return(0,R.jsx)(sp,{...sm().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});fm.classes=cm,fm.displayName=`@mantine/core/DrawerHeader`;var pm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`DrawerOverlay`,null,e);return(0,R.jsx)(up,{...sm().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});pm.classes=cm,pm.displayName=`@mantine/core/DrawerOverlay`;function mm(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function hm(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var gm={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},_m={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},vm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:xa(`modal`),position:`left`},ym=x((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":fe(n,`drawer-size`),"--drawer-flex":hm(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":mm(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":I(r)}})),bm=r(e=>{let t=P(`DrawerRoot`,vm,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,scrollAreaComponent:c,position:l,transitionProps:u,radius:d,attributes:f,...p}=t,{dir:m}=ko(),h=ae({name:`Drawer`,classes:cm,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:ym}),g=(m===`rtl`?_m:gm)[l];return(0,R.jsx)(om,{value:{scrollAreaComponent:c,getStyles:h,radius:d},children:(0,R.jsx)(tp,{...h(`root`),transitionProps:{transition:g,...u},"data-offset-scrollbars":c===Ku.Autosize||void 0,unstyled:o,...p})})});bm.classes=cm,bm.varsResolver=ym,bm.displayName=`@mantine/core/DrawerRoot`;var xm=(0,L.createContext)(null);function Sm({children:e}){let[t,n]=(0,L.useState)([]),[r,i]=(0,L.useState)(xa(`modal`));return(0,R.jsx)(xm,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}Sm.displayName=`@mantine/core/DrawerStack`;var Cm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`DrawerTitle`,null,e);return(0,R.jsx)(fp,{...sm().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Cm.classes=cm,Cm.displayName=`@mantine/core/DrawerTitle`;var wm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:xa(`modal`),withOverlay:!0,withCloseButton:!0},Tm=r(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,opened:s,stackId:c,zIndex:l,...u}=P(`Drawer`,wm,e),d=(0,L.use)(xm),f=!!t||i,p=d&&c?{closeOnEscape:d.currentId===c,trapFocus:d.currentId===c,zIndex:d.getZIndex(c)}:{},m=n===!1?!1:c&&d?d.currentId===c:s;return(0,L.useEffect)(()=>{d&&c&&(s?d.addModal(c,l||xa(`modal`)):d.removeModal(c))},[s,c,l]),(0,R.jsxs)(bm,{opened:s,zIndex:d&&c?d.getZIndex(c):l,...u,...p,children:[n&&(0,R.jsx)(pm,{visible:m,transitionProps:d&&c?{duration:0}:void 0,...r}),(0,R.jsxs)(dm,{__hidden:d&&c&&s?c!==d.currentId:!1,children:[f&&(0,R.jsxs)(fm,{children:[t&&(0,R.jsx)(Cm,{children:t}),i&&(0,R.jsx)(um,{...a})]}),(0,R.jsx)(lm,{children:o})]})]})});Tm.classes=cm,Tm.displayName=`@mantine/core/Drawer`,Tm.Root=bm,Tm.Overlay=pm,Tm.Content=dm,Tm.Body=lm,Tm.Header=fm,Tm.Title=Cm,Tm.CloseButton=um,Tm.Stack=Sm;var Em={root:`m_dc6f14e2`},Dm=x((e,{size:t})=>({root:{"--kbd-fz":fe(t,`kbd-fz`)}})),Om=r(e=>{let t=P(`Kbd`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,R.jsx)(we,{component:`kbd`,...ae({name:`Kbd`,classes:Em,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c,vars:s,varsResolver:Dm})(`root`),...l})});Om.classes=Em,Om.varsResolver=Dm,Om.displayName=`@mantine/core/Kbd`;var[km,Am]=ma(`Menu component was not found in the tree`),jm=(0,L.createContext)(null);function Mm(e){let{value:t,defaultValue:n,onChange:r,children:i}=P(`MenuCheckboxGroup`,null,e),[a,o]=Ka({value:t,defaultValue:n,finalValue:[],onChange:r});return(0,R.jsx)(jm,{value:{values:a,onChange:(0,L.useCallback)(e=>{o(a.includes(e)?a.filter(t=>t!==e):[...a,e])},[a,o])},children:i})}Mm.displayName=`@mantine/core/MenuCheckboxGroup`;var Nm=(0,L.createContext)(null);function Pm({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:o,children:s,disabled:c,dataDisabled:u,className:d,style:p,styles:m,classNames:g,buttonRef:_,others:v}){let y=Am(),b=(0,L.use)(Nm),x=f(),{dir:S}=ko(),C=(0,L.useRef)(null),w=wa(v.onClick,()=>{u||(r(),a&&y.closeDropdownImmediately())}),T=wa(v.onMouseMove,()=>{if(!y.hasSearch)return;let e=C.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==C.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=wa(v.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())}),O=i?x.variantColorResolver({color:i,theme:x,variant:`light`}):void 0,k=i?l({color:i,theme:x}):null,A=y.alignItemsLabels!==`none`||t;return(0,R.jsxs)(E,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:d,style:p,styles:m,classNames:g}),ref:h(C,_),role:e,"aria-checked":t,disabled:c,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":c||u||void 0,"data-mantine-stop-propagation":!0,onClick:w,onMouseMove:T,onKeyDown:ya({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:S,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,R.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:m,classNames:g}),"data-checked":t||void 0,children:t?n:null}),s&&(0,R.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:m,classNames:g}),"data-menu-item-label":!0,children:s}),o&&(0,R.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:m,classNames:g}),"data-position":`right`,children:o})]})}var Fm={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},Im=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,defaultChecked:m,onChange:h,checkIcon:g,ref:_,...v}=P(`MenuCheckboxItem`,null,e),y=Am(),b=(0,L.use)(jm),x=b&&f!==void 0?b.values.includes(f):void 0,[S,C]=Ka({value:p??x,defaultValue:m,finalValue:!1,onChange:h});return(0,R.jsx)(Pm,{role:`menuitemcheckbox`,checked:S,indicator:g??y.checkIcon??(0,R.jsx)(zp,{size:10}),onSelect:()=>{h?C(!S):b&&f!==void 0?b.onChange(f):C(!S)},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:l})});Im.classes=Fm,Im.displayName=`@mantine/core/MenuCheckboxItem`;function Lm(e){let{children:t,disabled:n,longPressDelay:r}=P(`MenuContextMenu`,null,e),i=to(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=Am(),o=_d();return(0,L.cloneElement)(i,vd({childProps:i.props,disabled:n||o.disabled,opened:a.opened,longPressDelay:r,setReference:o.reference,open:()=>a.openDropdown()}))}Lm.displayName=`@mantine/core/MenuContextMenu`;var Rm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`MenuDivider`,null,e);return(0,R.jsx)(we,{...Am().getStyles(`divider`,{className:n,style:r,styles:i,classNames:t}),...o})});Rm.classes=Fm,Rm.displayName=`@mantine/core/MenuDivider`;var zm=500;function Bm(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function Vm(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function Hm({enabled:e,opened:t,getDropdown:n}){let r=(0,L.useRef)({buffer:``,timeoutId:null});return(0,L.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,L.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},zm);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||Vm(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onKeyDown:c,children:l,ref:u,...d}=P(`MenuDropdown`,null,e),f=(0,L.useRef)(null),p=Am(),m=Hm({enabled:!p.hasSearch,opened:p.opened,getDropdown:()=>f.current}),g=wa(c,e=>{m(e),!(e.defaultPrevented||p.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),_=wa(o,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),v=wa(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,R.jsxs)(jd.Dropdown,{...d,onMouseEnter:_,onMouseLeave:v,role:`menu`,"aria-orientation":`vertical`,ref:h(u,f),...p.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:g,children:[p.withInitialFocusPlaceholder&&!p.hasSearch&&(0,R.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),l]})});Um.classes=Fm,Um.displayName=`@mantine/core/MenuDropdown`;var Wm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,leftSection:c,rightSection:u,children:d,disabled:p,"data-disabled":m,ref:g,..._}=P(`MenuItem`,null,e),v=Am(),y=(0,L.use)(Nm),b=f(),{dir:x}=ko(),S=(0,L.useRef)(null),C=_,w=wa(C.onClick,()=>{m||(typeof s==`boolean`?s&&v.closeDropdownImmediately():v.closeOnItemClick&&v.closeDropdownImmediately())}),T=wa(C.onMouseMove,()=>{if(!v.hasSearch)return;let e=S.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==S.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=o?b.variantColorResolver({color:o,theme:b,variant:`light`}):void 0,O=o?l({color:o,theme:b}):null,k=wa(C.onKeyDown,e=>{e.key===`ArrowLeft`&&y&&(y.close(),y.focusParentItem())});return(0,R.jsxs)(E,{onMouseDown:e=>e.preventDefault(),..._,unstyled:v.unstyled,tabIndex:v.menuItemTabIndex,...v.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(S,g),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:w,onMouseMove:T,onKeyDown:ya({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:v.loop,dir:x,orientation:`vertical`,onKeyDown:k}),__vars:{"--menu-item-color":O?.isThemeColor&&O?.shade===void 0?`var(--mantine-color-${O.color}-6)`:D?.color,"--menu-item-hover":D?.hover},children:[v.alignItemsLabels===`all`&&(0,R.jsx)(`div`,{...v.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),c&&(0,R.jsx)(`div`,{...v.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:c}),d&&(0,R.jsx)(`div`,{...v.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:d}),u&&(0,R.jsx)(`div`,{...v.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:u})]})});Wm.classes=Fm,Wm.displayName=`@mantine/core/MenuItem`;var Gm=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`MenuLabel`,null,e);return(0,R.jsx)(we,{...Am().getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...o})});Gm.classes=Fm,Gm.displayName=`@mantine/core/MenuLabel`;var Km=(0,L.createContext)(null);function qm(e){let{value:t,defaultValue:n,onChange:r,children:i}=P(`MenuRadioGroup`,null,e),[a,o]=Ka({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,R.jsx)(Km,{value:{value:a,onChange:e=>o(e)},children:i})}qm.displayName=`@mantine/core/MenuRadioGroup`;function Jm({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:I(e),height:I(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Ym=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,onChange:m,checkIcon:h,ref:g,..._}=P(`MenuRadioItem`,null,e),v=Am(),y=(0,L.use)(Km),b=p??(y?y.value===f:!1);return(0,R.jsx)(Pm,{role:`menuitemradio`,checked:b,indicator:h??v.checkIcon??(0,R.jsx)(Jm,{size:5}),onSelect:()=>{b||(m?m(f):y&&y.onChange(f))},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:g,others:_,children:l})});Ym.classes=Fm,Ym.displayName=`@mantine/core/MenuRadioItem`;var Xm=`[data-menu-item]:not([data-disabled])`,Zm=`[data-menu-active]`;function Qm(e){return e?.closest(`[data-menu-dropdown]`)}function $m(e){return e?Array.from(e.querySelectorAll(Xm)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function eh(e){e&&e.querySelectorAll(Zm).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function th(e,t){eh(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function nh(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var rh={clearSearchOnClose:!0},ih=r(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:a,clearSearchOnClose:o,ref:s,...c}=P(`MenuSearch`,rh,e),l=Am(),u=(0,L.useRef)(null),d=h(s,u),f=(0,L.useRef)(i);f.current=i,(0,L.useEffect)(()=>l.registerSearch(),[l.registerSearch]),(0,L.useEffect)(()=>{o?l.searchExitClearRef.current=()=>{f.current?.({currentTarget:{value:``}})}:l.searchExitClearRef.current=null},[o,l.searchExitClearRef]),(0,L.useEffect)(()=>{l.opened||eh(Qm(u.current))},[l.opened]);let p=wa(i,e=>{eh(Qm(e.currentTarget))}),m=wa(r,e=>{if(e.defaultPrevented)return;let t=Qm(e.currentTarget),n=$m(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=nh(n);th(n[r>=n.length-1?l.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=nh(n);th(n[r<=0?r===-1||l.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&th(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&th(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[nh(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),g=l.getStyles(`search`);return(0,R.jsx)(ce,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:a,...c,ref:d,classNames:[{input:g.className},t],styles:[{input:g.style},n],onKeyDown:m,onChange:p,__staticSelector:`Menu`})});ih.classes=Fm,ih.displayName=`@mantine/core/MenuSearch`;var ah=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l,onKeyDown:u,children:d,ref:f,...p}=P(`MenuSubDropdown`,null,e),m=(0,L.useRef)(null),g=Am(),_=(0,L.use)(Nm),v=Hm({enabled:!g.hasSearch,opened:_?.opened??!1,getDropdown:()=>m.current}),y=wa(u,e=>{v(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),b=_?.getFloatingProps({onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l});return(0,R.jsx)(jd.Dropdown,{...p,...b,role:`menu`,"aria-orientation":`vertical`,ref:h(f,m,_?.setFloating),...g.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:y,children:d})});ah.classes=Fm,ah.displayName=`@mantine/core/MenuSubDropdown`;var oh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,leftSection:s,rightSection:c,children:u,disabled:d,"data-disabled":p,closeMenuOnClick:m,ref:g,..._}=P(`MenuSubItem`,null,e),v=Am(),y=(0,L.use)(Nm),b=f(),{dir:x}=ko(),S=(0,L.useRef)(null),C=_,w=o?b.variantColorResolver({color:o,theme:b,variant:`light`}):void 0,T=o?l({color:o,theme:b}):null,D=wa(C.onKeyDown,e=>{e.key===`ArrowRight`&&(y?.open(),y?.focusFirstItem()),e.key===`ArrowLeft`&&y?.parentContext&&(y.parentContext.close(),y.parentContext.focusParentItem())}),O=wa(C.onClick,()=>{!p&&m&&v.closeDropdownImmediately()}),k=wa(C.onMouseMove,()=>{if(!v.hasSearch)return;let e=S.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==S.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),A=y?.getReferenceProps({onMouseEnter:C.onMouseEnter,onMouseLeave:C.onMouseLeave,onPointerEnter:C.onPointerEnter,onPointerLeave:C.onPointerLeave});return(0,R.jsxs)(E,{onMouseDown:e=>e.preventDefault(),..._,...A,unstyled:v.unstyled,tabIndex:v.menuItemTabIndex,...v.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:h(S,g,y?.setReference),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||p||void 0,"data-mantine-stop-propagation":!0,onClick:O,onMouseMove:k,onKeyDown:ya({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:v.loop,dir:x,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":T?.isThemeColor&&T?.shade===void 0?`var(--mantine-color-${T.color}-6)`:w?.color,"--menu-item-hover":w?.hover},children:[v.alignItemsLabels===`all`&&(0,R.jsx)(`div`,{...v.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),s&&(0,R.jsx)(`div`,{...v.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:s}),u&&(0,R.jsx)(`div`,{...v.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:u}),(0,R.jsx)(`div`,{...v.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:c||(0,R.jsx)(mp,{...v.getStyles(`chevron`),size:14})})]})});oh.classes=Fm,oh.displayName=`@mantine/core/MenuSubItem`;function sh({children:e,refProp:t}){if(!pa(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Am(),(0,R.jsx)(jd.Target,{refProp:t,popupType:`menu`,children:e})}sh.displayName=`@mantine/core/MenuSubTarget`;var ch={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function lh(t){let{children:n,closeDelay:r,openDelay:i,position:a,safeAreaPolygon:o,opened:s,onChange:c,...l}=P(`MenuSub`,ch,t),u=e(),[d,f]=Ka({value:s,finalValue:!1,onChange:c}),p=(0,L.use)(Nm),m=Am(),{dir:h}=ko(),g=rd(h,a),_=p?.registerOpenSub??m.registerOpenSub,v=(0,L.useRef)(null),y=(0,L.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,L.useRef)(f);b.current=f;let x=(0,L.useCallback)(()=>b.current(!0),[]),S=(0,L.useCallback)(()=>b.current(!1),[]);(0,L.useEffect)(()=>{if(d)return _(S)},[d,_,S]);let{context:C,refs:w}=Nu({placement:g,open:d,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:T,getFloatingProps:E}=Lu([bu(C,{handleClose:o?Uu(typeof o==`object`?o:void 0):void 0,delay:{open:i,close:r}})]);return(0,R.jsx)(Nm,{value:{opened:d,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:T,getFloatingProps:E,registerOpenSub:y},children:(0,R.jsx)(jd,{opened:d,onChange:e=>e?x():S(),withinPortal:!1,withArrow:!1,id:u,position:a,...l,children:n})})}lh.extend=e=>e,lh.displayName=`@mantine/core/MenuSub`,lh.Target=sh,lh.Dropdown=ah,lh.Item=oh;var uh={refProp:`ref`};function dh(e){let{children:t,refProp:n,...r}=P(`MenuTarget`,uh,e),i=to(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=Am(),o=i.props,s=wa(o.onClick,()=>{a.trigger===`click`?a.toggleDropdown():a.trigger===`click-hover`&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=wa(o.onMouseEnter,()=>(a.trigger===`hover`||a.trigger===`click-hover`)&&a.openDropdown()),l=wa(o.onMouseLeave,()=>{(a.trigger===`hover`||a.trigger===`click-hover`&&!a.openedViaClick)&&a.closeDropdown()});return(0,R.jsx)(jd.Target,{refProp:n,popupType:`menu`,...r,children:(0,L.cloneElement)(i,{onClick:s,onMouseEnter:c,onMouseLeave:l,"data-expanded":a.opened?!0:void 0})})}dh.displayName=`@mantine/core/MenuTarget`;var fh={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},ph=r(e=>{let n=P(`Menu`,fh,e),{children:r,onOpen:i,onClose:a,opened:o,defaultOpened:s,trapFocus:c,onChange:l,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:p,openDelay:m,closeDelay:h,classNames:g,styles:_,unstyled:v,variant:y,vars:b,menuItemTabIndex:x,keepMounted:S,withInitialFocusPlaceholder:C,attributes:w,onExitTransitionEnd:T,alignItemsLabels:E,checkIcon:D,...O}=n,k=ae({name:`Menu`,classes:Fm,props:n,classNames:g,styles:_,unstyled:v,attributes:w}),[A,ee]=Ka({value:o,defaultValue:s,finalValue:!1,onChange:l}),[j,M]=(0,L.useState)(!1),N=()=>{ee(!1),M(!1),A&&a?.()},te=()=>{ee(!0),!A&&i?.()},ne=()=>{A?N():te()},{openDropdown:re,closeDropdown:ie}=id({open:te,close:N,closeDelay:h,openDelay:m}),oe=(0,L.useRef)(null),se=(0,L.useCallback)(e=>{let t=oe.current;return t&&t!==e&&t(),oe.current=e,()=>{oe.current===e&&(oe.current=null)}},[]),ce=(0,L.useRef)(0),[le,ue]=(0,L.useState)(!1),de=(0,L.useCallback)(()=>(ce.current+=1,ce.current===1&&ue(!0),()=>{--ce.current,ce.current===0&&ue(!1)}),[]),fe=(0,L.useRef)(null),pe=()=>{fe.current?.(),T?.()},me=e=>Da(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:he,resolvedStyles:ge}=t({classNames:g,styles:_,props:n});return(0,R.jsx)(km,{value:{getStyles:k,opened:A,toggleDropdown:ne,getItemIndex:me,openedViaClick:j,setOpenedViaClick:M,closeOnItemClick:u,closeDropdown:p===`click`?N:ie,openDropdown:p===`click`?te:re,closeDropdownImmediately:N,loop:d,trigger:p,unstyled:v,menuItemTabIndex:x,withInitialFocusPlaceholder:C,registerOpenSub:se,hasSearch:le,registerSearch:de,searchExitClearRef:fe,alignItemsLabels:E,checkIcon:D},children:(0,R.jsx)(jd,{returnFocus:!0,...O,opened:A,onChange:ne,defaultOpened:s,trapFocus:!S&&c,closeOnEscape:f,__staticSelector:`Menu`,classNames:he,styles:ge,unstyled:v,variant:y,keepMounted:S,onExitTransitionEnd:pe,children:r})})});ph.displayName=`@mantine/core/Menu`,ph.classes=Fm,ph.Item=Wm,ph.Label=Gm,ph.Dropdown=Um,ph.Target=dh,ph.Divider=Rm,ph.Search=ih,ph.Sub=lh,ph.CheckboxItem=Im,ph.CheckboxGroup=Mm,ph.RadioItem=Ym,ph.RadioGroup=qm,ph.ContextMenu=Lm;var[mh,hh]=ma(`Modal component was not found in tree`),gh={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},_h=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`ModalBody`,null,e);return(0,R.jsx)(ip,{...hh().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});_h.classes=gh,_h.displayName=`@mantine/core/ModalBody`;var vh=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`ModalCloseButton`,null,e);return(0,R.jsx)(ap,{...hh().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});vh.classes=gh,vh.displayName=`@mantine/core/ModalCloseButton`;var yh=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,__hidden:s,...c}=P(`ModalContent`,null,e),l=hh(),u=l.scrollAreaComponent||pp;return(0,R.jsx)(op,{...l.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:l.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),"data-full-screen":l.fullScreen||void 0,"data-modal-content":!0,"data-hidden":s||void 0,...c,children:(0,R.jsx)(u,{style:{maxHeight:l.fullScreen?`100dvh`:`calc(100dvh - (${I(l.yOffset)} * 2))`},children:o})})});yh.classes=gh,yh.displayName=`@mantine/core/ModalContent`;var bh=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`ModalHeader`,null,e);return(0,R.jsx)(sp,{...hh().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});bh.classes=gh,bh.displayName=`@mantine/core/ModalHeader`;var xh=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`ModalOverlay`,null,e);return(0,R.jsx)(up,{...hh().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});xh.classes=gh,xh.displayName=`@mantine/core/ModalOverlay`;var Sh={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:xa(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},Ch=x((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:ie(t),"--modal-size":fe(n,`modal-size`),"--modal-y-offset":I(r),"--modal-x-offset":I(i)}})),wh=r(e=>{let t=P(`ModalRoot`,Sh,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,yOffset:c,scrollAreaComponent:l,radius:u,fullScreen:d,centered:f,xOffset:p,__staticSelector:m,attributes:h,...g}=t,_=ae({name:m,classes:gh,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Ch});return(0,R.jsx)(mh,{value:{yOffset:c,scrollAreaComponent:l,getStyles:_,fullScreen:d},children:(0,R.jsx)(tp,{..._(`root`),"data-full-screen":d||void 0,"data-centered":f||void 0,"data-offset-scrollbars":l===Ku.Autosize||void 0,unstyled:o,...g})})});wh.classes=gh,wh.varsResolver=Ch,wh.displayName=`@mantine/core/ModalRoot`;var Th=(0,L.createContext)(null);function Eh({children:e}){let[t,n]=(0,L.useState)([]),[r,i]=(0,L.useState)(xa(`modal`));return(0,R.jsx)(Th,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}Eh.displayName=`@mantine/core/ModalStack`;var Dh=r(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=P(`ModalTitle`,null,e);return(0,R.jsx)(fp,{...hh().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Dh.classes=gh,Dh.displayName=`@mantine/core/ModalTitle`;var Oh={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:xa(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},kh=r(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,radius:s,opened:c,stackId:l,zIndex:u,...d}=P(`Modal`,Oh,e),f=(0,L.use)(Th),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l)}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,L.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||xa(`modal`)):f.removeModal(l))},[c,l,u]),(0,R.jsxs)(wh,{radius:s,opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,R.jsx)(xh,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,R.jsxs)(yh,{radius:s,__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,R.jsxs)(bh,{children:[t&&(0,R.jsx)(Dh,{children:t}),i&&(0,R.jsx)(vh,{...a})]}),(0,R.jsx)(_h,{children:o})]})]})});kh.classes=gh,kh.displayName=`@mantine/core/Modal`,kh.Root=wh,kh.Overlay=xh,kh.Content=yh,kh.Body=_h,kh.Header=bh,kh.Title=Dh,kh.CloseButton=vh,kh.Stack=Eh;function Ah(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":fe(t??`sm`,`pin-input-size`)}})),Fh=r(n=>{let{name:r,form:i,className:a,value:o,defaultValue:s,variant:c,gap:l,style:u,size:d,classNames:f,styles:p,unstyled:m,length:h,onChange:g,onComplete:_,manageFocus:v,autoFocus:y,error:b,success:x,radius:C,disabled:w,oneTimeCode:T,placeholder:E,type:D,mask:O,readOnly:k,inputType:A,inputMode:ee,ariaLabel:j,vars:M,id:N,hiddenInputProps:ne,rootRef:re,getInputProps:ie,attributes:oe,ref:se,...le}=P([`Input`,`PinInput`],Nh,n),ue=e(N),de=ae({name:`PinInput`,classes:jh,props:n,className:a,style:u,classNames:f,styles:p,unstyled:m,attributes:oe,vars:M,varsResolver:Ph}),{resolvedClassNames:fe,resolvedStyles:pe}=t({classNames:f,styles:p,props:n}),[me,he]=(0,L.useState)(-1),ge=(0,L.useRef)([]),_e=h??4,F=(0,L.useRef)(!1),[ve,ye]=Ka({value:o===void 0?void 0:Ah(_e,o),defaultValue:s?.split(``).slice(0,_e),finalValue:Ah(_e,``),onChange:e=>{let t=e.join(``).trim();g?.(t),t.length===_e&&!F.current?(F.current=!0,_?.(t)):t.length<_e&&(F.current=!1)}}),be=ve.length===_e?ve:Ah(_e,ve.join(``)),xe=be.join(``).trim(),I=e=>(D instanceof RegExp?D:D&&D in Mh?Mh[D]:null)?.test(e),Se=(e,t)=>{if(v){if(e===`next`){let e=t+1;e<_e&&ge.current[e]?.focus()}else if(e===`prev`){let e=t-1;e>=0&&ge.current[e]?.focus()}}},Ce=(e,t)=>{let n=[...be];return n[t]=e,ye(n),n},we=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(I(n)){ye(Ah(_e,n));let e=Math.min(n.length,_e);e<_e&&Se(`next`,e-1)}return}let e=n.split(``)[n.length-1];I(e)&&(Ce(e,t),Se(`next`,t));return}n.length===1?I(n)?(Ce(n,t),Se(`next`,t)):Ce(``,t):n.length===0&&Ce(``,t)},Te=(e,t)=>{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(ee===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),Se(`prev`,t);break;case`ArrowRight`:e.preventDefault(),Se(`next`,t);break;case`Tab`:a&&t>0&&v&&(e.preventDefault(),Se(`prev`,t));break;case` `:e.preventDefault(),Se(`next`,t);break;case`Delete`:e.preventDefault(),Ce(``,t);break;case`Backspace`:s===``?(e.preventDefault(),Se(`prev`,t)):(Ce(``,t),t<_e-1&&(e.preventDefault(),Se(`prev`,t)));break;default:s.length>0&&i===be[t]&&(e.preventDefault(),Se(`next`,t))}},Ee=(e,t)=>{e.target.select(),he(t)},De=()=>{he(-1)},Oe=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(I(t.trim())){let e=Ah(_e,t);ye(e);let n=e.filter(e=>e!==``).length;n>=_e?ge.current[_e-1]?.focus():ge.current[n]?.focus()}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(te,{...le,...de(`root`),ref:re,role:`group`,id:ue,gap:l,unstyled:m,wrap:`nowrap`,variant:c,__size:d,dir:`ltr`,children:be.map((e,t)=>(0,L.createElement)(ce,{component:`input`,...de(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:fe,styles:pe,size:d,__staticSelector:`PinInput`,id:`${ue}-${t+1}`,key:`${ue}-${t}`,inputMode:ee||(D===`number`?`numeric`:`text`),onChange:e=>we(e,t),onKeyDown:e=>Te(e,t),onFocus:e=>Ee(e,t),onBlur:De,onPaste:Oe,type:A||(O?`password`:D===`number`?`tel`:`text`),radius:C,error:b,success:x,variant:c,disabled:w,ref:e=>{e&&(t===0&&S(se,e),ge.current[t]=e)},autoComplete:T?`one-time-code`:`off`,placeholder:me===t?``:E,value:e,autoFocus:y&&t===0,unstyled:m,"aria-label":j,readOnly:k,...ie?.(t)}))}),(0,R.jsx)(`input`,{type:`hidden`,name:r,form:i,value:xe,...ne})]})});Fh.classes={...jh,...pe.classes},Fh.varsResolver=Ph,Fh.displayName=`@mantine/core/PinInput`;function Ih({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,L.useState)(n),a=(0,L.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Nu({placement:t,middleware:[Vl({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,L.useCallback)(({clientX:e,clientY:t})=>{Number.isFinite(e)&&Number.isFinite(t)&&l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,L.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=As(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var Lh={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},Rh={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:xa(`popover`)},zh=x((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ie(t),"--tooltip-bg":n?a(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),Bh=r(e=>{let t=P(`TooltipFloating`,Rh,e),{children:n,refProp:r,withinPortal:i,style:a,className:o,classNames:s,styles:c,unstyled:l,radius:u,color:d,label:p,offset:m,position:g,multiline:_,zIndex:v,disabled:y,defaultOpened:b,variant:x,vars:S,portalProps:C,attributes:w,ref:T,...E}=t,D=f(),O=ae({name:`TooltipFloating`,props:t,classes:Lh,className:o,style:a,classNames:s,styles:c,unstyled:l,attributes:w,rootSelector:`tooltip`,vars:S,varsResolver:zh}),{handleMouseMove:k,x:A,y:ee,opened:j,boundaryRef:M,floating:N,setOpened:te}=Ih({offset:m,position:g,defaultOpened:b}),ne=to(n);if(!ne)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let re=h(M,eo(ne),T),ie=ne.props,oe=e=>{ie.onMouseEnter?.(e),k(e),te(!0)},se=e=>{ie.onMouseLeave?.(e),te(!1)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(pd,{...C,withinPortal:i,children:(0,R.jsx)(we,{...E,...O(`tooltip`,{style:{...Do(a,D),zIndex:v,display:!y&&j?`block`:`none`,top:Number.isFinite(ee)?Math.round(ee):``,left:Number.isFinite(A)?Math.round(A):``}}),variant:x,ref:N,mod:{multiline:_},children:p})}),(0,L.cloneElement)(ne,{...ie,[r]:re,onMouseEnter:oe,onMouseLeave:se})]})});Bh.classes=Lh,Bh.varsResolver=zh,Bh.displayName=`@mantine/core/TooltipFloating`;var Vh=(0,L.createContext)({withinGroup:!1}),Hh={openDelay:0,closeDelay:0};function Uh(e){let{openDelay:t,closeDelay:n,children:r}=P(`TooltipGroup`,Hh,e);return(0,R.jsx)(Vh,{value:{withinGroup:!0},children:(0,R.jsx)(wu,{delay:{open:t,close:n},children:r})})}Uh.displayName=`@mantine/core/TooltipGroup`,Uh.extend=e=>e;function Wh(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Gh(e){let t=Wh(e.middlewares),n=[Bl(e.offset)];return t.shift&&n.push(Vl(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?Ul():Ul(t.flip)),n.push(ql({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?Kl():Kl(t.inline)):e.inline&&n.push(Kl()),n}function Kh(t){let[n,r]=(0,L.useState)(t.defaultOpened),i=typeof t.opened==`boolean`?t.opened:n,a=(0,L.use)(Vh).withinGroup,o=e(),s=(0,L.useCallback)(e=>{r(e),e&&_(o)},[o]),{x:c,y:l,context:u,refs:d,placement:f,middlewareData:{arrow:{x:p,y:m}={}}}=Nu({strategy:t.strategy,placement:t.position,open:i,onOpenChange:s,middleware:Gh(t),whileElementsMounted:Sl}),{delay:h,currentId:g,setCurrentId:_}=Tu(u,{id:o}),{getReferenceProps:v,getFloatingProps:y}=Lu([bu(u,{enabled:t.events?.hover,delay:a?h:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch,handleClose:t.interactive?Uu():null}),Fu(u,{enabled:t.events?.focus,visibleOnly:!0}),zu(u,{role:`tooltip`}),ju(u,{enabled:t.opened===void 0})]),b=(0,L.useRef)(f);be(()=>{b.current!==f&&(b.current=f,t.onPositionChange?.(f))},[f]);let x=i&&g&&g!==o;return{x:c,y:l,arrowX:p,arrowY:m,reference:d.setReference,floating:d.setFloating,getFloatingProps:y,getReferenceProps:v,isGroupPhase:x,opened:i,placement:f}}var qh={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:xa(`popover`),middlewares:{flip:!0,shift:!0,inline:!1}},Jh=x((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:ie(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),Yh=r(e=>{let t=P(`Tooltip`,qh,e),{children:n,position:r,refProp:i,label:a,openDelay:o,closeDelay:s,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:g,styles:_,unstyled:v,style:y,className:b,withArrow:x,arrowSize:S,arrowOffset:C,arrowRadius:w,arrowPosition:T,offset:E,transitionProps:D,multiline:O,events:k,interactive:A,zIndex:ee,disabled:j,onClick:M,onMouseEnter:N,onMouseLeave:te,inline:ne,variant:re,keepMounted:ie,vars:oe,portalProps:se,mod:ce,floatingStrategy:le,middlewares:ue,autoContrast:de,attributes:fe,target:pe,ref:me,...he}=t,{dir:ge}=ko(),_e=(0,L.useRef)(null),F=Kh({position:rd(ge,r),closeDelay:s,openDelay:o,onPositionChange:l,opened:u,defaultOpened:d,events:k,interactive:A,arrowRef:_e,arrowOffset:C,offset:typeof E==`number`?E+(x?S/2:0):E,inline:ne,strategy:le,middlewares:ue});(0,L.useEffect)(()=>{let e=pe instanceof HTMLElement?pe:typeof pe==`string`?document.querySelector(pe):pe?.current||null;e&&F.reference(e)},[pe,F]);let ve=ae({name:`Tooltip`,props:t,classes:Lh,className:b,style:y,classNames:g,styles:_,unstyled:v,attributes:fe,rootSelector:`tooltip`,vars:oe,varsResolver:Jh}),ye=to(n);if(!pe&&!ye)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let be=ve(`tooltip`),xe=A&&!j&&!!F.opened,I=T===`merge`&&x?td({position:F.placement,dir:ge}):void 0;if(pe){let e=hd(D,{duration:100,transition:`fade`});return(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(pd,{...se,withinPortal:f,children:(0,R.jsx)(Se,{...e,keepMounted:ie,mounted:!j&&!!F.opened,duration:F.isGroupPhase?10:e.duration,children:e=>(0,R.jsxs)(we,{...he,"data-fixed":le===`fixed`||void 0,variant:re,mod:[{multiline:O,interactive:xe},ce],...be,...F.getFloatingProps({ref:F.floating,className:be.className,style:{...be.style,...e,...I,zIndex:ee,top:F.y??0,left:F.x??0}}),children:[a,(0,R.jsx)(nd,{ref:_e,arrowX:F.arrowX,arrowY:F.arrowY,visible:x,position:F.placement,arrowSize:S,arrowOffset:C,arrowRadius:w,arrowPosition:T,...ve(`arrow`)})]})})})})}let Ce=ye.props,Te=h(F.reference,eo(ye),me),Ee=hd(D,{duration:100,transition:`fade`});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(pd,{...se,withinPortal:f,children:(0,R.jsx)(Se,{...Ee,keepMounted:ie,mounted:!j&&!!F.opened,duration:F.isGroupPhase?10:Ee.duration,children:e=>(0,R.jsxs)(we,{...he,"data-fixed":le===`fixed`||void 0,variant:re,mod:[{multiline:O,interactive:xe},ce],...F.getFloatingProps({ref:F.floating,className:ve(`tooltip`).className,style:{...ve(`tooltip`).style,...e,...I,zIndex:ee,top:F.y??0,left:F.x??0}}),children:[a,(0,R.jsx)(nd,{ref:_e,arrowX:F.arrowX,arrowY:F.arrowY,visible:x,position:F.placement,arrowSize:S,arrowOffset:C,arrowRadius:w,arrowPosition:T,...ve(`arrow`)})]})})}),(0,L.cloneElement)(ye,F.getReferenceProps({onClick:M,onMouseEnter:N,onMouseLeave:te,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...Ce,className:c(b,Ce.className),[i]:Te}))]})});Yh.classes=Lh,Yh.varsResolver=Jh,Yh.displayName=`@mantine/core/Tooltip`,Yh.Floating=Bh,Yh.Group=Uh;var Xh=r(e=>(0,R.jsx)(pe,{component:`input`,...P([`Input`,`InputWrapper`,`TextInput`],null,e),__staticSelector:`TextInput`}));Xh.classes=pe.classes,Xh.displayName=`@mantine/core/TextInput`;var Zh=[];for(let e=0;e<256;++e)Zh.push((e+256).toString(16).slice(1));function Qh(e,t=0){return(Zh[e[t+0]]+Zh[e[t+1]]+Zh[e[t+2]]+Zh[e[t+3]]+`-`+Zh[e[t+4]]+Zh[e[t+5]]+`-`+Zh[e[t+6]]+Zh[e[t+7]]+`-`+Zh[e[t+8]]+Zh[e[t+9]]+`-`+Zh[e[t+10]]+Zh[e[t+11]]+Zh[e[t+12]]+Zh[e[t+13]]+Zh[e[t+14]]+Zh[e[t+15]]).toLowerCase()}var $h,eg=new Uint8Array(16);function tg(){if(!$h){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);$h=crypto.getRandomValues.bind(crypto)}return $h(eg)}var ng={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rg(e,t,n){if(ng.randomUUID&&!t&&!e)return ng.randomUUID();e||={};let r=e.random??e.rng?.()??tg();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Qh(r)}var ig;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(ig||={});var ag;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(ag||={});var z=ig.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),og=e=>{switch(typeof e){case`undefined`:return z.undefined;case`string`:return z.string;case`number`:return Number.isNaN(e)?z.nan:z.number;case`boolean`:return z.boolean;case`function`:return z.function;case`bigint`:return z.bigint;case`symbol`:return z.symbol;case`object`:return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?z.promise:typeof Map<`u`&&e instanceof Map?z.map:typeof Set<`u`&&e instanceof Set?z.set:typeof Date<`u`&&e instanceof Date?z.date:z.object;default:return z.unknown}},B=ig.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),sg=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};sg.create=e=>new sg(e);var cg=(e,t)=>{let n;switch(e.code){case B.invalid_type:n=e.received===z.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ig.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:n=`Unrecognized key(s) in object: ${ig.joinValues(e.keys,`, `)}`;break;case B.invalid_union:n=`Invalid input`;break;case B.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ig.joinValues(e.options)}`;break;case B.invalid_enum_value:n=`Invalid enum value. Expected ${ig.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:n=`Invalid function arguments`;break;case B.invalid_return_type:n=`Invalid function return type`;break;case B.invalid_date:n=`Invalid date`;break;case B.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ig.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case B.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case B.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case B.custom:n=`Invalid input`;break;case B.invalid_intersection_types:n=`Intersection results could not be merged`;break;case B.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,ig.assertNever(e)}return{message:n}},lg=cg;function ug(){return lg}var dg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function V(e,t){let n=ug(),r=dg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===cg?void 0:cg].filter(e=>!!e)});e.common.issues.push(r)}var fg=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return pg;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return pg;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},pg=Object.freeze({status:`aborted`}),mg=e=>({status:`dirty`,value:e}),hg=e=>({status:`valid`,value:e}),gg=e=>e.status===`aborted`,_g=e=>e.status===`dirty`,vg=e=>e.status===`valid`,yg=e=>typeof Promise<`u`&&e instanceof Promise,H;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(H||={});var bg=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xg=(e,t)=>{if(vg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new sg(e.common.issues);return this._error=t,this._error}}};function Sg(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Cg=class{get description(){return this._def.description}_getType(e){return og(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:og(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new fg,ctx:{common:e.parent.common,data:e.data,parsedType:og(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(yg(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:og(e)};return xg(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:og(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return vg(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>vg(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:og(e)},r=this._parse({data:e,path:n.path,parent:n});return xg(n,await(yg(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:B.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new E_({schema:this,typeName:F_.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return D_.create(this,this._def)}nullable(){return O_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return s_.create(this)}promise(){return T_.create(this,this._def)}or(e){return u_.create([this,e],this._def)}and(e){return m_.create(this,e,this._def)}transform(e){return new E_({...Sg(this._def),schema:this,typeName:F_.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new k_({...Sg(this._def),innerType:this,defaultValue:t,typeName:F_.ZodDefault})}brand(){return new M_({typeName:F_.ZodBranded,type:this,...Sg(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new A_({...Sg(this._def),innerType:this,catchValue:t,typeName:F_.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return N_.create(this,e)}readonly(){return P_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wg=/^c[^\s-]{8,}$/i,Tg=/^[0-9a-z]+$/,Eg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Dg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Og=/^[a-z0-9_-]{21}$/i,kg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ag=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jg=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mg=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Ng,Pg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Fg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ig=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lg=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rg=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zg=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Bg=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Vg=RegExp(`^${Bg}$`);function Hg(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ug(e){return RegExp(`^${Hg(e)}$`)}function Wg(e){let t=`${Bg}T${Hg(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Gg(e,t){return!((t!==`v4`&&t||!Pg.test(e))&&(t!==`v6`&&t||!Ig.test(e)))}function Kg(e,t){if(!kg.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function qg(e,t){return!((t!==`v4`&&t||!Fg.test(e))&&(t!==`v6`&&t||!Lg.test(e)))}var Jg=class e extends Cg{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.string,received:t.parsedType}),pg}let t=new fg,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),V(n,{code:B.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:B.invalid_string,...H.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...H.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...H.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...H.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...H.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...H.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...H.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...H.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...H.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...H.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...H.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...H.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...H.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Jg({checks:[],typeName:F_.ZodString,coerce:e?.coerce??!1,...Sg(e)});function Yg(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Xg=class e extends Cg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==z.number){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.number,received:t.parsedType}),pg}let t,n=new fg;for(let r of this._def.checks)r.kind===`int`?ig.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),V(t,{code:B.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),V(t,{code:B.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Yg(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),V(t,{code:B.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),V(t,{code:B.not_finite,message:r.message}),n.dirty()):ig.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,H.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,H.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,H.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,H.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:H.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:H.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:H.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:H.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&ig.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew Xg({checks:[],typeName:F_.ZodNumber,coerce:e?.coerce||!1,...Sg(e)});var Zg=class e extends Cg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==z.bigint)return this._getInvalidInput(e);let t,n=new fg;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),V(t,{code:B.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),V(t,{code:B.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):ig.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.bigint,received:t.parsedType}),pg}gte(e,t){return this.setLimit(`min`,e,!0,H.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,H.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,H.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,H.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:H.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Zg({checks:[],typeName:F_.ZodBigInt,coerce:e?.coerce??!1,...Sg(e)});var Qg=class extends Cg{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.boolean,received:t.parsedType}),pg}return hg(e.data)}};Qg.create=e=>new Qg({typeName:F_.ZodBoolean,coerce:e?.coerce||!1,...Sg(e)});var $g=class e extends Cg{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.date,received:t.parsedType}),pg}if(Number.isNaN(e.data.getTime()))return V(this._getOrReturnCtx(e),{code:B.invalid_date}),pg;let t=new fg,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),V(n,{code:B.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):ig.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew $g({checks:[],coerce:e?.coerce||!1,typeName:F_.ZodDate,...Sg(e)});var e_=class extends Cg{_parse(e){if(this._getType(e)!==z.symbol){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.symbol,received:t.parsedType}),pg}return hg(e.data)}};e_.create=e=>new e_({typeName:F_.ZodSymbol,...Sg(e)});var t_=class extends Cg{_parse(e){if(this._getType(e)!==z.undefined){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.undefined,received:t.parsedType}),pg}return hg(e.data)}};t_.create=e=>new t_({typeName:F_.ZodUndefined,...Sg(e)});var n_=class extends Cg{_parse(e){if(this._getType(e)!==z.null){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.null,received:t.parsedType}),pg}return hg(e.data)}};n_.create=e=>new n_({typeName:F_.ZodNull,...Sg(e)});var r_=class extends Cg{constructor(){super(...arguments),this._any=!0}_parse(e){return hg(e.data)}};r_.create=e=>new r_({typeName:F_.ZodAny,...Sg(e)});var i_=class extends Cg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return hg(e.data)}};i_.create=e=>new i_({typeName:F_.ZodUnknown,...Sg(e)});var a_=class extends Cg{_parse(e){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.never,received:t.parsedType}),pg}};a_.create=e=>new a_({typeName:F_.ZodNever,...Sg(e)});var o_=class extends Cg{_parse(e){if(this._getType(e)!==z.undefined){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.void,received:t.parsedType}),pg}return hg(e.data)}};o_.create=e=>new o_({typeName:F_.ZodVoid,...Sg(e)});var s_=class e extends Cg{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==z.array)return V(t,{code:B.invalid_type,expected:z.array,received:t.parsedType}),pg;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(V(t,{code:B.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new bg(t,e,t.path,n)))).then(e=>fg.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new bg(t,e,t.path,n)));return fg.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:H.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}};s_.create=(e,t)=>new s_({type:e,minLength:null,maxLength:null,exactLength:null,typeName:F_.ZodArray,...Sg(t)});function c_(e){if(e instanceof l_){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=D_.create(c_(r))}return new l_({...e._def,shape:()=>t})}return e instanceof s_?new s_({...e._def,type:c_(e.element)}):e instanceof D_?D_.create(c_(e.unwrap())):e instanceof O_?O_.create(c_(e.unwrap())):e instanceof h_?h_.create(e.items.map(e=>c_(e))):e}var l_=class e extends Cg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=ig.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==z.object){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.object,received:t.parsedType}),pg}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof a_&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new bg(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof a_){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(V(n,{code:B.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new bg(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>fg.mergeObjectSync(t,e)):fg.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return H.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:H.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:F_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of ig.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of ig.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return c_(this)}partial(t){let n={};for(let e of ig.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of ig.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof D_;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return S_(ig.objectKeys(this.shape))}};l_.create=(e,t)=>new l_({shape:()=>e,unknownKeys:`strip`,catchall:a_.create(),typeName:F_.ZodObject,...Sg(t)}),l_.strictCreate=(e,t)=>new l_({shape:()=>e,unknownKeys:`strict`,catchall:a_.create(),typeName:F_.ZodObject,...Sg(t)}),l_.lazycreate=(e,t)=>new l_({shape:e,unknownKeys:`strip`,catchall:a_.create(),typeName:F_.ZodObject,...Sg(t)});var u_=class extends Cg{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new sg(e.ctx.common.issues));return V(t,{code:B.invalid_union,unionErrors:n}),pg}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new sg(e));return V(t,{code:B.invalid_union,unionErrors:i}),pg}}get options(){return this._def.options}};u_.create=(e,t)=>new u_({options:e,typeName:F_.ZodUnion,...Sg(t)});var d_=e=>e instanceof b_?d_(e.schema):e instanceof E_?d_(e.innerType()):e instanceof x_?[e.value]:e instanceof C_?e.options:e instanceof w_?ig.objectValues(e.enum):e instanceof k_?d_(e._def.innerType):e instanceof t_?[void 0]:e instanceof n_?[null]:e instanceof D_?[void 0,...d_(e.unwrap())]:e instanceof O_?[null,...d_(e.unwrap())]:e instanceof M_||e instanceof P_?d_(e.unwrap()):e instanceof A_?d_(e._def.innerType):[],f_=class e extends Cg{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==z.object)return V(t,{code:B.invalid_type,expected:z.object,received:t.parsedType}),pg;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(V(t,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pg)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=d_(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:F_.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Sg(r)})}};function p_(e,t){let n=og(e),r=og(t);if(e===t)return{valid:!0,data:e};if(n===z.object&&r===z.object){let n=ig.objectKeys(t),r=ig.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=p_(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===z.array&&r===z.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(gg(e)||gg(r))return pg;let i=p_(e.value,r.value);return i.valid?((_g(e)||_g(r))&&t.dirty(),{status:t.value,value:i.data}):(V(n,{code:B.invalid_intersection_types}),pg)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};m_.create=(e,t,n)=>new m_({left:e,right:t,typeName:F_.ZodIntersection,...Sg(n)});var h_=class e extends Cg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return V(n,{code:B.invalid_type,expected:z.array,received:n.parsedType}),pg;if(n.data.lengththis._def.items.length&&(V(n,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new bg(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>fg.mergeArray(t,e)):fg.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};h_.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new h_({items:e,typeName:F_.ZodTuple,rest:null,...Sg(t)})};var g_=class e extends Cg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return V(n,{code:B.invalid_type,expected:z.object,received:n.parsedType}),pg;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new bg(n,e,n.path,e)),value:a._parse(new bg(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?fg.mergeObjectAsync(t,r):fg.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Cg?new e({keyType:t,valueType:n,typeName:F_.ZodRecord,...Sg(r)}):new e({keyType:Jg.create(),valueType:t,typeName:F_.ZodRecord,...Sg(n)})}},__=class extends Cg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.map)return V(n,{code:B.invalid_type,expected:z.map,received:n.parsedType}),pg;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new bg(n,e,n.path,[a,`key`])),value:i._parse(new bg(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return pg;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return pg;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};__.create=(e,t,n)=>new __({valueType:t,keyType:e,typeName:F_.ZodMap,...Sg(n)});var v_=class e extends Cg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return V(n,{code:B.invalid_type,expected:z.set,received:n.parsedType}),pg;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(V(n,{code:B.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return pg;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new bg(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:H.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};v_.create=(e,t)=>new v_({valueType:e,minSize:null,maxSize:null,typeName:F_.ZodSet,...Sg(t)});var y_=class e extends Cg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==z.function)return V(t,{code:B.invalid_type,expected:z.function,received:t.parsedType}),pg;function n(e,n){return dg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ug(),cg].filter(e=>!!e),issueData:{code:B.invalid_arguments,argumentsError:n}})}function r(e,n){return dg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ug(),cg].filter(e=>!!e),issueData:{code:B.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof T_){let e=this;return hg(async function(...t){let o=new sg([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return hg(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new sg([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new sg([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:h_.create(t).rest(i_.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||h_.create([]).rest(i_.create()),returns:n||i_.create(),typeName:F_.ZodFunction,...Sg(r)})}},b_=class extends Cg{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};b_.create=(e,t)=>new b_({getter:e,typeName:F_.ZodLazy,...Sg(t)});var x_=class extends Cg{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:B.invalid_literal,expected:this._def.value}),pg}return{status:`valid`,value:e.data}}get value(){return this._def.value}};x_.create=(e,t)=>new x_({value:e,typeName:F_.ZodLiteral,...Sg(t)});function S_(e,t){return new C_({values:e,typeName:F_.ZodEnum,...Sg(t)})}var C_=class e extends Cg{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return V(t,{expected:ig.joinValues(n),received:t.parsedType,code:B.invalid_type}),pg}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return V(t,{received:t.data,code:B.invalid_enum_value,options:n}),pg}return hg(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};C_.create=S_;var w_=class extends Cg{_parse(e){let t=ig.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){let e=ig.objectValues(t);return V(n,{expected:ig.joinValues(e),received:n.parsedType,code:B.invalid_type}),pg}if(this._cache||=new Set(ig.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=ig.objectValues(t);return V(n,{received:n.data,code:B.invalid_enum_value,options:e}),pg}return hg(e.data)}get enum(){return this._def.values}};w_.create=(e,t)=>new w_({values:e,typeName:F_.ZodNativeEnum,...Sg(t)});var T_=class extends Cg{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==z.promise&&t.common.async===!1?(V(t,{code:B.invalid_type,expected:z.promise,received:t.parsedType}),pg):hg((t.parsedType===z.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};T_.create=(e,t)=>new T_({type:e,typeName:F_.ZodPromise,...Sg(t)});var E_=class extends Cg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{V(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return pg;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?pg:r.status===`dirty`||t.value===`dirty`?mg(r.value):r});{if(t.value===`aborted`)return pg;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?pg:r.status===`dirty`||t.value===`dirty`?mg(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?pg:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?pg:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vg(e))return pg;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>vg(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):pg)}ig.assertNever(r)}};E_.create=(e,t,n)=>new E_({schema:e,typeName:F_.ZodEffects,effect:t,...Sg(n)}),E_.createWithPreprocess=(e,t,n)=>new E_({schema:t,effect:{type:`preprocess`,transform:e},typeName:F_.ZodEffects,...Sg(n)});var D_=class extends Cg{_parse(e){return this._getType(e)===z.undefined?hg(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};D_.create=(e,t)=>new D_({innerType:e,typeName:F_.ZodOptional,...Sg(t)});var O_=class extends Cg{_parse(e){return this._getType(e)===z.null?hg(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};O_.create=(e,t)=>new O_({innerType:e,typeName:F_.ZodNullable,...Sg(t)});var k_=class extends Cg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};k_.create=(e,t)=>new k_({innerType:e,typeName:F_.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Sg(t)});var A_=class extends Cg{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return yg(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new sg(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new sg(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};A_.create=(e,t)=>new A_({innerType:e,typeName:F_.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Sg(t)});var j_=class extends Cg{_parse(e){if(this._getType(e)!==z.nan){let t=this._getOrReturnCtx(e);return V(t,{code:B.invalid_type,expected:z.nan,received:t.parsedType}),pg}return{status:`valid`,value:e.data}}};j_.create=e=>new j_({typeName:F_.ZodNaN,...Sg(e)});var M_=class extends Cg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},N_=class e extends Cg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?pg:e.status===`dirty`?(t.dirty(),mg(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?pg:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:F_.ZodPipeline})}},P_=class extends Cg{_parse(e){let t=this._def.innerType._parse(e),n=e=>(vg(e)&&(e.value=Object.freeze(e.value)),e);return yg(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};P_.create=(e,t)=>new P_({innerType:e,typeName:F_.ZodReadonly,...Sg(t)}),l_.lazycreate;var F_;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(F_||={});var U=Jg.create,I_=Xg.create;j_.create,Zg.create;var L_=Qg.create;$g.create,e_.create,t_.create,n_.create;var R_=r_.create,z_=i_.create;a_.create,o_.create;var B_=s_.create,V_=l_.create;l_.strictCreate;var H_=u_.create,U_=f_.create;m_.create,h_.create;var W_=g_.create;__.create,v_.create,y_.create,b_.create;var W=x_.create,G_=C_.create,K_=w_.create;T_.create,E_.create,D_.create,O_.create,E_.createWithPreprocess,N_.create;var q_=je(),J_=W_(R_()).optional();function Y_(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}var X_=V_({name:U(),arguments:U()}),Z_=V_({id:U(),type:W(`function`),function:X_,encryptedValue:U().optional(),metadata:J_}),Q_=V_({id:U(),role:U(),content:U().optional(),name:U().optional(),encryptedValue:U().optional(),subagentRunId:U().optional(),metadata:J_}),$_=V_({type:W(`text`),text:U()}),ev=U_(`type`,[V_({type:W(`data`),value:U(),mimeType:U()}),V_({type:W(`url`),value:U(),mimeType:U().optional()})]),tv=V_({type:W(`image`),source:ev,metadata:z_().optional()}),nv=V_({type:W(`audio`),source:ev,metadata:z_().optional()}),rv=V_({type:W(`video`),source:ev,metadata:z_().optional()}),iv=V_({type:W(`document`),source:ev,metadata:z_().optional()}),av=V_({type:W(`binary`),mimeType:U(),id:U().optional(),url:U().optional(),data:U().optional(),filename:U().optional()}),ov=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:B.custom,message:`BinaryInputContent requires at least one of id, url, or data.`,path:[`id`]})};av.superRefine((e,t)=>{ov(e,t)});var sv=U_(`type`,[$_,tv,nv,rv,iv,av]).superRefine((e,t)=>{e.type===`binary`&&ov(e,t)}),cv=U_(`role`,[Q_.extend({role:W(`developer`),content:U()}),Q_.extend({role:W(`system`),content:U()}),Q_.extend({role:W(`assistant`),content:U().optional(),toolCalls:B_(Z_).optional()}),Q_.extend({role:W(`user`),content:H_([U(),B_(sv)])}),V_({id:U(),content:U(),role:W(`tool`),toolCallId:U(),error:U().optional(),encryptedValue:U().optional(),subagentRunId:U().optional(),metadata:J_}),V_({id:U(),role:W(`activity`),activityType:U(),content:W_(R_()),subagentRunId:U().optional(),metadata:J_}),V_({id:U(),role:W(`reasoning`),content:U(),encryptedValue:U().optional(),subagentRunId:U().optional(),metadata:J_})]);H_([W(`developer`),W(`system`),W(`assistant`),W(`user`),W(`tool`),W(`activity`),W(`reasoning`)]);var lv=V_({description:U(),value:U()}),uv=V_({name:U(),description:U(),parameters:R_(),metadata:W_(R_()).optional()}),dv=V_({id:U(),reason:U(),message:U().optional(),toolCallId:U().optional(),responseSchema:W_(R_()).optional(),expiresAt:U().optional(),metadata:W_(R_()).optional(),subagentRunId:U().optional()}),fv=V_({interruptId:U(),status:G_([`resolved`,`cancelled`]),payload:R_().optional(),metadata:J_}),pv=V_({threadId:U(),runId:U(),parentRunId:U().optional(),state:R_().transform(e=>e??void 0),messages:B_(cv),tools:B_(uv),context:B_(lv),forwardedProps:R_(),resume:B_(fv).optional()}),mv=R_(),hv=class extends Error{constructor(e){super(e)}},gv=class extends hv{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}},_v=V_({name:U(),description:U().optional()}),vv=V_({name:U().optional(),type:U().optional(),description:U().optional(),version:U().optional(),provider:U().optional(),documentationUrl:U().optional(),metadata:W_(z_()).optional()}),yv=V_({streaming:L_().optional(),websocket:L_().optional(),httpBinary:L_().optional(),pushNotifications:L_().optional(),resumable:L_().optional()}),bv=V_({supported:L_().optional(),items:B_(uv).optional(),parallelCalls:L_().optional(),clientProvided:L_().optional()}),xv=V_({structuredOutput:L_().optional(),supportedMimeTypes:B_(U()).optional()}),Sv=V_({snapshots:L_().optional(),deltas:L_().optional(),memory:L_().optional(),persistentState:L_().optional()}),Cv=V_({supported:L_().optional(),delegation:L_().optional(),handoffs:L_().optional(),subAgents:B_(_v).optional()}),wv=V_({supported:L_().optional(),streaming:L_().optional(),encrypted:L_().optional()}),Tv=V_({image:L_().optional(),audio:L_().optional(),video:L_().optional(),pdf:L_().optional(),file:L_().optional()}),Ev=V_({image:L_().optional(),audio:L_().optional()}),Dv=V_({input:Tv.optional(),output:Ev.optional()}),Ov=V_({codeExecution:L_().optional(),sandboxed:L_().optional(),maxIterations:I_().optional(),maxExecutionTime:I_().optional()}),kv=V_({supported:L_().optional(),approvals:L_().optional(),interventions:L_().optional(),feedback:L_().optional(),interrupts:L_().optional(),approveWithEdits:L_().optional()});V_({identity:vv.optional(),transport:yv.optional(),tools:bv.optional(),output:xv.optional(),state:Sv.optional(),multiAgent:Cv.optional(),reasoning:wv.optional(),multimodal:Dv.optional(),execution:Ov.optional(),humanInTheLoop:kv.optional(),custom:W_(z_()).optional()});var Av=H_([W(`developer`),W(`system`),W(`assistant`),W(`user`)]),G=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({}),jv=V_({type:K_(G),timestamp:I_().optional(),rawEvent:R_().optional(),metadata:J_}).passthrough(),Mv=jv.extend({type:W(G.TEXT_MESSAGE_START),messageId:U(),role:Av.default(`assistant`),name:U().optional(),subagentRunId:U().optional()}),Nv=jv.extend({type:W(G.TEXT_MESSAGE_CONTENT),messageId:U(),delta:U(),subagentRunId:U().optional()}),Pv=jv.extend({type:W(G.TEXT_MESSAGE_END),messageId:U(),subagentRunId:U().optional()}),Fv=jv.extend({type:W(G.TEXT_MESSAGE_CHUNK),messageId:U().optional(),role:Av.optional(),delta:U().optional(),name:U().optional(),subagentRunId:U().optional()}),Iv=jv.extend({type:W(G.THINKING_TEXT_MESSAGE_START)}),Lv=Nv.omit({messageId:!0,type:!0,subagentRunId:!0}).extend({type:W(G.THINKING_TEXT_MESSAGE_CONTENT)}),Rv=jv.extend({type:W(G.THINKING_TEXT_MESSAGE_END)}),zv=jv.extend({type:W(G.TOOL_CALL_START),toolCallId:U(),toolCallName:U(),parentMessageId:U().nullable().optional().transform(e=>e??void 0),subagentRunId:U().optional()}),Bv=jv.extend({type:W(G.TOOL_CALL_ARGS),toolCallId:U(),delta:U(),subagentRunId:U().optional()}),Vv=jv.extend({type:W(G.TOOL_CALL_END),toolCallId:U(),subagentRunId:U().optional()}),Hv=jv.extend({messageId:U(),type:W(G.TOOL_CALL_RESULT),toolCallId:U(),content:U(),role:W(`tool`).optional(),subagentRunId:U().optional()}),Uv=jv.extend({type:W(G.TOOL_CALL_CHUNK),toolCallId:U().optional(),toolCallName:U().optional(),parentMessageId:U().nullable().optional().transform(e=>e??void 0),delta:U().optional(),subagentRunId:U().optional()}),Wv=jv.extend({type:W(G.THINKING_START),title:U().optional()}),Gv=jv.extend({type:W(G.THINKING_END)}),Kv=jv.extend({type:W(G.STATE_SNAPSHOT),snapshot:mv,subagentRunId:U().optional()}),qv=jv.extend({type:W(G.STATE_DELTA),delta:B_(R_()),subagentRunId:U().optional()}),Jv=jv.extend({type:W(G.MESSAGES_SNAPSHOT),messages:B_(cv)}),Yv=jv.extend({type:W(G.ACTIVITY_SNAPSHOT),messageId:U(),activityType:U(),content:W_(R_()),replace:L_().optional().default(!0),subagentRunId:U().optional()}),Xv=jv.extend({type:W(G.ACTIVITY_DELTA),messageId:U(),activityType:U(),patch:B_(R_()),subagentRunId:U().optional()}),Zv=jv.extend({type:W(G.RAW),event:R_(),source:U().optional(),subagentRunId:U().optional()}),Qv=jv.extend({type:W(G.CUSTOM),name:U(),value:R_(),subagentRunId:U().optional()}),$v=jv.extend({type:W(G.RUN_STARTED),threadId:U(),runId:U(),parentRunId:U().optional(),input:pv.optional()}),ey=U_(`type`,[V_({type:W(`success`)}).strict(),V_({type:W(`interrupt`),interrupts:B_(dv).min(1)}).strict()]),ty=V_({provider:U().optional(),model:U().optional(),inputTokens:I_().int().nonnegative().optional(),outputTokens:I_().int().nonnegative().optional(),totalTokens:I_().int().nonnegative().optional(),reasoningTokens:I_().int().nonnegative().optional(),cachedInputTokens:I_().int().nonnegative().optional()}),ny=jv.extend({type:W(G.RUN_FINISHED),threadId:U(),runId:U(),result:R_().optional(),outcome:ey.nullable().optional().transform(e=>e??void 0),usage:B_(ty).optional()}),ry=jv.extend({type:W(G.RUN_ERROR),message:U(),code:U().optional(),usage:B_(ty).optional()}),iy=jv.extend({type:W(G.STEP_STARTED),stepName:U(),subagentRunId:U().optional()}),ay=jv.extend({type:W(G.STEP_FINISHED),stepName:U(),subagentRunId:U().optional()}),oy=H_([W(`tool-call`),W(`message`)]),sy=jv.extend({type:W(G.REASONING_START),messageId:U(),subagentRunId:U().optional()}),cy=jv.extend({type:W(G.REASONING_MESSAGE_START),messageId:U(),role:W(`reasoning`),subagentRunId:U().optional()}),ly=jv.extend({type:W(G.REASONING_MESSAGE_CONTENT),messageId:U(),delta:U(),subagentRunId:U().optional()}),uy=jv.extend({type:W(G.REASONING_MESSAGE_END),messageId:U(),subagentRunId:U().optional()}),dy=jv.extend({type:W(G.REASONING_MESSAGE_CHUNK),messageId:U().optional(),delta:U().optional(),subagentRunId:U().optional()}),fy=jv.extend({type:W(G.REASONING_END),messageId:U(),subagentRunId:U().optional()}),py=jv.extend({type:W(G.REASONING_ENCRYPTED_VALUE),subtype:oy,entityId:U(),encryptedValue:U(),subagentRunId:U().optional()}),my=jv.extend({type:W(G.SUBAGENT_STARTED),subagentRunId:U(),name:U(),description:U().optional(),parentSubagentRunId:U().optional(),parentToolCallId:U().optional(),parentMessageId:U().optional()}),hy=U_(`type`,[V_({type:W(`success`)}).strict(),V_({type:W(`suspended`),interruptIds:B_(U()).optional()}).strict()]),gy=U_(`type`,[Mv,Nv,Pv,Fv,Wv,Gv,Iv,Lv,Rv,zv,Bv,Vv,Uv,Hv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ny,ry,iy,ay,sy,cy,ly,uy,dy,fy,py,my,jv.extend({type:W(G.SUBAGENT_FINISHED),subagentRunId:U(),result:R_().optional(),outcome:hy.optional()}),jv.extend({type:W(G.SUBAGENT_ERROR),subagentRunId:U(),message:U(),code:U().optional()})]),_y=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vy=Object.prototype.hasOwnProperty;function yy(e,t){return vy.call(e,t)}function by(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Cy(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function wy(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Ty(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tky,_areEquals:()=>zy,applyOperation:()=>Py,applyPatch:()=>Fy,applyReducer:()=>Iy,deepClone:()=>Ay,getValueByPointer:()=>Ny,validate:()=>Ry,validator:()=>Ly}),ky=Dy,Ay=xy,jy={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=Ny(n,this.path);r&&=xy(r);var i=Py(n,{op:`remove`,path:this.from}).removed;return Py(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=Ny(n,this.from);return Py(n,{op:`add`,path:this.path,value:xy(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:zy(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},My={add:function(e,t,n){return Sy(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:jy.move,copy:jy.copy,test:jy.test,_get:jy._get};function Ny(e,t){if(t==``)return e;var n={op:`_get`,path:t};return Py(e,n),n.value}function Py(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):Ly(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=Ny(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=zy(e,t.value),o.test===!1)throw new ky(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new ky("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=xy(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:Ly;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=wy(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!Sy(f))throw new ky(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else Sy(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new ky(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=My[t.op].call(t,c,f,e);if(o.test===!1)throw new ky(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=jy[t.op].call(t,c,f,e);if(o.test===!1)throw new ky(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new ky('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new ky("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new ky("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&Ty(e.value))throw new ky("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new ky("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new ky(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=Ry([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new ky(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function Ry(e,t,n){try{if(!Array.isArray(e))throw new ky(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)Fy(xy(t),xy(e),n||!0);else{n||=Ly;for(var r=0;rZy,generate:()=>Yy,observe:()=>Jy,unobserve:()=>qy}),Vy=new WeakMap,Hy=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),Uy=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function Wy(e){return Vy.get(e)}function Gy(e,t){return e.observers.get(t)}function Ky(e,t){e.observers.delete(t.callback)}function qy(e,t){t.unobserve()}function Jy(e,t){var n=[],r,i=Wy(e);if(!i)i=new Hy(e),Vy.set(e,i);else{var a=Gy(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=xy(e),t){r.callback=t,r.next=null;var o=function(){Yy(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){Yy(r),clearTimeout(r.next),Ky(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new Uy(t,r)),r}function Yy(e,t){t===void 0&&(t=!1);var n=Vy.get(e.object);Xy(n.value,e.object,e.patches,``,t),e.patches.length&&Fy(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Xy(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=by(t),o=by(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(yy(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?Xy(u,d,n,r+`/`+Cy(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+Cy(l),value:xy(u)}),n.push({op:`replace`,path:r+`/`+Cy(l),value:xy(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+Cy(l),value:xy(u)}),n.push({op:`remove`,path:r+`/`+Cy(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(s||a.length!=o.length)for(var c=0;c0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ib(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ab(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof ob?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function cb(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof rb==`function`?rb(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function lb(e){return typeof e==`function`}function ub(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var db=ub(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: -`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(` - `):``,this.name=`UnsubscriptionError`,this.errors=t}});function fb(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var pb=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=rb(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(lb(c))try{c()}catch(e){i=e instanceof db?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=rb(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{gb(f)}catch(e){i??=[],e instanceof db?i=ab(ab([],ib(i)),ib(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new db(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)gb(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&fb(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&fb(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),mb=pb.EMPTY;function hb(e){return e instanceof pb||e&&`closed`in e&&lb(e.remove)&&lb(e.add)&&lb(e.unsubscribe)}function gb(e){lb(e)?e():e.unsubscribe()}var _b={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},vb={setTimeout:function(e,t){var n=[...arguments].slice(2),r=vb.delegate;return r?.setTimeout?r.setTimeout.apply(r,ab([e,t],ib(n))):setTimeout.apply(void 0,ab([e,t],ib(n)))},clearTimeout:function(e){return(vb.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function yb(e){vb.setTimeout(function(){var t=_b.onUnhandledError;if(t)t(e);else throw e})}function bb(){}var xb=(function(){return wb(`C`,void 0,void 0)})();function Sb(e){return wb(`E`,void 0,e)}function Cb(e){return wb(`N`,e,void 0)}function wb(e,t,n){return{kind:e,value:t,error:n}}var Tb=null;function Eb(e){if(_b.useDeprecatedSynchronousErrorHandling){var t=!Tb;if(t&&(Tb={errorThrown:!1,error:null}),e(),t){var n=Tb,r=n.errorThrown,i=n.error;if(Tb=null,r)throw i}}else e()}function Db(e){_b.useDeprecatedSynchronousErrorHandling&&Tb&&(Tb.errorThrown=!0,Tb.error=e)}var Ob=function(e){eb(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,hb(t)&&t.add(n)):n.destination=Ib,n}return t.create=function(e,t,n){return new Mb(e,t,n)},t.prototype.next=function(e){this.isStopped?Fb(Cb(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Fb(Sb(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Fb(xb,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(pb),kb=Function.prototype.bind;function Ab(e,t){return kb.call(e,t)}var jb=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Nb(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Nb(e)}else Nb(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Nb(e)}},e}(),Mb=function(e){eb(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(lb(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&_b.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Ab(t.next,o),error:t.error&&Ab(t.error,o),complete:t.complete&&Ab(t.complete,o)}):a=t}return i.destination=new jb(a),i}return t}(Ob);function Nb(e){_b.useDeprecatedSynchronousErrorHandling?Db(e):yb(e)}function Pb(e){throw e}function Fb(e,t){var n=_b.onStoppedNotification;n&&vb.setTimeout(function(){return n(e,t)})}var Ib={closed:!0,next:bb,error:Pb,complete:bb},Lb=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Rb(e){return e}function zb(){return Bb([...arguments])}function Bb(e){return e.length===0?Rb:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Vb=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Wb(e)?e:new Mb(e,t,n);return Eb(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Hb(t),new t(function(t,r){var i=new Mb({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[Lb]=function(){return this},e.prototype.pipe=function(){return Bb([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Hb(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Hb(e){return e??_b.Promise??Promise}function Ub(e){return e&&lb(e.next)&&lb(e.error)&&lb(e.complete)}function Wb(e){return e&&e instanceof Ob||Ub(e)&&hb(e)}function Gb(e){return lb(e?.lift)}function Kb(e){return function(t){if(Gb(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function qb(e,t,n,r,i){return new Jb(e,t,n,r,i)}var Jb=function(e){eb(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Ob),Yb=ub(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Xb=function(e){eb(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Zb(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Yb},t.prototype.next=function(e){var t=this;Eb(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=rb(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Eb(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Eb(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?mb:(this.currentObservers=null,a.push(e),new pb(function(){t.currentObservers=null,fb(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Vb;return e.source=this,e},t.create=function(e,t){return new Zb(e,t)},t}(Vb),Zb=function(e){eb(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??mb},t}(Xb),Qb={now:function(){return(Qb.delegate||Date).now()},delegate:void 0},$b=function(e){eb(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Qb);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a=0}function Xx(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Yx(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Yx(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Zx(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=Qx&&(i+=r/Qx|0,r%=Qx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?iS(r,i):rS(r,i)}function eS(e,t){let n=rS(e,t),r=n.hi&2147483648;r&&(n=iS(n.lo,n.hi));let i=tS(n.lo,n.hi);return r?`-`+i:i}function tS(e,t){if({lo:e,hi:t}=nS(e,t),t<=2097151)return String(Qx*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+aS(o)+aS(a)}function nS(e,t){return{lo:e>>>0,hi:t>>>0}}function rS(e,t){return{lo:e|0,hi:t|0}}function iS(e,t){return t=~t,e?e=~e+1:t+=1,rS(e,t)}var aS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function oS(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var sS=cS();function cS(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),fS(i)}return dS}function mS(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var hS;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(hS||={});var gS=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?mS(e):pS().encodeUtf8Into,this.buffer=yS,this.viewCache=bS,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||_S;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(vS),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-vS,n=SS(t);return n>vS&&(this.ensureCapacity(n-vS),this.buffer.copyWithin(e+n,e+vS,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(wS(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(CS(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=xS){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=SS(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=SS(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return TS(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return wS(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return CS(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return CS(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=sS.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=sS.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=sS.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=sS.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=sS.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},_S=128,vS=1,yS=new Uint8Array,bS=new DataView(yS.buffer),xS=32;function SS(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var q=class{constructor(e,t=pS().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Zx,this.uint32=oS,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),sS.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),sS.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,sS.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return sS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return sS.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=xS){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function CS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function wS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function TS(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ES=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function DS(){return{fields:{}}}var OS={encode(e,t=new gS){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&AS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=AS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=DS();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function kS(){return{key:``,value:void 0}}var AS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.key=e.key??``,t.value=e.value??void 0,t}};function jS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var J={encode(e,t=new gS){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&OS.encode(OS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&NS.encode(NS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=OS.unwrap(OS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=NS.unwrap(NS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=jS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=jS();if(e===null)t.nullValue=ES.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function MS(){return{values:[]}}var NS={encode(e,t=new gS){for(let n of e.values)J.encode(J.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(J.unwrap(J.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return NS.fromPartial(e??{})},fromPartial(e){let t=MS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=MS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},PS=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function FS(){return{op:0,path:``,from:void 0,value:void 0}}var IS={encode(e,t=new gS){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function LS(){return{id:``,type:``,function:void 0,metadata:void 0}}var RS={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&BS.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=BS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?BS.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t}};function zS(){return{name:``,arguments:``}}var BS={encode(e,t=new gS){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function VS(){return{value:``,mimeType:``}}var HS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function US(){return{value:``,mimeType:void 0}}var WS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function GS(){return{data:void 0,url:void 0}}var KS={encode(e,t=new gS){return e.data!==void 0&&HS.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&WS.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=HS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=WS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.data=e.data!==void 0&&e.data!==null?HS.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?WS.fromPartial(e.url):void 0,t}};function qS(){return{text:``}}var JS={encode(e,t=new gS){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.text=e.text??``,t}};function YS(){return{source:void 0,metadata:void 0}}var XS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XS.fromPartial(e??{})},fromPartial(e){let t=YS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZS(){return{source:void 0,metadata:void 0}}var QS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function $S(){return{source:void 0,metadata:void 0}}var eC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eC.fromPartial(e??{})},fromPartial(e){let t=$S();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tC(){return{source:void 0,metadata:void 0}}var nC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nC.fromPartial(e??{})},fromPartial(e){let t=tC();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rC(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var iC={encode(e,t=new gS){return e.text!==void 0&&JS.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&XS.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&QS.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&eC.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&nC.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=JS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=XS.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=QS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=eC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=nC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iC.fromPartial(e??{})},fromPartial(e){let t=rC();return t.text=e.text!==void 0&&e.text!==null?JS.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?XS.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?QS.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?eC.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?nC.fromPartial(e.document):void 0,t}};function aC(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0}}var oC={encode(e,t=new gS){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)RS.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)iC.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(RS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(iC.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return oC.fromPartial(e??{})},fromPartial(e){let t=aC();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>RS.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>iC.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function sC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var cC={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&J.encode(J.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=sC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=J.unwrap(J.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cC.fromPartial(e??{})},fromPartial(e){let t=sC();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},lC=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function uC(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Y={encode(e,t=new gS){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&J.encode(J.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=rw(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Y.fromPartial(e??{})},fromPartial(e){let t=uC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function dC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var fC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fC.fromPartial(e??{})},fromPartial(e){let t=dC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function pC(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var mC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mC.fromPartial(e??{})},fromPartial(e){let t=pC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function hC(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var gC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gC.fromPartial(e??{})},fromPartial(e){let t=hC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function _C(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var vC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vC.fromPartial(e??{})},fromPartial(e){let t=_C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function yC(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var bC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bC.fromPartial(e??{})},fromPartial(e){let t=yC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function xC(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var SC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SC.fromPartial(e??{})},fromPartial(e){let t=xC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function CC(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var wC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&J.encode(J.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wC.fromPartial(e??{})},fromPartial(e){let t=CC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function TC(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var EC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)IS.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(IS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return EC.fromPartial(e??{})},fromPartial(e){let t=TC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>IS.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function DC(){return{baseEvent:void 0,messages:[]}}var OC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)oC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(oC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OC.fromPartial(e??{})},fromPartial(e){let t=DC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>oC.fromPartial(e))||[],t}};function kC(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var AC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&J.encode(J.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AC.fromPartial(e??{})},fromPartial(e){let t=kC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function jC(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var MC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return MC.fromPartial(e??{})},fromPartial(e){let t=jC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function NC(){return{baseEvent:void 0,threadId:``,runId:``}}var PC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return PC.fromPartial(e??{})},fromPartial(e){let t=NC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function FC(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var IC={encode(e,t=new gS){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=rw(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=rw(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=rw(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=rw(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=rw(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IC.fromPartial(e??{})},fromPartial(e){let t=FC();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function LC(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var RC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)cC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)IC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(cC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RC.fromPartial(e??{})},fromPartial(e){let t=LC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>cC.fromPartial(e))||[],t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function zC(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var BC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)IC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BC.fromPartial(e??{})},fromPartial(e){let t=zC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function VC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var HC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function UC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var WC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WC.fromPartial(e??{})},fromPartial(e){let t=UC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function GC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var KC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KC.fromPartial(e??{})},fromPartial(e){let t=GC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function qC(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var JC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JC.fromPartial(e??{})},fromPartial(e){let t=qC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function YC(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var XC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XC.fromPartial(e??{})},fromPartial(e){let t=YC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function ZC(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var QC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QC.fromPartial(e??{})},fromPartial(e){let t=ZC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function $C(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var ew={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ew.fromPartial(e??{})},fromPartial(e){let t=$C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function tw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0}}var nw={encode(e,t=new gS){return e.textMessageStart!==void 0&&fC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&mC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&gC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&vC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&bC.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&SC.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&wC.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&EC.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&OC.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&AC.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&MC.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&PC.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&RC.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&BC.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&HC.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&WC.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&KC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&JC.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&XC.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&QC.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&ew.encode(e.subagentError,t.uint32(170).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=fC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=mC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=gC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=vC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=bC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=SC.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=wC.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=EC.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=OC.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=AC.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=MC.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=PC.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=RC.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=BC.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=HC.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=WC.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=KC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=JC.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=XC.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=QC.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=ew.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?fC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?mC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?gC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?vC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?bC.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?SC.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?wC.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?EC.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?OC.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?AC.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?MC.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?PC.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?RC.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?BC.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?HC.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?WC.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?KC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?JC.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?XC.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?QC.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?ew.fromPartial(e.subagentError):void 0,t}};function rw(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,aw=e=>{let t=iw(e);if(t){if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}}},ow=e=>{let t=iw(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:aw(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:aw(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:aw(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:aw(e.source),metadata:e.metadata}}}};function sw(e){let t=nw.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=lC[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,n.baseEvent.metadata!==void 0&&(n.metadata=n.baseEvent.metadata),delete n.baseEvent,n.type===G.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>ow(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===G.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if(n.type===G.SUBAGENT_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interruptIds)?e.interruptIds:[];delete e.interruptIds,t===`suspended`?e.outcome={type:`suspended`,...r.length>0&&{interruptIds:r}}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===G.RUN_FINISHED||n.type===G.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===G.STATE_DELTA)for(let e of n.delta)e.op=PS[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),gy.parse(n)}var cw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(cw||={});var lw;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(lw||={});var X=cw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),uw=e=>{switch(typeof e){case`undefined`:return X.undefined;case`string`:return X.string;case`number`:return Number.isNaN(e)?X.nan:X.number;case`boolean`:return X.boolean;case`function`:return X.function;case`bigint`:return X.bigint;case`symbol`:return X.symbol;case`object`:return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?X.promise:typeof Map<`u`&&e instanceof Map?X.map:typeof Set<`u`&&e instanceof Set?X.set:typeof Date<`u`&&e instanceof Date?X.date:X.object;default:return X.unknown}},Z=cw.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),dw=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};dw.create=e=>new dw(e);var fw=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===X.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,cw.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${cw.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${cw.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${cw.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:cw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,cw.assertNever(e)}return{message:n}},pw=fw;function mw(){return pw}var hw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=mw(),r=hw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fw?void 0:fw].filter(e=>!!e)});e.common.issues.push(r)}var gw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return _w;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return _w;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},_w=Object.freeze({status:`aborted`}),vw=e=>({status:`dirty`,value:e}),yw=e=>({status:`valid`,value:e}),bw=e=>e.status===`aborted`,xw=e=>e.status===`dirty`,Sw=e=>e.status===`valid`,Cw=e=>typeof Promise<`u`&&e instanceof Promise,$;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})($||={});var ww=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Tw=(e,t)=>{if(Sw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new dw(e.common.issues);return this._error=t,this._error}}};function Ew(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Dw=class{get description(){return this._def.description}_getType(e){return uw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gw,ctx:{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Cw(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};return Tw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Sw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Sw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)},r=this._parse({data:e,path:n.path,parent:n});return Tw(n,await(Cw(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new AT({schema:this,typeName:zT.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return jT.create(this,this._def)}nullable(){return MT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dT.create(this)}promise(){return kT.create(this,this._def)}or(e){return mT.create([this,e],this._def)}and(e){return vT.create(this,e,this._def)}transform(e){return new AT({...Ew(this._def),schema:this,typeName:zT.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new NT({...Ew(this._def),innerType:this,defaultValue:t,typeName:zT.ZodDefault})}brand(){return new IT({typeName:zT.ZodBranded,type:this,...Ew(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new PT({...Ew(this._def),innerType:this,catchValue:t,typeName:zT.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return LT.create(this,e)}readonly(){return RT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ow=/^c[^\s-]{8,}$/i,kw=/^[0-9a-z]+$/,Aw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mw=/^[a-z0-9_-]{21}$/i,Nw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Lw,Rw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ww=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Gw=RegExp(`^${Ww}$`);function Kw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qw(e){return RegExp(`^${Kw(e)}$`)}function Jw(e){let t=`${Ww}T${Kw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Yw(e,t){return!((t!==`v4`&&t||!Rw.test(e))&&(t!==`v6`&&t||!Bw.test(e)))}function Xw(e,t){if(!Nw.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Zw(e,t){return!((t!==`v4`&&t||!zw.test(e))&&(t!==`v6`&&t||!Vw.test(e)))}var Qw=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==X.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.string,received:t.parsedType}),_w}let t=new gw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:Z.invalid_string,...$.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...$.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...$.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...$.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...$.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...$.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...$.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...$.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...$.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...$.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...$.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...$.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...$.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...$.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Qw({checks:[],typeName:zT.ZodString,coerce:e?.coerce??!1,...Ew(e)});function $w(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var eT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==X.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.number,received:t.parsedType}),_w}let t,n=new gw;for(let r of this._def.checks)r.kind===`int`?cw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?$w(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:$.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:$.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:$.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:$.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&cw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew eT({checks:[],typeName:zT.ZodNumber,coerce:e?.coerce||!1,...Ew(e)});var tT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==X.bigint)return this._getInvalidInput(e);let t,n=new gw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.bigint,received:t.parsedType}),_w}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew tT({checks:[],typeName:zT.ZodBigInt,coerce:e?.coerce??!1,...Ew(e)});var nT=class extends Dw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==X.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.boolean,received:t.parsedType}),_w}return yw(e.data)}};nT.create=e=>new nT({typeName:zT.ZodBoolean,coerce:e?.coerce||!1,...Ew(e)});var rT=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==X.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.date,received:t.parsedType}),_w}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),_w;let t=new gw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):cw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew rT({checks:[],coerce:e?.coerce||!1,typeName:zT.ZodDate,...Ew(e)});var iT=class extends Dw{_parse(e){if(this._getType(e)!==X.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.symbol,received:t.parsedType}),_w}return yw(e.data)}};iT.create=e=>new iT({typeName:zT.ZodSymbol,...Ew(e)});var aT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.undefined,received:t.parsedType}),_w}return yw(e.data)}};aT.create=e=>new aT({typeName:zT.ZodUndefined,...Ew(e)});var oT=class extends Dw{_parse(e){if(this._getType(e)!==X.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.null,received:t.parsedType}),_w}return yw(e.data)}};oT.create=e=>new oT({typeName:zT.ZodNull,...Ew(e)});var sT=class extends Dw{constructor(){super(...arguments),this._any=!0}_parse(e){return yw(e.data)}};sT.create=e=>new sT({typeName:zT.ZodAny,...Ew(e)});var cT=class extends Dw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yw(e.data)}};cT.create=e=>new cT({typeName:zT.ZodUnknown,...Ew(e)});var lT=class extends Dw{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.never,received:t.parsedType}),_w}};lT.create=e=>new lT({typeName:zT.ZodNever,...Ew(e)});var uT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.void,received:t.parsedType}),_w}return yw(e.data)}};uT.create=e=>new uT({typeName:zT.ZodVoid,...Ew(e)});var dT=class e extends Dw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==X.array)return Q(t,{code:Z.invalid_type,expected:X.array,received:t.parsedType}),_w;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new ww(t,e,t.path,n)))).then(e=>gw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new ww(t,e,t.path,n)));return gw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(e){return this.min(1,e)}};dT.create=(e,t)=>new dT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:zT.ZodArray,...Ew(t)});function fT(e){if(e instanceof pT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=jT.create(fT(r))}return new pT({...e._def,shape:()=>t})}return e instanceof dT?new dT({...e._def,type:fT(e.element)}):e instanceof jT?jT.create(fT(e.unwrap())):e instanceof MT?MT.create(fT(e.unwrap())):e instanceof yT?yT.create(e.items.map(e=>fT(e))):e}var pT=class e extends Dw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=cw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==X.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof lT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new ww(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof lT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new ww(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>gw.mergeObjectSync(t,e)):gw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:$.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:zT.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of cw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of cw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return fT(this)}partial(t){let n={};for(let e of cw.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of cw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof jT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return ET(cw.objectKeys(this.shape))}};pT.create=(e,t)=>new pT({shape:()=>e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.strictCreate=(e,t)=>new pT({shape:()=>e,unknownKeys:`strict`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.lazycreate=(e,t)=>new pT({shape:e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)});var mT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new dw(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),_w}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new dw(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),_w}}get options(){return this._def.options}};mT.create=(e,t)=>new mT({options:e,typeName:zT.ZodUnion,...Ew(t)});var hT=e=>e instanceof wT?hT(e.schema):e instanceof AT?hT(e.innerType()):e instanceof TT?[e.value]:e instanceof DT?e.options:e instanceof OT?cw.objectValues(e.enum):e instanceof NT?hT(e._def.innerType):e instanceof aT?[void 0]:e instanceof oT?[null]:e instanceof jT?[void 0,...hT(e.unwrap())]:e instanceof MT?[null,...hT(e.unwrap())]:e instanceof IT||e instanceof RT?hT(e.unwrap()):e instanceof PT?hT(e._def.innerType):[],gT=class e extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.object)return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=hT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:zT.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ew(r)})}};function _T(e,t){let n=uw(e),r=uw(t);if(e===t)return{valid:!0,data:e};if(n===X.object&&r===X.object){let n=cw.objectKeys(t),r=cw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_T(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===X.array&&r===X.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(bw(e)||bw(r))return _w;let i=_T(e.value,r.value);return i.valid?((xw(e)||xw(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),_w)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};vT.create=(e,t,n)=>new vT({left:e,right:t,typeName:zT.ZodIntersection,...Ew(n)});var yT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.array)return Q(n,{code:Z.invalid_type,expected:X.array,received:n.parsedType}),_w;if(n.data.lengththis._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new ww(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>gw.mergeArray(t,e)):gw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new yT({items:e,typeName:zT.ZodTuple,rest:null,...Ew(t)})};var bT=class e extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.object)return Q(n,{code:Z.invalid_type,expected:X.object,received:n.parsedType}),_w;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new ww(n,e,n.path,e)),value:a._parse(new ww(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?gw.mergeObjectAsync(t,r):gw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Dw?new e({keyType:t,valueType:n,typeName:zT.ZodRecord,...Ew(r)}):new e({keyType:Qw.create(),valueType:t,typeName:zT.ZodRecord,...Ew(n)})}},xT=class extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.map)return Q(n,{code:Z.invalid_type,expected:X.map,received:n.parsedType}),_w;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new ww(n,e,n.path,[a,`key`])),value:i._parse(new ww(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};xT.create=(e,t,n)=>new xT({valueType:t,keyType:e,typeName:zT.ZodMap,...Ew(n)});var ST=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.set)return Q(n,{code:Z.invalid_type,expected:X.set,received:n.parsedType}),_w;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return _w;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new ww(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ST.create=(e,t)=>new ST({valueType:e,minSize:null,maxSize:null,typeName:zT.ZodSet,...Ew(t)});var CT=class e extends Dw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.function)return Q(t,{code:Z.invalid_type,expected:X.function,received:t.parsedType}),_w;function n(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof kT){let e=this;return yw(async function(...t){let o=new dw([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return yw(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new dw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new dw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yT.create(t).rest(cT.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||yT.create([]).rest(cT.create()),returns:n||cT.create(),typeName:zT.ZodFunction,...Ew(r)})}},wT=class extends Dw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};wT.create=(e,t)=>new wT({getter:e,typeName:zT.ZodLazy,...Ew(t)});var TT=class extends Dw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),_w}return{status:`valid`,value:e.data}}get value(){return this._def.value}};TT.create=(e,t)=>new TT({value:e,typeName:zT.ZodLiteral,...Ew(t)});function ET(e,t){return new DT({values:e,typeName:zT.ZodEnum,...Ew(t)})}var DT=class e extends Dw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:cw.joinValues(n),received:t.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),_w}return yw(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};DT.create=ET;var OT=class extends Dw{_parse(e){let t=cw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==X.string&&n.parsedType!==X.number){let e=cw.objectValues(t);return Q(n,{expected:cw.joinValues(e),received:n.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(cw.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=cw.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),_w}return yw(e.data)}get enum(){return this._def.values}};OT.create=(e,t)=>new OT({values:e,typeName:zT.ZodNativeEnum,...Ew(t)});var kT=class extends Dw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==X.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:X.promise,received:t.parsedType}),_w):yw((t.parsedType===X.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};kT.create=(e,t)=>new kT({type:e,typeName:zT.ZodPromise,...Ew(t)});var AT=class extends Dw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===zT.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return _w;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r});{if(t.value===`aborted`)return _w;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?_w:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?_w:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sw(e))return _w;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Sw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):_w)}cw.assertNever(r)}};AT.create=(e,t,n)=>new AT({schema:e,typeName:zT.ZodEffects,effect:t,...Ew(n)}),AT.createWithPreprocess=(e,t,n)=>new AT({schema:t,effect:{type:`preprocess`,transform:e},typeName:zT.ZodEffects,...Ew(n)});var jT=class extends Dw{_parse(e){return this._getType(e)===X.undefined?yw(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jT.create=(e,t)=>new jT({innerType:e,typeName:zT.ZodOptional,...Ew(t)});var MT=class extends Dw{_parse(e){return this._getType(e)===X.null?yw(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};MT.create=(e,t)=>new MT({innerType:e,typeName:zT.ZodNullable,...Ew(t)});var NT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};NT.create=(e,t)=>new NT({innerType:e,typeName:zT.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Ew(t)});var PT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cw(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};PT.create=(e,t)=>new PT({innerType:e,typeName:zT.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Ew(t)});var FT=class extends Dw{_parse(e){if(this._getType(e)!==X.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.nan,received:t.parsedType}),_w}return{status:`valid`,value:e.data}}};FT.create=e=>new FT({typeName:zT.ZodNaN,...Ew(e)});var IT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},LT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),vw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:zT.ZodPipeline})}},RT=class extends Dw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Sw(e)&&(e.value=Object.freeze(e.value)),e);return Cw(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};RT.create=(e,t)=>new RT({innerType:e,typeName:zT.ZodReadonly,...Ew(t)}),pT.lazycreate;var zT;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(zT||={});var BT=Qw.create;eT.create,FT.create,tT.create;var VT=nT.create;rT.create,iT.create,aT.create,oT.create;var HT=sT.create;cT.create,lT.create,uT.create,dT.create;var UT=pT.create;pT.strictCreate,mT.create;var WT=gT.create;vT.create,yT.create,bT.create,xT.create,ST.create,CT.create,wT.create;var GT=TT.create,KT=DT.create;OT.create,kT.create,AT.create,jT.create,MT.create,AT.createWithPreprocess,LT.create;var qT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,JT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(qT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},YT=e=>e===`*`||e===`x`||e===`X`,XT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},ZT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],QT=(e,t)=>{if(YT(e)||YT(t))return 0;let[n,r]=ZT(XT(e),XT(t));return n>r?1:n{for(let n=0;n{let n=JT(e),r=JT(t),i=n.pop(),a=r.pop(),o=$T(n,r);return o===0?i&&a?$T(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},tE=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function nE(){return rg()}function rE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&rE(t);return e}var iE=524288;function aE(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function oE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!aE(t,n,iE),c=s?tE(t):t,l=s?tE(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(rE(c),rE(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=tE(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=tE(e.state),d=!0,n=!0),s&&n&&aE(c,l,iE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?tE(c):c}:{},...d?{state:Object.isFrozen(l)?tE(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function sE(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function cE(e){if(e instanceof lE)return e;if(e===!0)return new lE(sE(!0))}var lE=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function uE(e){return e.enabled?new lE(e):void 0}function dE(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function fE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Y_(e.metadata,tE(t.metadata)),!0)}var pE=(e,t,n,r,i)=>{let a=cE(i),o=tE(n.messages),s=tE(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=tE(c);return c={},e.messages!==void 0||e.state!==void 0?Nx(e):ex};return t.pipe(Ux(async t=>{let i=await oE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return u();switch(t.type){case G.TEXT_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),u();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=fE(s,t);(!a||c)&&l({messages:o})}return u()}case G.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),u();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let d=await oE(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let c=await oE(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_START:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t,a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(fE(a,t)||r)&&l({messages:o}),u()}let s=new Set(o.map(e=>e.id)),c=dE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let d={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(d),fE(d,t),l({messages:o})}return u()}case G.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await oE(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Xx(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,fE(d,t),l({messages:o})),u()}case G.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),u();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return l(d),d.stopPropagation!==!0&&fE(c,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_RESULT:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u,subagentRunId:d}=t,f={id:i,toolCallId:a,role:u||`tool`,content:c,...d!=null&&{subagentRunId:d}};fE(f,t);let p=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(p===-1)o.push(f);else{let e=p+1;for(;e{t.onNewMessage?.({message:f,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case G.STATE_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case G.STATE_DELTA:{let i=await oE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Qy.applyPatch(s,e,!0,!1).newDocument,l({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return u()}case G.MESSAGES_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=n.some(e=>e.role===`activity`),a=n.some(e=>e.role===`reasoning`),s=e=>e.role===`activity`&&!i||e.role===`reasoning`&&!a;o=o.filter(e=>s(e)||r.has(e.id)).map(e=>s(e)?e:r.get(e.id));let c=new Set(o.map(e=>e.id));for(let e of n)c.has(e.id)||o.push(e);l({messages:o})}return u()}case G.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await oE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:tE(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,u;a===-1?(o.push(t),c=t,u=t):d?(f&&(o[a]={...d,activityType:i.activityType,content:tE(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),u=o[a]):f&&(o[a]=t,c=t,u=t),fE(u,i),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case G.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await oE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{fE(d,i)&&l({messages:o});let e=tE(d.content??{}),t=Qy.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:tE(t),activityType:i.activityType},l({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return u()}case G.RAW:return l(await oE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.CUSTOM:return l(await oE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.RUN_STARTED:{let i=await oE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}l({messages:o})}}return u()}case G.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await oE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),u()}case G.RUN_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case G.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case G.THINKING_START:return u();case G.THINKING_END:return u();case G.THINKING_TEXT_MESSAGE_START:return u();case G.THINKING_TEXT_MESSAGE_CONTENT:return u();case G.THINKING_TEXT_MESSAGE_END:return u();case G.REASONING_START:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e),i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=fE(i,t);(!r||a)&&l({messages:o})}return u()}case G.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u();let c=await oE(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case G.REASONING_END:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await oE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}case G.SUBAGENT_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u()}return t.type,u()}),zx(),r.length>0?Wx({}):e=>e)},mE=e=>t=>{let n=cE(e),r=new Set,i=new Set,a=new Set,o={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},s=!1,c=!1,l=!1,u=new Map,d=e=>{let t=u.get(e);return t||(t=new Map,u.set(e,t)),t},f=()=>{for(let e of u.values())if(e.size>0)return!0;return!1},p=new Map,m=new Set,h=!1,g=!1,_=!1,v=()=>{r.clear(),i.clear(),a.clear(),o.message.clear(),o.toolCall.clear(),o.activity.clear(),o.reasoning.clear(),u.clear(),p.clear(),m.clear(),h=!1,g=!1,s=!1,c=!1,_=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new hv(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?o.reasoning:e.role===`activity`?o.activity:o.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!o.toolCall.has(n.id))&&o.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new hv(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Rx(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),c&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(s&&t!==G.RUN_ERROR&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!l){if(l=!0,t!==G.RUN_STARTED&&t!==G.RUN_ERROR)return K(()=>new hv(`First event must be 'RUN_STARTED'`))}else if(t===G.RUN_STARTED){if(_&&!s&&!c)return K(()=>new hv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(s||c)&&v()}if(e.subagentRunId===null)return K(()=>new hv(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===G.SUBAGENT_STARTED||t===G.SUBAGENT_FINISHED||t===G.SUBAGENT_ERROR){let n=t===G.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===G.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return K(()=>new hv(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return K(()=>new hv(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return K(()=>new hv(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return K(()=>new hv(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===G.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return K(()=>new hv(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case G.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=o.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return K(()=>r)}return r.add(n),i||o.message.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):Nx(e)}case G.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):(r.delete(n),Nx(e))}case G.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,s;if(r!==void 0){let e=o.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));s=e}}let c=o.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return K(()=>e);if(a===void 0&&s&&s.subagentRunId!==c.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${s.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||o.toolCall.set(n,a===void 0?s??{subagentRunId:void 0}:{subagentRunId:a}),Nx(e)}case G.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):Nx(e)}case G.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):(i.delete(n),Nx(e))}case G.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return d(n).has(t)?K(()=>new hv(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(d(n).set(t,!0),Nx(e))}case G.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!d(n).has(t)){let e,r=!1;for(let[i,a]of u)if(i!==n&&a.has(t)){e=i,r=!0;break}return K(r?()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return d(n).delete(t),Nx(e)}case G.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!o.activity.has(t)||e.replace!==!1)&&o.activity.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&o.message.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_START:case G.REASONING_MESSAGE_START:{let n=e.messageId,r=o.reasoning.get(n);if(r){let i=b(t,e.subagentRunId,r,`reasoning message`,n);if(i)return K(()=>i)}return a.add(n),r||o.reasoning.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:{let n=e.messageId,r=b(t,e.subagentRunId,o.reasoning.get(n),`reasoning message`,n);return r?K(()=>r):(t===G.REASONING_END&&a.delete(n),Nx(e))}case G.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?o.toolCall.get(n):r===`message`?o.message.get(n)??o.reasoning.get(n):o.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,s=b(t,e.subagentRunId,i,a,n);return s?K(()=>s):Nx(e)}case G.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,o.activity.get(n),`activity`,n);return r?K(()=>r):Nx(e)}case G.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return p.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):m.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!p.has(n)&&!m.has(n)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(p.set(t,!0),Nx(e))}case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===G.SUBAGENT_ERROR&&typeof e.message!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return p.has(n)?(p.delete(n),m.add(n),Nx(e)):K(()=>new hv(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case G.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return K(()=>t)}return Nx(e);case G.RUN_STARTED:_=!0;{let t=y((e.input??{}).messages,!1);if(t)return K(()=>t)}return Nx(e);case G.RUN_FINISHED:if(f()){let e=[];for(let[t,n]of u)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(p.size>0){let e=Array.from(p.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return s=!0,Nx(e);case G.RUN_ERROR:return c=!0,Nx(e);case G.CUSTOM:return Nx(e);case G.THINKING_TEXT_MESSAGE_START:return h?g?K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(g=!0,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case G.THINKING_TEXT_MESSAGE_CONTENT:return g?Nx(e):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case G.THINKING_TEXT_MESSAGE_END:return g?(g=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case G.THINKING_START:return h?K(()=>new hv(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(h=!0,Nx(e));case G.THINKING_END:return h?(h=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return Nx(e)}}))},hE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),gE=e=>Bx(()=>Mx(e())).pipe(Kx(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Mx(e.text()).pipe(Rx(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,K(()=>i)}))}let t={type:hE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vb(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:hE.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):K(()=>Error(`Failed to getReader() from response`))})),_E=(e,t)=>{let n=cE(t),r=new Xb,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e)}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` -`),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` -`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},vE=e=>{let t=new Xb,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=cE(t),r=new Xb,i=new $b,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===hE.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?vE(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):_E(i,n).subscribe({next:e=>{try{let t=gy.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:G.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},bE=KT([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),xE=KT([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);WT(`type`,[UT({type:GT(bE.enum.TextMessageStart),messageId:BT(),parentMessageId:BT().optional(),role:BT().optional()}),UT({type:GT(bE.enum.TextMessageContent),messageId:BT(),content:BT()}),UT({type:GT(bE.enum.TextMessageEnd),messageId:BT()}),UT({type:GT(bE.enum.ActionExecutionStart),actionExecutionId:BT(),actionName:BT(),parentMessageId:BT().optional()}),UT({type:GT(bE.enum.ActionExecutionArgs),actionExecutionId:BT(),args:BT()}),UT({type:GT(bE.enum.ActionExecutionEnd),actionExecutionId:BT()}),UT({type:GT(bE.enum.ActionExecutionResult),actionName:BT(),actionExecutionId:BT(),result:BT()}),UT({type:GT(bE.enum.AgentStateMessage),threadId:BT(),agentName:BT(),nodeName:BT(),runId:BT(),active:VT(),role:BT(),state:BT(),running:VT()}),UT({type:GT(bE.enum.MetaEvent),name:xE,value:HT()}),UT({type:GT(bE.enum.RunError),message:BT(),code:BT().optional()})]),UT({id:BT(),role:BT(),content:BT(),parentMessageId:BT().optional()}),UT({id:BT(),name:BT(),arguments:HT(),parentMessageId:BT().optional()}),UT({id:BT(),result:HT(),actionExecutionId:BT(),actionName:BT()});var SE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)},CE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Rx(r=>{switch(r.type){case G.TEXT_MESSAGE_START:{let e=r;return[{type:bE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case G.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case G.TEXT_MESSAGE_END:{let e=r;return[{type:bE.enum.TextMessageEnd,messageId:e.messageId}]}case G.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case G.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:bE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case G.TOOL_CALL_END:{let e=r;return[{type:bE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case G.TOOL_CALL_RESULT:{let e=r;return[{type:bE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case G.RAW:return[];case G.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bE.enum.MetaEvent,name:e.name,value:e.value}]}case G.STATE_SNAPSHOT:return f(r.snapshot),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case G.STATE_DELTA:{let c=r,l=Qy.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case G.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case G.RUN_STARTED:return[];case G.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:wE(c)}:{}}),active:!1}];case G.RUN_ERROR:{let e=r;return[{type:bE.enum.RunError,message:e.message,code:e.code}]}case G.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case G.STEP_FINISHED:return u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function wE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=SE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var TE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,EE=e=>e===`tool`?`toolCallId`:`messageId`,DE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},OE=e=>t=>{let n=cE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:G.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:G.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:G.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&TE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${EE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Rx(e=>{switch(e.type){case G.TEXT_MESSAGE_START:case G.TEXT_MESSAGE_CONTENT:case G.TEXT_MESSAGE_END:case G.TOOL_CALL_START:case G.TOOL_CALL_ARGS:case G.TOOL_CALL_END:case G.TOOL_CALL_RESULT:case G.STATE_SNAPSHOT:case G.STATE_DELTA:case G.CUSTOM:case G.STEP_STARTED:case G.STEP_FINISHED:case G.THINKING_START:case G.THINKING_END:case G.THINKING_TEXT_MESSAGE_START:case G.THINKING_TEXT_MESSAGE_CONTENT:case G.THINKING_TEXT_MESSAGE_END:case G.REASONING_START:case G.REASONING_MESSAGE_START:case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:return[...i(e.subagentRunId??void 0),e];case G.RUN_STARTED:case G.RUN_FINISHED:case G.RUN_ERROR:case G.MESSAGES_SNAPSHOT:return[...a(),e];case G.RAW:case G.ACTIVITY_SNAPSHOT:case G.ACTIVITY_DELTA:case G.REASONING_ENCRYPTED_VALUE:case G.SUBAGENT_STARTED:return[e];case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case G.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=DE({type:G.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=DE({type:G.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=DE({type:G.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),Gx(()=>{a()}))};function kE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var AE=class{runNext(e,t){return t.run(e).pipe(OE(!1))}runNextWithState(e,t){let n=tE(e.messages||[]),r=tE(e.state||{}),i=new $b;return pE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:tE(n),state:tE(r)})))}},jE=class extends AE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ME(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var NE=class extends AE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ME)};return this.runNext(i,t)}},PE=`THINKING_START`,FE=`THINKING_END`,IE=`THINKING_TEXT_MESSAGE_START`,LE=`THINKING_TEXT_MESSAGE_CONTENT`,RE=`THINKING_TEXT_MESSAGE_END`,zE=class extends AE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ix(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PE:{this.currentReasoningId=nE();let{title:t,...n}=e;return this.warnAboutTransformation(PE,G.REASONING_START),{...n,type:G.REASONING_START,messageId:this.currentReasoningId}}case IE:return this.currentMessageId=nE(),this.warnAboutTransformation(IE,G.REASONING_MESSAGE_START),{...e,type:G.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case LE:{let{delta:t,...n}=e;return this.warnAboutTransformation(LE,G.REASONING_MESSAGE_CONTENT),{...n,type:G.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??nE(),delta:t}}case RE:{let t=this.currentMessageId??nE();return this.warnAboutTransformation(RE,G.REASONING_MESSAGE_END),{...e,type:G.REASONING_MESSAGE_END,messageId:t}}case FE:{let t=this.currentReasoningId??nE();return this.warnAboutTransformation(FE,G.REASONING_END),{...e,type:G.REASONING_END,messageId:t}}default:return e}}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function UE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>VE(e)?HE(e):e);return{...e,content:n}}var WE=class extends AE{run(e,t){let n={...e,messages:e.messages.map(UE)};return this.runNext(n,t)}},GE=`SUBAGENT_STARTED`,KE=`SUBAGENT_FINISHED`,qE=`SUBAGENT_ERROR`;function JE(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function YE(e){return e.map(e=>JE(e))}var XE=class extends AE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>JE(e))};return this.runNext(n,t).pipe(Jx(e=>{let t=e.type;(t===GE||t===KE||t===qE)&&this.warnDroppedLifecycleEvent(t)}),Vx(e=>{let t=e.type;return t!==GE&&t!==KE&&t!==qE}),Ix(e=>{let t=JE(e);if(t.type===G.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:YE(e.messages)}}if(t.type===G.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>JE(e))}}}if(t.type===G.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:YE(e.input.messages)}}}return t}))}},ZE=`0.0.59`,QE=class{get maxVersion(){return ZE}get debug(){return this._debug}set debug(e){this._debug=sE(e),this._debugLogger=uE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?uE(sE(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??rg(),this.messages=tE(r??[]),this.state=tE(i??{}),this._debug=sE(a),this._debugLogger=uE(this._debug),eE(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new NE),eE(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new zE),eE(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new WE),eE(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new XE)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new jE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Gx(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)));let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new gv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>Bx(()=>this.connect(n)),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof gv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return pE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=tE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||rg(),tools:tE(e?.tools??[]),context:tE(e?.context??[]),forwardedProps:tE(e?.forwardedProps??{}),state:tE(this.state),messages:n,...e?.resume===void 0?{}:{resume:tE(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new hv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(kE(e))throw new hv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Mx(oE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Ix(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=tE(this.messages),e.state=tE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=tE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=tE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=tE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??rg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(OE(this.debugLogger),mE(this.debugLogger),CE(this.threadId,t.runId,this.agentId),e=>e.pipe(Ix(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function $E(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var eD=class extends QE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify($E(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=tE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yE(gE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=tE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},tD=L.createContext(void 0),nD=e=>{let t=L.useContext(tD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rD=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(tD.Provider,{value:e,children:t})),iD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aD=new class{#e=iD;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oD(e){setTimeout(e,0)}var sD=typeof window>`u`||`Deno`in globalThis;function cD(){}function lD(e,t){return typeof e==`function`?e(t):e}function uD(e){return typeof e==`number`&&e>=0&&e!==1/0}function dD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fD(e,t){return typeof e==`function`?e(t):e}function pD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==hD(o,t.options))return!1}else if(!_D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function mD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(gD(t.options.mutationKey)!==gD(a))return!1}else if(!_D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hD(e,t){return(t?.queryKeyHashFn||gD)(e)}function gD(e){return JSON.stringify(e,(e,t)=>SD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=xD(e)&&xD(t);if(!r&&!(SD(e)&&SD(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{aD.setTimeout(t,e)})}function TD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:yD(e,t)}function ED(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function DD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var OD=Symbol();function kD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===OD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AD(e,t){return typeof e==`function`?e(...t):!!e}function jD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var MD=()=>sD,ND=()=>MD(),PD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FD=new class extends PD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ID=oD;function LD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ID,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var RD=LD(),zD=new class extends PD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function BD(e){return Math.min(1e3*2**e,3e4)}function VD(e){return(e??`online`)!==`online`||zD.isOnline()}var HD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function UD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(cD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new HD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>FD.isFocused()&&(e.networkMode===`always`||zD.isOnline())&&e.canRun(),p=()=>VD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ND()?0:3),a=e.retryDelay??BD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var WD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uD(this.gcTime)&&(this.#e=aD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ND()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aD.clearTimeout(this.#e),this.#e=void 0)}};function GD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{jD(e,()=>t.signal,()=>n=!0)},u=kD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?DD:ED;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?qD:KD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:KD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function KD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function JD(e,t){return t?KD(e,t)!=null:!1}function YD(e,t){return!t||!e.getPreviousPageParam?!1:qD(e,t)!=null}var XD=class extends WD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$D(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=$D(this.options);e.data!==void 0&&(this.setState(QD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=TD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(cD).catch(cD):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===OD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fD(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!dD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=kD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?GD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=UD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof HD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof HD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ZD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...QD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),RD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ZD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function QD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function $D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var eO=class extends PD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rO(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fD(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!bD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&iO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||fD(this.options.staleTime,this.#t)!==fD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bD(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cD)),t}#h(e){return!ND()&&fD(this.options.enabled,this.#t)!==!1&&uD(e)}#g(){this.#b();let e=fD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=dD(this.#r.dataUpdatedAt,e)+1;this.#u=aD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aD.setInterval(()=>{(this.options.refetchIntervalInBackground||FD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aD.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&nO(e,t),o=i&&iO(e,n,t,r);(a||o)&&(l={...l,...ZD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=TD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=TD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:aO(e,t),refetch:this.refetch,isEnabled:fD(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),bD(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();RD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function tO(e,t){return fD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fD(t.retryOnMount,e)!==!1)}function nO(e,t){return tO(e,t)||e.state.data!==void 0&&rO(e,t,t.refetchOnMount)}function rO(e,t,n){if(fD(t.enabled,e)!==!1&&fD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&aO(e,t)}return!1}function iO(e,t,n,r){return(e!==t||fD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&aO(e,n)}function aO(e,t){return fD(t.enabled,e)!==!1&&e.isStaleByTime(fD(t.staleTime,e))}var oO=class extends eO{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:JD(t,n.data),hasPreviousPage:YD(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},sO=class extends WD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||cO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),RD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function cO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var lO=class extends PD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new sO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=uO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){RD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mD(t,e))}findAll(e={}){return this.getAll().filter(t=>mD(e,t))}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return RD.batch(()=>Promise.all(e.map(e=>e.continue().catch(cD))))}};function uO(e){return e.options.scope?.id}var dO=class extends PD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??hD(r,t),a=this.get(i);return a||(a=new XD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){RD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pD(e,t)):t}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){RD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){RD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new dO,this.#t=e.mutationCache||new lO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fD(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=lD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return RD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;RD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return RD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=RD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cD).catch(cD)}invalidateQueries(e,t={}){return RD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=RD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cD)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fD(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cD).catch(cD)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cD).catch(cD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return zD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(gD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_D(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(gD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_D(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=hD(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===OD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pO=L.createContext(!1),mO=()=>L.useContext(pO);pO.Provider;function hO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gO=L.createContext(hO()),_O=()=>L.useContext(gO),vO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?AD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},yO=e=>{L.useEffect(()=>{e.clearReset()},[e])},bO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AD(n,[e.error,r])),xO=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},SO=(e,t)=>e?.suspense&&t.isPending,CO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wO(e,t,n){let r=mO(),i=_O(),a=nD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xO(o),vO(o,i,s),yO(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(RD.batchCalls(e)):cD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),SO(o,u))throw CO(o,l,i);if(bO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function TO(e,t){return wO(e,eO,t)}function EO(e,t){return wO(e,oO,t)}var DO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),OO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),kO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),AO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),jO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),MO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),NO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),PO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),FO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),IO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),LO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),RO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),zO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),BO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),VO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:DO}));VO.displayName=`ArrowLeftIcon`;var HO=VO,UO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:OO}));UO.displayName=`ArrowRightIcon`;var WO=UO,GO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:kO}));GO.displayName=`DotsThreeIcon`;var KO=GO,qO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:AO}));qO.displayName=`GithubLogoIcon`;var JO=qO,YO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:jO}));YO.displayName=`GlobeHemisphereWestIcon`;var XO=YO,ZO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:MO}));ZO.displayName=`MagnifyingGlassIcon`;var QO=ZO,$O=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:NO}));$O.displayName=`MoonIcon`;var ek=$O,tk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:PO}));tk.displayName=`PencilSimpleIcon`;var nk=tk,rk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:FO}));rk.displayName=`PlusIcon`;var ik=rk,ak=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:IO}));ak.displayName=`SignOutIcon`;var ok=ak,sk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:LO}));sk.displayName=`SparkleIcon`;var ck=sk,lk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:RO}));lk.displayName=`SunIcon`;var uk=lk,dk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:zO}));dk.displayName=`TrashIcon`;var fk=dk,pk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:BO}));pk.displayName=`UserPlusIcon`;var mk=pk,hk=`fanout.access-token`,gk=`fanout:unauthorized`;function _k(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function vk(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function yk(){localStorage.removeItem(hk)}function bk(){yk(),window.dispatchEvent(new Event(gk))}async function xk(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&bk(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Sk(){let e=await xk(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&bk(),window.location.assign(`/`)}var Ck=(0,L.createContext)(null);function wk(){let e=(0,L.useContext)(Ck);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Tk=(0,L.createContext)(null);function Ek(){let e=(0,L.useContext)(Tk);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Dk(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Ok(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function kk({children:e,wide:t=!1}){return(0,R.jsx)(we,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,R.jsx)(oe,{mih:`100dvh`,px:`md`,py:48,children:(0,R.jsx)(D,{size:t?680:480,w:`100%`,children:(0,R.jsx)(Ee,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Ak(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function jk(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Mk({children:e}){let t=bi(),[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(`none`),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(Ak),[v,y]=(0,L.useState)(jk),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(0),[D,k]=(0,L.useState)(()=>Date.now()),[A,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[ne,ie]=(0,L.useState)(null),[P,ae]=(0,L.useState)(!1),se=(0,L.useRef)(null),ce=_k(),le=o===`user`;async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(vk(t)),l(Dk(t))}async function fe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(Dk(await e.json().catch(()=>null)))}catch{}}(0,L.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,L.useEffect)(()=>{yk(),Ok(`/api/auth/status`).then(r).catch(e=>N(String(e))).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>d(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(gk,e),()=>window.removeEventListener(gk,e)},[]),(0,L.useEffect)(()=>{u&&o===`none`&&v&&(j(!0),N(``),Ok(`/api/auth/login-link`,{token:v}).then(()=>{s(`user`),fe()}).catch(e=>N(e instanceof Error?e.message:String(e))).finally(()=>{y(``),j(!1)}))},[v,u,o]),(0,L.useEffect)(()=>{le&&u&&ce&&window.location.replace(ce)},[le,ce,u]),(0,L.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{k(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let pe=Math.max(0,Math.ceil((T-D)/1e3));(0,L.useEffect)(()=>{S&&!A&&M&&se.current?.querySelector(`input`)?.focus()},[A,S,M]);async function me(e){try{await navigator.clipboard.writeText(e),ae(!0)}catch{N(`Clipboard access failed. Select and copy the token manually.`)}}if(ne?.ingest_token)return(0,R.jsx)(kk,{wide:!0,children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,R.jsx)(de,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,R.jsx)(O,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(am,{block:!0,children:ne.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(am,{block:!0,children:[ne.ingest_header_name??`Authorization`,`: Bearer `,ne.ingest_token]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsxs)(te,{grow:!0,align:`stretch`,children:[(0,R.jsx)(xe,{variant:`light`,radius:`md`,leftSection:P?(0,R.jsx)(re,{size:16,weight:`bold`}):(0,R.jsx)(ge,{size:16}),onClick:()=>void me(`${ne.ingest_header_name??`Authorization`}: Bearer ${ne.ingest_token}`),children:P?`Copied`:`Copy header`}),(0,R.jsx)(xe,{radius:`md`,rightSection:(0,R.jsx)(WO,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ie(null),fe()},children:`Continue to Fanout`})]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void me(ne.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||v)return(0,R.jsx)(oe,{mih:`100dvh`,children:(0,R.jsx)(C,{size:`sm`})});if(!n)return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsx)(de,{order:1,children:`Fanout is unavailable`}),(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(le&&ce)return null;if(le)return(0,R.jsx)(Ck.Provider,{value:n,children:(0,R.jsx)(Tk.Provider,{value:c??{id:``,email:f,name:m,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ce?`/api/auth/oidc/start?return_to=${encodeURIComponent(ce)}`:`/api/auth/oidc/start`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsx)(xe,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function he(){j(!0),N(``);try{await Ok(`/api/auth/start`,{email:f}),w(!0),x(``),E(Date.now()+3e4),k(Date.now())}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function _e(e){j(!0),N(``);try{await Ok(`/api/auth/verify`,{email:f,code:e}),s(`user`),w(!1),x(``),E(0),fe()}catch(e){x(``),N(e instanceof Error?e.message:String(e))}finally{j(!1)}}function ve(){w(!1),x(``),N(``)}async function be(e){e.preventDefault(),j(!0),N(``);try{if(n?.setup_required){let e=await Ok(`/api/auth/setup`,{email:f,name:m,setup_token:g});e.ingest_token?ie(e):(s(`user`),fe())}else if(S){await _e(b);return}else{await he();return}}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}let I=S&&!n?.setup_required,Se=n?.setup_required?`Create the first admin`:I?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Ce=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?I?`We sent a code to ${f}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:Se}),Ce&&(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ce})]}),(0,R.jsx)(`form`,{onSubmit:be,children:(0,R.jsxs)(F,{gap:`md`,children:[(0,R.jsx)(Xh,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:f,onChange:e=>p(e.currentTarget.value),disabled:S,variant:`filled`,radius:`md`,size:`md`,autoFocus:!S}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Name`,placeholder:`Your name`,value:m,onChange:e=>h(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:g,onChange:e=>_(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),I&&(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Verification code`}),(0,R.jsx)(we,{ref:se,children:(0,R.jsx)(Fh,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:b,onChange:x,onComplete:e=>void _e(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsxs)(O,{c:`dimmed`,size:`xs`,children:[`Sent to `,f]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(HO,{size:12,weight:`bold`}),onClick:ve,disabled:A,children:`Change email`})]}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void he(),disabled:A||pe>0,children:pe>0?`Resend in ${pe}s`:`Resend code`})]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),I?(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||b.length<6,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Verify code`}):(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,R.jsx)(mk,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var Nk=[`dashboards`],Pk=[`agent-threads`];async function Fk(e){let t=await xk(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var Ik=(0,L.createContext)(null);function Lk(){let e=(0,L.useContext)(Ik);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Rk=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,zk={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Bk(e){return zk[e]??`Working on it…`}var Vk=[];for(let e=0;e<256;++e)Vk.push((e+256).toString(16).slice(1));function Hk(e,t=0){return(Vk[e[t+0]]+Vk[e[t+1]]+Vk[e[t+2]]+Vk[e[t+3]]+`-`+Vk[e[t+4]]+Vk[e[t+5]]+`-`+Vk[e[t+6]]+Vk[e[t+7]]+`-`+Vk[e[t+8]]+Vk[e[t+9]]+`-`+Vk[e[t+10]]+Vk[e[t+11]]+Vk[e[t+12]]+Vk[e[t+13]]+Vk[e[t+14]]+Vk[e[t+15]]).toLowerCase()}var Uk=new Uint8Array(16);function Wk(){return crypto.getRandomValues(Uk)}var Gk={};function Kk(e,t,n){let r;if(e)r=Jk(e.random??e.rng?.()??Wk(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Wk();qk(Gk,e,i),r=Jk(i,Gk.msecs,Gk.seq,t,n)}return t??Hk(r)}function qk(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Yk(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Jk(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=Yk(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function Yk(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Xk(){return Kk()}async function Zk(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await xk(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function Qk({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,ref:l}){let u=nD(),[d,f]=(0,L.useState)(``),[p]=Na(d.trim(),250),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),T=(0,L.useRef)(null);(0,L.useImperativeHandle)(l,()=>({focusSearch:()=>T.current?.focus()}),[]),(0,L.useEffect)(()=>{r&&requestAnimationFrame(()=>T.current?.focus())},[r]);let D=EO({queryKey:[...Pk,p],queryFn:({pageParam:e})=>Zk(p,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),k=TO({queryKey:Nk,queryFn:()=>Fk(`/api/dashboards`),refetchInterval:3e4}),A=(0,L.useMemo)(()=>D.data?.pages.flatMap(e=>e.threads)??[],[D.data]),j=(0,L.useMemo)(()=>iA(A),[A]),M=(0,L.useMemo)(()=>{let e=k.data?.dashboards??[],t=p.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[k.data,p]);function N(e){x(``),y(e.title),h(e)}async function ne(){if(m&&v.trim()){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(m.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:v.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await u.invalidateQueries({queryKey:Pk}),h(null)}catch(e){x(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{w(!1)}}}async function re(){if(g){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=g.threadId;_(null),await u.invalidateQueries({queryKey:Pk}),o(t)}catch(e){x(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{w(!1)}}}return(0,R.jsxs)(F,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,R.jsx)(xe,{leftSection:(0,R.jsx)(ik,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,R.jsx)(Ku,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(F,{gap:`lg`,pb:`sm`,children:[e&&(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Chats`}),D.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),D.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!D.isLoading&&!D.isError&&A.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:p?`No matching chats`:`No chats yet`}),j.map(e=>(0,R.jsxs)(F,{gap:2,children:[j.length>1&&(0,R.jsx)(O,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(eA,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>N(e),onDelete:()=>{x(``),_(e)}},e.threadId))]},e.label)),D.hasNextPage&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:D.isFetchingNextPage,onClick:()=>void D.fetchNextPage(),children:`See all`})]}),(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Dashboards`}),k.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),k.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!k.isLoading&&!k.isError&&p&&M.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),M.map(e=>{let t=e.id===n;return(0,R.jsx)(E,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,R.jsxs)(te,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,R.jsx)($p,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,R.jsx)(ck,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,R.jsx)(Xh,{ref:T,value:d,onChange:e=>f(e.currentTarget.value),leftSection:(0,R.jsx)(QO,{size:15}),rightSection:(0,R.jsx)(Om,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats and dashboards`,size:`sm`}),(0,R.jsx)(kh,{opened:m!==null,onClose:()=>!S&&h(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(F,{children:[(0,R.jsx)(Xh,{label:`Name`,value:v,onChange:e=>y(e.currentTarget.value),maxLength:120,autoFocus:!0}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>h(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{type:`submit`,loading:S,disabled:!v.trim(),children:`Save`})]})]})})}),(0,R.jsx)(kh,{opened:g!==null,onClose:()=>!S&&_(null),title:`Delete chat?`,centered:!0,children:(0,R.jsxs)(F,{children:[(0,R.jsxs)(O,{size:`sm`,children:[`This permanently removes `,(0,R.jsx)(O,{span:!0,fw:650,children:g?.title}),` and its saved messages.`]}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>_(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{color:`bad`,loading:S,onClick:()=>void re(),children:`Delete`})]})]})})]})}function $k({children:e}){return(0,R.jsx)(O,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function eA({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(we,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(te,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(E,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(F,{gap:0,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:aA(e.updatedAt)})]})}),(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(KO,{size:18,weight:`bold`})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(nk,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(ph.Item,{color:`bad`,leftSection:(0,R.jsx)(fk,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function tA(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function nA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var rA=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function iA(e){let t=nA(new Date),n=new Map;for(let r of e){let e=Math.floor((t-nA(tA(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return rA.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function aA(e){let t=tA(e),n=nA(new Date);return Math.floor((n-nA(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function oA({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Lk(),s=bi(),c=ua({select:e=>e.location.pathname}),{dashboardId:l}=vi({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=qa(!1),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=(0,L.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,L.useRef)(v);y.current=v,(0,L.useEffect)(()=>{f.close()},[c]),(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Rk)};return(0,R.jsxs)(Rp,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(Rp.Header,{children:(0,R.jsxs)(te,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(te,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(nm,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,R.jsx)(ye,{size:`small`})]}),(0,R.jsxs)(te,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(sA,{}),(0,R.jsx)(cA,{onError:g})]})]})}),(0,R.jsx)(Rp.Navbar,{p:`sm`,children:(0,R.jsx)(Qk,{ref:_,...b})}),(0,R.jsx)(Tm,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(ye,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(Qk,{...b,autoFocusSearch:d&&p})}),(0,R.jsxs)(Rp.Main,{children:[h&&(0,R.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function sA(){let{setColorScheme:e}=co(),t=fo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,R.jsx)(Yh,{label:`Switch to ${n} theme`,children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,R.jsx)(uk,{size:17,weight:`bold`}):(0,R.jsx)(ek,{size:17,weight:`bold`})})})}function cA({onError:e}){let t=Ek(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,R.jsx)(Xp,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Label,{children:t.email||`Signed in`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(JO,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(XO,{size:15}),children:`LabStack`}),(0,R.jsx)(ph.Divider,{}),(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(ok,{size:15}),onClick:()=>void Sk().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function lA(){let{agent_available:e}=wk(),t=bi(),n=nD(),{threadId:r}=vi({strict:!1}),[i,a]=(0,L.useState)(Xk),o=(0,L.useRef)(new Set),s=r??i,[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(0),E=(0,L.useRef)(``),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useRef)(0),A=(0,L.useMemo)(()=>new eD({url:`/api/agent`,threadId:s,fetch:(e,t)=>xk(e,t)}),[s]),ee=!e||f===s;function j(){k.current=0,y(``)}(0,L.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),j(),C(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):xk(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(E.current=``,C(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),C(``)},onToolCallStartEvent:({event:e})=>{k.current+=1,y(Bk(e.toolCallName))},onToolCallEndEvent:()=>{k.current=Math.max(0,k.current-1),k.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})},onRunFailed:e=>{console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,w,s]),(0,L.useEffect)(()=>{D.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,L.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>O.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>O.current?.focus()))),e.key===`Escape`&&n===O.current&&(x(``),O.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function M(){_(!0),C(``);try{await A.runAgent()}catch(e){console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s)}}async function N(n){let i=n.trim();if(!e||!i||g||!ee||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Xk(),role:`user`,content:i};A.addMessage(a),l([...A.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await M()}(0,L.useEffect)(()=>{let e=E.current;ee&&r&&e&&(E.current=``,N(e))},[ee,r,s]);function te(e){e.preventDefault(),N(b)}function ne(){A.abortRun(),_(!1),j(),o.current.delete(s)}function re(){!g&&A.messages.some(e=>e.role===`user`)&&M()}function ie(n){if(!e)return;let r=Xk();o.current.add(r),E.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function P(){A.abortRun(),E.current=``,a(Xk()),t({to:`/chat`})}function ae(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function oe(){T(e=>e+1)}return(0,R.jsx)(Ik.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ee,running:g,activity:v,input:b,setInput:x,error:S,bottomRef:D,inputRef:O,send:N,submit:te,stop:ne,retry:re,reloadThread:oe,openChat:ie,newThread:P,selectThread:ae},children:(0,R.jsx)(oA,{children:(0,R.jsx)(ea,{})})})}function uA(){let e=(0,L.useMemo)(()=>new fO,[]);return(0,R.jsx)(rD,{client:e,children:(0,R.jsx)(Mk,{children:(0,R.jsx)(lA,{})})})}var dA=Vi({component:uA,notFoundComponent:()=>(0,R.jsx)(xi,{to:`/`,replace:!0})}),fA=`modulepreload`,pA=function(e){return`/`+e},mA={},hA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pA(t,n),t=s(t),t in mA)return;mA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gA=Hi(`/`)({component:Ui(()=>hA(()=>import(`./routes-C2A3xwKL.js`),__vite__mapDeps([0,1])),`component`)}),_A=Hi(`/chat/`)({component:Ui(()=>hA(()=>import(`./chat.index-u0MOvyAV.js`),__vite__mapDeps([2,3,1,4])),`component`)}),vA=Hi(`/chat/$threadId`)({component:Ui(()=>hA(()=>import(`./chat._threadId-u0MOvyAV.js`),__vite__mapDeps([5,3,1,4])),`component`)}),yA=Hi(`/dashboards/`)({component:Ui(()=>hA(()=>import(`./dashboards.index-D-Z1PEHh.js`),__vite__mapDeps([6,1,7,4])),`component`)}),bA=Hi(`/dashboards/$dashboardId`)({component:Ui(()=>hA(()=>import(`./dashboards._dashboardId-DCQxYJDK.js`),__vite__mapDeps([8,1,7,4])),`component`)}),xA=gA.update({id:`/`,path:`/`,getParentRoute:()=>dA}),SA=_A.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dA}),CA=vA.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dA}),wA=yA.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dA}),TA={IndexRoute:xA,ChatThreadIdRoute:CA,DashboardsDashboardIdRoute:bA.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dA}),ChatIndexRoute:SA,DashboardsIndexRoute:wA},EA=oa({routeTree:dA._addFileChildren(TA)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),DA=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],OA=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],kA=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],AA=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],jA=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],MA=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],NA={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},PA={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},FA={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},IA={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:DA,brand:OA,ok:kA,warn:AA,bad:jA,info:MA},defaultRadius:`md`,fontFamily:FA.body,fontFamilyMonospace:FA.display,headings:{fontFamily:FA.body,fontWeight:`600`},cursorType:`pointer`},LA=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":NA.light.muted},dark:{}}),RA=Eo(IA);(0,q_.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(To,{theme:RA,defaultColorScheme:`auto`,cssVariablesResolver:LA,children:(0,R.jsx)(la,{router:EA})})}));export{kh as A,eo as B,gD as C,nD as D,AD as E,jd as F,fa as G,Ea as H,Ku as I,xi as K,fo as L,$p as M,zp as N,Xh as O,zd as P,io as R,PD as S,bD as T,ma as U,Ka as V,pa as W,ik as _,PA as a,cO as b,hA as c,Nk as d,Fk as f,ck as g,fk as h,kA as i,ph as j,Yh as k,Xk as l,xk as m,NA as n,AA as o,wk as p,bi as q,MA as r,bA as s,jA as t,Lk as u,KO as v,cD as w,RD as x,TO as y,to as z}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js b/internal/ui/dist/assets/mcp-app-frame-BIeBcZvf.js similarity index 92% rename from internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js rename to internal/ui/dist/assets/mcp-app-frame-BIeBcZvf.js index 4f480bf8f..ab31612cb 100644 --- a/internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js +++ b/internal/ui/dist/assets/mcp-app-frame-BIeBcZvf.js @@ -1,4 +1,4 @@ -import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{L as p,m}from"./index-DSdcpqnK.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{i as p}from"./auth-d1anOsyP.js";import{t as m}from"./use-computed-color-scheme-CeR2KQyq.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` `)}\n};`)(...Object.values(this.closed))}},Sn={major:4,minor:5,patch:4},A=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=_e(t),a;for(let o of n){if(o._zod.def.when){if(ve(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new We;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(xe(t.issues,n,e),i||=_e(t,n))});else{if(t.issues.length===n)continue;xe(t.issues,n,e),i||=_e(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(_e(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ae(this,`~standard`,wn(this))},set"~standard"(e){ke(this,`~standard`,e)}}),Cn=e=>e.success?{value:e.data}:{issues:e.error?.issues};function wn(e){return{validate:t=>{try{return Cn(ut(e,t))}catch{return ft(e,t).then(Cn)}},vendor:`zod`,version:1}}var Tn=k(`$ZodString`,(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),j=k(`$ZodStringFormat`,(e,t)=>{pn.init(e,t),Tn.init(e,t)}),En=k(`$ZodGUID`,(e,t)=>{t.pattern??=kt,j.init(e,t)}),Dn=k(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=At(e)}else t.pattern??=At();j.init(e,t)}),On=k(`$ZodEmail`,(e,t)=>{t.pattern??=jt,j.init(e,t)});function kn(e,t){if(!t.normalize&&t.protocol?.source===Bt.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var An=/[\t\n\r]/g;function jn(e){return e.replace(An,``)}function Mn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pn=k(`$ZodURL`,(e,t)=>{j.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Mn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:jn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Fn=k(`$ZodEmoji`,(e,t)=>{t.pattern??=Nt(),j.init(e,t)}),In=k(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Et:Dt(t.length),j.init(e,t)}),Ln=k(`$ZodCUID`,(e,t)=>{t.pattern??=xt,j.init(e,t)}),Rn=k(`$ZodCUID2`,(e,t)=>{t.pattern??=St,j.init(e,t)}),zn=k(`$ZodULID`,(e,t)=>{t.pattern??=Ct,j.init(e,t)}),Bn=k(`$ZodXID`,(e,t)=>{t.pattern??=wt,j.init(e,t)}),Vn=k(`$ZodKSUID`,(e,t)=>{t.pattern??=Tt,j.init(e,t)}),Hn=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=qt(t),j.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Un=k(`$ZodISODate`,(e,t)=>{t.pattern??=Wt,j.init(e,t)}),Wn=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Kt(t),j.init(e,t)}),Gn=k(`$ZodISODuration`,(e,t)=>{t.pattern??=Ot,j.init(e,t)}),Kn=k(`$ZodIPv4`,(e,t)=>{t.pattern??=Pt,j.init(e,t),e._zod.bag.format=`ipv4`}),qn=/^[0-9a-fA-F:.]+$/;function Jn(e){if(!qn.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Yn=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Ft,j.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xn=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=It,j.init(e,t)});function Zn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Jn(n)}var Qn=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Lt,j.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $n(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var er=k(`$ZodBase64`,(e,t)=>{t.pattern??=Rt,j.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tr(e){if(!zt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $n(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var nr=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=zt,j.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=k(`$ZodE164`,(e,t)=>{t.pattern??=Vt,j.init(e,t)});function ir(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ar=k(`$ZodJWT`,(e,t)=>{j.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=k(`$ZodNumber`,(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sr=k(`$ZodNumberFormat`,(e,t)=>{ln.init(e,t),or.init(e,t)}),cr=k(`$ZodBoolean`,(e,t)=>{A.init(e,t),e._zod.pattern=Zt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),lr=k(`$ZodUndefined`,(e,t)=>{A.init(e,t),e._zod.pattern=$t,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ur=k(`$ZodNull`,(e,t)=>{A.init(e,t),e._zod.pattern=Qt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),dr=k(`$ZodAny`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),fr=k(`$ZodUnknown`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),pr=k(`$ZodNever`,(e,t)=>{A.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function mr(e,t,n){e.issues.length&&t.issues.push(...ye(n,e.issues)),t.value[n]=e.value}var hr=k(`$ZodArray`,(e,t)=>{A.init(e,t);let n=Ke.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;emr(t,r,e))):mr(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function gr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ye(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ce(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,u,d))):gr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var br=new WeakMap,xr=k(`$ZodObject`,(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;br.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),br.set(t,n),n}})}let n=v(()=>vr(t));O(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||S(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=w,i=t.catchall,a,o=Ke.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>gr(n,t,e,c,r,i))):gr(a,t,e,c,r,i)}return i?yr(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Sr=k(`$ZodObjectJIT`,(e,t)=>{xr.init(e,t);let n=e._zod.parse,r=v(()=>vr(t)),i=Ke.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new xn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` for (let i = 0; i < ${e}.issues.length; i++) { @@ -109,5 +109,5 @@ ${a}`,d++}else Nm(e,n,i)?f=e.slice(e.charCodeAt(n+6)===km?n+7:n+6,r)||void 0:_(e `,n)}return e.slice(n)}for(;n20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function Mm(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Nm(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Pm=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=jm({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}},Fm={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Im=class extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}},Lm=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=fp(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??Fm}async _authThenStart(){if(!this._authProvider)throw new Yp(`No auth provider`);let e;try{e=await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if(e!==`AUTHORIZED`)throw new Yp;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let t=dp(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let n=await this._commonHeaders();n.set(`Accept`,`text/event-stream`),t&&n.set(`last-event-id`,t);let r=await(this._fetch??fetch)(this._url,{method:`GET`,headers:n,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new Im(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(e){throw this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(n=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,n){if(!e)return;let{onresumptiontoken:r,replayMessageId:i}=t,a,o=!1,s=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Pm({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(a=e.id,o=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=wc.parse(JSON.parse(e.data));xc(t)&&(s=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Yp(`No auth provider`);if(await am(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp(`Failed to authorize`)}async close(){this._reconnectionTimeout&&=(clearTimeout(this._reconnectionTimeout),void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:n,onresumptiontoken:r}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:_c(e)?e.id:void 0}).catch(e=>this.onerror?.(e));return}let i=await this._commonHeaders();i.set(`content-type`,`application/json`),i.set(`accept`,`application/json, text/event-stream`);let a={...this._requestInit,method:`POST`,headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,a),s=o.headers.get(`mcp-session-id`);if(s&&(this._sessionId=s),!o.ok){let t=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Im(401,`Server returned 401 after successful authentication`);let{resourceMetadataUrl:t,scope:n}=lm(o);if(this._resourceMetadataUrl=t,this._scope=n,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp;return this._hasCompletedAuthFlow=!0,this.send(e)}if(o.status===403&&this._authProvider){let{resourceMetadataUrl:t,scope:n,error:r}=lm(o);if(r===`insufficient_scope`){let r=o.headers.get(`WWW-Authenticate`);if(this._lastUpscopingHeader===r)throw new Im(403,`Server returned 403 after trying upscoping`);if(n&&(this._scope=n),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=r??void 0,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!==`AUTHORIZED`)throw new Yp;return this.send(e)}}throw new Im(o.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,o.status===202){await o.body?.cancel(),Bc(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let c=(Array.isArray(e)?e:[e]).filter(e=>`method`in e&&`id`in e&&e.id!==void 0).length>0,l=o.headers.get(`content-type`),u=up(l);if(c){if(u===`text/event-stream`)this._handleSseStream(o.body,{onresumptiontoken:r},!1);else if(u===`application/json`){let e=await o.json(),t=Array.isArray(e)?e.map(e=>wc.parse(e)):[wc.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await o.body?.cancel(),new Im(-1,`Unexpected content type: ${l}`)}else await o.body?.cancel()}catch(e){throw this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,t);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Im(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},Rm=d(o(),1),zm=c(),Bm=`text/html;profile=mcp-app`,Vm=`io.modelcontextprotocol/ui`,Hm=3,Um=5,Wm=2e3,Gm=class extends Error{},Km=null,qm=null;async function Jm(){let e=new Lm(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>m(e,t)}),t=new cp({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[Vm]:{mimeTypes:[Bm]}}}});try{await t.connect(e);let n={client:t,references:0,closed:!1,closeListeners:new Set};return t.onclose=()=>Xm(n,!1),t.onerror=()=>Xm(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Ym(){for(let e=0;e{qm===e&&!t.closed&&(Km=t)}).catch(()=>{qm===e&&(qm=null)})}let e=qm;if(!e)continue;let t=await e;if(t.closed){qm===e&&(qm=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function Xm(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,Km===e&&(Km=null),qm=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Zm(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||Km!==e)&&(e.closed=!0,Km=null,qm=null,e.client.close().catch(()=>void 0))},0))}function Qm(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function $m(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function eh(e){let t=Qm(Qm(Qm(e)?.ui)?.csp),n=$m(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=$m(t?.resourceDomains,[`http`,`https`]),i=$m(t?.frameDomains,[`http`,`https`]),a=$m(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}function th(e,t){let n=``;return/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):`${n}${e}`}function nh(e){return e.filter(e=>e.type===`text`).map(e=>String(e.text??``)).join(` -`)}function rh({content:t,onMessage:n}){let a=(0,Rm.useRef)(null),o=(0,Rm.useRef)(null),c=(0,Rm.useRef)(null),l=(0,Rm.useRef)(null),[d,f]=(0,Rm.useState)(``),[m,h]=(0,Rm.useState)(240),[g,_]=(0,Rm.useState)(``),[v,y]=(0,Rm.useState)(0),b=(0,Rm.useRef)(0),x=p(`light`),S=(0,Rm.useRef)(x);S.current=x,(0,Rm.useEffect)(()=>{l.current?.setHostContext({theme:x,displayMode:`inline`})},[x]),(0,Rm.useEffect)(()=>{b.current=0},[t.resourceUri]),(0,Rm.useEffect)(()=>{let e=!1,n;f(``),_(``);let r=()=>{let e=b.current+1;if(e>Um)return;b.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?y(e=>e+1):n=setTimeout(()=>y(e=>e+1),t)},i=()=>r();async function a(){try{let n=await Ym();if(e){Zm(n);return}c.current=n,n.closeListeners.add(i),o.current=n.client;let r=(await n.client.readResource({uri:t.resourceUri})).contents[0];if(!r||!(`text`in r)||!r.text)throw new Gm(`MCP App resource has no HTML content`);if(r.uri!==t.resourceUri)throw new Gm(`MCP App resource URI does not match the requested URI`);if(r.mimeType!==Bm)throw new Gm(`MCP App resource has an unsupported MIME type`);e||(b.current=0,f(th(r.text,r._meta)))}catch(t){console.error(`MCP app resource load failed`,t),e||(_(`This view could not be loaded. Please try again.`),b.current>0&&!(t instanceof Gm)&&r())}}return a(),()=>{e=!0,n&&clearTimeout(n);let t=l.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),r=c.current;r&&(r.closeListeners.delete(i),t.finally(()=>Zm(r))),l.current=null,o.current=null,c.current=null}},[t.resourceUri,v]);async function C(){let e=a.current,r=o.current;if(e?.contentWindow&&d&&r&&!l.current)try{let i=new bd(null,{name:`Fanout`,version:`0.2.0`},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:S.current,displayMode:`inline`}});i.oncalltool=(e,t)=>r.request({method:`tools/call`,params:e},Xl,{signal:t.signal}),l.current=i,i.onsizechange=({height:e})=>{e&&h(Math.min(Wm,Math.max(240,Math.ceil(e)+32)))},i.onmessage=async({content:e})=>{let t=nh(e);return t?(await n(t),{}):{isError:!0}},i.oninitialized=async()=>{await i.sendToolInput({arguments:t.toolInput??{}}),await i.sendToolResult({content:[{type:`text`,text:JSON.stringify(t.toolResult??{})}],structuredContent:t.toolResult,isError:t.isError})},await i.connect(new vd(e.contentWindow,e.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),_(`This view could not be loaded. Please try again.`)}}return g?(0,zm.jsx)(i,{color:`bad`,m:`md`,children:g}):d?(0,zm.jsx)(u,{component:`iframe`,ref:a,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:d,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:m,transition:`height 200ms ease`},onLoad:()=>void C()}):(0,zm.jsxs)(s,{mih:180,p:`xl`,children:[(0,zm.jsx)(e,{size:`sm`}),(0,zm.jsx)(r,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{rh as default,eh as mcpAppCSP}; \ No newline at end of file +${t}`,d++;break;case`id`:t.includes(`\0`)||(l=t);break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new Em(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new Em(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function Mm(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Nm(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Pm=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=jm({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}},Fm={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Im=class extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}},Lm=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=fp(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??Fm}async _authThenStart(){if(!this._authProvider)throw new Yp(`No auth provider`);let e;try{e=await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if(e!==`AUTHORIZED`)throw new Yp;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let t=dp(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let n=await this._commonHeaders();n.set(`Accept`,`text/event-stream`),t&&n.set(`last-event-id`,t);let r=await(this._fetch??fetch)(this._url,{method:`GET`,headers:n,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new Im(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(e){throw this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(n=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,n){if(!e)return;let{onresumptiontoken:r,replayMessageId:i}=t,a,o=!1,s=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Pm({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(a=e.id,o=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=wc.parse(JSON.parse(e.data));xc(t)&&(s=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Yp(`No auth provider`);if(await am(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp(`Failed to authorize`)}async close(){this._reconnectionTimeout&&=(clearTimeout(this._reconnectionTimeout),void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:n,onresumptiontoken:r}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:_c(e)?e.id:void 0}).catch(e=>this.onerror?.(e));return}let i=await this._commonHeaders();i.set(`content-type`,`application/json`),i.set(`accept`,`application/json, text/event-stream`);let a={...this._requestInit,method:`POST`,headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,a),s=o.headers.get(`mcp-session-id`);if(s&&(this._sessionId=s),!o.ok){let t=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Im(401,`Server returned 401 after successful authentication`);let{resourceMetadataUrl:t,scope:n}=lm(o);if(this._resourceMetadataUrl=t,this._scope=n,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp;return this._hasCompletedAuthFlow=!0,this.send(e)}if(o.status===403&&this._authProvider){let{resourceMetadataUrl:t,scope:n,error:r}=lm(o);if(r===`insufficient_scope`){let r=o.headers.get(`WWW-Authenticate`);if(this._lastUpscopingHeader===r)throw new Im(403,`Server returned 403 after trying upscoping`);if(n&&(this._scope=n),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=r??void 0,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!==`AUTHORIZED`)throw new Yp;return this.send(e)}}throw new Im(o.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,o.status===202){await o.body?.cancel(),Bc(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let c=(Array.isArray(e)?e:[e]).filter(e=>`method`in e&&`id`in e&&e.id!==void 0).length>0,l=o.headers.get(`content-type`),u=up(l);if(c){if(u===`text/event-stream`)this._handleSseStream(o.body,{onresumptiontoken:r},!1);else if(u===`application/json`){let e=await o.json(),t=Array.isArray(e)?e.map(e=>wc.parse(e)):[wc.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await o.body?.cancel(),new Im(-1,`Unexpected content type: ${l}`)}else await o.body?.cancel()}catch(e){throw this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,t);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Im(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},Rm=d(o(),1),zm=c(),Bm=`text/html;profile=mcp-app`,Vm=`io.modelcontextprotocol/ui`,Hm=3,Um=5,Wm=2e3,Gm=class extends Error{},Km=null,qm=null;async function Jm(){let e=new Lm(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>p(e,t)}),t=new cp({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[Vm]:{mimeTypes:[Bm]}}}});try{await t.connect(e);let n={client:t,references:0,closed:!1,closeListeners:new Set};return t.onclose=()=>Xm(n,!1),t.onerror=()=>Xm(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Ym(){for(let e=0;e{qm===e&&!t.closed&&(Km=t)}).catch(()=>{qm===e&&(qm=null)})}let e=qm;if(!e)continue;let t=await e;if(t.closed){qm===e&&(qm=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function Xm(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,Km===e&&(Km=null),qm=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Zm(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||Km!==e)&&(e.closed=!0,Km=null,qm=null,e.client.close().catch(()=>void 0))},0))}function Qm(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function $m(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function eh(e){let t=Qm(Qm(Qm(e)?.ui)?.csp),n=$m(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=$m(t?.resourceDomains,[`http`,`https`]),i=$m(t?.frameDomains,[`http`,`https`]),a=$m(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}function th(e,t){let n=``;return/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):`${n}${e}`}function nh(e){return e.filter(e=>e.type===`text`).map(e=>String(e.text??``)).join(` +`)}function rh({content:t,onMessage:n}){let a=(0,Rm.useRef)(null),o=(0,Rm.useRef)(null),c=(0,Rm.useRef)(null),l=(0,Rm.useRef)(null),[d,f]=(0,Rm.useState)(``),[p,h]=(0,Rm.useState)(240),[g,_]=(0,Rm.useState)(``),[v,y]=(0,Rm.useState)(0),b=(0,Rm.useRef)(0),x=m(`light`),S=(0,Rm.useRef)(x);S.current=x,(0,Rm.useEffect)(()=>{l.current?.setHostContext({theme:x,displayMode:`inline`})},[x]),(0,Rm.useEffect)(()=>{b.current=0},[t.resourceUri]),(0,Rm.useEffect)(()=>{let e=!1,n;f(``),_(``);let r=()=>{let e=b.current+1;if(e>Um)return;b.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?y(e=>e+1):n=setTimeout(()=>y(e=>e+1),t)},i=()=>r();async function a(){try{let n=await Ym();if(e){Zm(n);return}c.current=n,n.closeListeners.add(i),o.current=n.client;let r=(await n.client.readResource({uri:t.resourceUri})).contents[0];if(!r||!(`text`in r)||!r.text)throw new Gm(`MCP App resource has no HTML content`);if(r.uri!==t.resourceUri)throw new Gm(`MCP App resource URI does not match the requested URI`);if(r.mimeType!==Bm)throw new Gm(`MCP App resource has an unsupported MIME type`);e||(b.current=0,f(th(r.text,r._meta)))}catch(t){console.error(`MCP app resource load failed`,t),e||(_(`This view could not be loaded. Please try again.`),b.current>0&&!(t instanceof Gm)&&r())}}return a(),()=>{e=!0,n&&clearTimeout(n);let t=l.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),r=c.current;r&&(r.closeListeners.delete(i),t.finally(()=>Zm(r))),l.current=null,o.current=null,c.current=null}},[t.resourceUri,v]);async function C(){let e=a.current,r=o.current;if(e?.contentWindow&&d&&r&&!l.current)try{let i=new bd(null,{name:`Fanout`,version:`0.2.0`},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:S.current,displayMode:`inline`}});i.oncalltool=(e,t)=>r.request({method:`tools/call`,params:e},Xl,{signal:t.signal}),l.current=i,i.onsizechange=({height:e})=>{e&&h(Math.min(Wm,Math.max(240,Math.ceil(e)+32)))},i.onmessage=async({content:e})=>{let t=nh(e);return t?(await n(t),{}):{isError:!0}},i.oninitialized=async()=>{await i.sendToolInput({arguments:t.toolInput??{}}),await i.sendToolResult({content:[{type:`text`,text:JSON.stringify(t.toolResult??{})}],structuredContent:t.toolResult,isError:t.isError})},await i.connect(new vd(e.contentWindow,e.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),_(`This view could not be loaded. Please try again.`)}}return g?(0,zm.jsx)(i,{color:`bad`,m:`md`,children:g}):d?(0,zm.jsx)(u,{component:`iframe`,ref:a,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:d,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:p,transition:`height 200ms ease`},onLoad:()=>void C()}):(0,zm.jsxs)(s,{mih:180,p:`xl`,children:[(0,zm.jsx)(e,{size:`sm`}),(0,zm.jsx)(r,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{rh as default,eh as mcpAppCSP}; \ No newline at end of file diff --git a/internal/ui/dist/assets/preload-helper-qpfFvVn3.js b/internal/ui/dist/assets/preload-helper-qpfFvVn3.js new file mode 100644 index 000000000..4ddd003e5 --- /dev/null +++ b/internal/ui/dist/assets/preload-helper-qpfFvVn3.js @@ -0,0 +1 @@ +import{$ as e,C as t,G as n,J as r,N as i,Q as a,S as o,Y as s,Z as c,_ as l,b as u,ht as d,it as f,j as p,k as m,mt as h,ot as g,pt as _,rt as v,tt as y,ut as b,v as x,x as S,xt as C,z as w}from"./brand-CCB4_HD8.js";var T=C(h(),1),E=_(),D=C(d(),1);function O(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==D.Fragment}function k(e){let t=(0,D.createContext)(null);return[t,()=>{let n=(0,D.use)(t);if(n===null)throw Error(e);return n}]}var A={app:100,modal:200,popover:300,overlay:400,max:9999};function j(e){return A[e]}function M(e){let t=(0,D.useRef)(e);return(0,D.useEffect)(()=>{t.current=e}),(0,D.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function N(e,t){let{delay:n,flushOnUnmount:r,leading:i,maxWait:a}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1,maxWait:void 0}:t,o=M(e),s=(0,D.useRef)(0),c=(0,D.useRef)(0),l=(0,D.useRef)(null),u=(0,D.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(s.current),l.current=t;let r=e._isFirstCall;e._isFirstCall=!1;function u(){window.clearTimeout(s.current),window.clearTimeout(c.current),s.current=0,c.current=0,e._isFirstCall=!0,e._hasPendingCallback=!1}function d(){a!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(s.current!==0){let e=l.current;u(),o(...e)}},a))}if(i&&r){o(...t),e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}if(i&&!r){e._hasPendingCallback=!0,e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}e._hasPendingCallback=!0;let f=()=>{s.current!==0&&(u(),o(...t))};e.flush=f,e.cancel=()=>{u()},s.current=window.setTimeout(f,n),d()},{flush:()=>{},cancel:()=>{},isPending:()=>e._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return e},[o,n,i,a]);return(0,D.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}function P(e){return e?.props?.ref}function ee(e){let t=D.Children.toArray(e);return t.length!==1||!O(t[0])?null:t[0]}function te(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...te(n,t)}),{}):typeof e==`function`?e(t):e??{}}var ne=(0,D.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function re(){return(0,D.use)(ne)}var[ie,F]=k(`ScrollArea.Root component was not found in tree`);function I(e,t){let n=(0,D.useEffectEvent)(t);y(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e])}function L(e){let{style:t,...n}=e,r=F(),[i,a]=(0,D.useState)(0),[o,s]=(0,D.useState)(0),c=!!(i&&o);return I(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),I(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,E.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function ae(e){let t=F(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,E.jsx)(L,{...e}):null}var R={scrollHideDelay:1e3,type:`hover`};function oe(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:o,...s}=p(`ScrollAreaRoot`,R,e),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(null),[f,m]=(0,D.useState)(null),[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(null),[y,b]=(0,D.useState)(0),[x,C]=(0,D.useState)(0),[w,T]=(0,D.useState)(!1),[O,k]=(0,D.useState)(!1),A=a(o,l);return(0,E.jsx)(ie,{value:{type:t,scrollHideDelay:n,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:m,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:w,onScrollbarXEnabledChange:T,scrollbarY:_,onScrollbarYChange:v,scrollbarYEnabled:O,onScrollbarYEnabledChange:k,onCornerWidthChange:b,onCornerHeightChange:C,getStyles:i},children:(0,E.jsx)(S,{...s,ref:A,__vars:{"--sa-corner-width":r===`xy`?`${y}px`:`0px`,"--sa-corner-height":r===`xy`?`${x}px`:`0px`}})})}oe.displayName=`@mantine/core/ScrollAreaRoot`;function se(e,t){let n=e/t;return Number.isNaN(n)?0:n}function ce(e){let t=se(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function le(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ue(e,[t,n]){return Math.min(n,Math.max(t,e))}function de(e,t,n=`ltr`){let r=ce(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=ue(e,n===`ltr`?[0,o]:[o*-1,0]);return le([0,o],[0,s])(c)}function fe(e,t,n,r=`ltr`){let i=ce(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return le([c,l],d)(e)}function pe(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[z,ge]=k(`ScrollAreaScrollbar was not found in tree`);function _e(e){let{sizes:t,hasThumb:n,onThumbChange:r,onThumbPointerUp:i,onThumbPointerDown:o,onThumbPositionChange:s,onDragScroll:c,onWheelScroll:l,onResize:u,ref:d,...f}=e,p=F(),[m,h]=(0,D.useState)(null),g=a(d,h),_=(0,D.useRef)(null),v=(0,D.useRef)(``),{viewport:y}=p,b=t.content-t.viewport,x=(0,D.useEffectEvent)(l),S=M(s),C=N(u,10),w=e=>{if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;c({x:t,y:n})}};return(0,D.useEffect)(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b]),(0,D.useEffect)(S,[t,S]),I(m,C),I(p.content,C),(0,E.jsx)(z,{value:{scrollbar:m,hasThumb:n,onThumbChange:M(r),onThumbPointerUp:M(i),onThumbPositionChange:S,onThumbPointerDown:M(o)},children:(0,E.jsx)(`div`,{...f,ref:g,"data-mantine-scrollbar":!0,style:{position:`absolute`,...f.style},onPointerDown:he(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,w(e))}),onPointerMove:he(e.onPointerMove,w),onPointerUp:he(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=v.current,_.current=null}})})}var ve=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...o}=e,s=F(),[c,l]=(0,D.useState)(),u=(0,D.useRef)(null),d=a(i,u,s.onScrollbarXChange);return(0,D.useEffect)(()=>{u.current&&l(getComputedStyle(u.current))},[u]),(0,E.jsx)(_e,{"data-orientation":`horizontal`,...o,ref:d,sizes:t,style:{...r,"--sa-thumb-width":`${ce(t)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(s.viewport){let r=s.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),pe(r,n)&&t.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:me(c.paddingLeft),paddingEnd:me(c.paddingRight)}})}})};ve.displayName=`@mantine/core/ScrollAreaScrollbarX`;function ye(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...o}=e,s=F(),[c,l]=(0,D.useState)(),u=(0,D.useRef)(null),d=a(i,u,s.onScrollbarYChange);return(0,D.useEffect)(()=>{u.current&&l(window.getComputedStyle(u.current))},[]),(0,E.jsx)(_e,{...o,"data-orientation":`vertical`,ref:d,sizes:t,style:{"--sa-thumb-height":`${ce(t)}px`,...r},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(s.viewport){let r=s.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),pe(r,n)&&t.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:me(c.paddingTop),paddingEnd:me(c.paddingBottom)}})}})}ye.displayName=`@mantine/core/ScrollAreaScrollbarY`;function B(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=re(),i=F(),a=(0,D.useRef)(null),o=(0,D.useRef)(0),[s,c]=(0,D.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=se(s.viewport,s.content),u={...n,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:e=>{o.current=e}},d=(e,t)=>fe(e,o.current,s,t);return t===`horizontal`?(0,E.jsx)(ve,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=de(e,s,r);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,r))}}):t===`vertical`?(0,E.jsx)(ye,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=de(e,s);s.scrollbar.size===0?a.current.style.setProperty(`--thumb-opacity`,`0`):a.current.style.setProperty(`--thumb-opacity`,`1`),a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}B.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function be(e){let t=F(),{forceMount:n,...r}=e,[i,a]=(0,D.useState)(!1),o=e.orientation===`horizontal`,s=N(()=>{if(t.viewport){let e=t.viewport.offsetWidth{let{scrollArea:e}=r,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},i=()=>{t=window.setTimeout(()=>a(!1),r.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,i),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,i)}}},[r.scrollArea,r.scrollHideDelay]),t||i?(0,E.jsx)(be,{"data-state":i?`visible`:`hidden`,...n}):null}xe.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function Se(e){let{forceMount:t,...n}=e,r=F(),i=e.orientation===`horizontal`,[a,o]=(0,D.useState)(`hidden`),s=N(()=>o(`idle`),100);return(0,D.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,D.useEffect)(()=>{let{viewport:e}=r,t=i?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(o(`scrolling`),s()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[r.viewport,i,s]),t||a!==`hidden`?(0,E.jsx)(B,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:he(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:he(e.onPointerLeave,()=>o(`idle`))}):null}function Ce(e){let{forceMount:t,...n}=e,r=F(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,D.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,E.jsx)(xe,{...n,forceMount:t}):r.type===`scroll`?(0,E.jsx)(Se,{...n,forceMount:t}):r.type===`auto`?(0,E.jsx)(be,{...n,forceMount:t}):r.type===`always`?(0,E.jsx)(B,{...n}):null}Ce.displayName=`@mantine/core/ScrollAreaScrollbar`;function we(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Te(e){let{style:t,ref:n,...r}=e,i=F(),o=ge(),{onThumbPositionChange:s}=o,c=a(n,o.onThumbChange),l=(0,D.useRef)(void 0),u=N(()=>{l.current&&=(l.current(),void 0)},100);return(0,D.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(u(),!l.current){let t=we(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,u,s]),(0,E.jsx)(`div`,{"data-state":o.hasThumb?`visible`:`hidden`,...r,ref:c,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:he(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:he(e.onPointerUp,o.onThumbPointerUp)})}Te.displayName=`@mantine/core/ScrollAreaThumb`;function Ee(e){let{forceMount:t,...n}=e,r=ge();return t||r.hasThumb?(0,E.jsx)(Te,{...n}):null}Ee.displayName=`@mantine/core/ScrollAreaThumb`;function De({children:e,style:t,ref:n,onWheel:r,...i}){let o=F(),s=a(n,o.onViewportChange),c=e=>{if(r?.(e),o.scrollbarXEnabled&&o.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:a}=o.viewport,s=t<1,c=t>=n-r-1;i>a&&(s||c)&&e.stopPropagation()}};return(0,E.jsx)(S,{...i,ref:s,onWheel:c,"data-scrollarea-viewport":!0,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,E.jsx)(`div`,{...o.getStyles(`content`),ref:o.onContentChange,children:e})})}De.displayName=`@mantine/core/ScrollAreaViewport`;var Oe={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function ke(){return typeof window<`u`}function Ae(e){return je(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((je(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function je(e){return ke()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return ke()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return ke()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Me(e){return!ke()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Ne(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Pe(e){return/^(table|td|th)$/.test(Ae(e))}function Fe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ie=/transform|translate|scale|rotate|perspective|filter/,Le=/paint|layout|strict|content/,Re=e=>!!e&&e!==`none`,ze;function Be(e){let t=U(e)?G(e):e;return Re(t.transform)||Re(t.translate)||Re(t.scale)||Re(t.rotate)||Re(t.perspective)||!He()&&(Re(t.backdropFilter)||Re(t.filter))||Ie.test(t.willChange||``)||Le.test(t.contain||``)}function Ve(e){let t=Ge(e);for(;W(t)&&!Ue(t);){if(Be(t))return t;if(Fe(t))return null;t=Ge(t)}return null}function He(){return ze??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ze}function Ue(e){return/^(html|body|#document)$/.test(Ae(e))}function G(e){return V(e).getComputedStyle(e)}function We(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ae(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Me(e)&&e.host||H(e);return Me(t)?t.host:t}function Ke(e){let t=Ge(e);return Ue(t)?(e.ownerDocument||e).body:W(t)&&Ne(t)?t:Ke(t)}function qe(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ke(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Je(a);return t.concat(a,a.visualViewport||[],Ne(r)?r:[],e&&n?qe(e):[])}return t.concat(r,qe(r,[],n))}function Je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ye=[`top`,`right`,`bottom`,`left`],K=Math.min,q=Math.max,Xe=Math.round,Ze=Math.floor,Qe=e=>({x:e,y:e}),$e={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function et(e,t,n){return q(e,K(t,n))}function J(e,t){return typeof e==`function`?e(t):e}function Y(e){return e.split(`-`)[0]}function tt(e){return e.split(`-`)[1]}function nt(e){return e===`x`?`y`:`x`}function rt(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function it(e){return nt(X(e))}function at(e,t,n){n===void 0&&(n=!1);let r=tt(e),i=it(e),a=rt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=mt(o)),[o,mt(o)]}function ot(e){let t=mt(e);return[st(e),t,st(t)]}function st(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ct=[`left`,`right`],lt=[`right`,`left`],ut=[`top`,`bottom`],dt=[`bottom`,`top`];function ft(e,t,n){switch(e){case`top`:case`bottom`:return n?t?lt:ct:t?ct:lt;case`left`:case`right`:return t?ut:dt;default:return[]}}function pt(e,t,n,r){let i=tt(e),a=ft(Y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(st)))),a}function mt(e){let t=Y(e);return $e[t]+e.slice(t.length)}function ht(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ht(e)}function _t(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vt(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yt(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function bt(){return/apple/i.test(navigator.vendor)}function xt(){return vt().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function St(){return yt().includes(`jsdom/`)}var Ct=`data-floating-ui-focusable`,wt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Tt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Et(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Me(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Dt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ot(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kt(e){return e.matches(`html,body`)}function At(e){return e?.ownerDocument||document}function jt(e){return W(e)&&e.matches(wt)}function Mt(e){if(!e||St())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Nt(e){return e?e.hasAttribute(Ct)?e:e.querySelector(`[`+Ct+`]`)||e:null}function Pt(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Pt(e,t.id,n)])}function Ft(e){return`nativeEvent`in e}function It(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Z=typeof document<`u`?D.useLayoutEffect:function(){},Lt={...D};function Rt(e){let t=D.useRef(e);return Z(()=>{t.current=e}),t}var zt=Lt.useInsertionEffect||(e=>e());function Q(e){let t=D.useRef(()=>{});return zt(()=>{t.current=e}),D.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Bt(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=it(t),s=rt(o),c=Y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=tt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J(t,e),p=gt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_t(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=_t(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J(e,t)||{};if(l==null)return{};let d=gt(u),f={x:n,y:r},p=it(i),m=rt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=K(d[_],T),D=K(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=et(E,k,O),j=!c.arrow&&tt(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return Ye.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}};function Yt(e){let t=K(...e.map(e=>e.left)),n=K(...e.map(e=>e.top)),r=q(...e.map(e=>e.right)),i=q(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Xt(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;er.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>_t(Yt(e)))}var Zt=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Xt(u),f=_t(Yt(u)),p=gt(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&ce.top-p.top&&l=2){if(X(n)===`y`){let e=d[0],t=d[d.length-1],r=Y(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return _t({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Y(n)===`left`,t=q(...d.map(e=>e.right)),r=K(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return _t({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Qt=new Set([`left`,`top`]);async function $t(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y(n),s=tt(n),c=X(n)===`y`,l=Qt.has(o)?-1:1,u=a&&c?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var en=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await $t(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tn=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=nt(f),m=u[p],h=u[f],g=(e,t)=>et(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},nn=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J(e,t),u={x:n,y:r},d=X(i),f=nt(d),p=u[f],m=u[d],h=J(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Qt.has(Y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},rn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=J(e,t),c=await i.detectOverflow(t,s),l=Y(n),u=tt(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=K(p-c[m],g),y=K(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*q(c.left,c.right):S=p-2*q(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function an(e){let t=G(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xe(n)!==a||Xe(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function on(e){return U(e)?e:e.contextElement}function sn(e){let t=on(e);if(!W(t))return Qe(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=an(t),o=(a?Xe(n.width):n.width)/r,s=(a?Xe(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var cn=Qe(0);function ln(e){let t=V(e);return!He()||!t.visualViewport?cn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function un(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function dn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=on(e),o=Qe(1);t&&(r?U(r)&&(o=sn(r)):o=sn(e));let s=un(a,n,r)?ln(a):Qe(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=Je(n);for(;i&&t!==n;){let e=sn(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=Je(n)}}return _t({width:u,height:d,x:c,y:l})}function fn(e,t){let n=We(e).scrollLeft;return t?t.left+n:dn(H(e)).left+n}function pn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fn(e,n),y:n.top+t.scrollTop}}function mn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?Fe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qe(1),u=Qe(0),d=W(r);if((d||!a)&&((Ae(r)!==`body`||Ne(o))&&(c=We(r)),d)){let e=dn(r);l=sn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?pn(o,c):Qe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function hn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function gn(e){let t=We(e),n=e.ownerDocument.body,r=q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+fn(e),o=-t.scrollTop;return G(n).direction===`rtl`&&(a+=q(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var _n=25;function vn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!He()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(fn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=_n&&(s-=o)}return{width:s,height:c,x:l,y:u}}function yn(e,t){let n=dn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=sn(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function bn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=vn(e,n,t);else if(t===`document`)r=gn(H(e));else if(U(t))r=yn(t,n);else{let n=ln(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _t(r)}function xn(e,t){let n=t.get(e);if(n)return n;let r=qe(e,[],!1).filter(e=>U(e)&&Ae(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?Ge(e):e;for(;U(o)&&!Ue(o);){let e=G(o),t=Be(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ge(o)}return t.set(e,r),r}function Sn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fe(t)?[]:xn(t,this._c):[].concat(n),r],o=bn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Nn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=on(e),u=i||a?[...l?qe(l):[],...t?qe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Mn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?dn(e):null;c&&g();function g(){let t=dn(e);h&&!jn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Pn=en,Fn=tn,In=Gt,Ln=rn,Rn=Jt,zn=Wt,Bn=Zt,Vn=nn,Hn=(e,t,n)=>{let r=new Map,i=n??{},a={...An,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},Un=typeof document<`u`?D.useLayoutEffect:function(){};function Wn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Wn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kn(e,t){let n=Gn(e);return Math.round(t*n)/n}function qn(e){let t=D.useRef(e);return Un(()=>{t.current=e}),t}function Jn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);Wn(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),E=c!=null,O=qn(c),k=qn(i),A=qn(l),j=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),Hn(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Wn(w.current,t)&&(w.current=t,T.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Un(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=D.useRef(!1);Un(()=>(M.current=!0,()=>{M.current=!1}),[]),Un(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(O.current)return O.current(b,x,j);j()}},[b,x,j,O,E]);let N=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Kn(P.floating,u.x),r=Kn(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:ee}),[u,j,N,P,ee])}var Yn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:zn({element:r.current,padding:i}).fn(n):r?zn({element:r,padding:i}).fn(n):{}}}},Xn=(e,t)=>{let n=Pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=Fn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>({fn:Vn(e).fn,options:[e,t]}),$n=(e,t)=>{let n=In(e);return{name:n.name,fn:n.fn,options:[e,t]}},er=(e,t)=>{let n=Ln(e);return{name:n.name,fn:n.fn,options:[e,t]}},tr=(e,t)=>{let n=Rn(e);return{name:n.name,fn:n.fn,options:[e,t]}},nr=(e,t)=>{let n=Bn(e);return{name:n.name,fn:n.fn,options:[e,t]}},rr=(e,t)=>{let n=Yn(e);return{name:n.name,fn:n.fn,options:[e,t]}};function ir(e){let t=D.useRef(void 0),n=D.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return D.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var ar=`data-floating-ui-focusable`,or=`active`,sr=`selected`,cr=`ArrowLeft`,lr=`ArrowRight`,ur=`ArrowUp`,dr=`ArrowDown`,fr=[cr,lr],pr=[ur,dr];[...fr,...pr];var mr={...D},hr=!1,gr=0,_r=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+gr++;function vr(){let[e,t]=D.useState(()=>hr?_r():void 0);return Z(()=>{e??t(_r())},[]),D.useEffect(()=>{hr=!0},[]),e}var yr=mr.useId||vr;function br(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var xr=D.createContext(null),Sr=D.createContext(null),Cr=()=>D.useContext(xr)?.id||null,wr=()=>D.useContext(Sr);function Tr(e){return`data-floating-ui-`+e}function $(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Er=Tr(`safe-polygon`);function Dr(e,t,n){if(n&&!It(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Or(e){return typeof e==`function`?e():e}function kr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=wr(),m=Cr(),h=Rt(l),g=Rt(c),_=Rt(n),v=Rt(d),y=D.useRef(),b=D.useRef(-1),x=D.useRef(),S=D.useRef(-1),C=D.useRef(!0),w=D.useRef(!1),T=D.useRef(()=>{}),E=D.useRef(!1),O=Q(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});D.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||($(b),$(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),D.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=At(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=D.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Dr(g.current,`close`,y.current);i&&!x.current?($(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&($(b),r(!1,e,n))},[g,r]),A=Q(()=>{T.current(),x.current=void 0}),j=Q(()=>{if(w.current){let e=At(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(Er),w.current=!1}}),M=Q(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);D.useEffect(()=>{if(!s)return;function e(e){if($(b),C.current=!1,u&&!It(y.current)||Or(v.current)>0&&!Dr(g.current,`open`))return;let t=Dr(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}T.current();let t=At(o.floating);if($(S),E.current=!1,h.current&&i.current.floatingContext){n||$(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!Et(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){$(b)}function l(e){M()||k(e,!1)}if(U(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Z(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){w.current=!0;let e=o.floating;if(U(o.domReference)&&e){var t;let n=At(o.floating).body;n.setAttribute(Er,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Z(()=>{n||(y.current=void 0,E.current=!1,A(),j())},[n,A,j]),D.useEffect(()=>()=>{A(),$(b),$(S),j()},[s,o.domReference,A,j]);let N=D.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}(!u||It(y.current))&&(n||Or(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||($(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,Or(v.current)))))}}},[u,r,n,_,v]);return D.useMemo(()=>s?{reference:N}:{},[s,N])}var Ar=()=>{},jr=D.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ar,setState:Ar,isInstantPhase:!1}),Mr=()=>D.useContext(jr);function Nr(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=D.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=D.useRef(null),s=D.useCallback(e=>{a({currentId:e})},[]);return Z(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,E.jsx)(jr.Provider,{value:D.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Pr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Mr(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Z(()=>{o&&l&&(f({delay:{open:1,close:Dr(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Z(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Z(()=>{o&&u!==Ar&&n&&u(s)},[o,n,u,s]),c}function Fr(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Me(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ir(e){return`composedPath`in e?e.composedPath()[0]:e.target}var Lr={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Rr={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},zr=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Br(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=wr(),g=Q(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=D.useRef(!1),{escapeKey:y,outsidePress:b}=zr(p),{escapeKey:x,outsidePress:S}=zr(m),C=D.useRef(!1),w=Q(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Pt(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Ft(e)?e.nativeEvent:e,`escape-key`)}),T=Q(e=>{var t;let n=()=>{var t;w(e),(t=Dt(e))==null||t.removeEventListener(`keydown`,n)};(t=Dt(e))==null||t.addEventListener(`keydown`,n)}),E=Q(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=Dt(e),s=`[`+Tr(`inert`)+`]`,c=At(i.floating).querySelectorAll(s),u=U(o)?o:null;for(;u&&!Ue(u);){let e=Ge(u);if(Ue(e)||!U(e))break;u=e}if(c.length&&U(o)&&!kt(o)&&!Et(o,i.floating)&&Array.from(c).every(e=>!Et(u,e)))return;if(W(o)&&A){let t=Ue(o),n=G(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Pt(h.nodesRef.current,d).some(t=>Ot(e,t.context?.elements.floating));if(Ot(e,i.floating)||Ot(e,i.domReference)||f)return;let p=h?Pt(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Q(e=>{var t;let n=()=>{var t;E(e),(t=Dt(e))==null||t.removeEventListener(l,n)};(t=Dt(e))==null||t.addEventListener(l,n)});D.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},He()?5:0)}let d=At(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(U(i.domReference)&&(p=qe(i.domReference)),U(i.floating)&&(p=p.concat(qe(i.floating))),!U(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(qe(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),D.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=D.useMemo(()=>({onKeyDown:w,...u&&{[Lr[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=D.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Rr[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return D.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Vr(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=yr(),a=D.useRef({}),[o]=D.useState(()=>br()),s=Cr()!=null,[c,l]=D.useState(r.reference),u=Q((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=D.useMemo(()=>({setPositionReference:l}),[]),f=D.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return D.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Hr(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Vr({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=D.useState(null),[l,u]=D.useState(null),d=o?.domReference||s,f=D.useRef(null),p=wr();Z(()=>{d&&(f.current=d)},[d]);let m=Jn({...n,elements:{...o,...l&&{reference:l}}}),h=D.useCallback(e=>{let t=U(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=D.useCallback(e=>{(U(e)||e===null)&&(f.current=e,c(e)),(U(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!U(e))&&m.refs.setReference(e)},[m.refs]),_=D.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=D.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Z(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),D.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Ur(){return xt()&&bt()}function Wr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=D.useRef(!1),u=D.useRef(-1),d=D.useRef(!0);D.useEffect(()=>{if(!s)return;let e=V(o.domReference);function t(){!n&&W(o.domReference)&&o.domReference===Tt(At(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Ur()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Ur()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),D.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),D.useEffect(()=>()=>{$(u)},[]);let f=D.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=Dt(e.nativeEvent);if(c&&U(t)){if(Ur()&&!e.relatedTarget){if(!d.current&&!jt(t))return}else if(!Mt(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=U(t)&&t.hasAttribute(Tr(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Tt(o.domReference?o.domReference.ownerDocument:document);(t||e!==o.domReference)&&(Et(a.current.floatingContext?.refs.floating.current,e)||Et(o.domReference,e)||i||r(!1,n,`focus`))})}}),[a,o.domReference,r,c]);return D.useMemo(()=>s?{reference:f}:{},[s,f])}function Gr(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[or]:t,[sr]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[ar]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[or,sr].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Kr(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=D.useCallback(t=>Gr(t,e,`reference`),t),a=D.useCallback(t=>Gr(t,e,`floating`),n),o=D.useCallback(t=>Gr(t,e,`item`),r);return D.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var qr=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Jr(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=yr(),c=r.domReference?.id||s,l=D.useMemo(()=>Nt(r.floating)?.id||i,[r.floating,i]),u=qr.get(o)??o,d=Cr()!=null,f=D.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=D.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=D.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return D.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Yr(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Yr(e,t.id,n)])}function Xr(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Zr(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Qr(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){$(i),u()}if($(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Ir(e),v=e.type===`mouseleave`,y=Fr(c.floating,_),b=Fr(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Zr(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&U(e.relatedTarget)&&Fr(c.floating,e.relatedTarget)||f&&Yr(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function P(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Xr([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Xr([m,h],P([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var $r={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},ei=s((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":b(t),"--scrollarea-over-scroll-behavior":i}}}),ti=t(e=>{let t=p(`ScrollArea`,$r,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,scrollbarSize:s,vars:c,type:l,scrollHideDelay:u,viewportProps:d,viewportRef:f,onScrollPositionChange:h,children:g,offsetScrollbars:_,scrollbars:v,onBottomReached:b,onTopReached:x,onLeftReached:S,onRightReached:C,overscrollBehavior:w,startScrollPosition:T,verticalScrollbarPosition:O,attributes:k,...A}=t,[j,M]=(0,D.useState)(!1),[N,P]=(0,D.useState)(!1),[ee,te]=(0,D.useState)(!1),ne=(0,D.useRef)(!0),re=(0,D.useRef)(!1),ie=(0,D.useRef)(!0),F=(0,D.useRef)(!1),L=m({name:`ScrollArea`,props:t,classes:Oe,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:k,vars:c,varsResolver:ei}),R=(0,D.useRef)(null),[se,ce]=(0,D.useState)(null),le=ir([f,R,(0,D.useCallback)(e=>{ce(t=>t===e?t:e)},[])]);return I(_===`present`?se:null,()=>{let e=R.current;e&&(P(e.scrollHeight>e.clientHeight),te(e.scrollWidth>e.clientWidth))}),y(()=>{T&&R.current&&R.current.scrollTo({left:T.x??0,top:T.y??0})},[]),(0,E.jsxs)(oe,{getStyles:L,type:l===`never`?`always`:l,scrollHideDelay:u,scrollbars:v,...L(`root`),...A,children:[(0,E.jsx)(De,{...d,...L(`viewport`,{style:d?.style}),ref:le,"data-offset-scrollbars":_===!0?`xy`:_||void 0,"data-scrollbars":v||void 0,"data-vertical-scrollbar-position":O||void 0,"data-horizontal-hidden":_===`present`&&!ee?`true`:void 0,"data-vertical-hidden":_===`present`&&!N?`true`:void 0,onScroll:e=>{d?.onScroll?.(e),h?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollLeft:i,scrollWidth:a,clientWidth:o}=e.currentTarget,s=t-(n-r)>=-.8,c=t===0;s&&!re.current&&b?.(),c&&!ne.current&&x?.(),re.current=s,ne.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!F.current&&C?.(),u&&!ie.current&&S?.(),F.current=l,ie.current=u},children:g}),(v===`xy`||v===`x`)&&(0,E.jsx)(Ce,{...L(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":l===`never`||_===`present`&&!ee||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,E.jsx)(Ee,{...L(`thumb`)})}),(v===`xy`||v===`y`)&&(0,E.jsx)(Ce,{...L(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":l===`never`||_===`present`&&!N||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,E.jsx)(Ee,{...L(`thumb`)})}),(0,E.jsx)(ae,{...L(`corner`),"data-vertical-scrollbar-position":O||void 0,"data-hovered":j||void 0,"data-hidden":l===`never`||void 0})]})});ti.displayName=`@mantine/core/ScrollArea`;var ni=t(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:a,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:m,viewportProps:h,scrollbars:g,style:_,vars:v,onBottomReached:y,onTopReached:b,startScrollPosition:x,verticalScrollbarPosition:C,onOverflowChange:w,...T}=p(`ScrollAreaAutosize`,$r,e),O=(0,D.useRef)(null),[k,A]=(0,D.useState)(null),j=ir([u,O,(0,D.useCallback)(e=>{A(t=>t===e?t:e)},[])]),M=(0,D.useRef)(!1),N=(0,D.useRef)(!1),P=(0,D.useEffectEvent)(()=>{let e=O.current;if(!e||!w)return;let t=e.scrollHeight>e.clientHeight;t!==M.current&&(N.current?w(t):(N.current=!0,t&&w(!0)),M.current=t)});return I(w?k:null,P),(0,E.jsx)(S,{...T,variant:m,style:[{display:`flex`,overflow:`hidden`},_],children:(0,E.jsx)(S,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...g===`y`&&{minWidth:0},...g===`x`&&{minHeight:0},...g===`xy`&&{minWidth:0,minHeight:0},...g===!1&&{minWidth:0,minHeight:0}},children:(0,E.jsx)(ti,{classNames:n,styles:r,scrollHideDelay:a,scrollbarSize:i,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:j,onScrollPositionChange:d,unstyled:f,variant:m,viewportProps:h,vars:v,scrollbars:g,onBottomReached:y,onTopReached:b,startScrollPosition:x,verticalScrollbarPosition:C,"data-autosize":`true`,children:t})})})});ti.classes=Oe,ti.varsResolver=ei,ni.displayName=`@mantine/core/ScrollAreaAutosize`,ni.classes=Oe,ti.Autosize=ni;function ri(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function ii(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var ai={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function oi({position:e,arrowSize:t,dir:n}){let[r,i]=e.split(`-`);if(!i)return;let a={width:t,height:t,position:`absolute`};if(r===`bottom`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,top:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(100% 0%, 0% 100%, 100% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`}}if(r===`top`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,bottom:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(0% 0%, 100% 0%, 0% 100%)`}}if(r===`left`)return{...a,right:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 0% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`};if(r===`right`)return{...a,left:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(100% 0%, 0% 100%, 100% 100%)`}}function si({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=oi({position:e,arrowSize:t,dir:s});if(n)return n}let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[ai[c]]:r},d=-t/2;return c===`left`?{...u,...ri(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...ri(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...ii(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...ii(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function ci({position:e,dir:t}){let[n,r]=e.split(`-`);if(!r)return;let i=r===`start`&&t===`ltr`||r===`end`&&t===`rtl`;if(n===`bottom`)return i?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n===`top`)return i?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n===`left`)return r===`start`?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n===`right`)return r===`start`?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function li({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=re();return a?(0,E.jsx)(`div`,{role:`presentation`,...l,style:{...c,...si({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}li.displayName=`@mantine/core/FloatingArrow`;function ui(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}function di(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function fi({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||di(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=di(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return di(n)}var pi={reuseTargetNode:!0},mi=t(e=>{let{children:t,target:n,reuseTargetNode:r,ref:i,...a}=p(`Portal`,pi,e),[o,s]=(0,D.useState)(!1),l=(0,D.useRef)(null);return y(()=>(s(!0),l.current=fi({target:n,reuseTargetNode:r,...a}),c(i,l.current),!n&&!r&&l.current&&document.body.appendChild(l.current),()=>{!n&&!r&&l.current&&document.body.removeChild(l.current)}),[n]),!o||!l.current?null:(0,T.createPortal)((0,E.jsx)(E.Fragment,{children:t}),l.current)});mi.displayName=`@mantine/core/Portal`;var hi=t(({withinPortal:e=!0,children:t,...n})=>w()===`test`||!e?(0,E.jsx)(E.Fragment,{children:t}):(0,E.jsx)(mi,{...n,children:t}));hi.displayName=`@mantine/core/OptionalPortal`;var gi={duration:100,transition:`fade`};function _i(e,t){return{...gi,...t,...e}}var vi={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},yi={orientation:`horizontal`},bi=s((e,{borderWidth:t})=>({group:{"--ai-border-width":b(t)}})),xi=t(e=>{let t=p(`ActionIconGroup`,yi,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:c,borderWidth:l,variant:u,mod:d,attributes:f,...h}=t;return(0,E.jsx)(S,{...m({name:`ActionIconGroup`,props:t,classes:vi,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:bi,rootSelector:`group`})(`group`),variant:u,mod:[{"data-orientation":s},d],role:`group`,...h})});xi.classes=vi,xi.varsResolver=bi,xi.displayName=`@mantine/core/ActionIconGroup`;var Si=s((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":g(o,`section-height`),"--section-padding-x":g(o,`section-padding-x`),"--section-fz":v(o),"--section-radius":t===void 0?void 0:f(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Ci=t(e=>{let t=p(`ActionIconGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,variant:c,gradient:l,radius:u,autoContrast:d,attributes:f,...h}=t;return(0,E.jsx)(S,{...m({name:`ActionIconGroupSection`,props:t,classes:vi,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Si,rootSelector:`groupSection`})(`groupSection`),variant:c,...h})});Ci.classes=vi,Ci.varsResolver=Si,Ci.displayName=`@mantine/core/ActionIconGroupSection`;var wi=s((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":g(t,`ai-size`),"--ai-radius":n===void 0?void 0:f(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),Ti=o(e=>{let t=p(`ActionIcon`,null,e),{className:n,unstyled:r,variant:i,classNames:a,styles:o,style:s,loading:c,loaderProps:d,size:f,color:h,radius:g,__staticSelector:_,gradient:v,vars:y,children:b,disabled:C,"data-disabled":w,autoContrast:T,mod:D,attributes:O,...k}=t,A=m({name:[`ActionIcon`,_],props:t,className:n,style:s,classes:vi,classNames:a,styles:o,unstyled:r,attributes:O,vars:y,varsResolver:wi});return(0,E.jsxs)(u,{...A(`root`,{active:!C&&!c&&!w}),"aria-busy":c||void 0,...k,unstyled:r,variant:i,size:f,disabled:C||c,mod:[{loading:c,disabled:C||w},D],children:[typeof c==`boolean`&&(0,E.jsx)(x,{mounted:c,transition:`slide-down`,duration:150,children:e=>(0,E.jsx)(S,{component:`span`,...A(`loader`,{style:e}),"aria-hidden":!0,children:(0,E.jsx)(l,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...d})})}),(0,E.jsx)(S,{component:`span`,mod:{loading:c},...A(`icon`),children:b})]})});Ti.classes=vi,Ti.varsResolver=wi,Ti.displayName=`@mantine/core/ActionIcon`,Ti.Group=xi,Ti.GroupSection=Ci;function Ei({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,D.useState)(n),a=(0,D.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Hr({placement:t,middleware:[Zn({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,D.useCallback)(({clientX:e,clientY:t})=>{Number.isFinite(e)&&Number.isFinite(t)&&l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,D.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=qe(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var Di={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},Oi={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:j(`popover`)},ki=s((e,{radius:t,color:r})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:f(t),"--tooltip-bg":r?n(r,e):void 0,"--tooltip-color":r?`var(--mantine-color-white)`:void 0}})),Ai=t(e=>{let t=p(`TooltipFloating`,Oi,e),{children:n,refProp:r,withinPortal:o,style:s,className:c,classNames:l,styles:u,unstyled:d,radius:f,color:h,label:g,offset:_,position:v,multiline:y,zIndex:b,disabled:x,defaultOpened:C,variant:w,vars:T,portalProps:O,attributes:k,ref:A,...j}=t,M=i(),N=m({name:`TooltipFloating`,props:t,classes:Di,className:c,style:s,classNames:l,styles:u,unstyled:d,attributes:k,rootSelector:`tooltip`,vars:T,varsResolver:ki}),{handleMouseMove:ne,x:re,y:ie,opened:F,boundaryRef:I,floating:L,setOpened:ae}=Ei({offset:_,position:v,defaultOpened:C}),R=ee(n);if(!R)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let oe=a(I,P(R),A),se=R.props,ce=e=>{se.onMouseEnter?.(e),ne(e),ae(!0)},le=e=>{se.onMouseLeave?.(e),ae(!1)};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(hi,{...O,withinPortal:o,children:(0,E.jsx)(S,{...j,...N(`tooltip`,{style:{...te(s,M),zIndex:b,display:!x&&F?`block`:`none`,top:Number.isFinite(ie)?Math.round(ie):``,left:Number.isFinite(re)?Math.round(re):``}}),variant:w,ref:L,mod:{multiline:y},children:g})}),(0,D.cloneElement)(R,{...se,[r]:oe,onMouseEnter:ce,onMouseLeave:le})]})});Ai.classes=Di,Ai.varsResolver=ki,Ai.displayName=`@mantine/core/TooltipFloating`;var ji=(0,D.createContext)({withinGroup:!1}),Mi={openDelay:0,closeDelay:0};function Ni(e){let{openDelay:t,closeDelay:n,children:r}=p(`TooltipGroup`,Mi,e);return(0,E.jsx)(ji,{value:{withinGroup:!0},children:(0,E.jsx)(Nr,{delay:{open:t,close:n},children:r})})}Ni.displayName=`@mantine/core/TooltipGroup`,Ni.extend=e=>e;function Pi(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Fi(e){let t=Pi(e.middlewares),n=[Xn(e.offset)];return t.shift&&n.push(Zn(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?$n():$n(t.flip)),n.push(rr({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?nr():nr(t.inline)):e.inline&&n.push(nr()),n}function Ii(t){let[n,r]=(0,D.useState)(t.defaultOpened),i=typeof t.opened==`boolean`?t.opened:n,a=(0,D.use)(ji).withinGroup,o=e(),s=(0,D.useCallback)(e=>{r(e),e&&_(o)},[o]),{x:c,y:l,context:u,refs:d,placement:f,middlewareData:{arrow:{x:p,y:m}={}}}=Hr({strategy:t.strategy,placement:t.position,open:i,onOpenChange:s,middleware:Fi(t),whileElementsMounted:Nn}),{delay:h,currentId:g,setCurrentId:_}=Pr(u,{id:o}),{getReferenceProps:v,getFloatingProps:b}=Kr([kr(u,{enabled:t.events?.hover,delay:a?h:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch,handleClose:t.interactive?Qr():null}),Wr(u,{enabled:t.events?.focus,visibleOnly:!0}),Jr(u,{role:`tooltip`}),Br(u,{enabled:t.opened===void 0})]),x=(0,D.useRef)(f);y(()=>{x.current!==f&&(x.current=f,t.onPositionChange?.(f))},[f]);let S=i&&g&&g!==o;return{x:c,y:l,arrowX:p,arrowY:m,reference:d.setReference,floating:d.setFloating,getFloatingProps:b,getReferenceProps:v,isGroupPhase:S,opened:i,placement:f}}var Li={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:j(`popover`),middlewares:{flip:!0,shift:!0,inline:!1}},Ri=s((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:f(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),zi=t(e=>{let t=p(`Tooltip`,Li,e),{children:n,position:i,refProp:o,label:s,openDelay:c,closeDelay:l,onPositionChange:u,opened:d,defaultOpened:f,withinPortal:h,radius:g,color:_,classNames:v,styles:y,unstyled:b,style:C,className:w,withArrow:T,arrowSize:O,arrowOffset:k,arrowRadius:A,arrowPosition:j,offset:M,transitionProps:N,multiline:te,events:ne,interactive:ie,zIndex:F,disabled:I,onClick:L,onMouseEnter:ae,onMouseLeave:R,inline:oe,variant:se,keepMounted:ce,vars:le,portalProps:ue,mod:de,floatingStrategy:fe,middlewares:pe,autoContrast:me,attributes:he,target:z,ref:ge,..._e}=t,{dir:ve}=re(),ye=(0,D.useRef)(null),B=Ii({position:ui(ve,i),closeDelay:l,openDelay:c,onPositionChange:u,opened:d,defaultOpened:f,events:ne,interactive:ie,arrowRef:ye,arrowOffset:k,offset:typeof M==`number`?M+(T?O/2:0):M,inline:oe,strategy:fe,middlewares:pe});(0,D.useEffect)(()=>{let e=z instanceof HTMLElement?z:typeof z==`string`?document.querySelector(z):z?.current||null;e&&B.reference(e)},[z,B]);let be=m({name:`Tooltip`,props:t,classes:Di,className:w,style:C,classNames:v,styles:y,unstyled:b,attributes:he,rootSelector:`tooltip`,vars:le,varsResolver:Ri}),xe=ee(n);if(!z&&!xe)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let Se=be(`tooltip`),Ce=ie&&!I&&!!B.opened,we=j===`merge`&&T?ci({position:B.placement,dir:ve}):void 0;if(z){let e=_i(N,{duration:100,transition:`fade`});return(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(hi,{...ue,withinPortal:h,children:(0,E.jsx)(x,{...e,keepMounted:ce,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:e.duration,children:e=>(0,E.jsxs)(S,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:te,interactive:Ce},de],...Se,...B.getFloatingProps({ref:B.floating,className:Se.className,style:{...Se.style,...e,...we,zIndex:F,top:B.y??0,left:B.x??0}}),children:[s,(0,E.jsx)(li,{ref:ye,arrowX:B.arrowX,arrowY:B.arrowY,visible:T,position:B.placement,arrowSize:O,arrowOffset:k,arrowRadius:A,arrowPosition:j,...be(`arrow`)})]})})})})}let Te=xe.props,Ee=a(B.reference,P(xe),ge),De=_i(N,{duration:100,transition:`fade`});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(hi,{...ue,withinPortal:h,children:(0,E.jsx)(x,{...De,keepMounted:ce,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:De.duration,children:e=>(0,E.jsxs)(S,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:te,interactive:Ce},de],...B.getFloatingProps({ref:B.floating,className:be(`tooltip`).className,style:{...be(`tooltip`).style,...e,...we,zIndex:F,top:B.y??0,left:B.x??0}}),children:[s,(0,E.jsx)(li,{ref:ye,arrowX:B.arrowX,arrowY:B.arrowY,visible:T,position:B.placement,arrowSize:O,arrowOffset:k,arrowRadius:A,arrowPosition:j,...be(`arrow`)})]})})}),(0,D.cloneElement)(xe,B.getReferenceProps({onClick:L,onMouseEnter:ae,onMouseLeave:R,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...Te,className:r(w,Te.className),[o]:Ee}))]})});zi.classes=Di,zi.varsResolver=Ri,zi.displayName=`@mantine/core/Tooltip`,zi.Floating=Ai,zi.Group=Ni;var Bi=(0,D.createContext)(null);function Vi(){let e=(0,D.useContext)(Bi);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Hi=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,Ui={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Wi(e){return Ui[e]??`Working on it…`}var Gi=`modulepreload`,Ki=function(e){return`/`+e},qi={},Ji=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ki(t,n),t=s(t),t in qi)return;qi[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Gi,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{k as A,Zn as C,ee as D,re as E,P as O,Xn as S,Nn as T,rr as _,Vi as a,nr as b,hi as c,ci as d,ti as f,Kr as g,kr as h,Hi as i,O as j,j as k,ui as l,Hr as m,Bi as n,zi as o,Qr as p,Wi as r,Ti as s,Ji as t,li as u,$n as v,er as w,Qn as x,tr as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/routes-4U_e7tED.js b/internal/ui/dist/assets/routes-4U_e7tED.js new file mode 100644 index 000000000..af59edf4b --- /dev/null +++ b/internal/ui/dist/assets/routes-4U_e7tED.js @@ -0,0 +1 @@ +import{pt as e}from"./brand-CCB4_HD8.js";import{c as t,n}from"./auth-d1anOsyP.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/routes-C2A3xwKL.js b/internal/ui/dist/assets/routes-C2A3xwKL.js deleted file mode 100644 index 46cb5d556..000000000 --- a/internal/ui/dist/assets/routes-C2A3xwKL.js +++ /dev/null @@ -1 +0,0 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{K as t,p as n}from"./index-DSdcpqnK.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/tokens-DbmTV7qX.js b/internal/ui/dist/assets/tokens-DbmTV7qX.js new file mode 100644 index 000000000..49a3fd093 --- /dev/null +++ b/internal/ui/dist/assets/tokens-DbmTV7qX.js @@ -0,0 +1,41 @@ +import{$ as e,A as t,C as n,G as r,H as i,J as a,K as o,N as s,Q as c,S as l,W as u,X as d,Y as f,a as p,at as m,b as h,et as g,g as _,gt as v,ht as y,it as b,j as x,k as S,m as C,ot as w,pt as T,q as E,st as D,tt as O,ut as k,v as A,x as j,xt as M,y as ee,z as te}from"./brand-CCB4_HD8.js";import{f as ne,i as re,l as ie,m as ae,p as oe,s as N,u as se}from"./auth-d1anOsyP.js";import{A as P,C as ce,D as F,E as I,O as le,S as ue,T as L,_ as de,b as R,c as fe,d as pe,f as me,g as he,h as z,j as ge,k as B,l as _e,m as ve,p as ye,u as be,v as xe,w as Se,x as Ce,y as we}from"./preload-helper-qpfFvVn3.js";import{r as Te}from"./use-computed-color-scheme-CeR2KQyq.js";function Ee(e){return e[e.length-1]}function De(e,t){return typeof e==`function`?e(t):e}var V=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;function ke(e){for(let t in e)if(V.call(e,t))return!0;return!1}var Ae=()=>Object.create(null),je=(e,t)=>Me(e,t,Ae);function Me(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=Ie(e)&&Ie(i);if(!a&&!(Pe(e)&&Pe(i)))return i;let o=a?e:Ne(e);if(!o)return i;let s=a?i:Ne(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!Le(e[o],t[o],n)))return!1;return i===a}return!1}function Re(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var ze=/[\x00-\x1f\x7f"<>`{}]/g;function Be(e){return e.replace(ze,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Ve(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Be(t)}var He=[`http:`,`https:`,`mailto:`,`tel:`];function Ue(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function We(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Ve(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Ve(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ge(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Ke(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Ye=4,Xe=5;function Ze(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=tt(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=et(r);e.kind=Xe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=et(r);e.kind=Ye,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)Qe(e,t,r,c,i,a,o,s)}function $e(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function et(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function tt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function nt(e,t){let n=et(`/`),r=new Uint16Array(6),i=[];for(let t of e)Qe(!1,r,t,1,n,0,i);for(let e of i)e.sort($e);t.masksTree=n,t.flatCache=Je(1e3)}function rt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=ct(e,t.masksTree);return t.flatCache.set(e,r),r}function it(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=et(`/`),Qe(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ct(r,o,n)}function at(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ct(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ut(a.route)),t.matchCache.set(r,a),a}function ot(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function st(e,t=!1,n){let r=et(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;Qe(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&qe(),o[e.id]=e,c!==0&&e.path){let t=ot(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort($e);return{processedTree:{segmentTree:r,singleCache:Je(1e3),matchCache:Je(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function ct(e,t,n=!1){let r=e.split(`/`),i=ft(e,r,t,n);if(!i)return null;let[a]=lt(e,r,i);return{route:i.node.route,rawParams:a}}function lt(e,t,n){let r=dt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ye)>(e.node.kind===Ye)||t.node.kind===Ye==(e.node.kind===Ye)&&t.node.depth>e.node.depth)))}function _t(e){return vt(e.filter(e=>e!==void 0).join(`/`))}function vt(e){return e.replace(/\/{2,}/g,`/`)}function yt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function bt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function xt(e){return bt(yt(e))}function St(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ct(e,t,n){return St(e,n)===St(t,n)}function wt({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=vt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=vt(e)),o=e.split(`/`);o.length>1&&Ee(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Ee(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?vt(s):s)||`/`;return a&&r&&r.set(a,c),c}function Tt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Et(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ot(e,n)).join(`/`):Ot(r,n):r}function Dt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=kt:this.parentRoute||qe();let r=n?kt:t?.path;r&&r!==`/`&&(r=yt(r));let i=t?.id||r,a=n?kt:_t([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=_t([`/`,a]));let o=a===`__root__`?`/`:_t([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=bt(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>At({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Pt=class extends Nt{constructor(e){super(e)}},H=M(y(),1),U=T();function Ft({children:e,fallback:t=null}){return(0,U.jsx)(H.Fragment,{children:It()?e:t})}function It(){return H.useSyncExternalStore(Lt,()=>!0,()=>!1)}function Lt(){return()=>{}}var Rt=H.createContext(void 0),zt=H.createContext(void 0),Bt=v((e=>{var t=y();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Vt=v(((e,t)=>{t.exports=Bt()})),Ht=v((e=>{var t=y(),n=Vt();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ut=v(((e,t)=>{t.exports=Ht()}))();function Wt(e,t){return e===t}function Gt(e,t,n=Wt){let r=(0,H.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,H.useCallback)(()=>e?.get(),[e]);return(0,Ut.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Kt={};function qt(e,t){let n=H.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Me(n.current,i):i}}function Jt(e){let t=se(),n=H.useContext(e.from?zt:Rt),r=e.from??n,i=t.stores.getMatchStore(r),a=qt(e,t),o=Gt(i,e=>e?a(e):Kt);if(o!==Kt)return o;(e.shouldThrow??!0)&&qe()}function Yt(e){return Jt({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xt(e){let{select:t,...n}=e;return Jt({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Zt(e){return Jt({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Qt(e){return Jt({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function $t(e){return Jt({...e,select:t=>e.select?e.select(t.context):t.context})}function en(e){let t=H.useRef(e);return Le(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function tn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function nn(e,t,n){if(e?.external)return Ue(e.href,n)?void 0:e.href;if(!mn(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),Ue(t,n)?void 0:t}catch{}}function rn(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Ct(e.pathname,t.pathname,r))return!1}else{let n=St(e.pathname,r),i=St(t.pathname,r);if(!n.startsWith(i)||n.length!==i.length&&n[i.length]!==`/`)return!1}return(n?.includeSearch??!0)&&!Le(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function an(e,t){let n=se(),r=oe(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:ee,unsafeRelative:te,from:ne,_fromLocation:re,...ie}=e,N=It(),P=en(e.search),ce=en(e.params),F=en(o),I=H.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,P,ce,e.state,e.mask,e.unsafeRelative]),le=H.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...I}),r=pn(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,v),i=nn(r,s,n.protocolAllowlist);return[r?.href,i,rn(e,t,F,n.basepath,N,i!==void 0)]},[F,v,N,I,n,s]),[ue,L,de]=Gt(n.stores.location,le,tn),R=de?De(i,{})??sn:on,fe=de?on:De(a,{})??on,pe=[b,R.className,fe.className].filter(Boolean).join(` `),me=(y||R.style||fe.style)&&{...y,...R.style,...fe.style},he=H.useRef(!1),z=e.reloadDocument||L||v?!1:c??n.options.defaultPreload,ge=l??n.options.defaultPreloadDelay??0,B=H.useCallback(()=>{n.preloadRoute(I).catch(e=>{console.warn(e),console.warn(Mt)})},[n,I]),_e=H.useCallback(e=>{if(!e){dn(r);return}if(!(e.isIntersecting??z===`intent`)){e.isIntersecting===!1&&dn(r);return}if(!ge){B();return}un.has(r)||un.set(r,setTimeout(()=>{un.delete(r),B()},ge))},[B,r,z,ge]);ae(r,_e,z!==`viewport`),H.useEffect(()=>{he.current||z===`render`&&(B(),he.current=!0)},[B,z]);let ve=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;!v&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...I,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D}))};if(L)return{...ie,ref:r,href:L,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let ye=()=>{z===`intent`&&B()},be=()=>{z===`intent`&&dn(r)};return{...ie,...R,...fe,href:ue,ref:r,onClick:fn([x,ve]),onBlur:fn([S,be]),onFocus:fn([C,_e]),onMouseEnter:fn([w,_e]),onMouseLeave:fn([T,be]),onTouchStart:fn([E,ye]),disabled:!!v,target:_,...me&&{style:me},...pe&&{className:pe},...v&&cn,...de&&ln}}var on={},sn={className:`active`},cn={role:`link`,"aria-disabled":!0},ln={"data-status":`active`,"aria-current":`page`},un=new WeakMap,dn=e=>{clearTimeout(un.get(e)),un.delete(e)},fn=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function pn(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function mn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var hn=H.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=an(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return H.createElement(`a`,t,o)}return H.createElement(n,a,o)}),gn=class extends Nt{constructor(e){super(e),this.useMatch=e=>Jt({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>$t({...e,from:this.id}),this.useSearch=e=>Qt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Zt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Xt({...e,from:this.id}),this.useLoaderData=e=>Yt({...e,from:this.id}),this.useNavigate=()=>ie({from:this.fullPath}),this.Link=H.forwardRef((e,t)=>(0,U.jsx)(hn,{ref:t,from:this.fullPath,...e}))}};function _n(e){return new gn(e)}var vn=class extends Pt{constructor(e){super(e),this.useMatch=e=>Jt({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>$t({...e,from:this.id}),this.useSearch=e=>Qt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Zt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Xt({...e,from:this.id}),this.useLoaderData=e=>Yt({...e,from:this.id}),this.useNavigate=()=>ie({from:this.fullPath}),this.Link=H.forwardRef((e,t)=>(0,U.jsx)(hn,{ref:t,from:this.fullPath,...e}))}};function yn(e){return new vn(e)}function bn(e){return e=>{let t=_n(e);return t.isRoot=!1,t}}function xn(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(Re(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(ne)ne(a());else throw a()}return H.createElement(r,e)};return o.preload=a,o}function Sn(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function Cn(e){let t=Sn(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function wn(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function Tn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function En(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(wn(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Dn(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=En(l,c,r),d=Tn(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[En(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[Tn(c.length,c,!1)]?.focus()}}}function kn(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Te:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function W(e,t){return n=>{e?.(n),t?.(n)}}function An(e,t){return e in t?Cn(t[e]):Cn(e)}function jn(e,t){let n=e.map(e=>({value:e,px:An(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Mn(e,t,n){return n?Array.from(wn(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Nn=[`mousedown`,`touchstart`];function Pn(e,t,n,r=!0){let i=(0,H.useRef)(null),a=t||Nn,o=(0,H.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let a=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!a.includes(e))&&e(t):i.current&&!a.includes(i.current)&&e(t)}),s=a.join(`,`);return(0,H.useEffect)(()=>{if(!r)return;let e=s.split(`,`);return e.forEach(e=>document.addEventListener(e,o)),()=>{e.forEach(e=>document.removeEventListener(e,o))}},[s,r]),i}function Fn({opened:e,shouldReturnFocus:t=!0}){let n=(0,H.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return g(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};if(document.addEventListener(`keydown`,a),e)n.current=document.activeElement;else if(t){let e=document.activeElement;i=window.setTimeout(()=>{let t=document.activeElement;(t===null||t===document.body||t===e)&&r()},10)}return()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var In=/input|select|textarea|button|object/,Ln=`a, input, select, textarea, button, object, [tabindex]`;function Rn(e){return e.style.display===`none`}function zn(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(Rn(t))return!1;t=t.parentNode}return!0}function Bn(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Vn(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(Bn(e));return(In.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&zn(e)}function Hn(e){let t=Bn(e);return(Number.isNaN(t)||t>=0)&&Vn(e)}function Un(e){return Array.from(e.querySelectorAll(Ln)).filter(Hn)}function Wn(e,t){let n=Un(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Gn(e=!0){let t=(0,H.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Ln));t=n.find(Hn)||n.find(Vn)||null,!t&&Vn(e)&&(t=e)}t?t.focus({preventScroll:!0}):console.warn(`[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node`,e)},r=(0,H.useCallback)(r=>{if(e){if(r===null){t.current=null;return}t.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn(`[@mantine/hooks/use-focus-trap] Ref node is not part of the dom`,r)}),t.current=r)}},[e]);return(0,H.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&Wn(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function Kn(e,t,n){let r=(0,H.useEffectEvent)(t);(0,H.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}var qn=[`mouse`,`touch`],Jn=10;function Yn(e,t={}){let{threshold:n=400,events:r=qn,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,H.useRef)(!1),l=(0,H.useRef)(!1),u=(0,H.useRef)(-1),d=(0,H.useRef)(null);return(0,H.useEffect)(()=>()=>window.clearTimeout(u.current),[]),(0,H.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?Jn:i===!1?0:i,p=t=>{(Qn(t)||Zn(t))&&(a&&a(t),d.current=Xn(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(Qn(e)||Zn(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=Xn(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,r.join(`,`)])}function Xn(e){if(Zn(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Zn(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function Qn(e){return e.nativeEvent instanceof MouseEvent}function $n({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&o({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function er(e,t,n){return $n({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function tr(e,t){let n=e.colors[e.primaryColor];return u(n)?e.autoContrast?er(n,e,t):`var(--mantine-color-white)`:$n({color:n[E(e,t)],theme:e,autoContrast:null})}var nr={root:`m_515a97f8`},rr=n(e=>{let t=x(`VisuallyHidden`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,U.jsx)(j,{component:`span`,...S({name:`VisuallyHidden`,classes:nr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c})(`root`),...l})});rr.classes=nr,rr.displayName=`@mantine/core/VisuallyHidden`;function ir({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,H.useRef)(-1),a=(0,H.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,H.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var ar={root:`m_9814e45f`},or={zIndex:B(`modal`)},sr=f((e,{gradient:t,color:n,backgroundOpacity:r,blur:a,radius:o,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&i(n||`#000`,r??.6)||void 0,"--overlay-filter":a?`blur(${k(a)})`:void 0,"--overlay-radius":o===void 0?void 0:b(o),"--overlay-z-index":s?.toString()}})),cr=l(e=>{let t=x(`Overlay`,or,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fixed:c,center:l,children:u,radius:d,zIndex:f,gradient:p,blur:m,color:h,backgroundOpacity:g,mod:_,attributes:v,...y}=t;return(0,U.jsx)(j,{...S({name:`Overlay`,props:t,classes:ar,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:sr})(`root`),mod:[{center:l,fixed:c},_],...y,children:u})});cr.classes=ar,cr.varsResolver=sr,cr.displayName=`@mantine/core/Overlay`;var[lr,ur]=P(`Popover component was not found in the tree`);function dr({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,H.useRef)(!1),s=(0,H.useRef)(!1),c=(0,H.useRef)(null),l=(0,H.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=W(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=W(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=Yn(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:W(e.onTouchStart,p.onTouchStart),onTouchEnd:W(e.onTouchEnd,p.onTouchEnd),onTouchCancel:W(e.onTouchCancel,p.onTouchCancel),onTouchMove:W(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function fr(e){let{children:t,disabled:n,longPressDelay:r}=x(`PopoverContextMenu`,null,e),i=F(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=ur();return(0,H.cloneElement)(i,dr({childProps:i.props,disabled:n||a.disabled,opened:a.opened,longPressDelay:r,setReference:a.reference,open:()=>{a.opened||a.onToggle()}}))}fr.displayName=`@mantine/core/PopoverContextMenu`;function pr({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=c(Gn(t),r),a=F(e);return a?(0,H.cloneElement)(a,{[n]:i}):e}function mr(e){return(0,U.jsx)(rr,{tabIndex:-1,"data-autofocus":!0,...e})}pr.displayName=`@mantine/core/FocusTrap`,mr.displayName=`@mantine/core/FocusTrapInitialFocus`,pr.InitialFocus=mr;var hr={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},gr=n(e=>{let t=x(`PopoverDropdown`,null,e),{className:n,style:r,vars:i,children:a,onKeyDownCapture:o,variant:s,classNames:l,styles:u,ref:d,...f}=t,p=ur(),{dir:m}=I(),h=p.arrowPosition===`merge`&&p.withArrow?pe({position:p.placement,dir:m}):void 0,g=Fn({opened:p.opened,shouldReturnFocus:p.returnFocus}),_=p.withRoles?{"aria-labelledby":p.getTargetId(),id:p.getDropdownId(),role:`dialog`,tabIndex:-1}:{},v=c(d,p.floating);return p.disabled?null:(0,U.jsx)(fe,{...p.portalProps,withinPortal:p.withinPortal,children:(0,U.jsx)(A,{mounted:p.opened,...p.transitionProps,transition:p.transitionProps?.transition||`fade`,duration:p.transitionProps?.duration??150,keepMounted:p.keepMounted,keepMountedMode:p.keepMountedMode,exitDuration:typeof p.transitionProps?.exitDuration==`number`?p.transitionProps.exitDuration:p.transitionProps?.duration,children:e=>(0,U.jsx)(pr,{active:p.trapFocus&&p.opened,innerRef:v,children:(0,U.jsxs)(j,{..._,...f,variant:s,onKeyDownCapture:kn(()=>{p.onClose?.(),p.onDismiss?.()},{active:p.closeOnEscape,onTrigger:g,onKeyDown:o}),"data-position":p.placement,"data-fixed":p.floatingStrategy===`fixed`||void 0,...p.getStyles(`dropdown`,{className:n,props:t,classNames:l,styles:u,style:[{...e,...h,zIndex:p.zIndex,top:p.y??0,left:p.x??0,width:p.width===`target`?void 0:k(p.width),...p.referenceHidden?{display:`none`}:null},p.resolvedStyles?.dropdown,u?.dropdown,r]}),children:[a,(0,U.jsx)(be,{ref:p.arrowRef,arrowX:p.arrowX,arrowY:p.arrowY,visible:p.withArrow,position:p.placement,arrowSize:p.arrowSize,arrowRadius:p.arrowRadius,arrowOffset:p.arrowOffset,arrowPosition:p.arrowPosition,...p.getStyles(`arrow`,{props:t,classNames:l,styles:u})})]})})})})});gr.classes=hr,gr.displayName=`@mantine/core/PopoverDropdown`;var _r={refProp:`ref`,popupType:`dialog`},vr=n(e=>{let{children:t,refProp:n,popupType:r,ref:i,...o}=x(`PopoverTarget`,_r,e),s=F(t);if(!s)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let l=o,u=ur(),d=c(u.reference,le(s),i),f=u.withRoles?{"aria-haspopup":r,"aria-expanded":u.opened,"aria-controls":u.opened?u.getDropdownId():void 0,id:u.getTargetId()}:{},p=s.props;return(0,H.cloneElement)(s,{...l,...f,...u.targetProps,className:a(u.targetProps.className,l.className,p.className),[n]:d,...u.controlled?null:{onClick:e=>{u.onToggle(),p.onClick?.(e)}}})});vr.displayName=`@mantine/core/PopoverTarget`;function yr(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function br(e,t,n,r){let i=yr(e.middlewares),a=[ue(e.offset),we()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(xe(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(ce(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:Ce(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?R():R(i.inline)),a.push(de({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(Se({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function xr(e){let[t,n]=N({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,H.useRef)(t),[i,a]=(0,H.useState)(null),o=e.preventPositionChangeWhenVisible!==!1,s=(0,H.useRef)(t);t!==s.current&&(s.current=t,t&&i!==null&&a(null));let c=(0,H.useCallback)(()=>a(null),[]),l=()=>{t&&!e.disabled&&n(!1)},u=()=>{e.disabled||n(!t)},d=ve({open:t,strategy:e.strategy,placement:o?i??e.position:e.position,middleware:br(e,()=>d,o&&i!==null,o),whileElementsMounted:e.keepMounted?void 0:L});(0,H.useEffect)(()=>{if(!e.keepMounted)return;let n=d.refs.reference.current,r=d.refs.floating.current;if(t&&n&&r)return L(n,r,d.update)},[e.keepMounted,t,d.update,d.elements.reference,d.elements.floating]);let f=(0,H.useRef)(!1);O(()=>{if(!t){f.current=!1;return}if(!o||i!==null)return;let e=d.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!f.current){f.current=!0,d.update();return}d.isPositioned&&a(d.placement)}},[o,t,d.isPositioned,d.placement,i,d.update]);let p=(0,H.useRef)(d.placement);return O(()=>{p.current!==d.placement&&(p.current=d.placement,e.onPositionChange?.(d.placement))},[d.placement]),g(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:d,controlled:typeof e.opened==`boolean`,opened:t,onClose:l,onToggle:u,resetLockedPlacement:c}}var Sr={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:B(`popover`),__staticSelector:`Popover`,width:`max-content`},Cr=f((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:b(t),"--popover-shadow":m(n)}}));function G(n){let r=x(`Popover`,Sr,n),{children:i,position:a,offset:o,onPositionChange:s,opened:c,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:f,middlewares:p,withArrow:m,arrowSize:h,arrowOffset:g,arrowRadius:_,arrowPosition:v,unstyled:y,classNames:b,styles:C,closeOnClickOutside:w,withinPortal:T,portalProps:E,closeOnEscape:D,clickOutsideEvents:O,trapFocus:k,onClose:j,onDismiss:M,onOpen:ee,onChange:ne,zIndex:re,radius:ie,shadow:ae,id:oe,defaultOpened:N,__staticSelector:se,withRoles:P,disabled:ce,returnFocus:F,variant:le,keepMounted:ue,keepMountedMode:L,vars:de,floatingStrategy:R,withOverlay:pe,overlayProps:me,hideDetached:he,attributes:z,preventPositionChangeWhenVisible:ge,...B}=r,ve=S({name:se,props:r,classes:hr,classNames:b,styles:C,unstyled:y,attributes:z,rootSelector:`dropdown`,vars:de,varsResolver:Cr}),{resolvedStyles:ye}=t({classNames:b,styles:C,props:r}),be=(0,H.useRef)(null),[xe,Se]=(0,H.useState)(null),[Ce,we]=(0,H.useState)(null),{dir:Te}=I(),Ee=te(),De=e(oe),V=xr({middlewares:p,width:f,position:_e(Te,a),offset:typeof o==`number`?o+(m?h/2:0):o,arrowRef:be,arrowOffset:g,onPositionChange:s,opened:c,defaultOpened:N,onChange:ne,onOpen:ee,onClose:j,onDismiss:M,strategy:R,disabled:ce,preventPositionChangeWhenVisible:ge,keepMounted:ue});Pn(()=>{w&&(V.onClose(),M?.())},O,[xe,Ce]);let Oe=(0,H.useCallback)(e=>{Se(e),V.floating.refs.setReference(e)},[V.floating.refs.setReference]),ke=(0,H.useCallback)(e=>{we(e),V.floating.refs.setFloating(e)},[V.floating.refs.setFloating]),Ae=(0,H.useCallback)(()=>{l?.onExited?.(),u?.(),V.resetLockedPlacement()},[l?.onExited,u,V.resetLockedPlacement]),je=(0,H.useCallback)(()=>{l?.onEntered?.(),d?.()},[l?.onEntered,d]);return(0,U.jsxs)(lr,{value:{returnFocus:F,disabled:ce,controlled:V.controlled,reference:Oe,floating:ke,x:V.floating.x,y:V.floating.y,arrowX:V.floating?.middlewareData?.arrow?.x,arrowY:V.floating?.middlewareData?.arrow?.y,opened:V.opened,arrowRef:be,transitionProps:{...l,onExited:Ae,onEntered:je},width:f,withArrow:m,arrowSize:h,arrowOffset:g,arrowRadius:_,arrowPosition:v,placement:V.floating.placement,trapFocus:k,withinPortal:T,portalProps:E,zIndex:re,radius:ie,shadow:ae,closeOnEscape:D,onDismiss:M,onClose:V.onClose,onToggle:V.onToggle,getTargetId:()=>De,getDropdownId:()=>`${De}-dropdown`,withRoles:P,targetProps:B,__staticSelector:se,classNames:b,styles:C,unstyled:y,variant:le,keepMounted:ue,keepMountedMode:L,getStyles:ve,resolvedStyles:ye,floatingStrategy:R,referenceHidden:he&&Ee!==`test`?V.floating.middlewareData.hide?.referenceHidden:!1},children:[i,pe&&(0,U.jsx)(A,{transition:`fade`,mounted:V.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:e=>(0,U.jsx)(fe,{withinPortal:T,children:(0,U.jsx)(cr,{...me,...ve(`overlay`,{className:me?.className,style:[e,me?.style]})})})})]})}G.Target=vr,G.Dropdown=gr,G.ContextMenu=fr,G.varsResolver=Cr,G.displayName=`@mantine/core/Popover`,G.extend=e=>e,G.withProps=e=>{let t=t=>(0,U.jsx)(G,{...e,...t});return t.extend=G.extend,t.displayName=`WithProps(${G.displayName})`,t};var[wr,K]=P(`ModalBase component was not found in tree`);function Tr({opened:e,transitionDuration:t}){let[n,r]=(0,H.useState)(e),i=(0,H.useRef)(-1),a=d()?0:t;return(0,H.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function Er({id:t,transitionProps:n,opened:r,trapFocus:i,closeOnEscape:a,onClose:o,returnFocus:s}){let c=e(t),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=Tr({opened:r,transitionDuration:typeof n?.duration==`number`?n?.duration:200});return Kn(`keydown`,e=>{e.key===`Escape`&&a&&!e.isComposing&&r&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&o()},{capture:!0}),Fn({opened:r,shouldReturnFocus:i&&s}),{_id:c,titleMounted:l,bodyMounted:d,shouldLockScroll:p,setTitleMounted:u,setBodyMounted:f}}var Dr=function(){return Dr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`)return ni;var t=ii(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oi=ti(),si=`data-scroll-locked`,ci=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` + .${Mr} { + overflow: hidden ${r}; + padding-right: ${s}px ${r}; + } + body[${si}] { + overflow: hidden ${r}; + overscroll-behavior: contain; + ${[t&&`position: relative ${r};`,n===`margin`&&` + padding-left: ${i}px; + padding-top: ${a}px; + padding-right: ${o}px; + margin-left:0; + margin-top:0; + margin-right: ${s}px ${r}; + `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} + } + + .${Ar} { + right: ${s}px ${r}; + } + + .${jr} { + margin-right: ${s}px ${r}; + } + + .${Ar} .${Ar} { + right: 0 ${r}; + } + + .${jr} .${jr} { + margin-right: 0 ${r}; + } + + body[${si}] { + ${Nr}: ${s}px; + } +`},li=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ui=function(){H.useEffect(function(){return document.body.setAttribute(si,(li()+1).toString()),function(){var e=li()-1;e<=0?document.body.removeAttribute(si):document.body.setAttribute(si,e.toString())}},[])},di=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ui();var a=H.useMemo(function(){return ai(i)},[i]);return H.createElement(oi,{styles:ci(a,!t,i,n?``:`!important`)})},fi=!1;if(typeof window<`u`)try{var pi=Object.defineProperty({},"passive",{get:function(){return fi=!0,!0}});window.addEventListener(`test`,pi,pi),window.removeEventListener(`test`,pi,pi)}catch{fi=!1}var mi=fi?{passive:!1}:!1,hi=function(e){return e.tagName===`TEXTAREA`},gi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!hi(e)&&n[t]===`visible`)},_i=function(e){return gi(e,`overflowY`)},vi=function(e){return gi(e,`overflowX`)},yi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Si(e,r)){var i=Ci(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bi=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},xi=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Si=function(e,t){return e===`v`?_i(t):vi(t)},Ci=function(e,t){return e===`v`?bi(t):xi(t)},wi=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ti=function(e,t,n,r,i){var a=wi(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ci(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Si(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ei=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Di=function(e){return[e.deltaX,e.deltaY]},Oi=function(e){return e&&`current`in e?e.current:e},ki=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ai=function(e){return` + .block-interactivity-${e} {pointer-events: none;} + .allow-interactivity-${e} {pointer-events: all;} +`},ji=0,Mi=[];function Ni(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),i=H.useState(ji++)[0],a=H.useState(ti)[0],o=H.useRef(e);H.useEffect(function(){o.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=kr([e.lockRef.current],(e.shards||[]).map(Oi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=H.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ei(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=yi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=yi(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ti(h,t,e,h===`h`?s:c,!0)},[]),c=H.useCallback(function(e){var n=e;if(Mi.length&&Mi[Mi.length-1]===a){var r=`deltaY`in n?Di(n):Ei(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ki(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Oi).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=H.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Pi(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=H.useCallback(function(e){n.current=Ei(e),r.current=void 0},[]),d=H.useCallback(function(t){l(t.type,Di(t),t.target,s(t,e.lockRef.current))},[]),f=H.useCallback(function(t){l(t.type,Ei(t),t.target,s(t,e.lockRef.current))},[]);H.useEffect(function(){return Mi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,mi),document.addEventListener(`touchmove`,c,mi),document.addEventListener(`touchstart`,u,mi),function(){Mi=Mi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,mi),document.removeEventListener(`touchmove`,c,mi),document.removeEventListener(`touchstart`,u,mi)}},[]);var p=e.removeScrollBar,m=e.inert;return H.createElement(H.Fragment,null,m?H.createElement(a,{styles:Ai(i)}):null,p?H.createElement(di,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Fi=Gr(Kr,Ni),Ii=H.forwardRef(function(e,t){return H.createElement(Jr,Dr({},e,{ref:t,sideCar:Fi}))});Ii.classNames=Jr.classNames;function Li({keepMounted:e,keepMountedMode:t=`activity`,opened:n,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:s,trapFocus:c,closeOnEscape:l,returnFocus:u,closeOnClickOutside:d,withinPortal:f,portalProps:p,lockScroll:h,children:g,zIndex:_,shadow:v,padding:y,__vars:b,unstyled:x,removeScrollProps:S,...C}){let{_id:w,titleMounted:T,bodyMounted:E,shouldLockScroll:O,setTitleMounted:k,setBodyMounted:A}=Er({id:i,transitionProps:a,opened:n,trapFocus:c,closeOnEscape:l,onClose:r,returnFocus:u}),{key:M,...ee}=S||{};return(0,U.jsx)(fe,{...p,withinPortal:f,children:(0,U.jsx)(wr,{value:{opened:n,onClose:r,closeOnClickOutside:d,onExitTransitionEnd:o,onEnterTransitionEnd:s,transitionProps:{...a,keepMounted:e,keepMountedMode:t},getTitleId:()=>`${w}-title`,getBodyId:()=>`${w}-body`,titleMounted:T,bodyMounted:E,setTitleMounted:k,setBodyMounted:A,trapFocus:c,closeOnEscape:l,zIndex:_,unstyled:x},children:(0,U.jsx)(Ii,{enabled:O&&h,...ee,children:(0,U.jsx)(j,{...C,id:w,__vars:{...b,"--mb-z-index":(_||B(`modal`)).toString(),"--mb-shadow":m(v),"--mb-padding":D(y)},children:g})},M)})})}Li.displayName=`@mantine/core/ModalBase`;function Ri(){let e=K();return(0,H.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var zi={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Bi({className:e,...t}){let n=Ri(),r=K();return(0,U.jsx)(j,{id:n,className:a({[zi.body]:!r.unstyled},e),...t})}Bi.displayName=`@mantine/core/ModalBaseBody`;function Vi({className:e,onClick:t,...n}){let r=K();return(0,U.jsx)(_,{...n,onClick:e=>{r.onClose(),t?.(e)},className:a({[zi.close]:!r.unstyled},e),unstyled:r.unstyled})}Vi.displayName=`@mantine/core/ModalBaseCloseButton`;function Hi({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,ref:o,...s}){let c=K();return(0,U.jsx)(A,{mounted:c.opened,transition:`pop`,...c.transitionProps,onExited:()=>{c.onExitTransitionEnd?.(),c.transitionProps?.onExited?.()},onEntered:()=>{c.onEnterTransitionEnd?.(),c.transitionProps?.onEntered?.()},...e,children:e=>(0,U.jsx)(`div`,{...n,className:a({[zi.inner]:!c.unstyled},n.className),children:(0,U.jsx)(pr,{active:c.opened&&c.trapFocus,innerRef:o,children:(0,U.jsx)(ee,{...s,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":c.bodyMounted?c.getBodyId():void 0,"aria-labelledby":c.titleMounted?c.getTitleId():void 0,style:[i,e],className:a({[zi.content]:!c.unstyled},t),unstyled:c.unstyled,children:s.children})})})})}Hi.displayName=`@mantine/core/ModalBaseContent`;function Ui({className:e,...t}){let n=K();return(0,U.jsx)(j,{component:`header`,className:a({[zi.header]:!n.unstyled},e),...t})}Ui.displayName=`@mantine/core/ModalBaseHeader`;var Wi={duration:200,timingFunction:`ease`,transition:`fade`};function Gi(e){let t=K();return{...Wi,...t.transitionProps,...e}}function Ki({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=K(),o=Gi(t);return(0,U.jsx)(A,{mounted:r===void 0?a.opened:r,...o,transition:`fade`,children:t=>(0,U.jsx)(cr,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}Ki.displayName=`@mantine/core/ModalBaseOverlay`;function qi(){let e=K();return(0,H.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function Ji({className:e,...t}){let n=qi(),r=K();return(0,U.jsx)(j,{component:`h2`,className:a({[zi.title]:!r.unstyled},e),id:n,...t})}Ji.displayName=`@mantine/core/ModalBaseTitle`;function Yi({children:e}){return(0,U.jsx)(U.Fragment,{children:e})}function Xi({style:e,size:t=16,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:k(t),height:k(t),display:`block`},...n,children:(0,U.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}Xi.displayName=`@mantine/core/AccordionChevron`;function Zi({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:k(e),height:k(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Qi={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},$i=f((e,{radius:t,color:n,gradient:i,variant:a,size:o,autoContrast:s,circle:c})=>{let l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:a||`filled`,autoContrast:s});return{root:{"--badge-height":w(o,`badge-height`),"--badge-padding-x":w(o,`badge-padding-x`),"--badge-fz":w(o,`badge-fz`),"--badge-radius":c||t===void 0?void 0:b(t),"--badge-bg":n||a?l.background:void 0,"--badge-color":n||a?l.color:void 0,"--badge-bd":n||a?l.border:void 0,"--badge-dot-color":a===`dot`?r(n,e):void 0}}}),ea=l(e=>{let t=x(`Badge`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,radius:c,color:l,gradient:u,leftSection:d,rightSection:f,children:p,variant:m,fullWidth:h,autoContrast:g,circle:_,mod:v,attributes:y,...b}=t,C=S({name:`Badge`,props:t,classes:Qi,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:$i});return(0,U.jsxs)(j,{variant:m,mod:[{block:h,circle:_,"with-right-section":!!f,"with-left-section":!!d},v],...C(`root`,{variant:m}),...b,children:[d&&(0,U.jsx)(`span`,{...C(`section`),"data-position":`left`,children:d}),(0,U.jsx)(`span`,{...C(`label`),children:p}),f&&(0,U.jsx)(`span`,{...C(`section`),"data-position":`right`,children:f})]})});ea.classes=Qi,ea.varsResolver=$i,ea.displayName=`@mantine/core/Badge`;var[ta,q]=P(`Menu component was not found in the tree`),na=(0,H.createContext)(null);function ra(e){let{value:t,defaultValue:n,onChange:r,children:i}=x(`MenuCheckboxGroup`,null,e),[a,o]=N({value:t,defaultValue:n,finalValue:[],onChange:r});return(0,U.jsx)(na,{value:{values:a,onChange:(0,H.useCallback)(e=>{o(a.includes(e)?a.filter(t=>t!==e):[...a,e])},[a,o])},children:i})}ra.displayName=`@mantine/core/MenuCheckboxGroup`;var ia=(0,H.createContext)(null);function aa({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:l,children:u,disabled:d,dataDisabled:f,className:p,style:m,styles:g,classNames:_,buttonRef:v,others:y}){let b=q(),x=(0,H.use)(ia),S=s(),{dir:C}=I(),w=(0,H.useRef)(null),T=W(y.onClick,()=>{f||(r(),a&&b.closeDropdownImmediately())}),E=W(y.onMouseMove,()=>{if(!b.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),D=W(y.onKeyDown,e=>{e.key===`ArrowLeft`&&x&&(x.close(),x.focusParentItem())}),O=i?S.variantColorResolver({color:i,theme:S,variant:`light`}):void 0,k=i?o({color:i,theme:S}):null,A=b.alignItemsLabels!==`none`||t;return(0,U.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...y,unstyled:b.unstyled,tabIndex:b.menuItemTabIndex,...b.getStyles(`item`,{className:p,style:m,styles:g,classNames:_}),ref:c(w,v),role:e,"aria-checked":t,disabled:d,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onClick:T,onMouseMove:E,onKeyDown:On({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:b.loop,dir:C,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[A&&(0,U.jsx)(`div`,{...b.getStyles(`itemIndicator`,{styles:g,classNames:_}),"data-checked":t||void 0,children:t?n:null}),u&&(0,U.jsx)(`div`,{...b.getStyles(`itemLabel`,{styles:g,classNames:_}),"data-menu-item-label":!0,children:u}),l&&(0,U.jsx)(`div`,{...b.getStyles(`itemSection`,{styles:g,classNames:_}),"data-position":`right`,children:l})]})}var J={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},oa=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,defaultChecked:m,onChange:h,checkIcon:g,ref:_,...v}=x(`MenuCheckboxItem`,null,e),y=q(),b=(0,H.use)(na),S=b&&f!==void 0?b.values.includes(f):void 0,[C,w]=N({value:p??S,defaultValue:m,finalValue:!1,onChange:h});return(0,U.jsx)(aa,{role:`menuitemcheckbox`,checked:C,indicator:g??y.checkIcon??(0,U.jsx)(Zi,{size:10}),onSelect:()=>{h?w(!C):b&&f!==void 0?b.onChange(f):w(!C)},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:l})});oa.classes=J,oa.displayName=`@mantine/core/MenuCheckboxItem`;function sa(e){let{children:t,disabled:n,longPressDelay:r}=x(`MenuContextMenu`,null,e),i=F(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=q(),o=ur();return(0,H.cloneElement)(i,dr({childProps:i.props,disabled:n||o.disabled,opened:a.opened,longPressDelay:r,setReference:o.reference,open:()=>a.openDropdown()}))}sa.displayName=`@mantine/core/MenuContextMenu`;var ca=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`MenuDivider`,null,e);return(0,U.jsx)(j,{...q().getStyles(`divider`,{className:n,style:r,styles:i,classNames:t}),...o})});ca.classes=J,ca.displayName=`@mantine/core/MenuDivider`;var la=500;function ua(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function da(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function fa({enabled:e,opened:t,getDropdown:n}){let r=(0,H.useRef)({buffer:``,timeoutId:null});return(0,H.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,H.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},la);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||da(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onKeyDown:l,children:u,ref:d,...f}=x(`MenuDropdown`,null,e),p=(0,H.useRef)(null),m=q(),h=fa({enabled:!m.hasSearch,opened:m.opened,getDropdown:()=>p.current}),g=W(l,e=>{h(e),!(e.defaultPrevented||m.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),p.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),_=W(o,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.openDropdown()),v=W(s,()=>(m.trigger===`hover`||m.trigger===`click-hover`)&&m.closeDropdown());return(0,U.jsxs)(G.Dropdown,{...f,onMouseEnter:_,onMouseLeave:v,role:`menu`,"aria-orientation":`vertical`,ref:c(d,p),...m.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:g,children:[m.withInitialFocusPlaceholder&&!m.hasSearch&&(0,U.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});pa.classes=J,pa.displayName=`@mantine/core/MenuDropdown`;var ma=l(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:l,closeMenuOnClick:u,leftSection:d,rightSection:f,children:p,disabled:m,"data-disabled":g,ref:_,...v}=x(`MenuItem`,null,e),y=q(),b=(0,H.use)(ia),S=s(),{dir:C}=I(),w=(0,H.useRef)(null),T=v,E=W(T.onClick,()=>{g||(typeof u==`boolean`?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),D=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=l?S.variantColorResolver({color:l,theme:S,variant:`light`}):void 0,k=l?o({color:l,theme:S}):null,A=W(T.onKeyDown,e=>{e.key===`ArrowLeft`&&b&&(b.close(),b.focusParentItem())});return(0,U.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...v,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:c(w,_),role:`menuitem`,disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:On({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:A}),__vars:{"--menu-item-color":k?.isThemeColor&&k?.shade===void 0?`var(--mantine-color-${k.color}-6)`:O?.color,"--menu-item-hover":O?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),d&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:d}),p&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:p}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:f})]})});ma.classes=J,ma.displayName=`@mantine/core/MenuItem`;var ha=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`MenuLabel`,null,e);return(0,U.jsx)(j,{...q().getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...o})});ha.classes=J,ha.displayName=`@mantine/core/MenuLabel`;var ga=(0,H.createContext)(null);function _a(e){let{value:t,defaultValue:n,onChange:r,children:i}=x(`MenuRadioGroup`,null,e),[a,o]=N({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,U.jsx)(ga,{value:{value:a,onChange:e=>o(e)},children:i})}_a.displayName=`@mantine/core/MenuRadioGroup`;function va({size:e,style:t,...n}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:k(e),height:k(e),...t},"aria-hidden":!0,...n,children:(0,U.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var ya=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,onChange:m,checkIcon:h,ref:g,..._}=x(`MenuRadioItem`,null,e),v=q(),y=(0,H.use)(ga),b=p??(y?y.value===f:!1);return(0,U.jsx)(aa,{role:`menuitemradio`,checked:b,indicator:h??v.checkIcon??(0,U.jsx)(va,{size:5}),onSelect:()=>{b||(m?m(f):y&&y.onChange(f))},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:g,others:_,children:l})});ya.classes=J,ya.displayName=`@mantine/core/MenuRadioItem`;var ba=`[data-menu-item]:not([data-disabled])`,xa=`[data-menu-active]`;function Sa(e){return e?.closest(`[data-menu-dropdown]`)}function Ca(e){return e?Array.from(e.querySelectorAll(ba)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function wa(e){e&&e.querySelectorAll(xa).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function Ta(e,t){wa(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function Ea(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Da={clearSearchOnClose:!0},Oa=n(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:a,clearSearchOnClose:o,ref:s,...l}=x(`MenuSearch`,Da,e),u=q(),d=(0,H.useRef)(null),f=c(s,d),p=(0,H.useRef)(i);p.current=i,(0,H.useEffect)(()=>u.registerSearch(),[u.registerSearch]),(0,H.useEffect)(()=>{o?u.searchExitClearRef.current=()=>{p.current?.({currentTarget:{value:``}})}:u.searchExitClearRef.current=null},[o,u.searchExitClearRef]),(0,H.useEffect)(()=>{u.opened||wa(Sa(d.current))},[u.opened]);let m=W(i,e=>{wa(Sa(e.currentTarget))}),h=W(r,e=>{if(e.defaultPrevented)return;let t=Sa(e.currentTarget),n=Ca(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=Ea(n);Ta(n[r>=n.length-1?u.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=Ea(n);Ta(n[r<=0?r===-1||u.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&Ta(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&Ta(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[Ea(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),g=u.getStyles(`search`);return(0,U.jsx)(C,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:a,...l,ref:f,classNames:[{input:g.className},t],styles:[{input:g.style},n],onKeyDown:h,onChange:m,__staticSelector:`Menu`})});Oa.classes=J,Oa.displayName=`@mantine/core/MenuSearch`;var ka=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onPointerEnter:l,onPointerLeave:u,onKeyDown:d,children:f,ref:p,...m}=x(`MenuSubDropdown`,null,e),h=(0,H.useRef)(null),g=q(),_=(0,H.use)(ia),v=fa({enabled:!g.hasSearch,opened:_?.opened??!1,getDropdown:()=>h.current}),y=W(d,e=>{v(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),b=_?.getFloatingProps({onMouseEnter:o,onMouseLeave:s,onPointerEnter:l,onPointerLeave:u});return(0,U.jsx)(G.Dropdown,{...m,...b,role:`menu`,"aria-orientation":`vertical`,ref:c(p,h,_?.setFloating),...g.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:y,children:f})});ka.classes=J,ka.displayName=`@mantine/core/MenuSubDropdown`;var Aa=l(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,closeMenuOnClick:g,ref:_,...v}=x(`MenuSubItem`,null,e),y=q(),b=(0,H.use)(ia),S=s(),{dir:C}=I(),w=(0,H.useRef)(null),T=v,E=l?S.variantColorResolver({color:l,theme:S,variant:`light`}):void 0,D=l?o({color:l,theme:S}):null,O=W(T.onKeyDown,e=>{e.key===`ArrowRight`&&(b?.open(),b?.focusFirstItem()),e.key===`ArrowLeft`&&b?.parentContext&&(b.parentContext.close(),b.parentContext.focusParentItem())}),k=W(T.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),A=W(T.onMouseMove,()=>{if(!y.hasSearch)return;let e=w.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==w.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),j=b?.getReferenceProps({onMouseEnter:T.onMouseEnter,onMouseLeave:T.onMouseLeave,onPointerEnter:T.onPointerEnter,onPointerLeave:T.onPointerLeave});return(0,U.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...v,...j,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:c(w,_,b?.setReference),role:`menuitem`,disabled:p,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:A,onKeyDown:On({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:y.loop,dir:C,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[y.alignItemsLabels===`all`&&(0,U.jsx)(`div`,{...y.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),u&&(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:u}),f&&(0,U.jsx)(`div`,{...y.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:f}),(0,U.jsx)(`div`,{...y.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:d||(0,U.jsx)(Xi,{...y.getStyles(`chevron`),size:14})})]})});Aa.classes=J,Aa.displayName=`@mantine/core/MenuSubItem`;function ja({children:e,refProp:t}){if(!ge(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return q(),(0,U.jsx)(G.Target,{refProp:t,popupType:`menu`,children:e})}ja.displayName=`@mantine/core/MenuSubTarget`;var Ma={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Na(t){let{children:n,closeDelay:r,openDelay:i,position:a,safeAreaPolygon:o,opened:s,onChange:c,...l}=x(`MenuSub`,Ma,t),u=e(),[d,f]=N({value:s,finalValue:!1,onChange:c}),p=(0,H.use)(ia),m=q(),{dir:h}=I(),g=_e(h,a),_=p?.registerOpenSub??m.registerOpenSub,v=(0,H.useRef)(null),y=(0,H.useCallback)(e=>{let t=v.current;return t&&t!==e&&t(),v.current=e,()=>{v.current===e&&(v.current=null)}},[]),b=(0,H.useRef)(f);b.current=f;let S=(0,H.useCallback)(()=>b.current(!0),[]),C=(0,H.useCallback)(()=>b.current(!1),[]);(0,H.useEffect)(()=>{if(d)return _(C)},[d,_,C]);let{context:w,refs:T}=ve({placement:g,open:d,onOpenChange:e=>{e?S():C()}}),{getReferenceProps:E,getFloatingProps:D}=he([z(w,{handleClose:o?ye(typeof o==`object`?o:void 0):void 0,delay:{open:i,close:r}})]);return(0,U.jsx)(ia,{value:{opened:d,close:C,open:S,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${u}-target`)?.focus()},16),parentContext:p,setReference:T.setReference,setFloating:T.setFloating,getReferenceProps:E,getFloatingProps:D,registerOpenSub:y},children:(0,U.jsx)(G,{opened:d,onChange:e=>e?S():C(),withinPortal:!1,withArrow:!1,id:u,position:a,...l,children:n})})}Na.extend=e=>e,Na.displayName=`@mantine/core/MenuSub`,Na.Target=ja,Na.Dropdown=ka,Na.Item=Aa;var Pa={refProp:`ref`};function Fa(e){let{children:t,refProp:n,...r}=x(`MenuTarget`,Pa,e),i=F(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=q(),o=i.props,s=W(o.onClick,()=>{a.trigger===`click`?a.toggleDropdown():a.trigger===`click-hover`&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=W(o.onMouseEnter,()=>(a.trigger===`hover`||a.trigger===`click-hover`)&&a.openDropdown()),l=W(o.onMouseLeave,()=>{(a.trigger===`hover`||a.trigger===`click-hover`&&!a.openedViaClick)&&a.closeDropdown()});return(0,U.jsx)(G.Target,{refProp:n,popupType:`menu`,...r,children:(0,H.cloneElement)(i,{onClick:s,onMouseEnter:c,onMouseLeave:l,"data-expanded":a.opened?!0:void 0})})}Fa.displayName=`@mantine/core/MenuTarget`;var Ia={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Y=n(e=>{let n=x(`Menu`,Ia,e),{children:r,onOpen:i,onClose:a,opened:o,defaultOpened:s,trapFocus:c,onChange:l,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:p,openDelay:m,closeDelay:h,classNames:g,styles:_,unstyled:v,variant:y,vars:b,menuItemTabIndex:C,keepMounted:w,withInitialFocusPlaceholder:T,attributes:E,onExitTransitionEnd:D,alignItemsLabels:O,checkIcon:k,...A}=n,j=S({name:`Menu`,classes:J,props:n,classNames:g,styles:_,unstyled:v,attributes:E}),[M,ee]=N({value:o,defaultValue:s,finalValue:!1,onChange:l}),[te,ne]=(0,H.useState)(!1),re=()=>{ee(!1),ne(!1),M&&a?.()},ie=()=>{ee(!0),!M&&i?.()},ae=()=>{M?re():ie()},{openDropdown:oe,closeDropdown:se}=ir({open:ie,close:re,closeDelay:h,openDelay:m}),P=(0,H.useRef)(null),ce=(0,H.useCallback)(e=>{let t=P.current;return t&&t!==e&&t(),P.current=e,()=>{P.current===e&&(P.current=null)}},[]),F=(0,H.useRef)(0),[I,le]=(0,H.useState)(!1),ue=(0,H.useCallback)(()=>(F.current+=1,F.current===1&&le(!0),()=>{--F.current,F.current===0&&le(!1)}),[]),L=(0,H.useRef)(null),de=()=>{L.current?.(),D?.()},R=e=>Mn(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:fe,resolvedStyles:pe}=t({classNames:g,styles:_,props:n});return(0,U.jsx)(ta,{value:{getStyles:j,opened:M,toggleDropdown:ae,getItemIndex:R,openedViaClick:te,setOpenedViaClick:ne,closeOnItemClick:u,closeDropdown:p===`click`?re:se,openDropdown:p===`click`?ie:oe,closeDropdownImmediately:re,loop:d,trigger:p,unstyled:v,menuItemTabIndex:C,withInitialFocusPlaceholder:T,registerOpenSub:ce,hasSearch:I,registerSearch:ue,searchExitClearRef:L,alignItemsLabels:O,checkIcon:k},children:(0,U.jsx)(G,{returnFocus:!0,...A,opened:M,onChange:ae,defaultOpened:s,trapFocus:!w&&c,closeOnEscape:f,__staticSelector:`Menu`,classNames:fe,styles:pe,unstyled:v,variant:y,keepMounted:w,onExitTransitionEnd:de,children:r})})});Y.displayName=`@mantine/core/Menu`,Y.classes=J,Y.Item=ma,Y.Label=ha,Y.Dropdown=pa,Y.Target=Fa,Y.Divider=ca,Y.Search=Oa,Y.Sub=Na,Y.CheckboxItem=oa,Y.CheckboxGroup=ra,Y.RadioItem=ya,Y.RadioGroup=_a,Y.ContextMenu=sa;var[La,Ra]=P(`Modal component was not found in tree`),X={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},za=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`ModalBody`,null,e);return(0,U.jsx)(Bi,{...Ra().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});za.classes=X,za.displayName=`@mantine/core/ModalBody`;var Ba=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`ModalCloseButton`,null,e);return(0,U.jsx)(Vi,{...Ra().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});Ba.classes=X,Ba.displayName=`@mantine/core/ModalCloseButton`;var Va=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,__hidden:s,...c}=x(`ModalContent`,null,e),l=Ra(),u=l.scrollAreaComponent||Yi;return(0,U.jsx)(Hi,{...l.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:l.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),"data-full-screen":l.fullScreen||void 0,"data-modal-content":!0,"data-hidden":s||void 0,...c,children:(0,U.jsx)(u,{style:{maxHeight:l.fullScreen?`100dvh`:`calc(100dvh - (${k(l.yOffset)} * 2))`},children:o})})});Va.classes=X,Va.displayName=`@mantine/core/ModalContent`;var Ha=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`ModalHeader`,null,e);return(0,U.jsx)(Ui,{...Ra().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});Ha.classes=X,Ha.displayName=`@mantine/core/ModalHeader`;var Ua=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`ModalOverlay`,null,e);return(0,U.jsx)(Ki,{...Ra().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});Ua.classes=X,Ua.displayName=`@mantine/core/ModalOverlay`;var Wa={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:B(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},Ga=f((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:b(t),"--modal-size":w(n,`modal-size`),"--modal-y-offset":k(r),"--modal-x-offset":k(i)}})),Ka=n(e=>{let t=x(`ModalRoot`,Wa,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,yOffset:c,scrollAreaComponent:l,radius:u,fullScreen:d,centered:f,xOffset:p,__staticSelector:m,attributes:h,...g}=t,_=S({name:m,classes:X,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Ga});return(0,U.jsx)(La,{value:{yOffset:c,scrollAreaComponent:l,getStyles:_,fullScreen:d},children:(0,U.jsx)(Li,{..._(`root`),"data-full-screen":d||void 0,"data-centered":f||void 0,"data-offset-scrollbars":l===me.Autosize||void 0,unstyled:o,...g})})});Ka.classes=X,Ka.varsResolver=Ga,Ka.displayName=`@mantine/core/ModalRoot`;var qa=(0,H.createContext)(null);function Ja({children:e}){let[t,n]=(0,H.useState)([]),[r,i]=(0,H.useState)(B(`modal`));return(0,U.jsx)(qa,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}Ja.displayName=`@mantine/core/ModalStack`;var Ya=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=x(`ModalTitle`,null,e);return(0,U.jsx)(Ji,{...Ra().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Ya.classes=X,Ya.displayName=`@mantine/core/ModalTitle`;var Xa={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:B(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},Z=n(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,radius:s,opened:c,stackId:l,zIndex:u,...d}=x(`Modal`,Xa,e),f=(0,H.use)(qa),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l)}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,H.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||B(`modal`)):f.removeModal(l))},[c,l,u]),(0,U.jsxs)(Ka,{radius:s,opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,U.jsx)(Ua,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,U.jsxs)(Va,{radius:s,__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,U.jsxs)(Ha,{children:[t&&(0,U.jsx)(Ya,{children:t}),i&&(0,U.jsx)(Ba,{...a})]}),(0,U.jsx)(za,{children:o})]})]})});Z.classes=X,Z.displayName=`@mantine/core/Modal`,Z.Root=Ka,Z.Overlay=Ua,Z.Content=Va,Z.Body=za,Z.Header=Ha,Z.Title=Ya,Z.CloseButton=Ba,Z.Stack=Ja;var Za=H.createContext(void 0),Qa=e=>{let t=H.useContext(Za);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},$a=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,U.jsx)(Za.Provider,{value:e,children:t})),eo={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},to=new class{#e=eo;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function no(e){setTimeout(e,0)}var ro=typeof window>`u`||`Deno`in globalThis;function io(){}function ao(e,t){return typeof e==`function`?e(t):e}function oo(e){return typeof e==`number`&&e>=0&&e!==1/0}function so(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Q(e,t){return typeof e==`function`?e(t):e}function co(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==uo(o,t.options))return!1}else if(!po(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function lo(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(fo(t.options.mutationKey)!==fo(a))return!1}else if(!po(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uo(e,t){return(t?.queryKeyHashFn||fo)(e)}function fo(e){return JSON.stringify(e,(e,t)=>vo(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=_o(e)&&_o(t);if(!r&&!(vo(e)&&vo(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{to.setTimeout(t,e)})}function xo(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ho(e,t)}function So(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Co(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var wo=Symbol();function To(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===wo?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Eo(e,t){return typeof e==`function`?e(...t):!!e}function Do(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Oo=()=>ro,ko=()=>Oo(),Ao=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},jo=new class extends Ao{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Mo=no;function No(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Mo,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Po=No(),Fo=new class extends Ao{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Io(e){return Math.min(1e3*2**e,3e4)}function Lo(e){return(e??`online`)!==`online`||Fo.isOnline()}var Ro=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function zo(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(io);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ro(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>jo.isFocused()&&(e.networkMode===`always`||Fo.isOnline())&&e.canRun(),p=()=>Lo(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ko()?0:3),a=e.retryDelay??Io,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Bo=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oo(this.gcTime)&&(this.#e=to.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ko()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(to.clearTimeout(this.#e),this.#e=void 0)}};function Vo(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Do(e,()=>t.signal,()=>n=!0)},u=To(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Co:So;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Uo:Ho,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ho(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ho(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Uo(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Wo(e,t){return t?Ho(e,t)!=null:!1}function Go(e,t){return!t||!e.getPreviousPageParam?!1:Uo(e,t)!=null}var Ko=class extends Bo{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Yo(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Yo(this.options);e.data!==void 0&&(this.setState(Jo(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=xo(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(io).catch(io):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Q(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wo||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Q(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!so(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=To(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Vo(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=zo({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ro&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ro){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...qo(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Jo(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Po.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function qo(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lo(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Jo(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Yo(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Xo=class extends Ao{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Qo(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $o(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $o(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Q(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!go(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&es(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Q(this.options.enabled,this.#t)!==Q(t.enabled,this.#t)||Q(this.options.staleTime,this.#t)!==Q(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Q(this.options.enabled,this.#t)!==Q(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return go(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(io)),t}#h(e){return!ko()&&Q(this.options.enabled,this.#t)!==!1&&oo(e)}#g(){this.#b();let e=Q(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=so(this.#r.dataUpdatedAt,e)+1;this.#u=to.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=to.setInterval(()=>{(this.options.refetchIntervalInBackground||jo.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(to.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(to.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Qo(e,t),o=i&&es(e,n,t,r);(a||o)&&(l={...l,...qo(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=xo(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=xo(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ts(e,t),refetch:this.refetch,isEnabled:Q(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),go(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Po.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Zo(e,t){return Q(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Q(t.retryOnMount,e)!==!1)}function Qo(e,t){return Zo(e,t)||e.state.data!==void 0&&$o(e,t,t.refetchOnMount)}function $o(e,t,n){if(Q(t.enabled,e)!==!1&&Q(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ts(e,t)}return!1}function es(e,t,n,r){return(e!==t||Q(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ts(e,n)}function ts(e,t){return Q(t.enabled,e)!==!1&&e.isStaleByTime(Q(t.staleTime,e))}var ns=class extends Bo{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||rs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=zo({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Po.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function rs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var is=H.createContext(!1),as=()=>H.useContext(is);is.Provider;function os(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ss=H.createContext(os()),cs=()=>H.useContext(ss),ls=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Eo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},us=e=>{H.useEffect(()=>{e.clearReset()},[e])},ds=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Eo(n,[e.error,r])),fs=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ps=(e,t)=>e?.suspense&&t.isPending,ms=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function hs(e,t,n){let r=as(),i=cs(),a=Qa(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,fs(o),ls(o,i,s),us(i);let[l]=H.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(H.useSyncExternalStore(H.useCallback(e=>{let t=d?l.subscribe(Po.batchCalls(e)):io;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),H.useEffect(()=>{l.setOptions(o)},[o,l]),ps(o,u))throw ms(o,l,i);if(ds({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gs(e,t){return hs(e,Xo,t)}var _s=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),vs=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),ys=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),bs=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),xs=H.forwardRef((e,t)=>H.createElement(p,{ref:t,...e,weights:_s}));xs.displayName=`DotsThreeIcon`;var Ss=xs,Cs=H.forwardRef((e,t)=>H.createElement(p,{ref:t,...e,weights:vs}));Cs.displayName=`PlusIcon`;var ws=Cs,Ts=H.forwardRef((e,t)=>H.createElement(p,{ref:t,...e,weights:ys}));Ts.displayName=`SparkleIcon`;var Es=Ts,Ds=H.forwardRef((e,t)=>H.createElement(p,{ref:t,...e,weights:bs}));Ds.displayName=`TrashIcon`;var Os=Ds,ks=[`dashboards`],As=[`agent-threads`];async function js(e){let t=await re(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var $=[];for(let e=0;e<256;++e)$.push((e+256).toString(16).slice(1));function Ms(e,t=0){return($[e[t+0]]+$[e[t+1]]+$[e[t+2]]+$[e[t+3]]+`-`+$[e[t+4]]+$[e[t+5]]+`-`+$[e[t+6]]+$[e[t+7]]+`-`+$[e[t+8]]+$[e[t+9]]+`-`+$[e[t+10]]+$[e[t+11]]+$[e[t+12]]+$[e[t+13]]+$[e[t+14]]+$[e[t+15]]).toLowerCase()}var Ns=new Uint8Array(16);function Ps(){return crypto.getRandomValues(Ns)}var Fs={};function Is(e,t,n){let r;if(e)r=Rs(e.random??e.rng?.()??Ps(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Ps();Ls(Fs,e,i),r=Rs(i,Fs.msecs,Fs.seq,t,n)}return t??Ms(r)}function Ls(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=zs(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Rs(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=zs(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function zs(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Bs(){return Is()}var Vs=[{value:`15m`,label:`15 minutes`},{value:`1h`,label:`1 hour`},{value:`6h`,label:`6 hours`},{value:`24h`,label:`24 hours`},{value:`168h`,label:`7 days`},{value:`720h`,label:`30 days`}];function Hs(e){return Vs.find(t=>t.value===e)?.label??e}function Us(e,t){let n=e?.[t];return typeof n==`string`?n:``}function Ws(e,t,n=[]){let r=new URLSearchParams({window:e.window,limit:`40`});e.namespace&&r.set(`namespace`,e.namespace);for(let e of n){let n=Us(t,e);n&&r.set(e,n)}return r}function Gs(e,t){return[`observability`,e,t.toString()]}var Ks=e=>e.state.status===`error`?15e3:3e4;function qs(e,t,n=!0){return gs({queryKey:Gs(e,t),queryFn:()=>js(`/api/observability/${e}?${t}`),enabled:n,refetchInterval:Ks})}function Js(e){return e.getQueryCache().findAll({queryKey:[`observability`]}).reduce((e,t)=>Math.max(e,t.state.dataUpdatedAt),0)||null}function Ys(){let e=Qa(),[t,n]=(0,H.useState)(()=>Js(e));return(0,H.useEffect)(()=>e.getQueryCache().subscribe(()=>n(Js(e))),[e]),t}function Xs(e){let t={};return typeof e.window==`string`&&Vs.some(t=>t.value===e.window)&&(t.window=e.window),typeof e.namespace==`string`&&e.namespace.trim()&&(t.namespace=e.namespace.trim()),t}var Zs=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Qs=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],$s=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],ec=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],tc=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],nc=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],rc={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},ic={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},ac={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`};export{Zi as $,Ko as A,wt as At,lo as B,He as Bt,ws as C,Rt as Ct,ns as D,Tt as Dt,hs as E,kt as Et,jo as F,at as Ft,go as G,De as Gt,io as H,We as Ht,Ao as I,it as It,$a as J,Ee as Jt,Eo as K,ke as Kt,ao as L,nt as Lt,Go as M,bt as Mt,Fo as N,ut as Nt,rs as O,Dt as Ot,Po as P,rt as Pt,ea as Q,fo as R,st as Rt,Es as S,Gt as St,gs as T,jt as Tt,po as U,Le as Ut,co as V,Ke as Vt,Q as W,Ge as Wt,Z as X,Me as Xt,Qa as Y,je as Yt,Y as Z,Bs as _,xn as _t,ac as a,Vi as at,As as b,Zt as bt,ic as c,Ii as ct,Us as d,tr as dt,Yi as et,Vs as f,er as ft,Hs as g,Cn as gt,Ws as h,An as ht,rc as i,Hi as it,Wo as j,xt as jt,Xo as k,_t as kt,ec as l,G as lt,qs as m,jn as mt,tc as n,Ki as nt,nc as o,Bi as ot,Ys as p,Kn as pt,wo as q,Ue as qt,Qs as r,Ui as rt,$s as s,Li as st,Zs as t,Ji as tt,Xs as u,$n as ut,ks as v,bn as vt,Ss as w,Ft as wt,Os as x,qt as xt,js as y,yn as yt,uo as z,Je as zt}; \ No newline at end of file diff --git a/internal/ui/dist/assets/use-computed-color-scheme-CeR2KQyq.js b/internal/ui/dist/assets/use-computed-color-scheme-CeR2KQyq.js new file mode 100644 index 000000000..e9846d824 --- /dev/null +++ b/internal/ui/dist/assets/use-computed-color-scheme-CeR2KQyq.js @@ -0,0 +1 @@ +import{B as e,F as t,ht as n,nt as r,xt as i}from"./brand-CCB4_HD8.js";var a=()=>{};function o(e,t){return r(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}var s=i(n(),1);function c(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function l({keepTransitions:n}={}){let r=(0,s.useRef)(a),i=(0,s.useRef)(-1),l=(0,s.use)(t),u=(0,s.useRef)(e()?.());if(!l)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let d=e=>{l.setColorScheme(e),r.current=n?()=>{}:c(u.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current?.()},10)},f=()=>{l.clearColorScheme(),r.current=n?()=>{}:c(u.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current?.()},10)},p=o(`light`,{getInitialValueInEffect:!1}),m=l.colorScheme===`auto`?p:l.colorScheme,h=(0,s.useCallback)(()=>d(m===`light`?`dark`:`light`),[d,m]);return(0,s.useEffect)(()=>()=>{r.current?.(),window.clearTimeout(i.current)},[]),{colorScheme:l.colorScheme,setColorScheme:d,clearColorScheme:f,toggleColorScheme:h}}function u(e,t={getInitialValueInEffect:!0}){let n=o(e,t),{colorScheme:r}=l();return r===`auto`?n:r}export{l as n,a as r,u as t}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index afd4875e4..8af378879 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,8 +21,12 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + + + + + diff --git a/ui/host/src/dashboard-search.test.ts b/ui/host/src/dashboard-search.test.ts new file mode 100644 index 000000000..2d61d949d --- /dev/null +++ b/ui/host/src/dashboard-search.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "vitest"; +import { dashboardSearch } from "./dashboard-search"; + +describe("dashboardSearch", () => { + it("keeps a window the dashboard actually offers", () => { + expect(dashboardSearch({ window: "24h" })).toEqual({ window: "24h" }); + }); + + it("drops a window nothing can render rather than failing the route", () => { + expect(dashboardSearch({ window: "7d" })).toEqual({}); + expect(dashboardSearch({ window: 24 })).toEqual({}); + }); + + it("keeps a namespace and trims it", () => { + expect(dashboardSearch({ namespace: " prod " })).toEqual({ namespace: "prod" }); + }); + + it("treats a blank namespace as no filter", () => { + expect(dashboardSearch({ namespace: " " })).toEqual({}); + }); +}); diff --git a/ui/host/src/dashboard-search.ts b/ui/host/src/dashboard-search.ts new file mode 100644 index 000000000..502602c0b --- /dev/null +++ b/ui/host/src/dashboard-search.ts @@ -0,0 +1,14 @@ +import { dashboardWindows } from "./widgets/data"; + +/** The part of a dashboard's view that belongs in the address bar, so a link + * reproduces what its sender was looking at rather than opening on whatever + * the recipient last chose. Anything unrecognised is dropped instead of + * rejected: a stale or hand-edited link should still open the dashboard. */ +export type DashboardSearch = { window?: string; namespace?: string }; + +export function dashboardSearch(search: Record): DashboardSearch { + const next: DashboardSearch = {}; + if (typeof search.window === "string" && dashboardWindows.some((option) => option.value === search.window)) next.window = search.window; + if (typeof search.namespace === "string" && search.namespace.trim()) next.namespace = search.namespace.trim(); + return next; +} diff --git a/ui/host/src/dashboard.tsx b/ui/host/src/dashboard.tsx index bcdae3324..3729c8ba2 100644 --- a/ui/host/src/dashboard.tsx +++ b/ui/host/src/dashboard.tsx @@ -8,7 +8,7 @@ import type { Overview } from "../../contracts"; import { authorizedFetch } from "./auth"; import { compactDashboardLayout, nextDashboardSlot, widgetDefaults, widgetTypes, type DashboardLayoutItem, type WidgetType } from "./dashboard-layout"; import { createID } from "./id"; -import { dashboardWindows, useLastUpdated, useObservability, widgetParams, type WidgetConfig } from "./widgets/data"; +import { dashboardWindows, useLastUpdated, useObservability, widgetParams, type Filters, type WidgetConfig } from "./widgets/data"; import WidgetCard, { widgetTitles } from "./widgets/widget-card"; const Grid = WidthProvider(Responsive); @@ -22,7 +22,7 @@ function widgetSizeFor(type: string) { return Object.hasOwn(widgetDefaults, type) ? widgetDefaults[type as WidgetType] : undefined; } -export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat, onDashboardChange }: { dashboardID?: string; agentAvailable: boolean; onOpenChat: (prompt?: string) => void; onDashboardChange?: (id: string, replace?: boolean) => void }) { +export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat, onDashboardChange, urlFilters, onFiltersChange }: { dashboardID?: string; agentAvailable: boolean; onOpenChat: (prompt?: string) => void; onDashboardChange?: (id: string, replace?: boolean) => void; urlFilters?: Partial; onFiltersChange?: (filters: Filters) => void }) { const queryClient = useQueryClient(); const dark = useComputedColorScheme("light") === "dark"; const dashboards = useQuery({ queryKey: dashboardsQueryKey, queryFn: () => getJSON<{ dashboards: DashboardSummary[] }>("/api/dashboards"), refetchInterval: 30_000 }); @@ -42,7 +42,20 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat const selected = useQuery({ queryKey: ["dashboard", selectedID], queryFn: () => getJSON(`/api/dashboards/${encodeURIComponent(selectedID)}`), enabled: Boolean(selectedID), refetchInterval: save.isPending || save.isError ? false : 30_000 }); const [state, setState] = useState(emptyState); const [breakpoint, setBreakpoint] = useState("lg"); - const overview = useObservability("overview", widgetParams(state.filters), Boolean(selected.data)); + // While the address bar names a namespace it decides what is shown, which + // would make the field itself unusable: every keystroke would be overwritten + // by the value in the URL. Typing edits a draft; blurring commits it to both. + const [namespaceDraft, setNamespaceDraft] = useState(null); + // A link carries what its sender was looking at. Without this the window and + // namespace lived only in the saved dashboard, so a shared URL opened on + // whatever the recipient had chosen and the two people discussed different + // numbers. The URL wins while it says something; it is not written back to + // the dashboard until the recipient changes a control themselves. + const filters = useMemo(() => ({ + window: dashboardWindows.some((option) => option.value === urlFilters?.window) ? urlFilters!.window! : state.filters.window, + namespace: urlFilters?.namespace ?? state.filters.namespace, + }), [urlFilters?.window, urlFilters?.namespace, state.filters.window, state.filters.namespace]); + const overview = useObservability("overview", widgetParams(filters), Boolean(selected.data)); const services = useMemo(() => (overview.data?.data.services ?? []).map((service) => service.service), [overview.data]); const updatedAt = useLastUpdated(); @@ -55,7 +68,11 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat const items = dashboards.data?.dashboards; if (!items?.length) return; if (dashboardID && items.some((item) => item.id === dashboardID)) return; - if (!dashboardID && selectedID && items.some((item) => item.id === selectedID)) { onDashboardChange?.(selectedID, true); return; } + // An address naming a dashboard that is not there is answered, not + // redecorated: quietly swapping in the default left the URL pointing at one + // dashboard while the screen showed another. + if (dashboardID) return; + if (selectedID && items.some((item) => item.id === selectedID)) { onDashboardChange?.(selectedID, true); return; } const next = items.find((item) => item.is_default) ?? items[0]; choose(next.id, true); }, [dashboardID, dashboards.data, selectedID]); @@ -88,10 +105,16 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat const slot = nextDashboardSlot(state.layout, size.w, size.h, 12, size.minW); update({ ...state, widgets: [...state.widgets, { id, type, title: widgetTitles[type], enabled: true }], layout: [...state.layout, { i: id, x: slot.x, y: slot.y, w: slot.w, h: size.h, minW: size.minW, minH: size.minH }] }); } + // A filter change is both saved and put in the address bar, so the link the + // user copies afterwards shows what they are looking at. + function applyFilters(next: Filters) { update({ ...state, filters: next }); onFiltersChange?.(next); } function remove(id: string) { update({ ...state, widgets: state.widgets.filter((widget) => widget.id !== id), layout: state.layout.filter((item) => item.i !== id) }); } function configure(id: string, config: WidgetConfig) { update({ ...state, widgets: state.widgets.map((widget) => (widget.id === id ? { ...widget, config } : widget)) }); } if (dashboards.isLoading || (selectedID && selected.isLoading)) return ; + const known = dashboards.data?.dashboards ?? []; + const missing = Boolean(dashboardID) && known.length > 0 && !known.some((entry) => entry.id === dashboardID); + if (missing) return choose((known.find((entry) => entry.is_default) ?? known[0]).id, true)} />; if (dashboards.isError || selected.isError) return ; const item = selected.data; if (!item) return ; @@ -104,8 +127,8 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat - window && applyFilters({ ...filters, window })} data={dashboardWindows} w={{ base: "100%", xs: 150 }} size="sm" /> + setNamespaceDraft(event.currentTarget.value)} onBlur={(event) => { setNamespaceDraft(null); applyFilters({ ...filters, namespace: event.currentTarget.value.trim() }); }} onKeyDown={(event) => { if (event.key === "Enter") event.currentTarget.blur(); }} placeholder="All namespaces" w={{ base: "100%", xs: 200 }} size="sm" /> {/* The row wraps rather than squeezing: at 390px a single line clipped both button labels to "Add vie" and "Ask Fano". */} @@ -129,7 +152,7 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat { if (breakpoint === "lg") update({ ...state, layout: [...layout] }); }} onResizeStop={(layout: readonly DashboardLayoutItem[]) => { if (breakpoint === "lg") update({ ...state, layout: [...layout] }); }}> {state.widgets.map((widget) =>
- remove(widget.id)} onConfigure={(config) => configure(widget.id, config)} /> + remove(widget.id)} onConfigure={(config) => configure(widget.id, config)} />
)}
; @@ -138,3 +161,13 @@ export default function Dashboard({ dashboardID = "", agentAvailable, onOpenChat function LoadingState({ label }: { label: string }) { return
{label}
; } + +function NotFoundState({ onOpenDefault }: { onOpenDefault: () => void }) { + return
+ + This dashboard isn't here + The link may be out of date, or the dashboard may have been renamed or deleted. + + +
; +} diff --git a/ui/host/src/rail.test.tsx b/ui/host/src/rail.test.tsx index 5d4c9544b..6279bd055 100644 --- a/ui/host/src/rail.test.tsx +++ b/ui/host/src/rail.test.tsx @@ -28,6 +28,12 @@ function dashboards() { function respond(input: RequestInfo | URL, init?: RequestInit) { const url = new URL(String(input), "http://localhost"); if (url.pathname === "/api/dashboards") return dashboards(); + if (url.pathname === "/api/observability/overview") { + return json({ schema: "test", summary: "", provenance: {}, data: { health: "unhealthy", counts: { healthy: 0, degraded: 0, unhealthy: 1 }, total_spans: 10, error_rate: 0.1, service_count: 2, services: [ + { service: "checkout", health: "unhealthy", spans: 10, error_rate: 0.1, p50_ms: 4, p95_ms: 900, log_count: 0, metric_count: 0 }, + { service: "payments", health: "healthy", spans: 8, error_rate: 0, p50_ms: 3, p95_ms: 40, log_count: 0, metric_count: 0 }, + ] } }); + } if (url.pathname === "/api/agent/threads") return threadsPage(url.searchParams.get("q") ?? ""); if (url.pathname.startsWith("/api/agent/threads/") && init?.method === "PATCH") return json({ title: "Checkout follow-up" }); if (url.pathname.startsWith("/api/agent/threads/") && init?.method === "DELETE") return new Response(null, { status: 204 }); @@ -40,7 +46,7 @@ function mount(props: Partial[0]> = {}) { const root = createRoot(container); const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } }); const handlers = { - onNewChat: vi.fn(), onSelectThread: vi.fn(), onDeletedThread: vi.fn(), onSelectDashboard: vi.fn(), onCreateDashboard: vi.fn(), + onNewChat: vi.fn(), onSelectThread: vi.fn(), onDeletedThread: vi.fn(), onSelectDashboard: vi.fn(), onCreateDashboard: vi.fn(), onInvestigateService: vi.fn(), }; const ref = createRef(); const render = () => root.render( @@ -140,7 +146,7 @@ describe("Rail", () => { await act(async () => render()); await vi.waitFor(() => expect(document.body.textContent).toContain("Checkout latency")); act(() => ref.current?.focusSearch()); - const search = document.querySelector('input[aria-label="Search chats and dashboards"]') as HTMLInputElement; + const search = document.querySelector('input[aria-label="Search chats, dashboards and services"]') as HTMLInputElement; expect(document.activeElement).toBe(search); await act(async () => setValue(search, "checkout")); await vi.waitFor(() => expect(fetchMock.mock.calls.some(([input]) => String(input).includes("q=checkout"))).toBe(true), { timeout: 1500 }); @@ -157,13 +163,37 @@ describe("Rail", () => { const { root, render } = mount(); await act(async () => render()); await vi.waitFor(() => expect(document.body.textContent).toContain("System overview")); - const search = document.querySelector('input[aria-label="Search chats and dashboards"]') as HTMLInputElement; + const search = document.querySelector('input[aria-label="Search chats, dashboards and services"]') as HTMLInputElement; await act(async () => setValue(search, "zzz")); await vi.waitFor(() => expect(document.body.textContent).toContain("No matching dashboards"), { timeout: 1500 }); expect(document.body.textContent).toContain("Create with AI"); await act(async () => root.unmount()); }); + // A search naming a live service used to come back empty-handed, because the + // search only knew about things the user had already named. + it("offers a matching service and opens an investigation", async () => { + const { root, handlers, render } = mount(); + await act(async () => render()); + await vi.waitFor(() => expect(document.body.textContent).toContain("System overview")); + const search = document.querySelector('input[aria-label="Search chats, dashboards and services"]') as HTMLInputElement; + await act(async () => setValue(search, "payments")); + await vi.waitFor(() => expect(document.body.textContent).toContain("Services"), { timeout: 1500 }); + const service = Array.from(document.querySelectorAll(".rail-row")).find((row) => row.textContent?.trim() === "payments"); + expect(service).not.toBeUndefined(); + await act(async () => service?.click()); + expect(handlers.onInvestigateService).toHaveBeenCalledWith("payments"); + await act(async () => root.unmount()); + }); + + it("does not ask for the service catalogue until someone searches", async () => { + const { root, render } = mount(); + await act(async () => render()); + await vi.waitFor(() => expect(document.body.textContent).toContain("System overview")); + expect(fetchMock.mock.calls.some(([input]) => String(input).includes("/api/observability/overview"))).toBe(false); + await act(async () => root.unmount()); + }); + it("renames and deletes a chat", async () => { const { root, handlers, render } = mount(); await act(async () => render()); diff --git a/ui/host/src/rail.tsx b/ui/host/src/rail.tsx index 7d8a40b62..5f4348273 100644 --- a/ui/host/src/rail.tsx +++ b/ui/host/src/rail.tsx @@ -4,7 +4,9 @@ import { DotsThree, MagnifyingGlass, PencilSimple, Plus, Sparkle, Trash } from " import { useInfiniteQuery, useQuery, useQueryClient } from "@tanstack/react-query"; import { useEffect, useImperativeHandle, useMemo, useRef, useState, type Ref } from "react"; import { dashboardsQueryKey, getJSON, threadHistoryQueryKey, type DashboardSummary } from "./api"; +import type { Overview } from "../../contracts"; import { authorizedFetch } from "./auth"; +import { useObservability, widgetParams } from "./widgets/data"; export type RailHandle = { focusSearch(): void }; @@ -19,6 +21,7 @@ export type RailProps = { onDeletedThread: (threadID: string) => void; onSelectDashboard: (dashboardID: string) => void; onCreateDashboard: () => void; + onInvestigateService?: (service: string) => void; ref?: Ref; }; @@ -34,7 +37,7 @@ async function fetchThreads(query: string, cursor: string): Promise return response.json(); } -export default function Rail({ agentAvailable, activeThreadID, activeDashboardID, autoFocusSearch = false, onNewChat, onSelectThread, onDeletedThread, onSelectDashboard, onCreateDashboard, ref }: RailProps) { +export default function Rail({ agentAvailable, activeThreadID, activeDashboardID, autoFocusSearch = false, onNewChat, onSelectThread, onDeletedThread, onSelectDashboard, onCreateDashboard, onInvestigateService, ref }: RailProps) { const queryClient = useQueryClient(); const [search, setSearch] = useState(""); const [query] = useDebouncedValue(search.trim(), 250); @@ -57,6 +60,16 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID const dashboards = useQuery({ queryKey: dashboardsQueryKey, queryFn: () => getJSON<{ dashboards: DashboardSummary[] }>("/api/dashboards"), refetchInterval: 30_000 }); const threads = useMemo(() => history.data?.pages.flatMap((page) => page.threads) ?? [], [history.data]); const groups = useMemo(() => groupThreads(threads), [threads]); + // Searching for a service used to answer "No matching chats / No matching + // dashboards" while that service was live, traced and logged — the search + // looked only at what the user had already named. The catalogue is fetched + // only once someone is actually searching. + const overview = useObservability("overview", widgetParams({ window: "1h", namespace: "" }), Boolean(query) && Boolean(onInvestigateService)); + const matchingServices = useMemo(() => { + if (!query) return []; + const needle = query.toLowerCase(); + return (overview.data?.data.services ?? []).map((entry) => entry.service).filter((service) => service.toLowerCase().includes(needle)).slice(0, 6); + }, [overview.data, query]); const visibleDashboards = useMemo(() => { const items = dashboards.data?.dashboards ?? []; const needle = query.toLowerCase(); @@ -108,6 +121,12 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID )} {history.hasNextPage && } } + {matchingServices.length > 0 && onInvestigateService && + Services + {matchingServices.map((service) => onInvestigateService(service)}> + {service} + )} + } Dashboards {dashboards.isLoading &&
} @@ -129,7 +148,7 @@ export default function Rail({ agentAvailable, activeThreadID, activeDashboardID
- setSearch(event.currentTarget.value)} leftSection={} rightSection={⌘K} rightSectionWidth={44} placeholder="Search" aria-label="Search chats and dashboards" size="sm" /> + setSearch(event.currentTarget.value)} leftSection={} rightSection={⌘K} rightSectionWidth={44} placeholder="Search" aria-label="Search chats, dashboards and services" size="sm" /> !busy && setRenaming(null)} title="Rename chat" centered>
{ event.preventDefault(); void renameThread(); }}> diff --git a/ui/host/src/routes/dashboards.$dashboardId.tsx b/ui/host/src/routes/dashboards.$dashboardId.tsx index 884621b3d..d7372a53d 100644 --- a/ui/host/src/routes/dashboards.$dashboardId.tsx +++ b/ui/host/src/routes/dashboards.$dashboardId.tsx @@ -1,14 +1,24 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useFanoutApp } from "../app-context"; import Dashboard from "../dashboard"; +import { dashboardSearch, type DashboardSearch } from "../dashboard-search"; export const Route = createFileRoute("/dashboards/$dashboardId")({ component: DashboardDetail, + validateSearch: dashboardSearch, }); function DashboardDetail() { const { dashboardId } = Route.useParams(); + const search = Route.useSearch(); const navigate = useNavigate(); const { agentAvailable, openChat } = useFanoutApp(); - return void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId: nextID }, replace })} />; + return void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId: nextID }, search: search as DashboardSearch, replace })} + urlFilters={search} + onFiltersChange={(filters) => void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId }, search: { window: filters.window, namespace: filters.namespace || undefined }, replace: true })} + />; } diff --git a/ui/host/src/routes/dashboards.index.tsx b/ui/host/src/routes/dashboards.index.tsx index 775999d6a..ddbc86bed 100644 --- a/ui/host/src/routes/dashboards.index.tsx +++ b/ui/host/src/routes/dashboards.index.tsx @@ -1,13 +1,21 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useFanoutApp } from "../app-context"; import Dashboard from "../dashboard"; +import { dashboardSearch, type DashboardSearch } from "../dashboard-search"; export const Route = createFileRoute("/dashboards/")({ component: DashboardIndex, + validateSearch: dashboardSearch, }); function DashboardIndex() { + const search = Route.useSearch(); const navigate = useNavigate(); const { agentAvailable, openChat } = useFanoutApp(); - return void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId }, replace: true })} />; + return void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId }, search: search as DashboardSearch, replace: true })} + urlFilters={search} + />; } diff --git a/ui/host/src/shell.tsx b/ui/host/src/shell.tsx index ee951487a..06d4abe2b 100644 --- a/ui/host/src/shell.tsx +++ b/ui/host/src/shell.tsx @@ -50,6 +50,7 @@ export default function Shell({ children }: { children: ReactNode }) { onDeletedThread: (deletedID) => { if (deletedID === threadID) newThread(); }, onSelectDashboard: (id) => void navigate({ to: "/dashboards/$dashboardId", params: { dashboardId: id } }), onCreateDashboard: () => openChat(createDashboardPrompt), + onInvestigateService: (service) => openChat(`Investigate the ${service} service. Explain its errors and latency.`), }; return diff --git a/ui/host/src/widgets/activity.tsx b/ui/host/src/widgets/activity.tsx index 0f77c7d9d..5c1380973 100644 --- a/ui/host/src/widgets/activity.tsx +++ b/ui/host/src/widgets/activity.tsx @@ -1,4 +1,5 @@ import { ScrollArea, Table, Text } from "@mantine/core"; +import type { KeyboardEvent } from "react"; import type { Overview } from "../../../contracts"; import { duration, percent } from "../../../format"; import { useObservability, widgetParams } from "./data"; @@ -7,15 +8,27 @@ import type { WidgetBodyProps } from "./widget-card"; const order: Record = { unhealthy: 0, degraded: 1, healthy: 2 }; -export default function ActivityWidget({ widget, filters }: WidgetBodyProps) { +export default function ActivityWidget({ widget, filters, agentAvailable, onOpenChat }: WidgetBodyProps) { const overview = useObservability("overview", widgetParams(filters, widget.config, ["service"])); if (overview.isError) return void overview.refetch()} />; const services = [...(overview.data?.data.services ?? [])].sort((left, right) => (order[left.health] ?? 3) - (order[right.health] ?? 3) || right.error_rate - left.error_rate); if (overview.data && services.length === 0) return ; + // The rows lit up on hover and did nothing when clicked. They lead somewhere + // now — the same investigation a service-map node opens — and only look + // clickable when there is an agent to answer. + const investigate = (service: string) => onOpenChat(`Investigate the ${service} service. Explain its errors and latency.`); return - +
ServiceP95Errors - {services.map((entry) => + {services.map((entry) => investigate(entry.service), + onKeyDown: (event: KeyboardEvent) => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); investigate(entry.service); } }, + tabIndex: 0, + role: "button", + "aria-label": `Investigate ${entry.service}`, + style: { cursor: "pointer" }, + })}> {duration(entry.p95_ms)} = 0.01 ? "bad" : "dimmed"}>{percent(entry.error_rate)} diff --git a/ui/host/src/widgets/overview.tsx b/ui/host/src/widgets/overview.tsx index 8dcb13391..ec4a46ada 100644 --- a/ui/host/src/widgets/overview.tsx +++ b/ui/host/src/widgets/overview.tsx @@ -22,7 +22,7 @@ export default function OverviewWidget({ widget, filters, dark }: WidgetBodyProp const healthWord = !data ? "—" : empty ? "No data" : data.health.charAt(0).toUpperCase() + data.health.slice(1); return - + = 0.01 ? "bad" : undefined} hint={data && !empty ? `${integer.format(data.total_spans)} operations` : undefined}> {errorTrend.length > 1 && } diff --git a/ui/host/src/widgets/widget-card.tsx b/ui/host/src/widgets/widget-card.tsx index e05afa0a5..618894a64 100644 --- a/ui/host/src/widgets/widget-card.tsx +++ b/ui/host/src/widgets/widget-card.tsx @@ -1,4 +1,4 @@ -import { ActionIcon, Group, Menu, Paper, Stack, Title } from "@mantine/core"; +import { ActionIcon, Button, Group, Menu, Modal, Paper, Stack, Text, Title } from "@mantine/core"; import { DotsThree, SlidersHorizontal, Trash } from "@phosphor-icons/react"; import { useState, type JSX } from "react"; import type { DashboardWidgetRecord } from "../api"; @@ -49,6 +49,10 @@ export default function WidgetCard(props: WidgetBodyProps & { onRemove: () => vo const { widget, services, onRemove, onConfigure } = props; const [menuOpened, setMenuOpened] = useState(false); const [configuring, setConfiguring] = useState(false); + // Remove used to take effect on the click, and a dashboard has no undo: the + // card, its size and its configuration were gone, and rebuilding one that + // the assistant had composed meant asking for it again. + const [confirmingRemove, setConfirmingRemove] = useState(false); // A dashboard saved by a newer build can name a view this one has never // heard of. That is one card that says so, not a crash that takes the // whole page down with it. @@ -66,12 +70,21 @@ export default function WidgetCard(props: WidgetBodyProps & { onRemove: () => vo {configurable(widget.type) && } onClick={() => setConfiguring(true)}>Configure} - } onClick={onRemove}>Remove + } onClick={() => setConfirmingRemove(true)}>Remove
setConfiguring(false)} onSave={onConfigure} /> + setConfirmingRemove(false)} title={`Remove ${widget.title}?`} centered radius="md"> + + This takes the card off the dashboard for everyone who opens it. You can add it again from Add view, but its size and settings are not kept. + + + + + + ; } diff --git a/ui/host/src/widgets/widgets.test.tsx b/ui/host/src/widgets/widgets.test.tsx index 15b0aae52..be2ffc1f0 100644 --- a/ui/host/src/widgets/widgets.test.tsx +++ b/ui/host/src/widgets/widgets.test.tsx @@ -187,7 +187,36 @@ describe("widgets", () => { await act(async () => actions.click()); const remove = Array.from(document.querySelectorAll('[role="menuitem"]')).find((item) => item.textContent?.includes("Remove")); await act(async () => remove?.click()); + // The menu item asks; it does not remove. A dashboard has no undo. + expect(onRemove).not.toHaveBeenCalled(); + const confirm = Array.from(document.querySelectorAll('[role="dialog"] button')).find((button) => button.textContent?.trim() === "Remove"); + await act(async () => confirm?.click()); expect(onRemove).toHaveBeenCalled(); await act(async () => root.unmount()); }); + + it("keeps the widget when the removal is cancelled", async () => { + const onRemove = vi.fn(); + const root = await mount({ id: "w7b", type: "logs", title: "Logs", enabled: true }, { onRemove }); + await vi.waitFor(() => expect(document.body.textContent).toContain("POST /charge failed")); + const actions = document.querySelector('button[aria-label="Actions for Logs"]') as HTMLButtonElement; + await act(async () => actions.click()); + const remove = Array.from(document.querySelectorAll('[role="menuitem"]')).find((item) => item.textContent?.includes("Remove")); + await act(async () => remove?.click()); + const cancel = Array.from(document.querySelectorAll('[role="dialog"] button')).find((button) => button.textContent?.trim() === "Cancel"); + await act(async () => cancel?.click()); + expect(onRemove).not.toHaveBeenCalled(); + await act(async () => root.unmount()); + }); + + it("recent activity rows lead to an investigation", async () => { + const onOpenChat = vi.fn(); + const root = await mount({ id: "w9", type: "activity", title: "Recent activity", enabled: true }, { onOpenChat }); + await vi.waitFor(() => expect(document.body.textContent).toContain("payments")); + const row = document.querySelector('[aria-label="Investigate payments"]') as HTMLElement; + expect(row).not.toBeNull(); + await act(async () => row.click()); + expect(onOpenChat).toHaveBeenCalledWith(expect.stringContaining("payments")); + await act(async () => root.unmount()); + }); });